Mercurial > hg > orthanc
comparison OrthancServer/OrthancInitialization.cpp @ 2115:a657f7772e69
Handling of private tags/creators in the "Dictionary" configuration option
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 31 Oct 2016 15:23:32 +0100 |
parents | bcbc9137a535 |
children | bb199bccdc45 |
comparison
equal
deleted
inserted
replaced
2114:e4f8e377782f | 2115:a657f7772e69 |
---|---|
392 for (Json::Value::ArrayIndex i = 0; i < tags.size(); i++) | 392 for (Json::Value::ArrayIndex i = 0; i < tags.size(); i++) |
393 { | 393 { |
394 const Json::Value& content = configuration["Dictionary"][tags[i]]; | 394 const Json::Value& content = configuration["Dictionary"][tags[i]]; |
395 if (content.type() != Json::arrayValue || | 395 if (content.type() != Json::arrayValue || |
396 content.size() < 2 || | 396 content.size() < 2 || |
397 content.size() > 4 || | 397 content.size() > 5 || |
398 content[0].type() != Json::stringValue || | 398 content[0].type() != Json::stringValue || |
399 content[1].type() != Json::stringValue || | 399 content[1].type() != Json::stringValue || |
400 (content.size() >= 3 && content[2].type() != Json::intValue) || | 400 (content.size() >= 3 && content[2].type() != Json::intValue) || |
401 (content.size() >= 4 && content[3].type() != Json::intValue)) | 401 (content.size() >= 4 && content[3].type() != Json::intValue) || |
402 (content.size() >= 5 && content[4].type() != Json::stringValue)) | |
402 { | 403 { |
403 throw OrthancException(ErrorCode_BadFileFormat); | 404 throw OrthancException(ErrorCode_BadFileFormat); |
404 } | 405 } |
405 | 406 |
406 DicomTag tag(FromDcmtkBridge::ParseTag(tags[i])); | 407 DicomTag tag(FromDcmtkBridge::ParseTag(tags[i])); |
407 ValueRepresentation vr = StringToValueRepresentation(content[0].asString(), true); | 408 ValueRepresentation vr = StringToValueRepresentation(content[0].asString(), true); |
408 std::string name = content[1].asString(); | 409 std::string name = content[1].asString(); |
409 unsigned int minMultiplicity = (content.size() >= 2) ? content[2].asUInt() : 1; | 410 unsigned int minMultiplicity = (content.size() >= 2) ? content[2].asUInt() : 1; |
410 unsigned int maxMultiplicity = (content.size() >= 3) ? content[3].asUInt() : 1; | 411 unsigned int maxMultiplicity = (content.size() >= 3) ? content[3].asUInt() : 1; |
411 | 412 std::string privateCreator = (content.size() >= 4) ? content[4].asString() : ""; |
412 FromDcmtkBridge::RegisterDictionaryTag(tag, vr, name, minMultiplicity, maxMultiplicity); | 413 |
414 FromDcmtkBridge::RegisterDictionaryTag(tag, vr, name, minMultiplicity, maxMultiplicity, privateCreator); | |
413 } | 415 } |
414 } | 416 } |
415 | 417 |
416 | 418 |
417 static void ConfigurePkcs11(const Json::Value& config) | 419 static void ConfigurePkcs11(const Json::Value& config) |