Mercurial > hg > orthanc
comparison OrthancServer/Scheduler/ModifyInstanceCommand.cpp @ 1341:479e31b13de5
Allow replacing PatientID/StudyInstanceUID/SeriesInstanceUID from Lua scripts
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 03 Apr 2015 13:53:08 +0200 |
parents | 6e7e5ed91c2d |
children | f967bdf8534e |
comparison
equal
deleted
inserted
replaced
1340:0ad4773f28b3 | 1341:479e31b13de5 |
---|---|
34 | 34 |
35 #include <glog/logging.h> | 35 #include <glog/logging.h> |
36 | 36 |
37 namespace Orthanc | 37 namespace Orthanc |
38 { | 38 { |
39 ModifyInstanceCommand::ModifyInstanceCommand(ServerContext& context, | |
40 const DicomModification& modification) : | |
41 context_(context), | |
42 modification_(modification) | |
43 { | |
44 modification_.SetAllowManualIdentifiers(true); | |
45 | |
46 if (modification_.IsReplaced(DICOM_TAG_PATIENT_ID)) | |
47 { | |
48 modification_.SetLevel(ResourceType_Patient); | |
49 } | |
50 else if (modification_.IsReplaced(DICOM_TAG_STUDY_INSTANCE_UID)) | |
51 { | |
52 modification_.SetLevel(ResourceType_Study); | |
53 } | |
54 else if (modification_.IsReplaced(DICOM_TAG_SERIES_INSTANCE_UID)) | |
55 { | |
56 modification_.SetLevel(ResourceType_Series); | |
57 } | |
58 else | |
59 { | |
60 modification_.SetLevel(ResourceType_Instance); | |
61 } | |
62 } | |
63 | |
64 | |
39 bool ModifyInstanceCommand::Apply(ListOfStrings& outputs, | 65 bool ModifyInstanceCommand::Apply(ListOfStrings& outputs, |
40 const ListOfStrings& inputs) | 66 const ListOfStrings& inputs) |
41 { | 67 { |
42 for (ListOfStrings::const_iterator | 68 for (ListOfStrings::const_iterator |
43 it = inputs.begin(); it != inputs.end(); ++it) | 69 it = inputs.begin(); it != inputs.end(); ++it) |