comparison UnitTestsSources/ServerIndexTests.cpp @ 2208:90ea60bee5ff

New metadata automatically computed at the instance level: "SopClassUid"
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 09 Dec 2016 14:48:31 +0100
parents 3b9ee145f149
children a3a65de1840f
comparison
equal deleted inserted replaced
2207:6dc3bdb4088b 2208:90ea60bee5ff
791 DicomMap instance; 791 DicomMap instance;
792 instance.SetValue(DICOM_TAG_PATIENT_ID, "patient-" + id, false); 792 instance.SetValue(DICOM_TAG_PATIENT_ID, "patient-" + id, false);
793 instance.SetValue(DICOM_TAG_STUDY_INSTANCE_UID, "study-" + id, false); 793 instance.SetValue(DICOM_TAG_STUDY_INSTANCE_UID, "study-" + id, false);
794 instance.SetValue(DICOM_TAG_SERIES_INSTANCE_UID, "series-" + id, false); 794 instance.SetValue(DICOM_TAG_SERIES_INSTANCE_UID, "series-" + id, false);
795 instance.SetValue(DICOM_TAG_SOP_INSTANCE_UID, "instance-" + id, false); 795 instance.SetValue(DICOM_TAG_SOP_INSTANCE_UID, "instance-" + id, false);
796 instance.SetValue(DICOM_TAG_SOP_CLASS_UID, "1.2.840.10008.5.1.4.1.1.1", false); // CR image
796 797
797 std::map<MetadataType, std::string> instanceMetadata; 798 std::map<MetadataType, std::string> instanceMetadata;
798 DicomInstanceToStore toStore; 799 DicomInstanceToStore toStore;
799 toStore.SetSummary(instance); 800 toStore.SetSummary(instance);
800 ASSERT_EQ(StoreStatus_Success, index.Store(instanceMetadata, toStore, attachments)); 801 ASSERT_EQ(StoreStatus_Success, index.Store(instanceMetadata, toStore, attachments));
801 ASSERT_EQ(4u, instanceMetadata.size()); 802 ASSERT_EQ(5u, instanceMetadata.size());
802 ASSERT_TRUE(instanceMetadata.find(MetadataType_Instance_RemoteAet) != instanceMetadata.end()); 803 ASSERT_TRUE(instanceMetadata.find(MetadataType_Instance_RemoteAet) != instanceMetadata.end());
803 ASSERT_TRUE(instanceMetadata.find(MetadataType_Instance_ReceptionDate) != instanceMetadata.end()); 804 ASSERT_TRUE(instanceMetadata.find(MetadataType_Instance_ReceptionDate) != instanceMetadata.end());
804 ASSERT_TRUE(instanceMetadata.find(MetadataType_Instance_TransferSyntax) != instanceMetadata.end()); 805 ASSERT_TRUE(instanceMetadata.find(MetadataType_Instance_TransferSyntax) != instanceMetadata.end());
806 ASSERT_TRUE(instanceMetadata.find(MetadataType_Instance_SopClassUid) != instanceMetadata.end());
805 807
806 // By default, an Explicit VR Little Endian is used by Orthanc 808 // By default, an Explicit VR Little Endian is used by Orthanc
807 ASSERT_EQ("1.2.840.10008.1.2.1", instanceMetadata[MetadataType_Instance_TransferSyntax]); 809 ASSERT_EQ("1.2.840.10008.1.2.1", instanceMetadata[MetadataType_Instance_TransferSyntax]);
810
811 ASSERT_EQ("1.2.840.10008.5.1.4.1.1.1", instanceMetadata[MetadataType_Instance_SopClassUid]);
808 812
809 DicomInstanceHasher hasher(instance); 813 DicomInstanceHasher hasher(instance);
810 ids.push_back(hasher.HashPatient()); 814 ids.push_back(hasher.HashPatient());
811 ids.push_back(hasher.HashStudy()); 815 ids.push_back(hasher.HashStudy());
812 ids.push_back(hasher.HashSeries()); 816 ids.push_back(hasher.HashSeries());