AnpherosAnpheros PlatformDevelopers

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

The elements that matter

ElementCardinalityNotes
status1..1planned, in-progress, finished and others.
class1..1One Coding in R4 (AMB, IMP, EMER, VR for virtual…). In R5 it became an array.
type0..*The specific kind of visit.
period0..1Start and end.
participant0..*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.

Status from r5

R5 renamed finished to completed; R4 rejects it.

Missing class

Encounter.class is 1..1 in R4.

Store it in a real FHIR R4 serverA free sandbox key gives you 30 synthetic patients and the full API, including POST /fhir/R4/Encounter and $validate.
Get a free API key

More examples

Related guides