Why data needs a format
Health Data Formats: XML, JSON and Turtle: Why data needs a format.
A record travels. As what?
A health record sits in one system and has to reach another. It cannot travel as a screen or a form. It has to become text, written in a way both systems agree on. That agreement is a format.
From a record to text and back
Here is the path. First, a record exists in one system. Second, it is written as text, following the rules of a format. Third, that text is sent or saved as a file. And fourth, the other system reads the text using the same rules, and rebuilds the record. If the rules are shared, the record arrives whole.
- Step 1 · A record · Held in one system. · file
- Step 2 · Written as text · By the rules of a format. · pencil
- Step 3 · Sent or saved · As a message or a file. · share
- Step 4 · Read back · By the same rules. · check
The same fact in three formats
Here is one made up fact, a birth date, written in the three formats you will meet in this course. In X M L, the value sits between a start tag and an end tag. In JSON, it is a name and a value, separated by a colon. And in Turtle, it is a statement with three parts, ending in a full stop. Same fact, three ways of writing it down.
- XML · <born>1974-12-25</born> · tag
- JSON · "born": "1974-12-25" · box
- Turtle · :p1 :born "1974-12-25" . · link
A format, and what it is
What do the standards say about themselves? X M L, from the W3C, is a subset of S G M L, made for use on the Web. JSON, in the I E T F standard, is a lightweight, text based, language independent data interchange format. Turtle, from the W3C, is a compact textual form for writing down an R D F graph made of triples. And FHIR says its resources can be represented in X M L, JSON and Turtle.
- XML (W3C) · A subset of SGML, for the Web · tag · navy
- JSON (IETF) · A lightweight text interchange format · box · navy
- Turtle (W3C) · A compact text form for RDF triples · link · amber
- FHIR · Resources as XML, JSON or Turtle · globe · slate
Check yourself
Pause and think. In which formats does FHIR say a resource can be represented? The answer: X M L, JSON and Turtle.
- XML, JSON and Turtle
- Only JSON
- Only PDF files
- Only spreadsheets
Keep these in mind
A format is an agreement on how to write a record as text. X M L, JSON and Turtle write the same fact in three ways. Each has its own standard and its own rules. And FHIR can use all three.
- A format is an agreement on how to write a record as text
- XML, JSON and Turtle write the same fact in three ways
- Each has its own standard and its own rules
- FHIR can use all three
SNOMED CT®, LOINC®, ICD and other terminologies are the property of their respective owners and are shown for education under their licences. Licences & attributions