Encounter — the visit
Tie observations, conditions, and procedures together under a single care episode.
One visit, one envelope
A patient walks into an outpatient clinic on a Tuesday morning. A nurse records their temperature and blood pressure. The doctor notes a diagnosis of mild hypertension and orders a lipid panel. An hour later the patient walks out.
That whole episode — the who, where, when, in what status, and everything that came out of it — is one Encounter. The observations, the condition, the procedure orders: each is its own FHIR resource, and each points back at the same Encounter. That's the moment FHIR's graph-shape clicks. The Encounter is the thread; the clinical facts are the beads.
Anatomy of an Encounter
Only two fields are required, and both are small:
status— where this visit sits in its lifecycle. The state machine isplanned → arrived → in-progress → finished, withcancelledas the escape hatch at any point (plus a few less-common states liketriaged,onleave, andentered-in-error).class— the kind of visit. Coded againsthttp://terminology.hl7.org/CodeSystem/v3-ActCode:AMB(ambulatory / outpatient),IMP(inpatient),EMER(emergency),HH(home health),VR(virtual).
Everything else is optional but almost always present in real data:
subject— who the visit is for. A reference to aPatient.period—startandendtimestamps for the visit.participant— the clinicians involved, each a reference to aPractitioner.reasonCode— the chief complaint or reason for the visit, as a coded concept.serviceProvider— theOrganizationresponsible for the visit (the hospital, the clinic).
1 · Create an Encounter
Below is an outpatient visit that has already concluded — status: "finished", class: AMB. The subject.reference is a literal Patient id you can swap for one you created in the last lesson. Press Run.
meta.tag: loading is added automatically so you can find this resource later.The server responds with a server-assignedidand ameta.versionId. Note it down — the next two runners will auto-fill it.
2 · Read it back
Same URL shape as every other FHIR resource: /Encounter/{id}. The id auto-fills from the Encounter you just created.
{ID}). Create a Encounter first above, or paste an id here.3 · Linking an Observation to this Encounter
Here's where the graph takes shape. An Observation — say, the blood-pressure reading taken during this visit — carries two references: one to the patient, and one to the encounter it happened in. We're not going to POST this one (that's the next lesson), but study the shape:
{
"resourceType": "Observation",
"status": "final",
"code": {
"coding": [
{ "system": "http://loinc.org", "code": "8480-6", "display": "Systolic blood pressure" }
]
},
"subject": { "reference": "Patient/example" },
"encounter": { "reference": "Encounter/{id}" },
"valueQuantity": { "value": 142, "unit": "mmHg", "system": "http://unitsofmeasure.org", "code": "mm[Hg]" }
}That one field — encounter.reference — is the whole mechanism. Any resource that happened during a visit (Observations, Conditions, Procedures, DiagnosticReports, MedicationAdministrations) can point at the Encounter the same way. Different resources, one anchor.
4 · Find everything that happened during one Encounter
This is the payoff. Because every clinical resource points back at the Encounter by reference, you can ask the server: "give me every Observation whose encounter is this one." One search, one Bundle, every reading from that visit.
{ID}). Create a Encounter first above, or paste an id here.You'll get back a Bundle of type searchset — empty for now, because we haven't linked any Observations yet. After the next lesson, come back and run this again. Every vital sign you posted against this Encounter will show up here.
5 · Find all your Encounters
Same tag trick as last lesson. Every resource you create through this course is stamped with your anonymous learner ID, so one search pulls back just the Encounters you have created.
{UID}). Waiting for your anonymous ID…What just happened
- You created an
Encounter— a FHIR resource whose entire job is to be an envelope for a clinical visit. - You saw the two required fields (
status,class) and the state machine they move through:planned → arrived → in-progress → finished. - You saw how an
Observationties itself to a visit with a singleencounter.reference— the same pattern every clinical resource uses. - You searched by
?encounter=Encounter/{id}and saw how one query can reconstruct everything that happened during a single visit.
Up next: Observation, up close. Vital signs, labs, measurements — one resource for all of them. We'll POST a few against the Encounter you just created, then come back here and watch Section 4 light up with real data. After that, the References chapter unpacks exactly what "Encounter/{id}" means to a FHIR server, and why that one string is doing so much work.