Clinical resources
Procedure
Learn about the Procedure resource for surgical and medical procedures.
Set up the SDK server client to run the examples using esus. The REST examples use a session token. To run them with the SDK’s API key, send X-API-Key instead of Authorization.
The Procedure resource documents a healthcare intervention performed on a patient: surgeries, therapies, diagnostic procedures, and other medical services.
API convention: the patient, encounter, and location references are sent as flat string fields (
subjectId,encounterId,locationId). Performer references use the standard FHIR shape. All ids are raw UUIDs (v4).
Creating a Procedure
curl -X POST https://api.esus.health/fhir/Procedure \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/fhir+json" \
-d '{
"status": "completed",
"subjectId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"encounterId": "c1a2e3d4-5b6f-7890-abcd-ef1234567890",
"code": {
"coding": [{
"system": "http://snomed.info/sct",
"code": "80146002",
"display": "Appendectomy"
}]
},
"performedDateTime": "2026-04-21T11:30:00Z",
"performer": [
{
"actor": {
"reference": "Practitioner/a7b1c2d3-e4f5-6789-abcd-ef0123456789",
"display": "Dr. John Martinez"
},
"function": {
"coding": [{ "system": "http://snomed.info/sct", "code": "304292004", "display": "Surgeon" }]
}
}
]
}'
const created = await esus.fhir.create("Procedure", {
"status": "completed",
"subjectId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"encounterId": "c1a2e3d4-5b6f-7890-abcd-ef1234567890",
"code": {
"coding": [
{
"system": "http://snomed.info/sct",
"code": "80146002",
"display": "Appendectomy"
}
]
},
"performedDateTime": "2026-04-21T11:30:00Z",
"performer": [
{
"actor": {
"reference": "Practitioner/a7b1c2d3-e4f5-6789-abcd-ef0123456789",
"display": "Dr. John Martinez"
},
"function": {
"coding": [
{
"system": "http://snomed.info/sct",
"code": "304292004",
"display": "Surgeon"
}
]
}
}
]
});
Required: subjectId and code. If you omit status, it is stored as completed. The patient, encounter, and location must exist in your organization; otherwise the API answers 400.
Common Fields
| Field | Description |
|---|---|
subjectId | The patient (UUID) |
encounterId | The visit where it happened (UUID) |
locationId | Where it was performed (UUID of a Location) |
performedDateTime / performedString | When it was performed (date or free text) |
performer[] | Who performed it: actor (reference, required) and optional function |
category | Kind of procedure (CodeableConcept) |
reasonCode[] | Why it was performed |
bodySite[] | Body site |
outcome | Result (success, failure, etc.) |
statusReason | Reason for the status, e.g. why it is not-done |
note[] | Free-text notes |
Procedure Statuses
| Status | Meaning |
|---|---|
preparation | Being prepared |
in-progress | Currently being performed |
not-done | Procedure was not performed |
on-hold | Temporarily suspended |
stopped | Stopped before completion |
completed | Completed |
entered-in-error | Recorded in error |
unknown | Cannot be determined |
Searching Procedures
| Parameter | Behavior |
|---|---|
_id | Exact id |
patient / subject | Patient id (<uuid> or Patient/<uuid>) |
encounter | Encounter id |
status | Exact |
code | Exact system|code, or partial text |
category | Partial text |
date | Date of performedDateTime, with optional prefix eq, gt, lt, ge, or le; repeat it for a range (date=ge2026-01-01&date=lt2026-02-01) |
performer | Practitioner id (<uuid> or Practitioner/<uuid>) |
location | Location id |
Page with _count and _offset, and sort with _sort by _lastUpdated, date, or status.
Read, update (PUT/PATCH), delete, and _history work the same as for Patient: see CRUD Operations.