changeset 11:544732bbd87b

added support for Osimis Web Viewer
author amazy
date Thu, 08 Mar 2018 20:42:27 +0100
parents a2e3e7cd380e
children bc49bd53a057
files Plugin/DefaultAuthorizationParser.cpp Plugin/DefaultAuthorizationParser.h
diffstat 2 files changed, 23 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/Plugin/DefaultAuthorizationParser.cpp	Mon Sep 11 14:32:58 2017 +0200
+++ b/Plugin/DefaultAuthorizationParser.cpp	Thu Mar 08 20:42:27 2018 +0100
@@ -28,7 +28,10 @@
     AuthorizationParserBase(context, factory),
     resourcesPattern_("^/(patients|studies|series|instances)/([a-f0-9-]+)(|/.*)$"),
     seriesPattern_("^/(web-viewer/series|web-viewer/is-stable-series|wsi/pyramids|wsi/tiles)/([a-f0-9-]+)(|/.*)$"),
-    instancesPattern_("^/web-viewer/instances/[a-z0-9]+-([a-f0-9-]+)_[0-9]+$")
+    instancesPattern_("^/web-viewer/instances/[a-z0-9]+-([a-f0-9-]+)_[0-9]+$"),
+    osimisViewerSeries_("^/osimis-viewer/series/([a-f0-9-]+)(|/.*)$"),
+    osimisViewerImages_("^/osimis-viewer/images/([a-f0-9-]+)(|/.*)$"),
+    osimisViewerStudies_("^/osimis-viewer/studies/([a-f0-9-]+)(|/.*)$")
   {
     std::string tmp = dicomWebRoot;
     while (!tmp.empty() &&
@@ -110,6 +113,21 @@
       AddDicomInstance(target, what[1], what[2], what[3]);
       return true;
     }
+    else if (boost::regex_match(uri, what, osimisViewerSeries_))
+    {
+      AddOrthancSeries(target, what[1]);
+      return true;
+    }
+    else if (boost::regex_match(uri, what, osimisViewerStudies_))
+    {
+      AddOrthancStudy(target, what[1]);
+      return true;
+    }
+    else if (boost::regex_match(uri, what, osimisViewerImages_))
+    {
+      AddOrthancInstance(target, what[1]);
+      return true;
+    }
     else
     {
       // Unknown type of resource: Consider it as a system access
--- a/Plugin/DefaultAuthorizationParser.h	Mon Sep 11 14:32:58 2017 +0200
+++ b/Plugin/DefaultAuthorizationParser.h	Thu Mar 08 20:42:27 2018 +0100
@@ -36,6 +36,10 @@
     boost::regex dicomWebSeries_;
     boost::regex dicomWebInstances_;
 
+    boost::regex osimisViewerSeries_;
+    boost::regex osimisViewerImages_;
+    boost::regex osimisViewerStudies_;
+
   public:
     DefaultAuthorizationParser(OrthancPluginContext* context,
                                ICacheFactory& factory,