Skip to main content
The Encounter resource represents an interaction between a patient and healthcare provider(s). All encounters must reference a valid Patient.

Endpoints

Create Encounter

Requires admin or practitioner role.
POST /api/fhir/Encounter
Authorization: Bearer {token}
Content-Type: application/json
resourceType
string
required
Must be "Encounter"
status
string
required
planned, arrived, triaged, in-progress, onleave, finished, cancelled, entered-in-error, unknown
class
object
required
Classification of patient encounter (ambulatory, emergency, inpatient)
type
array
Specific type of encounter
subject
object
required
Reference to Patient: {"reference": "Patient/{id}"}
period
object
The start and end time of the encounter
reasonCode
array
Coded reason for the encounter
participant
array
List of participants in the encounter

Example Request

cURL
curl -X POST https://api.example.com/api/fhir/Encounter \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "resourceType": "Encounter",
    "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/65f1234567890abcdef12345"
    },
    "period": {
      "start": "2024-03-15T09:00:00Z",
      "end": "2024-03-15T09:30:00Z"
    },
    "reasonCode": [{
      "coding": [{
        "system": "http://snomed.info/sct",
        "code": "390906007",
        "display": "Follow-up encounter"
      }]
    }]
  }'

Response

{
  "resourceType": "Encounter",
  "id": "65f6789012345abcdef67890",
  "status": "finished",
  "class": {
    "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode",
    "code": "AMB",
    "display": "ambulatory"
  },
  "subject": {
    "reference": "Patient/65f1234567890abcdef12345"
  },
  "period": {
    "start": "2024-03-15T09:00:00Z",
    "end": "2024-03-15T09:30:00Z"
  }
}

List Encounters

GET /api/fhir/Encounter
Authorization: Bearer {token}
subject
string
Filter by patient: Patient/{id}
status
string
Filter by status
date
string
Filter by encounter date

Get Encounter by ID

GET /api/fhir/Encounter/:id
Authorization: Bearer {token}

Update Encounter

PUT /api/fhir/Encounter/:id
Authorization: Bearer {token}
Content-Type: application/json

Encounter Classes

CodeDisplayDescription
AMBambulatoryOutpatient visit
EMERemergencyEmergency department visit
IMPinpatientInpatient admission
VRvirtualTelemedicine encounter

Encounter Status Lifecycle

1

Planned

Encounter is scheduled but not yet started
2

Arrived

Patient has arrived for the encounter
3

In Progress

Encounter is currently happening
4

Finished

Encounter has been completed

Role Permissions

RoleCreateReadUpdate
Admin
Practitioner
Auditor

Build docs developers (and LLMs) love