Explore documentation

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

REST
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" }]
        }
      }
    ]
  }'
SDK
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

FieldDescription
subjectIdThe patient (UUID)
encounterIdThe visit where it happened (UUID)
locationIdWhere it was performed (UUID of a Location)
performedDateTime / performedStringWhen it was performed (date or free text)
performer[]Who performed it: actor (reference, required) and optional function
categoryKind of procedure (CodeableConcept)
reasonCode[]Why it was performed
bodySite[]Body site
outcomeResult (success, failure, etc.)
statusReasonReason for the status, e.g. why it is not-done
note[]Free-text notes

Procedure Statuses

StatusMeaning
preparationBeing prepared
in-progressCurrently being performed
not-doneProcedure was not performed
on-holdTemporarily suspended
stoppedStopped before completion
completedCompleted
entered-in-errorRecorded in error
unknownCannot be determined

Searching Procedures

ParameterBehavior
_idExact id
patient / subjectPatient id (<uuid> or Patient/<uuid>)
encounterEncounter id
statusExact
codeExact system|code, or partial text
categoryPartial text
dateDate of performedDateTime, with optional prefix eq, gt, lt, ge, or le; repeat it for a range (date=ge2026-01-01&date=lt2026-02-01)
performerPractitioner id (<uuid> or Practitioner/<uuid>)
locationLocation 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.