comparison OrthancServer/OrthancMoveRequestHandler.cpp @ 1162:1ea4094d077c db-changes

refactoring
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 17 Sep 2014 13:25:37 +0200
parents 84513f2ee1f3
children 703fcd797186
comparison
equal deleted inserted replaced
1161:82cbf1480aac 1162:1ea4094d077c
99 } 99 }
100 }; 100 };
101 } 101 }
102 102
103 103
104 bool OrthancMoveRequestHandler::LookupResource(std::string& publicId, 104 bool OrthancMoveRequestHandler::LookupIdentifier(std::string& publicId,
105 DicomTag tag, 105 DicomTag tag,
106 const DicomMap& input) 106 const DicomMap& input)
107 { 107 {
108 if (!input.HasTag(tag)) 108 if (!input.HasTag(tag))
109 { 109 {
111 } 111 }
112 112
113 std::string value = input.GetValue(tag).AsString(); 113 std::string value = input.GetValue(tag).AsString();
114 114
115 std::list<std::string> ids; 115 std::list<std::string> ids;
116 context_.GetIndex().LookupTagValue(ids, tag, value); 116 context_.GetIndex().LookupIdentifier(ids, tag, value);
117 117
118 if (ids.size() != 1) 118 if (ids.size() != 1)
119 { 119 {
120 return false; 120 return false;
121 } 121 }
153 std::string publicId; 153 std::string publicId;
154 154
155 switch (level) 155 switch (level)
156 { 156 {
157 case ResourceType_Patient: 157 case ResourceType_Patient:
158 ok = LookupResource(publicId, DICOM_TAG_PATIENT_ID, input); 158 ok = LookupIdentifier(publicId, DICOM_TAG_PATIENT_ID, input);
159 break; 159 break;
160 160
161 case ResourceType_Study: 161 case ResourceType_Study:
162 ok = LookupResource(publicId, DICOM_TAG_STUDY_INSTANCE_UID, input); 162 ok = LookupIdentifier(publicId, DICOM_TAG_STUDY_INSTANCE_UID, input);
163 break; 163 break;
164 164
165 case ResourceType_Series: 165 case ResourceType_Series:
166 ok = LookupResource(publicId, DICOM_TAG_SERIES_INSTANCE_UID, input); 166 ok = LookupIdentifier(publicId, DICOM_TAG_SERIES_INSTANCE_UID, input);
167 break; 167 break;
168 168
169 case ResourceType_Instance: 169 case ResourceType_Instance:
170 ok = LookupResource(publicId, DICOM_TAG_SOP_INSTANCE_UID, input); 170 ok = LookupIdentifier(publicId, DICOM_TAG_SOP_INSTANCE_UID, input);
171 break; 171 break;
172 172
173 default: 173 default:
174 ok = false; 174 ok = false;
175 } 175 }