changeset 4884:d7d5d63985c8

allow custom value for "Modality" in /tools/create-dicom for PDF
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 09 Feb 2022 21:07:57 +0100
parents 504624b0a062
children 86468693779e
files OrthancFramework/Sources/DicomParsing/ParsedDicomFile.cpp
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancFramework/Sources/DicomParsing/ParsedDicomFile.cpp	Wed Feb 09 13:10:11 2022 +0100
+++ b/OrthancFramework/Sources/DicomParsing/ParsedDicomFile.cpp	Wed Feb 09 21:07:57 2022 +0100
@@ -1502,11 +1502,14 @@
 
     InvalidateCache();
 
+    // In Orthanc <= 1.9.7, the "Modality" would have always be overwritten as "OT"
+    // https://groups.google.com/g/orthanc-users/c/eNSddNrQDtM/m/wc1HahimAAAJ
+    
     ReplacePlainString(DICOM_TAG_SOP_CLASS_UID, UID_EncapsulatedPDFStorage);
-    ReplacePlainString(FromDcmtkBridge::Convert(DCM_Modality), "OT");
-    ReplacePlainString(FromDcmtkBridge::Convert(DCM_ConversionType), "WSD");
-    ReplacePlainString(FromDcmtkBridge::Convert(DCM_MIMETypeOfEncapsulatedDocument), MIME_PDF);
-    //ReplacePlainString(FromDcmtkBridge::Convert(DCM_SeriesNumber), "1");
+    SetIfAbsent(FromDcmtkBridge::Convert(DCM_Modality), "OT");
+    SetIfAbsent(FromDcmtkBridge::Convert(DCM_ConversionType), "WSD");
+    SetIfAbsent(FromDcmtkBridge::Convert(DCM_MIMETypeOfEncapsulatedDocument), MIME_PDF);
+    //SetIfAbsent(FromDcmtkBridge::Convert(DCM_SeriesNumber), "1");
 
     std::unique_ptr<DcmPolymorphOBOW> element(new DcmPolymorphOBOW(DCM_EncapsulatedDocument));