changeset 1724:7e0b5e413c7c db-changes

C-Move SCP for studies using AccessionNumber tag
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 20 Oct 2015 11:02:06 +0200
parents 40a8445fc81d
children a7c05bbfaf6a
files NEWS OrthancServer/OrthancMoveRequestHandler.cpp OrthancServer/ServerEnumerations.cpp OrthancServer/ServerEnumerations.h
diffstat 4 files changed, 25 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Tue Oct 20 10:45:21 2015 +0200
+++ b/NEWS	Tue Oct 20 11:02:06 2015 +0200
@@ -22,6 +22,7 @@
 Maintenance
 -----------
 
+* C-Move SCP for studies using AccessionNumber tag
 * Fix issue 4 (C-Store Association not renegotiated on Specific-to-specific transfer syntax change)
 * "/system" URI gives information about the plugins used for storage area and DB back-end
 * Plugin callbacks should now return explicit "OrthancPluginErrorCode" instead of integers
--- a/OrthancServer/OrthancMoveRequestHandler.cpp	Tue Oct 20 10:45:21 2015 +0200
+++ b/OrthancServer/OrthancMoveRequestHandler.cpp	Tue Oct 20 11:02:06 2015 +0200
@@ -108,7 +108,30 @@
                                                    ResourceType level,
                                                    const DicomMap& input)
   {
-    DicomTag tag = GetIdentifierTag(level);
+    DicomTag tag(0, 0);   // Dummy initialization
+
+    switch (level)
+    {
+      case ResourceType_Patient:
+        tag = DICOM_TAG_PATIENT_ID;
+        break;
+
+      case ResourceType_Study:
+        tag = (input.HasTag(DICOM_TAG_ACCESSION_NUMBER) ? 
+               DICOM_TAG_ACCESSION_NUMBER : DICOM_TAG_STUDY_INSTANCE_UID);
+        break;
+        
+      case ResourceType_Series:
+        tag = DICOM_TAG_SERIES_INSTANCE_UID;
+        break;
+        
+      case ResourceType_Instance:
+        tag = DICOM_TAG_SOP_INSTANCE_UID;
+        break;
+
+      default:
+        throw OrthancException(ErrorCode_ParameterOutOfRange);
+    }
 
     if (!input.HasTag(tag))
     {
--- a/OrthancServer/ServerEnumerations.cpp	Tue Oct 20 10:45:21 2015 +0200
+++ b/OrthancServer/ServerEnumerations.cpp	Tue Oct 20 11:02:06 2015 +0200
@@ -364,26 +364,4 @@
         throw OrthancException(ErrorCode_ParameterOutOfRange);
     }
   }
-
-
-  DicomTag GetIdentifierTag(ResourceType level)
-  {
-    switch (level)
-    {
-      case ResourceType_Patient:
-        return DICOM_TAG_PATIENT_ID;
-
-      case ResourceType_Study:
-        return DICOM_TAG_STUDY_INSTANCE_UID;
-        
-      case ResourceType_Series:
-        return DICOM_TAG_SERIES_INSTANCE_UID;
-        
-      case ResourceType_Instance:
-        return DICOM_TAG_SOP_INSTANCE_UID;
-
-      default:
-        throw OrthancException(ErrorCode_ParameterOutOfRange);
-    }
-  }
 }
--- a/OrthancServer/ServerEnumerations.h	Tue Oct 20 10:45:21 2015 +0200
+++ b/OrthancServer/ServerEnumerations.h	Tue Oct 20 11:02:06 2015 +0200
@@ -195,6 +195,4 @@
   const char* EnumerationToString(TransferSyntax syntax);
 
   ModalityManufacturer StringToModalityManufacturer(const std::string& manufacturer);
-
-  DicomTag GetIdentifierTag(ResourceType level);
 }