Mercurial > hg > orthanc
comparison Plugins/Samples/ModalityWorklists/Plugin.cpp @ 2827:d4fd4614f275
IncomingWorklistRequestFilter() to filter incoming C-FIND worklist queries
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 19 Sep 2018 21:10:49 +0200 |
parents | 878b59270859 |
children | bb7a66efbeb1 |
comparison
equal
deleted
inserted
replaced
2826:c277e0421200 | 2827:d4fd4614f275 |
---|---|
90 // of the C-Find issuer. This code will make the integration test | 90 // of the C-Find issuer. This code will make the integration test |
91 // "test_filter_issuer_aet" succeed (cf. the orthanc-tests repository). | 91 // "test_filter_issuer_aet" succeed (cf. the orthanc-tests repository). |
92 | 92 |
93 static const char* SCHEDULED_PROCEDURE_STEP_SEQUENCE = "0040,0100"; | 93 static const char* SCHEDULED_PROCEDURE_STEP_SEQUENCE = "0040,0100"; |
94 static const char* SCHEDULED_STATION_AETITLE = "0040,0001"; | 94 static const char* SCHEDULED_STATION_AETITLE = "0040,0001"; |
95 static const char* PREGNANCY_STATUS = "0010,21c0"; | |
95 | 96 |
96 if (!json.isMember(SCHEDULED_PROCEDURE_STEP_SEQUENCE)) | 97 if (!json.isMember(SCHEDULED_PROCEDURE_STEP_SEQUENCE)) |
97 { | 98 { |
98 // Create a ScheduledProcedureStepSequence sequence, with one empty element | 99 // Create a ScheduledProcedureStepSequence sequence, with one empty element |
99 json[SCHEDULED_PROCEDURE_STEP_SEQUENCE] = Json::arrayValue; | 100 json[SCHEDULED_PROCEDURE_STEP_SEQUENCE] = Json::arrayValue; |
116 v[0][SCHEDULED_STATION_AETITLE].asString() == "*") | 117 v[0][SCHEDULED_STATION_AETITLE].asString() == "*") |
117 { | 118 { |
118 v[0][SCHEDULED_STATION_AETITLE] = issuerAet; | 119 v[0][SCHEDULED_STATION_AETITLE] = issuerAet; |
119 } | 120 } |
120 | 121 |
121 if (json.isMember("0010,21c0") && | 122 if (json.isMember(PREGNANCY_STATUS) && |
122 json["0010,21c0"].asString().size() == 0) | 123 json[PREGNANCY_STATUS].asString().size() == 0) |
123 { | 124 { |
124 json.removeMember("0010,21c0"); | 125 json.removeMember(PREGNANCY_STATUS); |
125 } | 126 } |
126 | 127 |
127 // Encode the modified JSON as a DICOM instance, then convert it to a C-Find matcher | 128 // Encode the modified JSON as a DICOM instance, then convert it to a C-Find matcher |
128 OrthancPlugins::MemoryBuffer modified(context_); | 129 OrthancPlugins::MemoryBuffer modified(context_); |
129 modified.CreateDicom(json, OrthancPluginCreateDicomFlags_None); | 130 modified.CreateDicom(json, OrthancPluginCreateDicomFlags_None); |