diff OrthancServer/FromDcmtkBridge.cpp @ 315:fc856d175d18

modifications
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 21 Dec 2012 17:18:04 +0100
parents 26efccdff583
children b83d85a85d69
line wrap: on
line diff
--- a/OrthancServer/FromDcmtkBridge.cpp	Fri Dec 21 13:53:24 2012 +0100
+++ b/OrthancServer/FromDcmtkBridge.cpp	Fri Dec 21 17:18:04 2012 +0100
@@ -690,6 +690,23 @@
   }
 
 
+
+  DicomInstanceHasher ParsedDicomFile::GetHasher()
+  {
+    std::string patientId, studyUid, seriesUid, instanceUid;
+
+    if (!GetTagValue(patientId, DICOM_TAG_PATIENT_ID) ||
+        !GetTagValue(studyUid, DICOM_TAG_STUDY_INSTANCE_UID) ||
+        !GetTagValue(seriesUid, DICOM_TAG_SERIES_INSTANCE_UID) ||
+        !GetTagValue(instanceUid, DICOM_TAG_SOP_INSTANCE_UID))
+    {
+      throw OrthancException(ErrorCode_BadFileFormat);
+    }
+
+    return DicomInstanceHasher(patientId, studyUid, seriesUid, instanceUid);
+  }
+
+
   void FromDcmtkBridge::Convert(DicomMap& target, DcmDataset& dataset)
   {
     target.Clear();