This wiki has undergone a migration to Confluence found Here

Difference between revisions of "JSON based ITS"

From HL7Wiki
Jump to navigation Jump to search
Line 1: Line 1:
 
[[category:RIMBAA Issue]]  
 
[[category:RIMBAA Issue]]  
 +
[[Image:Json-speeds-md-thumb.png‎|frame]]
 
==Summary==
 
==Summary==
 
[http://www.json.org JSON] encoding rather than XML. Or even binary/zipped.  
 
[http://www.json.org JSON] encoding rather than XML. Or even binary/zipped.  
Line 6: Line 7:
 
==Analysis==
 
==Analysis==
 
XML is not the most performant way to send information.
 
XML is not the most performant way to send information.
 +
Image taken from: http://viswaug.wordpress.com/2008/01/23/json-over-xml/
 +
JSON has proven to be much more efficient in parsing and size.
 +
One thing I did not expect is that the JSON version (1596 chars) is larger than the XML version (1346 chars).
 +
 +
===Example XML===
  
JSON has proven to be much more efficient in parsing and size.
+
<organizer classCode="ORGANIZER" xmlns="urn:hl7-org:v3">
[[Image:Json-speeds-md-thumb.png‎|frame]]
+
  <templateId root="2.16.840.1.113883.2.4.3.8.1000.9" extension="660d999b-0157-41c2-8f2b-762d101aa279"/>
Taken from: http://viswaug.wordpress.com/2008/01/23/json-over-xml/
+
  <code code="RJM2009021801" codeSystem="2.16.840.1.113883.2.4.3.8.1000.21" codeSystemName="UMCG Tijdelijk">
 +
      <originalText>Diagnosis</originalText>
 +
  </code>
 +
  <recordTarget typeCode="RCT">
 +
      <patient classCode="PAT">
 +
        <id root="2.16.840.1.113883.2.4.3.8.12" extension="2761703" assigningAuthorityName="UMCG"/>
 +
      </patient>
 +
  </recordTarget>
 +
  <component typeCode="COMP">
 +
      <observation classCode="OBS" moodCode="EVN">
 +
        <id root="2.16.840.1.113883.2.4.3.8.1000.31" extension="491216"/>
 +
        <code code="DX" codeSystem="2.16.840.1.113883.1.11.16228" codeSystemName="ObservationDiagnosisTypes"/>
 +
        <text/>
 +
        <effectiveTime value="20060329"/>
 +
        <value xsi:type="CD" code="474.10" codeSystem="2.16.840.1.113883.6.103" codeSystemName="ICD-9-CM">
 +
            <originalText>Otitis media / niet gespecificeerd</originalText>
 +
        </value>
 +
        <author typeCode="AUT">
 +
            <assignedEntity classCode="ASSIGNED">
 +
              <id root="2.16.840.1.113883.2.4.3.8.1000.8" extension="KNO"/>
 +
            </assignedEntity>
 +
        </author>
 +
      </observation>
 +
  </component>
 +
</organizer>
 +
 
 +
===Example JSON===
 +
 
 +
"organizer": { "@classCode": "ORGANIZER", "@xmlns": "urn:hl7-org:v3",
 +
  "templateId": {
 +
    "@root": "2.16.840.1.113883.2.4.3.8.1000.9",
 +
    "@extension": "660d999b-0157-41c2-8f2b-762d101aa279"
 +
  },
 +
  "code": {
 +
    "@code": "RJM2009021801",
 +
    "@codeSystem": "2.16.840.1.113883.2.4.3.8.1000.21",
 +
    "@codeSystemName": "UMCG Tijdelijk",
 +
    "originalText": "Diagnosis"
 +
  },
 +
  "recordTarget": { "@typeCode": "RCT",
 +
    "patient": { "@classCode": "PAT",
 +
      "id": {
 +
        "@root": "2.16.840.1.113883.2.4.3.8.12",
 +
        "@extension: "2761703",
 +
        "@assigningAuthorityName": "UMCG"
 +
      }
 +
    }
 +
  },
 +
  "component": { "@typeCode": "COMP",
 +
    "observation": { "@classCode": "OBS", "@moodCode": "EVN",
 +
      "id": {
 +
        "@root": "2.16.840.1.113883.2.4.3.8.1000.31",
 +
        "@extension": "491216"
 +
      },
 +
      "code": {
 +
        "@code": "DX",
 +
        "@codeSystem": "2.16.840.1.113883.1.11.16228",
 +
        "@codeSystemName": "ObservationDiagnosisTypes"
 +
      },
 +
      "text": null,
 +
      "effectiveTime" { "value": "20060329" },
 +
      "value": { "@xsi:type": "CD",
 +
        "@code": "474.10",
 +
        "@codeSystem": "2.16.840.1.113883.6.103",
 +
        "@codeSystemName": "ICD-9-CM"
 +
        "originalText": "Otitis media / niet gespecificeerd"
 +
      }
 +
      "author": { "@typeCode": "AUT",
 +
        "assignedEntity": { "@classCode": "ASSIGNED",
 +
          "id": {
 +
            "@root": "2.16.840.1.113883.2.4.3.8.1000.8",
 +
            "@extension": "KNO"
 +
          }
 +
        }
 +
      }
 +
    }
 +
  }
 +
};
  
 
==Discussion==
 
==Discussion==

Revision as of 21:55, 17 April 2009

Json-speeds-md-thumb.png

Summary

JSON encoding rather than XML. Or even binary/zipped. See also "(informational only) New ITS - RIM based ITS" RIMBAA_200901_WGM_Minutes

Analysis

XML is not the most performant way to send information. Image taken from: http://viswaug.wordpress.com/2008/01/23/json-over-xml/ JSON has proven to be much more efficient in parsing and size. One thing I did not expect is that the JSON version (1596 chars) is larger than the XML version (1346 chars).

Example XML

<organizer classCode="ORGANIZER" xmlns="urn:hl7-org:v3">
  <templateId root="2.16.840.1.113883.2.4.3.8.1000.9" extension="660d999b-0157-41c2-8f2b-762d101aa279"/>
  
     <originalText>Diagnosis</originalText>
  
  <recordTarget typeCode="RCT">
     <patient classCode="PAT">
       <id root="2.16.840.1.113883.2.4.3.8.12" extension="2761703" assigningAuthorityName="UMCG"/>
     </patient>
  </recordTarget>
  <component typeCode="COMP">
     <observation classCode="OBS" moodCode="EVN">
        <id root="2.16.840.1.113883.2.4.3.8.1000.31" extension="491216"/>
        
        <text/>
        <effectiveTime value="20060329"/>
        <value xsi:type="CD" code="474.10" codeSystem="2.16.840.1.113883.6.103" codeSystemName="ICD-9-CM">
           <originalText>Otitis media / niet gespecificeerd</originalText>
        </value>
        <author typeCode="AUT">
           <assignedEntity classCode="ASSIGNED">
              <id root="2.16.840.1.113883.2.4.3.8.1000.8" extension="KNO"/>
           </assignedEntity>
        </author>
     </observation>
  </component>
</organizer>

Example JSON

"organizer": { "@classCode": "ORGANIZER", "@xmlns": "urn:hl7-org:v3",
 "templateId": {
   "@root": "2.16.840.1.113883.2.4.3.8.1000.9",
   "@extension": "660d999b-0157-41c2-8f2b-762d101aa279"
 },
 "code": {
   "@code": "RJM2009021801",
   "@codeSystem": "2.16.840.1.113883.2.4.3.8.1000.21",
   "@codeSystemName": "UMCG Tijdelijk",
   "originalText": "Diagnosis"
 },
 "recordTarget": { "@typeCode": "RCT",
   "patient": { "@classCode": "PAT",
     "id": {
       "@root": "2.16.840.1.113883.2.4.3.8.12",
       "@extension: "2761703",
       "@assigningAuthorityName": "UMCG"
     }
   }
 },
 "component": { "@typeCode": "COMP",
   "observation": { "@classCode": "OBS", "@moodCode": "EVN",
     "id": {
       "@root": "2.16.840.1.113883.2.4.3.8.1000.31",
       "@extension": "491216"
     },
     "code": {
       "@code": "DX",
       "@codeSystem": "2.16.840.1.113883.1.11.16228",
       "@codeSystemName": "ObservationDiagnosisTypes"
     },
     "text": null,
     "effectiveTime" { "value": "20060329" },
     "value": { "@xsi:type": "CD",
       "@code": "474.10",
       "@codeSystem": "2.16.840.1.113883.6.103",
       "@codeSystemName": "ICD-9-CM"
       "originalText": "Otitis media / niet gespecificeerd"
     }
     "author": { "@typeCode": "AUT",
       "assignedEntity": { "@classCode": "ASSIGNED",
         "id": {
           "@root": "2.16.840.1.113883.2.4.3.8.1000.8",
           "@extension": "KNO"
         }
       }
     }
   }
 }
};

Discussion