changeset 1315:0c735fed8953

ZIP archives now display the accession number of the studies
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 12 Feb 2015 13:28:47 +0100
parents 01be1432bda9
children 1c8dfedefefe
files NEWS OrthancServer/OrthancRestApi/OrthancRestArchive.cpp
diffstat 2 files changed, 13 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Wed Feb 11 12:33:07 2015 +0100
+++ b/NEWS	Thu Feb 12 13:28:47 2015 +0100
@@ -15,6 +15,7 @@
 * More flexible "/modify" and "/anonymize" for single instance
 * Access to called AET and remote AET from Lua scripts ("OnStoredInstance")
 * Option "DicomAssociationCloseDelay" to set delay before closing DICOM association
+* ZIP archives now display the accession number of the studies
 
 Plugins
 -------
--- a/OrthancServer/OrthancRestApi/OrthancRestArchive.cpp	Wed Feb 11 12:33:07 2015 +0100
+++ b/OrthancServer/OrthancRestApi/OrthancRestArchive.cpp	Thu Feb 12 13:28:47 2015 +0100
@@ -56,27 +56,34 @@
                                                ResourceType resourceType)
   {
     std::string s;
+    const Json::Value& tags = resource["MainDicomTags"];
 
     switch (resourceType)
     {
       case ResourceType_Patient:
       {
-        std::string p = resource["MainDicomTags"]["PatientID"].asString();
-        std::string n = resource["MainDicomTags"]["PatientName"].asString();
+        std::string p = tags["PatientID"].asString();
+        std::string n = tags["PatientName"].asString();
         s = p + " " + n;
         break;
       }
 
       case ResourceType_Study:
       {
-        s = resource["MainDicomTags"]["StudyDescription"].asString();
+        std::string p;
+        if (tags.isMember("AccessionNumber"))
+        {
+          p = tags["AccessionNumber"].asString() + " ";
+        }
+
+        s = p + tags["StudyDescription"].asString();
         break;
       }
         
       case ResourceType_Series:
       {
-        std::string d = resource["MainDicomTags"]["SeriesDescription"].asString();
-        std::string m = resource["MainDicomTags"]["Modality"].asString();
+        std::string d = tags["SeriesDescription"].asString();
+        std::string m = tags["Modality"].asString();
         s = m + " " + d;
         break;
       }