diff OrthancServer/ServerToolbox.cpp @ 2380:96b3ec054b69

reorganization in macros
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 29 Aug 2017 16:49:44 +0200
parents a3a65de1840f
children e4045b3c9772
line wrap: on
line diff
--- a/OrthancServer/ServerToolbox.cpp	Mon Aug 28 18:07:03 2017 +0200
+++ b/OrthancServer/ServerToolbox.cpp	Tue Aug 29 16:49:44 2017 +0200
@@ -135,88 +135,6 @@
     }
 
 
-    static std::string ValueAsString(const DicomMap& summary,
-                                     const DicomTag& tag)
-    {
-      const DicomValue& value = summary.GetValue(tag);
-      if (value.IsNull())
-      {
-        return "(null)";
-      }
-      else
-      {
-        return value.GetContent();
-      }
-    }
-
-
-    void LogMissingRequiredTag(const DicomMap& summary)
-    {
-      std::string s, t;
-
-      if (summary.HasTag(DICOM_TAG_PATIENT_ID))
-      {
-        if (t.size() > 0)
-          t += ", ";
-        t += "PatientID=" + ValueAsString(summary, DICOM_TAG_PATIENT_ID);
-      }
-      else
-      {
-        if (s.size() > 0)
-          s += ", ";
-        s += "PatientID";
-      }
-
-      if (summary.HasTag(DICOM_TAG_STUDY_INSTANCE_UID))
-      {
-        if (t.size() > 0)
-          t += ", ";
-        t += "StudyInstanceUID=" + ValueAsString(summary, DICOM_TAG_STUDY_INSTANCE_UID);
-      }
-      else
-      {
-        if (s.size() > 0)
-          s += ", ";
-        s += "StudyInstanceUID";
-      }
-
-      if (summary.HasTag(DICOM_TAG_SERIES_INSTANCE_UID))
-      {
-        if (t.size() > 0)
-          t += ", ";
-        t += "SeriesInstanceUID=" + ValueAsString(summary, DICOM_TAG_SERIES_INSTANCE_UID);
-      }
-      else
-      {
-        if (s.size() > 0)
-          s += ", ";
-        s += "SeriesInstanceUID";
-      }
-
-      if (summary.HasTag(DICOM_TAG_SOP_INSTANCE_UID))
-      {
-        if (t.size() > 0)
-          t += ", ";
-        t += "SOPInstanceUID=" + ValueAsString(summary, DICOM_TAG_SOP_INSTANCE_UID);
-      }
-      else
-      {
-        if (s.size() > 0)
-          s += ", ";
-        s += "SOPInstanceUID";
-      }
-
-      if (t.size() == 0)
-      {
-        LOG(ERROR) << "Store has failed because all the required tags (" << s << ") are missing (is it a DICOMDIR file?)";
-      }
-      else
-      {
-        LOG(ERROR) << "Store has failed because required tags (" << s << ") are missing for the following instance: " << t;
-      }
-    }
-
-
     static void StoreMainDicomTagsInternal(IDatabaseWrapper& database,
                                            int64_t resource,
                                            const DicomMap& tags)