comparison OrthancServer/DicomProtocol/DicomUserConnection.cpp @ 2335:174c3616ab6d

code review
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 17 Jul 2017 10:25:25 +0200
parents ae6245053bcf
children b5a04d983647
comparison
equal deleted inserted replaced
2334:dd26536454a0 2335:174c3616ab6d
482 482
483 483
484 static ParsedDicomFile* ConvertQueryFields(const DicomMap& fields, 484 static ParsedDicomFile* ConvertQueryFields(const DicomMap& fields,
485 ModalityManufacturer manufacturer) 485 ModalityManufacturer manufacturer)
486 { 486 {
487 // Fix outgoing C-Find requests 487 // Fix outgoing C-Find requests issue for Syngo.Via and its
488 // issue for Syngo.Via and its solution was reported by 488 // solution was reported by Emsy Chan by private mail on
489 // Emsy Chan by private mail on 2015-06-17. According to 489 // 2015-06-17. According to Robert van Ommen (2015-11-30), the
490 // Robert van Ommen (2015-11-30), the same fix is required for 490 // same fix is required for Agfa Impax. This was generalized for
491 // Agfa Impax. 491 // generic manufacturer since it seems to affect PhilipsADW,
492 // solutions was generalized for generic manufacturer since it seems to affect PhilipsADW, GEWAServer as well (check issue #31) 492 // GEWAServer as well:
493 // https://bitbucket.org/sjodogne/orthanc/issues/31/
493 494
494 switch (manufacturer) 495 switch (manufacturer)
495 { 496 {
496 case ModalityManufacturer_GenericNoWildcardInDates: 497 case ModalityManufacturer_GenericNoWildcardInDates:
497 case ModalityManufacturer_GenericNoWildcards: 498 case ModalityManufacturer_GenericNoWildcards:
501 std::set<DicomTag> tags; 502 std::set<DicomTag> tags;
502 fix->GetTags(tags); 503 fix->GetTags(tags);
503 504
504 for (std::set<DicomTag>::const_iterator it = tags.begin(); it != tags.end(); ++it) 505 for (std::set<DicomTag>::const_iterator it = tags.begin(); it != tags.end(); ++it)
505 { 506 {
506 // Replace a "*" query by an empty query ("") for "date" or "all" value representations depending on the manufacturer. 507 // Replace a "*" wildcard query by an empty query ("") for
507 if ((manufacturer == ModalityManufacturer_GenericNoWildcards) 508 // "date" or "all" value representations depending on the
508 || (manufacturer == ModalityManufacturer_GenericNoWildcardInDates && FromDcmtkBridge::LookupValueRepresentation(*it) == ValueRepresentation_Date)) 509 // type of manufacturer.
510 if (manufacturer == ModalityManufacturer_GenericNoWildcards ||
511 (manufacturer == ModalityManufacturer_GenericNoWildcardInDates &&
512 FromDcmtkBridge::LookupValueRepresentation(*it) == ValueRepresentation_Date))
509 { 513 {
510 const DicomValue* value = fix->TestAndGetValue(*it); 514 const DicomValue* value = fix->TestAndGetValue(*it);
511 515
512 if (value != NULL && 516 if (value != NULL &&
513 !value->IsNull() && 517 !value->IsNull() &&