changeset 92:8dc22bc353de

QIDO-RS now supports named tags in get arguments
author Alain Mazy <am@osimis.io>
date Thu, 13 Apr 2023 20:56:44 +0200
parents 50b18e7a254d
children 90582b3bf0cf
files NEWS Plugin/DefaultAuthorizationParser.cpp UnitTestsSources/UnitTestsMain.cpp
diffstat 3 files changed, 31 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Thu Apr 13 15:43:27 2023 +0200
+++ b/NEWS	Thu Apr 13 20:56:44 2023 +0200
@@ -4,6 +4,7 @@
 * Added a default permission for /toolk/bulk-delete
 * Added a default permission for /changes
 * Added a default permission for /auth/tokens/ohif-viewer-publication
+* QIDO-RS now supports named tags in get arguments
 
 
 2023-03-17 - v 0.5.0
--- a/Plugin/DefaultAuthorizationParser.cpp	Thu Apr 13 15:43:27 2023 +0200
+++ b/Plugin/DefaultAuthorizationParser.cpp	Thu Apr 13 20:56:44 2023 +0200
@@ -137,9 +137,28 @@
       std::string studyInstanceUid, seriesInstanceUid, sopInstanceUid, patientId;
 
       studyInstanceUid = Orthanc::HttpToolbox::GetArgument(getArguments, "0020000D", "");
+      if (studyInstanceUid.empty())
+      {
+        studyInstanceUid = Orthanc::HttpToolbox::GetArgument(getArguments, "StudyInstanceUID", "");
+      }
+
       seriesInstanceUid = Orthanc::HttpToolbox::GetArgument(getArguments, "0020000E", "");
+      if (seriesInstanceUid.empty())
+      {
+        seriesInstanceUid = Orthanc::HttpToolbox::GetArgument(getArguments, "SeriesInstanceUID", "");
+      }
+
       sopInstanceUid = Orthanc::HttpToolbox::GetArgument(getArguments, "00080018", "");
+      if (sopInstanceUid.empty())
+      {
+        sopInstanceUid = Orthanc::HttpToolbox::GetArgument(getArguments, "SOPInstanceUID", "");
+      }
+
       patientId = Orthanc::HttpToolbox::GetArgument(getArguments, "00100010", "");
+      if (patientId.empty())
+      {
+        patientId = Orthanc::HttpToolbox::GetArgument(getArguments, "PatientID", "");
+      }
 
       if (!sopInstanceUid.empty() && !seriesInstanceUid.empty() && !studyInstanceUid.empty())
       {
--- a/UnitTestsSources/UnitTestsMain.cpp	Thu Apr 13 15:43:27 2023 +0200
+++ b/UnitTestsSources/UnitTestsMain.cpp	Thu Apr 13 20:56:44 2023 +0200
@@ -237,6 +237,17 @@
   }
   {
     accesses.clear();
+    const char* getKeys[] = {"StudyInstanceUID", "SOPInstanceUID", "SeriesInstanceUID"};
+    const char* getValues[] = {"2.2", "4.4", "3.3", };
+    AssociativeArray getArguments(3, getKeys, getValues, false);
+    parser.Parse(accesses, "/dicom-web/studies", getArguments.GetMap());
+    ASSERT_TRUE(IsAccessing(accesses, AccessLevel_Instance, instanceOrthancId));
+    ASSERT_TRUE(IsAccessing(accesses, AccessLevel_Series, seriesOrthancId));
+    ASSERT_TRUE(IsAccessing(accesses, AccessLevel_Study, studyOrthancId));
+    ASSERT_TRUE(IsAccessing(accesses, AccessLevel_Patient, patientOrthancId));
+  }
+  {
+    accesses.clear();
     const char* getKeys[] = {"00100010"};
     const char* getValues[] = {"PATIENT.1"};
     AssociativeArray getArguments(1, getKeys, getValues, false);