comparison OrthancFramework/Sources/DicomFormat/DicomMap.cpp @ 4944:f377d5643538 more-tags

new Warnings configuration + InstanceAvailability tag
author Alain Mazy <am@osimis.io>
date Thu, 17 Mar 2022 17:03:59 +0100
parents 304514ce84ee
children c68265bf1f94
comparison
equal deleted inserted replaced
4941:96a3e81eba90 4944:f377d5643538
632 IsMainDicomTag(tag, ResourceType_Study) || 632 IsMainDicomTag(tag, ResourceType_Study) ||
633 IsMainDicomTag(tag, ResourceType_Series) || 633 IsMainDicomTag(tag, ResourceType_Series) ||
634 IsMainDicomTag(tag, ResourceType_Instance)); 634 IsMainDicomTag(tag, ResourceType_Instance));
635 } 635 }
636 636
637 static bool IsGenericComputedTag(const DicomTag& tag)
638 {
639 return tag == DICOM_TAG_RETRIEVE_URL ||
640 tag == DICOM_TAG_RETRIEVE_AE_TITLE;
641 }
642
637 bool DicomMap::IsComputedTag(const DicomTag& tag) 643 bool DicomMap::IsComputedTag(const DicomTag& tag)
638 { 644 {
639 return (IsComputedTag(tag, ResourceType_Patient) || 645 return (IsComputedTag(tag, ResourceType_Patient) ||
640 IsComputedTag(tag, ResourceType_Study) || 646 IsComputedTag(tag, ResourceType_Study) ||
641 IsComputedTag(tag, ResourceType_Series) || 647 IsComputedTag(tag, ResourceType_Series) ||
642 IsComputedTag(tag, ResourceType_Instance)); 648 IsComputedTag(tag, ResourceType_Instance) ||
649 IsGenericComputedTag(tag));
643 } 650 }
644 651
645 bool DicomMap::IsComputedTag(const DicomTag& tag, ResourceType level) 652 bool DicomMap::IsComputedTag(const DicomTag& tag, ResourceType level)
646 { 653 {
654 if (IsGenericComputedTag(tag))
655 {
656 return true;
657 }
658
647 switch (level) 659 switch (level)
648 { 660 {
649 case ResourceType_Patient: 661 case ResourceType_Patient:
650 return ( 662 return (
651 tag == DICOM_TAG_NUMBER_OF_PATIENT_RELATED_STUDIES || 663 tag == DICOM_TAG_NUMBER_OF_PATIENT_RELATED_STUDIES ||
662 case ResourceType_Series: 674 case ResourceType_Series:
663 return ( 675 return (
664 tag == DICOM_TAG_NUMBER_OF_SERIES_RELATED_INSTANCES 676 tag == DICOM_TAG_NUMBER_OF_SERIES_RELATED_INSTANCES
665 ); 677 );
666 case ResourceType_Instance: 678 case ResourceType_Instance:
667 return false; 679 return (
680 tag == DICOM_TAG_INSTANCE_AVAILABILITY
681 );
668 default: 682 default:
669 throw OrthancException(ErrorCode_ParameterOutOfRange); 683 throw OrthancException(ErrorCode_ParameterOutOfRange);
670 } 684 }
671 } 685 }
672 686