annotate OrthancServer/Plugins/Samples/ModalityWorklists/Plugin.cpp @ 4551:350a22c094f2 db-changes

testing replay of transactions
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 02 Mar 2021 19:36:59 +0100
parents d9473bd5ed43
children 7053502fbf97
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1802
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
1900
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1890
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
1802
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
4437
d9473bd5ed43 upgrade to year 2021
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4395
diff changeset
5 * Copyright (C) 2017-2021 Osimis S.A., Belgium
1802
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 *
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * This program is free software: you can redistribute it and/or
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * modify it under the terms of the GNU General Public License as
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * published by the Free Software Foundation, either version 3 of the
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * License, or (at your option) any later version.
2289
89d17c72287b Modality worklist: added logs to display the number of files parsed and number of matches
Alain Mazy <alain@mazy.be>
parents: 2268
diff changeset
11 *
1802
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful, but
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * General Public License for more details.
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 *
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * You should have received a copy of the GNU General Public License
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 **/
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21
4045
05b8fd21089c fix path
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4044
diff changeset
22 #include "../../../../OrthancFramework/Sources/Compatibility.h"
2205
395522e46b2b refactoring of the worklist sample using OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1911
diff changeset
23 #include "../Common/OrthancPluginCppWrapper.h"
1802
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 #include <boost/filesystem.hpp>
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 #include <json/value.h>
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 #include <string.h>
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 #include <iostream>
1814
7c5ea3e51839 fix msvc build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1813
diff changeset
29 #include <algorithm>
1802
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 static std::string folder_;
2233
8f5b60647654 worklist sample: FilterIssuerAet configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2216
diff changeset
32 static bool filterIssuerAet_ = false;
4145
c5cdb6dc6865 New config option "Worklist.LimitAnswers" for the sample modality worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4045
diff changeset
33 static unsigned int limitAnswers_ = 0;
1802
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 /**
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 * This is the main function for matching a DICOM worklist against a query.
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 **/
2289
89d17c72287b Modality worklist: added logs to display the number of files parsed and number of matches
Alain Mazy <alain@mazy.be>
parents: 2268
diff changeset
38 static bool MatchWorklist(OrthancPluginWorklistAnswers* answers,
2214
b1d93286b315 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2206
diff changeset
39 const OrthancPluginWorklistQuery* query,
b1d93286b315 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2206
diff changeset
40 const OrthancPlugins::FindMatcher& matcher,
2206
27106f7e3759 more refactoring of the worklist sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2205
diff changeset
41 const std::string& path)
1802
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 {
2958
bb7a66efbeb1 OrthancPlugins::SetGlobalContext() in OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2827
diff changeset
43 OrthancPlugins::MemoryBuffer dicom;
2205
395522e46b2b refactoring of the worklist sample using OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1911
diff changeset
44 dicom.ReadFile(path);
1802
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45
2214
b1d93286b315 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2206
diff changeset
46 if (matcher.IsMatch(dicom))
1802
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 {
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 // This DICOM file matches the worklist query, add it to the answers
2206
27106f7e3759 more refactoring of the worklist sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2205
diff changeset
49 OrthancPluginErrorCode code = OrthancPluginWorklistAddAnswer
2958
bb7a66efbeb1 OrthancPlugins::SetGlobalContext() in OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2827
diff changeset
50 (OrthancPlugins::GetGlobalContext(), answers, query, dicom.GetData(), dicom.GetSize());
1802
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51
2206
27106f7e3759 more refactoring of the worklist sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2205
diff changeset
52 if (code != OrthancPluginErrorCode_Success)
27106f7e3759 more refactoring of the worklist sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2205
diff changeset
53 {
2958
bb7a66efbeb1 OrthancPlugins::SetGlobalContext() in OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2827
diff changeset
54 OrthancPlugins::LogError("Error while adding an answer to a worklist request");
2234
a78d15509a1c cleaner separation of PluginException
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2216
diff changeset
55 ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(code);
2206
27106f7e3759 more refactoring of the worklist sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2205
diff changeset
56 }
2289
89d17c72287b Modality worklist: added logs to display the number of files parsed and number of matches
Alain Mazy <alain@mazy.be>
parents: 2268
diff changeset
57
89d17c72287b Modality worklist: added logs to display the number of files parsed and number of matches
Alain Mazy <alain@mazy.be>
parents: 2268
diff changeset
58 return true;
2206
27106f7e3759 more refactoring of the worklist sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2205
diff changeset
59 }
2289
89d17c72287b Modality worklist: added logs to display the number of files parsed and number of matches
Alain Mazy <alain@mazy.be>
parents: 2268
diff changeset
60
89d17c72287b Modality worklist: added logs to display the number of files parsed and number of matches
Alain Mazy <alain@mazy.be>
parents: 2268
diff changeset
61 return false;
1814
7c5ea3e51839 fix msvc build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1813
diff changeset
62 }
7c5ea3e51839 fix msvc build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1813
diff changeset
63
7c5ea3e51839 fix msvc build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1813
diff changeset
64
2216
9a8fab016145 sample worklist plugin fine-tuning the C-Find query
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2215
diff changeset
65 static OrthancPlugins::FindMatcher* CreateMatcher(const OrthancPluginWorklistQuery* query,
2233
8f5b60647654 worklist sample: FilterIssuerAet configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2216
diff changeset
66 const char* issuerAet)
2215
028214a95194 refactoring the worklist sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2214
diff changeset
67 {
2216
9a8fab016145 sample worklist plugin fine-tuning the C-Find query
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2215
diff changeset
68 // Extract the DICOM instance underlying the C-Find query
2958
bb7a66efbeb1 OrthancPlugins::SetGlobalContext() in OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2827
diff changeset
69 OrthancPlugins::MemoryBuffer dicom;
2215
028214a95194 refactoring the worklist sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2214
diff changeset
70 dicom.GetDicomQuery(query);
028214a95194 refactoring the worklist sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2214
diff changeset
71
2216
9a8fab016145 sample worklist plugin fine-tuning the C-Find query
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2215
diff changeset
72 // Convert the DICOM as JSON, and dump it to the user in "--verbose" mode
9a8fab016145 sample worklist plugin fine-tuning the C-Find query
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2215
diff changeset
73 Json::Value json;
2289
89d17c72287b Modality worklist: added logs to display the number of files parsed and number of matches
Alain Mazy <alain@mazy.be>
parents: 2268
diff changeset
74 dicom.DicomToJson(json, OrthancPluginDicomToJsonFormat_Short,
2216
9a8fab016145 sample worklist plugin fine-tuning the C-Find query
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2215
diff changeset
75 static_cast<OrthancPluginDicomToJsonFlags>(0), 0);
2289
89d17c72287b Modality worklist: added logs to display the number of files parsed and number of matches
Alain Mazy <alain@mazy.be>
parents: 2268
diff changeset
76
2958
bb7a66efbeb1 OrthancPlugins::SetGlobalContext() in OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2827
diff changeset
77 OrthancPlugins::LogInfo("Received worklist query from remote modality " +
2233
8f5b60647654 worklist sample: FilterIssuerAet configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2216
diff changeset
78 std::string(issuerAet) + ":\n" + json.toStyledString());
2216
9a8fab016145 sample worklist plugin fine-tuning the C-Find query
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2215
diff changeset
79
2233
8f5b60647654 worklist sample: FilterIssuerAet configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2216
diff changeset
80 if (!filterIssuerAet_)
8f5b60647654 worklist sample: FilterIssuerAet configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2216
diff changeset
81 {
2958
bb7a66efbeb1 OrthancPlugins::SetGlobalContext() in OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2827
diff changeset
82 return new OrthancPlugins::FindMatcher(query);
2233
8f5b60647654 worklist sample: FilterIssuerAet configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2216
diff changeset
83 }
8f5b60647654 worklist sample: FilterIssuerAet configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2216
diff changeset
84 else
8f5b60647654 worklist sample: FilterIssuerAet configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2216
diff changeset
85 {
8f5b60647654 worklist sample: FilterIssuerAet configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2216
diff changeset
86 // Alternative sample showing how to fine-tune an incoming C-Find
8f5b60647654 worklist sample: FilterIssuerAet configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2216
diff changeset
87 // request, before matching it against the worklist database. The
8f5b60647654 worklist sample: FilterIssuerAet configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2216
diff changeset
88 // code below will restrict the original DICOM request by
8f5b60647654 worklist sample: FilterIssuerAet configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2216
diff changeset
89 // requesting the ScheduledStationAETitle to correspond to the AET
8f5b60647654 worklist sample: FilterIssuerAet configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2216
diff changeset
90 // of the C-Find issuer. This code will make the integration test
8f5b60647654 worklist sample: FilterIssuerAet configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2216
diff changeset
91 // "test_filter_issuer_aet" succeed (cf. the orthanc-tests repository).
2216
9a8fab016145 sample worklist plugin fine-tuning the C-Find query
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2215
diff changeset
92
2233
8f5b60647654 worklist sample: FilterIssuerAet configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2216
diff changeset
93 static const char* SCHEDULED_PROCEDURE_STEP_SEQUENCE = "0040,0100";
8f5b60647654 worklist sample: FilterIssuerAet configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2216
diff changeset
94 static const char* SCHEDULED_STATION_AETITLE = "0040,0001";
2827
d4fd4614f275 IncomingWorklistRequestFilter() to filter incoming C-FIND worklist queries
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2447
diff changeset
95 static const char* PREGNANCY_STATUS = "0010,21c0";
2216
9a8fab016145 sample worklist plugin fine-tuning the C-Find query
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2215
diff changeset
96
2233
8f5b60647654 worklist sample: FilterIssuerAet configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2216
diff changeset
97 if (!json.isMember(SCHEDULED_PROCEDURE_STEP_SEQUENCE))
8f5b60647654 worklist sample: FilterIssuerAet configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2216
diff changeset
98 {
8f5b60647654 worklist sample: FilterIssuerAet configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2216
diff changeset
99 // Create a ScheduledProcedureStepSequence sequence, with one empty element
8f5b60647654 worklist sample: FilterIssuerAet configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2216
diff changeset
100 json[SCHEDULED_PROCEDURE_STEP_SEQUENCE] = Json::arrayValue;
8f5b60647654 worklist sample: FilterIssuerAet configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2216
diff changeset
101 json[SCHEDULED_PROCEDURE_STEP_SEQUENCE].append(Json::objectValue);
8f5b60647654 worklist sample: FilterIssuerAet configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2216
diff changeset
102 }
2215
028214a95194 refactoring the worklist sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2214
diff changeset
103
2233
8f5b60647654 worklist sample: FilterIssuerAet configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2216
diff changeset
104 Json::Value& v = json[SCHEDULED_PROCEDURE_STEP_SEQUENCE];
2216
9a8fab016145 sample worklist plugin fine-tuning the C-Find query
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2215
diff changeset
105
2233
8f5b60647654 worklist sample: FilterIssuerAet configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2216
diff changeset
106 if (v.type() != Json::arrayValue ||
8f5b60647654 worklist sample: FilterIssuerAet configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2216
diff changeset
107 v.size() != 1 ||
8f5b60647654 worklist sample: FilterIssuerAet configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2216
diff changeset
108 v[0].type() != Json::objectValue)
8f5b60647654 worklist sample: FilterIssuerAet configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2216
diff changeset
109 {
2236
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2235
diff changeset
110 ORTHANC_PLUGINS_THROW_EXCEPTION(BadFileFormat);
2233
8f5b60647654 worklist sample: FilterIssuerAet configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2216
diff changeset
111 }
2216
9a8fab016145 sample worklist plugin fine-tuning the C-Find query
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2215
diff changeset
112
2233
8f5b60647654 worklist sample: FilterIssuerAet configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2216
diff changeset
113 // Set the ScheduledStationAETitle if none was provided
8f5b60647654 worklist sample: FilterIssuerAet configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2216
diff changeset
114 if (!v[0].isMember(SCHEDULED_STATION_AETITLE) ||
8f5b60647654 worklist sample: FilterIssuerAet configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2216
diff changeset
115 v[0].type() != Json::stringValue ||
8f5b60647654 worklist sample: FilterIssuerAet configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2216
diff changeset
116 v[0][SCHEDULED_STATION_AETITLE].asString().size() == 0 ||
8f5b60647654 worklist sample: FilterIssuerAet configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2216
diff changeset
117 v[0][SCHEDULED_STATION_AETITLE].asString() == "*")
8f5b60647654 worklist sample: FilterIssuerAet configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2216
diff changeset
118 {
8f5b60647654 worklist sample: FilterIssuerAet configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2216
diff changeset
119 v[0][SCHEDULED_STATION_AETITLE] = issuerAet;
8f5b60647654 worklist sample: FilterIssuerAet configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2216
diff changeset
120 }
2216
9a8fab016145 sample worklist plugin fine-tuning the C-Find query
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2215
diff changeset
121
2827
d4fd4614f275 IncomingWorklistRequestFilter() to filter incoming C-FIND worklist queries
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2447
diff changeset
122 if (json.isMember(PREGNANCY_STATUS) &&
d4fd4614f275 IncomingWorklistRequestFilter() to filter incoming C-FIND worklist queries
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2447
diff changeset
123 json[PREGNANCY_STATUS].asString().size() == 0)
2233
8f5b60647654 worklist sample: FilterIssuerAet configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2216
diff changeset
124 {
2827
d4fd4614f275 IncomingWorklistRequestFilter() to filter incoming C-FIND worklist queries
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2447
diff changeset
125 json.removeMember(PREGNANCY_STATUS);
2233
8f5b60647654 worklist sample: FilterIssuerAet configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2216
diff changeset
126 }
2216
9a8fab016145 sample worklist plugin fine-tuning the C-Find query
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2215
diff changeset
127
2233
8f5b60647654 worklist sample: FilterIssuerAet configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2216
diff changeset
128 // Encode the modified JSON as a DICOM instance, then convert it to a C-Find matcher
2958
bb7a66efbeb1 OrthancPlugins::SetGlobalContext() in OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2827
diff changeset
129 OrthancPlugins::MemoryBuffer modified;
2233
8f5b60647654 worklist sample: FilterIssuerAet configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2216
diff changeset
130 modified.CreateDicom(json, OrthancPluginCreateDicomFlags_None);
2958
bb7a66efbeb1 OrthancPlugins::SetGlobalContext() in OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2827
diff changeset
131
bb7a66efbeb1 OrthancPlugins::SetGlobalContext() in OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2827
diff changeset
132 return new OrthancPlugins::FindMatcher(modified);
2233
8f5b60647654 worklist sample: FilterIssuerAet configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2216
diff changeset
133 }
2215
028214a95194 refactoring the worklist sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2214
diff changeset
134 }
028214a95194 refactoring the worklist sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2214
diff changeset
135
028214a95194 refactoring the worklist sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2214
diff changeset
136
028214a95194 refactoring the worklist sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2214
diff changeset
137
1802
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138 OrthancPluginErrorCode Callback(OrthancPluginWorklistAnswers* answers,
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
139 const OrthancPluginWorklistQuery* query,
2233
8f5b60647654 worklist sample: FilterIssuerAet configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2216
diff changeset
140 const char* issuerAet,
1802
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
141 const char* calledAet)
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
142 {
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
143 try
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
144 {
2215
028214a95194 refactoring the worklist sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2214
diff changeset
145 // Construct an object to match the worklists in the database against the C-Find query
3768
6110a4995ace replacing std::auto_ptr by std::unique_ptr in GDCM sample plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3640
diff changeset
146 std::unique_ptr<OrthancPlugins::FindMatcher> matcher(CreateMatcher(query, issuerAet));
1911
7a05144cb919 fix issue 11
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1900
diff changeset
147
2215
028214a95194 refactoring the worklist sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2214
diff changeset
148 // Loop over the regular files in the database folder
2289
89d17c72287b Modality worklist: added logs to display the number of files parsed and number of matches
Alain Mazy <alain@mazy.be>
parents: 2268
diff changeset
149 namespace fs = boost::filesystem;
2214
b1d93286b315 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2206
diff changeset
150
2205
395522e46b2b refactoring of the worklist sample using OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1911
diff changeset
151 fs::path source(folder_);
395522e46b2b refactoring of the worklist sample using OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1911
diff changeset
152 fs::directory_iterator end;
4145
c5cdb6dc6865 New config option "Worklist.LimitAnswers" for the sample modality worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4045
diff changeset
153 unsigned int parsedFilesCount = 0;
c5cdb6dc6865 New config option "Worklist.LimitAnswers" for the sample modality worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4045
diff changeset
154 unsigned int matchedWorklistCount = 0;
2205
395522e46b2b refactoring of the worklist sample using OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1911
diff changeset
155
395522e46b2b refactoring of the worklist sample using OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1911
diff changeset
156 try
395522e46b2b refactoring of the worklist sample using OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1911
diff changeset
157 {
395522e46b2b refactoring of the worklist sample using OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1911
diff changeset
158 for (fs::directory_iterator it(source); it != end; ++it)
1802
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
159 {
2205
395522e46b2b refactoring of the worklist sample using OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1911
diff changeset
160 fs::file_type type(it->status().type());
1814
7c5ea3e51839 fix msvc build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1813
diff changeset
161
2205
395522e46b2b refactoring of the worklist sample using OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1911
diff changeset
162 if (type == fs::regular_file ||
395522e46b2b refactoring of the worklist sample using OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1911
diff changeset
163 type == fs::reparse_file) // cf. BitBucket issue #11
1802
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
164 {
2205
395522e46b2b refactoring of the worklist sample using OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1911
diff changeset
165 std::string extension = fs::extension(it->path());
2206
27106f7e3759 more refactoring of the worklist sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2205
diff changeset
166 std::transform(extension.begin(), extension.end(), extension.begin(), tolower); // Convert to lowercase
2205
395522e46b2b refactoring of the worklist sample using OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1911
diff changeset
167
395522e46b2b refactoring of the worklist sample using OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1911
diff changeset
168 if (extension == ".wl")
1802
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
169 {
2289
89d17c72287b Modality worklist: added logs to display the number of files parsed and number of matches
Alain Mazy <alain@mazy.be>
parents: 2268
diff changeset
170 parsedFilesCount++;
2215
028214a95194 refactoring the worklist sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2214
diff changeset
171 // We found a worklist (i.e. a DICOM find with extension ".wl"), match it against the query
2289
89d17c72287b Modality worklist: added logs to display the number of files parsed and number of matches
Alain Mazy <alain@mazy.be>
parents: 2268
diff changeset
172 if (MatchWorklist(answers, query, *matcher, it->path().string()))
89d17c72287b Modality worklist: added logs to display the number of files parsed and number of matches
Alain Mazy <alain@mazy.be>
parents: 2268
diff changeset
173 {
4145
c5cdb6dc6865 New config option "Worklist.LimitAnswers" for the sample modality worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4045
diff changeset
174 if (limitAnswers_ != 0 &&
c5cdb6dc6865 New config option "Worklist.LimitAnswers" for the sample modality worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4045
diff changeset
175 matchedWorklistCount >= limitAnswers_)
c5cdb6dc6865 New config option "Worklist.LimitAnswers" for the sample modality worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4045
diff changeset
176 {
c5cdb6dc6865 New config option "Worklist.LimitAnswers" for the sample modality worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4045
diff changeset
177 // Too many answers are to be returned wrt. the
c5cdb6dc6865 New config option "Worklist.LimitAnswers" for the sample modality worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4045
diff changeset
178 // "LimitAnswers" configuration parameter. Mark the
c5cdb6dc6865 New config option "Worklist.LimitAnswers" for the sample modality worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4045
diff changeset
179 // C-FIND result as incomplete.
c5cdb6dc6865 New config option "Worklist.LimitAnswers" for the sample modality worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4045
diff changeset
180 OrthancPluginWorklistMarkIncomplete(OrthancPlugins::GetGlobalContext(), answers);
c5cdb6dc6865 New config option "Worklist.LimitAnswers" for the sample modality worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4045
diff changeset
181 return OrthancPluginErrorCode_Success;
c5cdb6dc6865 New config option "Worklist.LimitAnswers" for the sample modality worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4045
diff changeset
182 }
c5cdb6dc6865 New config option "Worklist.LimitAnswers" for the sample modality worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4045
diff changeset
183
2958
bb7a66efbeb1 OrthancPlugins::SetGlobalContext() in OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2827
diff changeset
184 OrthancPlugins::LogInfo("Worklist matched: " + it->path().string());
2289
89d17c72287b Modality worklist: added logs to display the number of files parsed and number of matches
Alain Mazy <alain@mazy.be>
parents: 2268
diff changeset
185 matchedWorklistCount++;
89d17c72287b Modality worklist: added logs to display the number of files parsed and number of matches
Alain Mazy <alain@mazy.be>
parents: 2268
diff changeset
186 }
1802
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
187 }
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
188 }
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
189 }
2289
89d17c72287b Modality worklist: added logs to display the number of files parsed and number of matches
Alain Mazy <alain@mazy.be>
parents: 2268
diff changeset
190
89d17c72287b Modality worklist: added logs to display the number of files parsed and number of matches
Alain Mazy <alain@mazy.be>
parents: 2268
diff changeset
191 std::ostringstream message;
4145
c5cdb6dc6865 New config option "Worklist.LimitAnswers" for the sample modality worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4045
diff changeset
192 message << "Worklist C-Find: parsed " << parsedFilesCount
c5cdb6dc6865 New config option "Worklist.LimitAnswers" for the sample modality worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4045
diff changeset
193 << " files, found " << matchedWorklistCount << " match(es)";
2958
bb7a66efbeb1 OrthancPlugins::SetGlobalContext() in OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2827
diff changeset
194 OrthancPlugins::LogInfo(message.str());
1802
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
195 }
2205
395522e46b2b refactoring of the worklist sample using OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1911
diff changeset
196 catch (fs::filesystem_error&)
395522e46b2b refactoring of the worklist sample using OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1911
diff changeset
197 {
2958
bb7a66efbeb1 OrthancPlugins::SetGlobalContext() in OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2827
diff changeset
198 OrthancPlugins::LogError("Inexistent folder while scanning for worklists: " + source.string());
2205
395522e46b2b refactoring of the worklist sample using OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1911
diff changeset
199 return OrthancPluginErrorCode_DirectoryExpected;
395522e46b2b refactoring of the worklist sample using OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1911
diff changeset
200 }
395522e46b2b refactoring of the worklist sample using OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1911
diff changeset
201
395522e46b2b refactoring of the worklist sample using OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1911
diff changeset
202 return OrthancPluginErrorCode_Success;
1802
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
203 }
2205
395522e46b2b refactoring of the worklist sample using OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1911
diff changeset
204 catch (OrthancPlugins::PluginException& e)
1802
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
205 {
2205
395522e46b2b refactoring of the worklist sample using OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1911
diff changeset
206 return e.GetErrorCode();
1802
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
207 }
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
208 }
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
209
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
210
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
211 extern "C"
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
212 {
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
213 ORTHANC_PLUGINS_API int32_t OrthancPluginInitialize(OrthancPluginContext* c)
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
214 {
2958
bb7a66efbeb1 OrthancPlugins::SetGlobalContext() in OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2827
diff changeset
215 OrthancPlugins::SetGlobalContext(c);
1802
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
216
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
217 /* Check the version of the Orthanc core */
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
218 if (OrthancPluginCheckVersion(c) == 0)
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
219 {
2958
bb7a66efbeb1 OrthancPlugins::SetGlobalContext() in OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2827
diff changeset
220 OrthancPlugins::ReportMinimalOrthancVersion(ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER,
2268
ce5c13b95dac New function: OrthancPluginRegisterIncomingHttpRequestFilter2()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
221 ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER,
ce5c13b95dac New function: OrthancPluginRegisterIncomingHttpRequestFilter2()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
222 ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER);
1802
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
223 return -1;
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
224 }
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
225
2958
bb7a66efbeb1 OrthancPlugins::SetGlobalContext() in OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2827
diff changeset
226 OrthancPlugins::LogWarning("Sample worklist plugin is initializing");
bb7a66efbeb1 OrthancPlugins::SetGlobalContext() in OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2827
diff changeset
227 OrthancPluginSetDescription(c, "Serve DICOM modality worklists from a folder with Orthanc.");
1802
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
228
2958
bb7a66efbeb1 OrthancPlugins::SetGlobalContext() in OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2827
diff changeset
229 OrthancPlugins::OrthancConfiguration configuration;
2205
395522e46b2b refactoring of the worklist sample using OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1911
diff changeset
230
395522e46b2b refactoring of the worklist sample using OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1911
diff changeset
231 OrthancPlugins::OrthancConfiguration worklists;
395522e46b2b refactoring of the worklist sample using OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1911
diff changeset
232 configuration.GetSection(worklists, "Worklists");
1808
9c2ffc4e938b configuration of the sample modality worklists plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
233
2205
395522e46b2b refactoring of the worklist sample using OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1911
diff changeset
234 bool enabled = worklists.GetBooleanValue("Enable", false);
395522e46b2b refactoring of the worklist sample using OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1911
diff changeset
235 if (enabled)
1802
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
236 {
2205
395522e46b2b refactoring of the worklist sample using OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1911
diff changeset
237 if (worklists.LookupStringValue(folder_, "Database"))
1802
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
238 {
2958
bb7a66efbeb1 OrthancPlugins::SetGlobalContext() in OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2827
diff changeset
239 OrthancPlugins::LogWarning("The database of worklists will be read from folder: " + folder_);
bb7a66efbeb1 OrthancPlugins::SetGlobalContext() in OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2827
diff changeset
240 OrthancPluginRegisterWorklistCallback(OrthancPlugins::GetGlobalContext(), Callback);
1802
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
241 }
1808
9c2ffc4e938b configuration of the sample modality worklists plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
242 else
9c2ffc4e938b configuration of the sample modality worklists plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
243 {
2958
bb7a66efbeb1 OrthancPlugins::SetGlobalContext() in OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2827
diff changeset
244 OrthancPlugins::LogError("The configuration option \"Worklists.Database\" must contain a path");
2205
395522e46b2b refactoring of the worklist sample using OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1911
diff changeset
245 return -1;
1808
9c2ffc4e938b configuration of the sample modality worklists plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
246 }
2233
8f5b60647654 worklist sample: FilterIssuerAet configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2216
diff changeset
247
8f5b60647654 worklist sample: FilterIssuerAet configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2216
diff changeset
248 filterIssuerAet_ = worklists.GetBooleanValue("FilterIssuerAet", false);
4145
c5cdb6dc6865 New config option "Worklist.LimitAnswers" for the sample modality worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4045
diff changeset
249 limitAnswers_ = worklists.GetUnsignedIntegerValue("LimitAnswers", 0);
1802
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
250 }
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
251 else
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
252 {
2958
bb7a66efbeb1 OrthancPlugins::SetGlobalContext() in OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2827
diff changeset
253 OrthancPlugins::LogWarning("Worklist server is disabled by the configuration file");
1808
9c2ffc4e938b configuration of the sample modality worklists plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
254 }
1802
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
255
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
256 return 0;
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
257 }
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
258
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
259
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
260 ORTHANC_PLUGINS_API void OrthancPluginFinalize()
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
261 {
2958
bb7a66efbeb1 OrthancPlugins::SetGlobalContext() in OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2827
diff changeset
262 OrthancPlugins::LogWarning("Sample worklist plugin is finalizing");
1802
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
263 }
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
264
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
265
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
266 ORTHANC_PLUGINS_API const char* OrthancPluginGetName()
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
267 {
1808
9c2ffc4e938b configuration of the sample modality worklists plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
268 return "worklists";
1802
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
269 }
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
270
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
271
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
272 ORTHANC_PLUGINS_API const char* OrthancPluginGetVersion()
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
273 {
1808
9c2ffc4e938b configuration of the sample modality worklists plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
274 return MODALITY_WORKLISTS_VERSION;
1802
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
275 }
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
276 }