# HG changeset patch # User Sebastien Jodogne # Date 1359637594 -3600 # Node ID 8d3a0db39967ce1d327d80e6caa5366630020508 # Parent d1f82cf3ae35bc5d38133daecf103761a6c724d0 fix of standalone builds diff -r d1f82cf3ae35 -r 8d3a0db39967 OrthancServer/DicomProtocol/DicomServer.cpp --- 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 diff -r d1f82cf3ae35 -r 8d3a0db39967 OrthancServer/OrthancRestApi.cpp --- a/OrthancServer/OrthancRestApi.cpp Thu Jan 31 11:32:00 2013 +0100 +++ b/OrthancServer/OrthancRestApi.cpp Thu Jan 31 14:06:34 2013 +0100 @@ -913,8 +913,11 @@ for (Json::Value::ArrayIndex i = 0; i < removals.size(); i++) { - DicomTag tag = FromDcmtkBridge::ParseTag(removals[i].asString()); + std::string name = removals[i].asString(); + DicomTag tag = FromDcmtkBridge::ParseTag(name); target.insert(tag); + + VLOG(1) << "Removal: " << name << " " << tag << std::endl; } } @@ -937,6 +940,8 @@ DicomTag tag = FromDcmtkBridge::ParseTag(name); target[tag] = value; + + VLOG(1) << "Replacement: " << name << " " << tag << " == " << value << std::endl; } } @@ -1148,7 +1153,6 @@ RestApi::PostCall& call) { boost::mutex::scoped_lock lock(cacheMutex_); - RETRIEVE_CONTEXT(call); std::string id = call.GetUriComponent("id", "");