comparison OrthancServer/Search/DatabaseLookup.cpp @ 3679:6358923d3ced

C-FIND: forbid wildcard matching on some VRs, ignore main tags below the queried level
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 20 Feb 2020 20:06:19 +0100
parents 94f4a18a79cc
children 2a170a8f1faf
comparison
equal deleted inserted replaced
3678:26c6d47467a9 3679:6358923d3ced
196 constraint->AddValue(items[i]); 196 constraint->AddValue(items[i]);
197 } 197 }
198 198
199 AddConstraint(constraint.release()); 199 AddConstraint(constraint.release());
200 } 200 }
201 else if (dicomQuery.find('*') != std::string::npos || 201 else if (
202 dicomQuery.find('?') != std::string::npos) 202 /**
203 * New test in Orthanc 1.6.0: Wild card matching is only allowed
204 * for a subset of value representations: AE, CS, LO, LT, PN,
205 * SH, ST, UC, UR, UT.
206 * http://dicom.nema.org/medical/dicom/2019e/output/chtml/part04/sect_C.2.2.2.4.html
207 **/
208 (vr == ValueRepresentation_ApplicationEntity || // AE
209 vr == ValueRepresentation_CodeString || // CS
210 vr == ValueRepresentation_LongString || // LO
211 vr == ValueRepresentation_LongText || // LT
212 vr == ValueRepresentation_PersonName || // PN
213 vr == ValueRepresentation_ShortString || // SH
214 vr == ValueRepresentation_ShortText || // ST
215 vr == ValueRepresentation_UnlimitedCharacters || // UC
216 vr == ValueRepresentation_UniversalResource || // UR
217 vr == ValueRepresentation_UnlimitedText // UT
218 ) &&
219 (dicomQuery.find('*') != std::string::npos ||
220 dicomQuery.find('?') != std::string::npos))
203 { 221 {
204 AddConstraint(new DicomTagConstraint 222 AddConstraint(new DicomTagConstraint
205 (tag, ConstraintType_Wildcard, dicomQuery, caseSensitive, mandatoryTag)); 223 (tag, ConstraintType_Wildcard, dicomQuery, caseSensitive, mandatoryTag));
206 } 224 }
207 else 225 else