This wiki has undergone a migration to Confluence found Here
<meta name="googlebot" content="noindex">

JSON based ITS

From HL7Wiki
Jump to navigation Jump to search


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


XML is not the most performant way to send information. Image taken from: 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." extension="660d999b-0157-41c2-8f2b-762d101aa279"/>
  <code code="RJM2009021801" codeSystem="2.16.840.1.113883." codeSystemName="UMCG Tijdelijk">
  <recordTarget typeCode="RCT">
     <patient classCode="PAT">
       <id root="2.16.840.1.113883." extension="2761703" assigningAuthorityName="UMCG"/>
  <component typeCode="COMP">
     <observation classCode="OBS" moodCode="EVN">
        <id root="2.16.840.1.113883." extension="491216"/>
        <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>
        <author typeCode="AUT">
           <assignedEntity classCode="ASSIGNED">
              <id root="2.16.840.1.113883." extension="KNO"/>

Example JSON

"organizer": { "@classCode": "ORGANIZER", "@xmlns": "urn:hl7-org:v3",
 "templateId": {
   "@root": "2.16.840.1.113883.",
   "@extension": "660d999b-0157-41c2-8f2b-762d101aa279"
 "code": {
   "@code": "RJM2009021801",
   "@codeSystem": "2.16.840.1.113883.",
   "@codeSystemName": "UMCG Tijdelijk",
   "originalText": "Diagnosis"
 "recordTarget": { "@typeCode": "RCT",
   "patient": { "@classCode": "PAT",
     "id": {
       "@root": "2.16.840.1.113883.",
       "@extension: "2761703",
       "@assigningAuthorityName": "UMCG"
 "component": { "@typeCode": "COMP",
   "observation": { "@classCode": "OBS", "@moodCode": "EVN",
     "id": {
       "@root": "2.16.840.1.113883.",
       "@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.",
           "@extension": "KNO"


  • Validation using OCL?
  • Validation using JSON Schema, see New 'Orderly' schema threatens XML dominance?
  • Polymorphism and "xsi:type". In this example we see the "xsi:type" attribute being demoted to an "ordinary" attribute. In fact this should signal the JSON-processor that it should deserialize the data to a certain type. Unfortunately JSON does not yet support this kind of typing. How to handle this?
  • Closed the RIMBAA issue. If this moves forward, it will have to be as a proposal to the ITS WG.