- Resources: one JSON object per clinical fact
- CodeableConcepts: a code plus a label
- Choice fields: fields such as
onset[x]that can hold different types - References: links from one resource to another
- Bundles: the list that holds all resources
Resources
A resource is one JSON object that describes one clinical fact. ItsresourceType field tells you what kind of fact it is. Because every system agrees on the same resource types, field names, and code systems, a resource that one system writes, another system can read.
Condition has clinicalStatus, severity, and bodySite. An Observation has valueQuantity and interpretation. The endpoint only fills a field when the note supports it, apart from the references and a few fixed defaults such as clinicalStatus: active, and leaves out every empty field. Two Condition resources from the same response can therefore have different sets of fields.
CodeableConcepts
Most coded fields in FHIR are CodeableConcepts (R4 definition). A CodeableConcept wraps one or more codes in acoding list, plus a human-readable text. Each entry in coding has three parts:
A coding from SNOMED CT or LOINC can also carry a
version with the version of the code system the endpoint used. The examples in these docs leave it out.
Simplified, you can read a CodeableConcept as “code plus label”: 195967001 Asthma. In JSON, it looks like this:
system and code together. The code 8480-6 means “Systolic blood pressure” in LOINC, but nothing in SNOMED CT.
One concept, two codings
Some CodeableConcepts carry two codings for the same meaning. The endpoint puts the FHIR value-set code first, and adds the SNOMED CT equivalent second. For example, a family member’s relationship:coding[0], it gets the FHIR code. If your system understands SNOMED CT, it can use the second coding.
Text-only CodeableConcepts
Some fields describe things that the endpoint does not code, such as the reason for a procedure. Those CodeableConcepts carry onlytext:
Plain codes
A few FHIR fields are not CodeableConcepts but plain strings from a fixed list. Examples areObservation.status ("final"), AllergyIntolerance.criticality ("high"), and Patient.gender ("female"). You read those directly.
Choice fields
FHIR writes some fields asonset[x], value[x], or performed[x]. The R4 specification calls these choice elements. The [x] means the field can hold different data types, and the type becomes part of the field name. A resource only ever has one variant.
FHIR Extraction uses a date field only when the note states the date as a year or an ISO 8601 date, and falls back to a text field otherwise:
Observations use the same pattern for their result:
When you read a choice field, check each variant you support, for example
onsetDateTime first and onsetString second.
References
Resources point to each other with references (R4 definition). Every clinical resource points to the Patient of the note, withsubject or, on AllergyIntolerance and FamilyMemberHistory, patient. Every Condition, Procedure, and Observation also points to the Encounter of the note:
reference names the fullUrl of the Encounter’s entry in the same Bundle, and identifier repeats the Encounter’s business ID, so you can link the resources when you import them. AllergyIntolerance and FamilyMemberHistory carry no encounter reference, because allergies and family history outlast a single visit. R4 defines an optional encounter on AllergyIntolerance, but the endpoint does not fill it.
Some references carry only a display name, for example the clinician who asserted a diagnosis:
Bundles
A Bundle is a FHIR resource that holds other resources (FHIR R4 Bundle). The endpoint returns a Bundle of typetransaction. Each item in entry wraps one resource, and its fullUrl matches the resource’s id, so references between the resources resolve inside the Bundle. Each request tells a FHIR server to create the resource, so you can POST the Bundle as it is to your server:
Put it together
Here is a short note and the Condition the endpoint produces from it, first simplified and then as the real JSON.- Simplified
- JSON
extension entries that point back to the words in the note. Every value points back to the note explains them.
Next steps
How FHIR Extraction works
Learn why codes are positive, and how to read status fields.
FHIR datatypes
Look up every datatype, with its fields and an example.