FHIR R4 Encounter resource example
Encounter is a visit: when it happened, what kind it was and who took part. Observations, Conditions and Procedures recorded during the visit can point to it through encounter.
The Encounter in JSON
{
"resourceType": "Encounter",
"id": "checkup",
"status": "finished",
"class": {
"system": "http://terminology.hl7.org/CodeSystem/v3-ActCode",
"code": "AMB",
"display": "ambulatory"
},
"type": [
{
"coding": [
{
"system": "http://snomed.info/sct",
"code": "185349003",
"display": "Encounter for check up"
}
]
}
],
"subject": {
"reference": "Patient/example",
"display": "Jane Doe"
},
"participant": [
{
"individual": {
"reference": "Practitioner/dr-smith",
"display": "Dr. Alex Smith"
}
}
],
"period": {
"start": "2026-10-01T08:15:00-05:00",
"end": "2026-10-01T08:45:00-05:00"
},
"reasonCode": [
{
"text": "Annual check-up"
}
],
"serviceProvider": {
"reference": "Organization/clinic",
"display": "Springfield Family Clinic"
}
}
Validator result: raw JSON · open the validator
- informationNo errors: this Encounter matches the FHIR R4 structure checked here.
The elements that matter
| Element | Cardinality | Notes |
|---|---|---|
status | 1..1 | planned, in-progress, finished and others. |
class | 1..1 | One Coding in R4 (AMB, IMP, EMER, VR for virtual…). In R5 it became an array. |
type | 0..* | The specific kind of visit. |
period | 0..1 | Start and end. |
participant | 0..* | Practitioners and others who took part. |
The full definition is in the FHIR R4 Encounter specification.
Common mistakes and the errors they cause
Class as an array (r5 style)
R5 changed class to 0..*; in R4 it is a single Coding.
- error
Encounter.classExpected a single Coding object, not an array (in FHIR R4 this element has cardinality 0..1 or 1..1).
Status from r5
R5 renamed finished to completed; R4 rejects it.
- error
Encounter.statusEncounter.status 'completed' is not in the required value set (arrived, cancelled, entered-in-error, finished, in-progress, onleave, planned, triaged, unknown).
Missing class
Encounter.class is 1..1 in R4.
- error
Encounter.classRequired element is missing.
Store it in a real FHIR R4 serverA free sandbox key gives you 30 synthetic patients and the full API, including
Get a free API keyPOST /fhir/R4/Encounter and $validate.More examples
- Patient resource example
- Observation example: blood pressure
- Observation example: laboratory result
- DiagnosticReport example: lab panel
- Condition resource example
- MedicationStatement example
- AllergyIntolerance example
- Immunization resource example
Related guides
- How to integrate clinic systems with a FHIR backendTutorial: connect a clinic EMR to patients' FHIR R4 records — directory of doctors, matching by record number, a visit as one transaction with the doctor as author, lab reports, other providers' data and webhooks.
- FHIR platformHL7 FHIR R4 explained and how Anpheros implements it as a managed FHIR database: 26 resource types, search, history, transactions, $everything, the International Patient Summary and the simpler REST view of the same data.