Mercurial > hg > orthanc
comparison OrthancServer/Sources/OrthancFindRequestHandler.cpp @ 5699:e8e028aed89f find-refactoring
c-find tests pass using ResourceFinder
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 12 Jul 2024 14:08:31 +0200 |
parents | 075558c95cbb |
children | 1fab9ddaf702 |
comparison
equal
deleted
inserted
replaced
5698:075558c95cbb | 5699:e8e028aed89f |
---|---|
535 level != ResourceType_Instance) | 535 level != ResourceType_Instance) |
536 { | 536 { |
537 throw OrthancException(ErrorCode_NotImplemented); | 537 throw OrthancException(ErrorCode_NotImplemented); |
538 } | 538 } |
539 | 539 |
540 | |
541 DicomArray query(*filteredInput); | 540 DicomArray query(*filteredInput); |
542 CLOG(INFO, DICOM) << "DICOM C-Find request at level: " << EnumerationToString(level); | 541 CLOG(INFO, DICOM) << "DICOM C-Find request at level: " << EnumerationToString(level); |
543 | 542 |
544 for (size_t i = 0; i < query.GetSize(); i++) | 543 for (size_t i = 0; i < query.GetSize(); i++) |
545 { | 544 { |
583 { | 582 { |
584 const DicomElement& element = query.GetElement(i); | 583 const DicomElement& element = query.GetElement(i); |
585 const DicomTag tag = element.GetTag(); | 584 const DicomTag tag = element.GetTag(); |
586 | 585 |
587 // remove tags that are not used for matching | 586 // remove tags that are not used for matching |
588 if (element.GetValue().IsNull() || | 587 if (tag == DICOM_TAG_QUERY_RETRIEVE_LEVEL || |
589 tag == DICOM_TAG_QUERY_RETRIEVE_LEVEL || | |
590 tag == DICOM_TAG_SPECIFIC_CHARACTER_SET || | 588 tag == DICOM_TAG_SPECIFIC_CHARACTER_SET || |
591 tag == DICOM_TAG_TIMEZONE_OFFSET_FROM_UTC) // time zone is not directly used for matching. Once we support "Timezone query adjustment", we may use it to adjust date-time filters but for now, just ignore it | 589 tag == DICOM_TAG_TIMEZONE_OFFSET_FROM_UTC) // time zone is not directly used for matching. Once we support "Timezone query adjustment", we may use it to adjust date-time filters but for now, just ignore it |
592 { | 590 { |
591 continue; | |
592 } | |
593 | |
594 requestedTags.insert(tag); | |
595 | |
596 if (element.GetValue().IsNull()) | |
597 { | |
598 // There is no constraint on this tag | |
593 continue; | 599 continue; |
594 } | 600 } |
595 | 601 |
596 std::string value = element.GetValue().GetContent(); | 602 std::string value = element.GetValue().GetContent(); |
597 if (value.size() == 0) | 603 if (value.size() == 0) |
615 | 621 |
616 lookup.AddDicomConstraint(tag, value, sensitive, true /* mandatory */); | 622 lookup.AddDicomConstraint(tag, value, sensitive, true /* mandatory */); |
617 } | 623 } |
618 else | 624 else |
619 { | 625 { |
620 requestedTags.insert(tag); | |
621 CLOG(INFO, DICOM) << "Because of a patch for the manufacturer of the remote modality, " | 626 CLOG(INFO, DICOM) << "Because of a patch for the manufacturer of the remote modality, " |
622 << "ignoring constraint on tag (" << tag.Format() << ") " | 627 << "ignoring constraint on tag (" << tag.Format() << ") " |
623 << FromDcmtkBridge::GetTagName(element); | 628 << FromDcmtkBridge::GetTagName(element); |
624 } | 629 } |
625 } | 630 } |
630 **/ | 635 **/ |
631 | 636 |
632 size_t limit = (level == ResourceType_Instance) ? maxInstances_ : maxResults_; | 637 size_t limit = (level == ResourceType_Instance) ? maxInstances_ : maxResults_; |
633 | 638 |
634 | 639 |
635 if (false) | 640 if (true) |
636 { | 641 { |
637 /** | 642 /** |
638 * EXPERIMENTAL VERSION | 643 * EXPERIMENTAL VERSION |
639 **/ | 644 **/ |
640 | 645 |