Capitalization of JSON key names and XML attribute names is not consistently used through the documentation. They should be precisely defined because both XML and JSON are case sensitive.
I have experienced this problem working on a piece of software that tries to recover information from a Dicom storage server. The idea is to recover the information using the standard models: Native Dicom Model (XML) and Dicom JSON
I will try to show the discrepancies with references to different sections of the documentation:
According to DICOM PS 3.19 2011,
Annex A.1: Native Dicom Model
Some of the XML attribute names appear in uppercase or lowercase inconsistently.
Table A.1.5-2 DICOM Data Set Macro
Some attribute names appear with the first letter in lowercase: 'keyword', 'tag', 'vr', 'privateCreator', ...
A.1.6 Schema, line 1050
DicomAttribute = element DicomAttribute {
Tag, VR, Keyword?, PrivateCreator?,
( BulkData | Value+ | Item+ | PersonName+ )?
}
Attribute names used here use begins by a capital letter: 'Keyword', 'Tag', 'VR', 'PrivateCreator'
A.1.7 Examples
/DicomNativeModel/DicomAttribute[@keyword=”ViewCodeSequence”]/Item[@number=1]/
/DicomAttribute[@keyword=”CodeMeaning”]/Value[@number=1]
Notice the attribute name 'keyword' appearing in lowercase. This example has been written having in mind that attribute name 'keyword' does not use any capital letter at all.
* If we try to extract information using XPath expressions, capitalization should be well defined and it must be used consistently. Otherwise, we will have problems.
XML is case sensitive, including attribute names. So, XPath queries to extract the information are case sensitive, too.
Now, to the second document:
Sup 166 LB, Annex F.2.1.1.1
<?xml version="1.0" encoding="UTF-8"?>
<NativeDicomModel>
<DicomAttribute Tag="0020000D" VR="UI" Keyword="StudyInstanceUID">
<Value
number="1">1.2.392.200036.9116.2.2.2.1762893313.1029997326.945873</value>
</DicomAttribute>
</NativeDicomModel>
...
If we try to apply the XPath query example from the annex A.1.7 in the "PS 3.19" document, the query will fail: The attribute is not named 'keyword', but 'Keyword'.
This same problem translates to the Dicom JSON model.
Sup 166 LB, Annex F.2.1.1.2
[
{
"StudyInstanceUID": {
"Tag": "0020000D" ,
"VR": "UI",
"Value": [ "1.2.392.200036.9116.2.2.2.1762893313.1029997326.945873" ]
}
}
...
Notice the letter case for the JSON key names 'Tag', 'VR', 'Keyword'
JSON is also case-sensitive (including key names)
The document "Sup 166 LB" is consistent itself in the usage of uppercase or lowercase letters. Unfortunately, there are some products developed over the previous (and, may be, missleading) standard (Native Dicom Model), so the user can end up obtaining XML / JSON responses like these (In fact, I have just suffered this, using one well known open source Dicom toolkit).
XML:
<DicomAttribute keyword="StudyDate" tag="00080020" vr="DA">
<Value number="1">20051107</Value>
</DicomAttribute>
...
JSON:
{
"StudyDate" : {
"tag" : "00080020",
"vr" : "DA",
"Value" : [
"20051107"
]
},
...
Currently, I am assuming the right syntax is that of document 'sup 166 LB' (Initial capital letter. At least, this document is itself fully consistent).
Before opening a bug report on the website of third party software product I would like to hear more reputed opinions about this issue.
Regards,
José Antonio Pérez
http://goo.gl/lW17d