diff OrthancServer/DicomProtocol/DicomServer.cpp @ 357:8d3a0db39967

fix of standalone builds
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 31 Jan 2013 14:06:34 +0100
parents 6c4f6229aad7
children 2cef9c2d4148
line wrap: on
line diff
--- a/OrthancServer/DicomProtocol/DicomServer.cpp	Thu Jan 31 11:32:00 2013 +0100
+++ b/OrthancServer/DicomProtocol/DicomServer.cpp	Thu Jan 31 14:06:34 2013 +0100
@@ -80,19 +80,36 @@
     LOG(WARNING) << "Loading the embedded dictionaries";
     dcmDataDict.clear();
     DcmDataDictionary& d = dcmDataDict.wrlock();
+
+    /**
+     * Do not load DICONDE dictionary, it breaks the other tags. The
+     * command "strace storescu 2>&1 |grep dic" shows that DICONDE
+     * dictionary is not loaded by storescu.
+     **/
+    //LoadEmbeddedDictionary(d, EmbeddedResources::DICTIONARY_DICONDE);
+
     LoadEmbeddedDictionary(d, EmbeddedResources::DICTIONARY_DICOM);
     LoadEmbeddedDictionary(d, EmbeddedResources::DICTIONARY_PRIVATE);
-    LoadEmbeddedDictionary(d, EmbeddedResources::DICTIONARY_DICONDE);
     dcmDataDict.unlock();
 #endif
 
     /* make sure data dictionary is loaded */
     if (!dcmDataDict.isDictionaryLoaded())
     {
-      LOG(ERROR) << "no data dictionary loaded, check environment variable: " << DCM_DICT_ENVIRONMENT_VARIABLE;
+      LOG(ERROR) << "No DICOM dictionary loaded, check environment variable: " << DCM_DICT_ENVIRONMENT_VARIABLE;
       throw OrthancException(ErrorCode_InternalError);
     }
 
+    {
+      // Test the dictionary with a simple DICOM tag
+      DcmTag key(0x0010, 0x1030); // This is PatientWeight
+      if (key.getEVR() != EVR_DS)
+      {
+        LOG(ERROR) << "The DICOM dictionary has not been correctly read";
+        throw OrthancException(ErrorCode_InternalError);
+      }
+    }
+
     /* initialize network, i.e. create an instance of T_ASC_Network*. */
     T_ASC_Network *net;
     OFCondition cond = ASC_initializeNetwork