|
@@ -151,15 +151,16 @@ class ctkDicomSoapBool : public QtSoapSimpleType{
|
|
|
};
|
|
|
|
|
|
//Not easy to template, will see later for other types
|
|
|
-class ctkDicomSoapArrayOfString : public QtSoapArray{
|
|
|
+class ctkDicomSoapArrayOfStringType : public QtSoapArray{
|
|
|
public:
|
|
|
- ctkDicomSoapArrayOfString ( const QString & name, const QStringList array):
|
|
|
+ ctkDicomSoapArrayOfStringType ( const QString& typeName,
|
|
|
+ const QString & name, const QStringList array):
|
|
|
QtSoapArray ( QtSoapQName(name),QtSoapType::String,
|
|
|
array.size()){
|
|
|
|
|
|
for (QStringList::ConstIterator it = array.constBegin();
|
|
|
it < array.constEnd(); it++){
|
|
|
- this->append(new QtSoapSimpleType(QtSoapQName("string"),*it));
|
|
|
+ this->append(new QtSoapSimpleType(QtSoapQName(typeName),*it));
|
|
|
}
|
|
|
};
|
|
|
|
|
@@ -173,31 +174,305 @@ class ctkDicomSoapArrayOfString : public QtSoapArray{
|
|
|
};
|
|
|
|
|
|
};
|
|
|
+
|
|
|
+class ctkDicomSoapArrayOfUUIDS : public QtSoapArray{
|
|
|
+ public:
|
|
|
+ ctkDicomSoapArrayOfUUIDS ( const QString & name, const QList<QUuid> &array):
|
|
|
+ QtSoapArray ( QtSoapQName(name),QtSoapType::String,
|
|
|
+ array.size()){
|
|
|
+
|
|
|
+ for (QList<QUuid>::ConstIterator it = array.constBegin();
|
|
|
+ it < array.constEnd(); it++){
|
|
|
+ this->append(new QtSoapSimpleType(QtSoapQName("UUID"),(*it).toString()));
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ static QList<QUuid>* getArray(const QtSoapArray& array){
|
|
|
+ QList<QUuid> * list = new QList<QUuid>();
|
|
|
+ for (int i = 0; i < array.count() ; i++ ){
|
|
|
+ const QString str = array.at(i).value().toString();
|
|
|
+ list->append( QUuid(str));
|
|
|
+ }
|
|
|
+ return list;
|
|
|
+ };
|
|
|
+
|
|
|
+};
|
|
|
+
|
|
|
+class ctkDicomSoapObjectDescriptor : public QtSoapStruct{
|
|
|
+public:
|
|
|
+ ctkDicomSoapObjectDescriptor ( const QString & name,
|
|
|
+ const ctkDicomWG23::ObjectDescriptor& od ):
|
|
|
+ QtSoapStruct ( QtSoapQName(name) ){
|
|
|
+ this->insert(new QtSoapSimpleType(QtSoapQName("DescriptorUUID"),
|
|
|
+ od.descriptorUUID) );
|
|
|
+ this->insert(new QtSoapSimpleType(
|
|
|
+ QtSoapQName("MimeType"),
|
|
|
+ od.mimeType) );
|
|
|
+ this->insert(new QtSoapSimpleType(
|
|
|
+ QtSoapQName("ClassUID"),
|
|
|
+ od.classUID) );
|
|
|
+ this->insert(new QtSoapSimpleType(
|
|
|
+ QtSoapQName("TransferSyntaxUID"),
|
|
|
+ od.transferSyntaxUID) );
|
|
|
+ this->insert(new QtSoapSimpleType(
|
|
|
+ QtSoapQName("Modality"),
|
|
|
+ od.modality) );
|
|
|
+ };
|
|
|
+
|
|
|
+ static ctkDicomWG23::ObjectDescriptor getObjectDescriptor(const QtSoapType& type){
|
|
|
+ ctkDicomWG23::ObjectDescriptor od;
|
|
|
+
|
|
|
+ od.descriptorUUID = QUuid(type["DescriptorUUID"].value().toString());
|
|
|
+ od.mimeType =
|
|
|
+ type["MimeType"].value().toString();
|
|
|
+ od.classUID =
|
|
|
+ type["ClassUID"].value().toString();
|
|
|
+ od.transferSyntaxUID =
|
|
|
+ type["TransferSyntaxUID"].value().toString();
|
|
|
+ od.modality =
|
|
|
+ type["Modality"].value().toString();
|
|
|
+ return od;
|
|
|
+ };
|
|
|
+};
|
|
|
+
|
|
|
+class ctkDicomSoapSeries : public QtSoapStruct{
|
|
|
+ public:
|
|
|
+ ctkDicomSoapSeries ( const QString & name,
|
|
|
+ const ctkDicomWG23::Series& s ):
|
|
|
+ QtSoapStruct ( QtSoapQName(name) ){
|
|
|
+ this->insert(new QtSoapSimpleType(QtSoapQName("SeriesUID"),
|
|
|
+ s.seriesUID) );
|
|
|
+ QtSoapArray * odescriptors = new QtSoapArray( QtSoapQName("ObjectDescriptors"),QtSoapType::Other,
|
|
|
+ s.objectDescriptors.size());
|
|
|
+
|
|
|
+ for (QList<ctkDicomWG23::ObjectDescriptor>::ConstIterator it = s.objectDescriptors.constBegin();
|
|
|
+ it < s.objectDescriptors.constEnd(); it++){
|
|
|
+ odescriptors->append(new ctkDicomSoapObjectDescriptor("ObjectDescriptor",*it));
|
|
|
+ }
|
|
|
+ this->insert(odescriptors);
|
|
|
+ };
|
|
|
+
|
|
|
+ static ctkDicomWG23::Series getSeries(const QtSoapType& type){
|
|
|
+ ctkDicomWG23::Series s;
|
|
|
+
|
|
|
+ s.seriesUID = type["SeriesUID"].value().toString();
|
|
|
+ QList<ctkDicomWG23::ObjectDescriptor> list;
|
|
|
+ const QtSoapArray& array = static_cast<const QtSoapArray&> (type["ObjectDescriptors"]);
|
|
|
+ for (int i = 0; i < array.count() ; i++ ){
|
|
|
+ const ctkDicomWG23::ObjectDescriptor od =
|
|
|
+ ctkDicomSoapObjectDescriptor::getObjectDescriptor(array.at(i));
|
|
|
+ list.append(od);
|
|
|
+ }
|
|
|
+ s.objectDescriptors = list;
|
|
|
+ return s;
|
|
|
+ };
|
|
|
+};
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+class ctkDicomSoapStudy : public QtSoapStruct{
|
|
|
+ public:
|
|
|
+ ctkDicomSoapStudy ( const QString & name,
|
|
|
+ const ctkDicomWG23::Study& s ):
|
|
|
+ QtSoapStruct ( QtSoapQName(name) ){
|
|
|
+ this->insert(new QtSoapSimpleType(QtSoapQName("StudyUID"),
|
|
|
+ s.studyUID) );
|
|
|
+ QtSoapArray * odescriptors = new QtSoapArray( QtSoapQName("ObjectDescriptors"),QtSoapType::Other,
|
|
|
+ s.objectDescriptors.size());
|
|
|
+
|
|
|
+ for (QList<ctkDicomWG23::ObjectDescriptor>::ConstIterator it = s.objectDescriptors.constBegin();
|
|
|
+ it < s.objectDescriptors.constEnd(); it++){
|
|
|
+ odescriptors->append(new ctkDicomSoapObjectDescriptor("ObjectDescriptor",*it));
|
|
|
+ }
|
|
|
+ this->insert(odescriptors);
|
|
|
+
|
|
|
+ QtSoapArray * series = new QtSoapArray( QtSoapQName("Series"),QtSoapType::Other,
|
|
|
+ s.series.size());
|
|
|
+
|
|
|
+ for (QList<ctkDicomWG23::Series>::ConstIterator it = s.series.constBegin();
|
|
|
+ it < s.series.constEnd(); it++){
|
|
|
+ series->append(new ctkDicomSoapSeries("Series",*it));
|
|
|
+ }
|
|
|
+ this->insert(series);
|
|
|
+ };
|
|
|
+
|
|
|
+ static ctkDicomWG23::Study getStudy(const QtSoapType& type){
|
|
|
+ ctkDicomWG23::Study s;
|
|
|
+
|
|
|
+ s.studyUID = type["StudyUID"].value().toString();
|
|
|
+ QList<ctkDicomWG23::ObjectDescriptor> list;
|
|
|
+ const QtSoapArray& array = static_cast<const QtSoapArray&> (type["ObjectDescriptors"]);
|
|
|
+ for (int i = 0; i < array.count() ; i++ ){
|
|
|
+ const ctkDicomWG23::ObjectDescriptor od =
|
|
|
+ ctkDicomSoapObjectDescriptor::getObjectDescriptor(array.at(i));
|
|
|
+ list.append(od);
|
|
|
+ }
|
|
|
+ s.objectDescriptors = list;
|
|
|
+ QList<ctkDicomWG23::Series> listSeries;
|
|
|
+ const QtSoapArray& array2 = static_cast<const QtSoapArray&> (type["Series"]);
|
|
|
+ for (int i = 0; i < array2.count() ; i++ ){
|
|
|
+ const ctkDicomWG23::Series series =
|
|
|
+ ctkDicomSoapSeries::getSeries(array2.at(i));
|
|
|
+ listSeries.append(series);
|
|
|
+ }
|
|
|
+ s.series = listSeries;
|
|
|
+
|
|
|
+ return s;
|
|
|
+ };
|
|
|
+};
|
|
|
+
|
|
|
+class ctkDicomSoapPatient : public QtSoapStruct{
|
|
|
+ public:
|
|
|
+ ctkDicomSoapPatient ( const QString & name,
|
|
|
+ const ctkDicomWG23::Patient& p ):
|
|
|
+ QtSoapStruct ( QtSoapQName(name) ){
|
|
|
+ this->insert(new QtSoapSimpleType(QtSoapQName("Name"),
|
|
|
+ p.name) );
|
|
|
+ this->insert(new QtSoapSimpleType(QtSoapQName("ID"),
|
|
|
+ p.id) );
|
|
|
+ this->insert(new QtSoapSimpleType(QtSoapQName("AssigningAuthority"),
|
|
|
+ p.assigningAuthority) );
|
|
|
+ this->insert(new QtSoapSimpleType(QtSoapQName("Sex"),
|
|
|
+ p.sex) );
|
|
|
+ this->insert(new QtSoapSimpleType(QtSoapQName("BirthDate"),
|
|
|
+ p.birthDate) );
|
|
|
+ QtSoapArray * odescriptors = new QtSoapArray( QtSoapQName("ObjectDescriptors"),QtSoapType::Other,
|
|
|
+ p.objectDescriptors.size());
|
|
|
+
|
|
|
+ for (QList<ctkDicomWG23::ObjectDescriptor>::ConstIterator it = p.objectDescriptors.constBegin();
|
|
|
+ it < p.objectDescriptors.constEnd(); it++){
|
|
|
+ odescriptors->append(new ctkDicomSoapObjectDescriptor("ObjectDescriptor",*it));
|
|
|
+ }
|
|
|
+ this->insert(odescriptors);
|
|
|
+
|
|
|
+ QtSoapArray * study = new QtSoapArray( QtSoapQName("Studies"),QtSoapType::Other,
|
|
|
+ p.studies.size());
|
|
|
+
|
|
|
+ for (QList<ctkDicomWG23::Study>::ConstIterator it = p.studies.constBegin();
|
|
|
+ it < p.studies.constEnd(); it++){
|
|
|
+ study->append(new ctkDicomSoapStudy("Study",*it));
|
|
|
+ }
|
|
|
+ this->insert(study);
|
|
|
+ };
|
|
|
+
|
|
|
+ static ctkDicomWG23::Patient getPatient(const QtSoapType& type){
|
|
|
+ ctkDicomWG23::Patient p;
|
|
|
+
|
|
|
+ p.name = type["Name"].value().toString();
|
|
|
+ p.id = type["ID"].value().toString();
|
|
|
+ p.assigningAuthority = type["AssigningAuthority"].value().toString();
|
|
|
+ p.sex = type["Sex"].value().toString();
|
|
|
+ p.birthDate = type["Birthdate"].value().toString();
|
|
|
+
|
|
|
+ QList<ctkDicomWG23::ObjectDescriptor> list;
|
|
|
+ const QtSoapArray& array = static_cast<const QtSoapArray&> (type["ObjectDescriptors"]);
|
|
|
+ for (int i = 0; i < array.count() ; i++ ){
|
|
|
+ const ctkDicomWG23::ObjectDescriptor od =
|
|
|
+ ctkDicomSoapObjectDescriptor::getObjectDescriptor(array.at(i));
|
|
|
+ list.append(od);
|
|
|
+ }
|
|
|
+
|
|
|
+ p.objectDescriptors = list;
|
|
|
+ QList<ctkDicomWG23::Study> listPatient;
|
|
|
+ const QtSoapArray& array2 = static_cast<const QtSoapArray&> (type["Studies"]);
|
|
|
+ for (int i = 0; i < array2.count() ; i++ ){
|
|
|
+ const ctkDicomWG23::Study study =
|
|
|
+ ctkDicomSoapStudy::getStudy(array2.at(i));
|
|
|
+ listPatient.append(study);
|
|
|
+ }
|
|
|
+
|
|
|
+ p.studies = listPatient;
|
|
|
+ return p;
|
|
|
+ };
|
|
|
+};
|
|
|
+
|
|
|
+
|
|
|
class ctkDicomSoapAvailableData :public QtSoapStruct {
|
|
|
public:
|
|
|
ctkDicomSoapAvailableData ( const QString & name,
|
|
|
const ctkDicomWG23::AvailableData& ad ):
|
|
|
QtSoapStruct ( QtSoapQName(name) ){
|
|
|
+ QtSoapArray * odescriptors = new QtSoapArray( QtSoapQName("ObjectDescriptors"),QtSoapType::Other,
|
|
|
+ ad.objectDescriptors.size());
|
|
|
+
|
|
|
+ for (QList<ctkDicomWG23::ObjectDescriptor>::ConstIterator it = ad.objectDescriptors.constBegin();
|
|
|
+ it < ad.objectDescriptors.constEnd(); it++){
|
|
|
+ odescriptors->append(new ctkDicomSoapObjectDescriptor("ObjectDescriptor",*it));
|
|
|
+ }
|
|
|
+ this->insert(odescriptors);
|
|
|
|
|
|
- QList<ctkDicomWG23::ObjectDescriptor> objectDescriptors;
|
|
|
- QList<ctkDicomWG23::Patient> patients;
|
|
|
- //TO BE IMPLEMENTED!!!!!!!!!!!!!!!
|
|
|
- //this->insert(new QtSoapSimpleType(QtSoapQName("StatusType"),
|
|
|
- // s.statusType) );
|
|
|
+ QtSoapArray * patient = new QtSoapArray( QtSoapQName("Patient"),QtSoapType::Other,
|
|
|
+ ad.patients.size());
|
|
|
+
|
|
|
+ for (QList<ctkDicomWG23::Patient>::ConstIterator it = ad.patients.constBegin();
|
|
|
+ it < ad.patients.constEnd(); it++){
|
|
|
+ patient->append(new ctkDicomSoapPatient("Patient",*it));
|
|
|
+ }
|
|
|
+ this->insert(patient);
|
|
|
};
|
|
|
static ctkDicomWG23::AvailableData getAvailableData (const QtSoapType& type){
|
|
|
ctkDicomWG23::AvailableData ad;
|
|
|
- type;
|
|
|
-
|
|
|
-// s.codingSchemeDesignator =
|
|
|
-// type["CodingSchemeDesignator"].value().toString();
|
|
|
-// s.codeValue =
|
|
|
-// type["CodeValue"].value().toString();
|
|
|
-// s.codeMeaning =
|
|
|
-// type["CodeMeaning"].value().toString();
|
|
|
+
|
|
|
+ QList<ctkDicomWG23::ObjectDescriptor> list;
|
|
|
+ const QtSoapArray& array = static_cast<const QtSoapArray&> (type["ObjectDescriptors"]);
|
|
|
+ for (int i = 0; i < array.count() ; i++ ){
|
|
|
+ const ctkDicomWG23::ObjectDescriptor od =
|
|
|
+ ctkDicomSoapObjectDescriptor::getObjectDescriptor(array.at(i));
|
|
|
+ list.append(od);
|
|
|
+ }
|
|
|
+ ad.objectDescriptors = list;
|
|
|
+ QList<ctkDicomWG23::Patient> listPatients;
|
|
|
+ const QtSoapArray& array2 = static_cast<const QtSoapArray&> (type["Patients"]);
|
|
|
+ for (int i = 0; i < array2.count() ; i++ ){
|
|
|
+ const ctkDicomWG23::Patient patient =
|
|
|
+ ctkDicomSoapPatient::getPatient(array2.at(i));
|
|
|
+ listPatients.append(patient);
|
|
|
+ }
|
|
|
+ ad.patients = listPatients;
|
|
|
return ad;
|
|
|
};
|
|
|
};
|
|
|
|
|
|
+class ctkDicomSoapObjectLocator : public QtSoapStruct{
|
|
|
+public:
|
|
|
+ ctkDicomSoapObjectLocator ( const QString & name,
|
|
|
+ const ctkDicomWG23::ObjectLocator& ol ):
|
|
|
+ QtSoapStruct ( QtSoapQName(name) ){
|
|
|
+ this->insert(new QtSoapSimpleType(QtSoapQName("Locator"),
|
|
|
+ ol.locator) );
|
|
|
+ this->insert(new QtSoapSimpleType(
|
|
|
+ QtSoapQName("Source"),
|
|
|
+ ol.source) );
|
|
|
+ this->insert(new QtSoapSimpleType(
|
|
|
+ QtSoapQName("TransfertSyntax"),
|
|
|
+ ol.transferSyntax) );
|
|
|
+ this->insert(new QtSoapSimpleType(
|
|
|
+ QtSoapQName("Length"),
|
|
|
+ ol.length) );
|
|
|
+ this->insert(new QtSoapSimpleType(
|
|
|
+ QtSoapQName("Offset"),
|
|
|
+ ol.offset) );
|
|
|
+ this->insert(new QtSoapSimpleType(
|
|
|
+ QtSoapQName("URI"),
|
|
|
+ ol.URI) );
|
|
|
+ };
|
|
|
+
|
|
|
+ static ctkDicomWG23::ObjectLocator getObjectLocator(const QtSoapType& type){
|
|
|
+ ctkDicomWG23::ObjectLocator ol;
|
|
|
+
|
|
|
+ ol.locator = QUuid(type["Locator"].value().toString());
|
|
|
+ ol.source = QUuid(type["Source"].value().toString());
|
|
|
+ ol.transferSyntax =
|
|
|
+ type["TransferSyntax"].value().toString();
|
|
|
+ ol.length =
|
|
|
+ type["Length"].value().toInt();
|
|
|
+ ol.offset =
|
|
|
+ type["Offset"].value().toInt();
|
|
|
+ ol.URI =
|
|
|
+ type["URI"].value().toString();
|
|
|
+ return ol;
|
|
|
+ };
|
|
|
+};
|
|
|
+
|
|
|
|
|
|
#endif
|