Explore documentation

Diagnostic Reports

Managing lab results and diagnostic reports

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.

DiagnosticReport

DiagnosticReport is used for reports such as lab results, imaging studies, and pathology reports. It holds the conclusion and references the supporting observations.

API convention: patient and encounter are flat ids (subjectId, encounterId) and come back as subject / encounter references. Performer, result and the other references use the standard FHIR reference shape. All ids are UUIDs.

Create a DiagnosticReport

code and subjectId are required. status defaults to final.

REST
curl -X POST https://api.esus.health/fhir/DiagnosticReport \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/fhir+json" \
  -d '{
    "status": "final",
    "subjectId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "encounterId": "c1a2e3d4-5b6f-7890-abcd-ef1234567890",
    "category": [{
      "coding": [{
        "system": "http://terminology.hl7.org/CodeSystem/v2-0074",
        "code": "LAB",
        "display": "Laboratory"
      }]
    }],
    "code": {
      "coding": [{
        "system": "http://loinc.org",
        "code": "58410-2",
        "display": "Complete blood count panel"
      }]
    },
    "effectiveDateTime": "2026-04-21T09:30:00Z",
    "performer": [{
      "reference": "Organization/9a8b7c6d-5e4f-3210-9876-543210fedcba",
      "display": "Central Lab Services"
    }],
    "result": [
      { "reference": "Observation/aa11bb22-cc33-dd44-ee55-ff6677889900" },
      { "reference": "Observation/bb22cc33-dd44-ee55-ff66-778899001122" }
    ],
    "conclusion": "All values within normal limits",
    "conclusionCode": [{
      "coding": [{
        "system": "http://snomed.info/sct",
        "code": "17621005",
        "display": "Normal findings"
      }]
    }]
  }'
SDK
const created = await esus.fhir.create("DiagnosticReport", {
  "status": "final",
  "subjectId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "encounterId": "c1a2e3d4-5b6f-7890-abcd-ef1234567890",
  "category": [
    {
      "coding": [
        {
          "system": "http://terminology.hl7.org/CodeSystem/v2-0074",
          "code": "LAB",
          "display": "Laboratory"
        }
      ]
    }
  ],
  "code": {
    "coding": [
      {
        "system": "http://loinc.org",
        "code": "58410-2",
        "display": "Complete blood count panel"
      }
    ]
  },
  "effectiveDateTime": "2026-04-21T09:30:00Z",
  "performer": [
    {
      "reference": "Organization/9a8b7c6d-5e4f-3210-9876-543210fedcba",
      "display": "Central Lab Services"
    }
  ],
  "result": [
    {
      "reference": "Observation/aa11bb22-cc33-dd44-ee55-ff6677889900"
    },
    {
      "reference": "Observation/bb22cc33-dd44-ee55-ff66-778899001122"
    }
  ],
  "conclusion": "All values within normal limits",
  "conclusionCode": [
    {
      "coding": [
        {
          "system": "http://snomed.info/sct",
          "code": "17621005",
          "display": "Normal findings"
        }
      ]
    }
  ]
});

Other accepted fields: identifier, basedOn, resultsInterpreter, specimen, imagingStudy, media ([{ "comment", "link" }]) and note. conclusion and note are encrypted at rest.

DiagnosticReport Status

StatusMeaning
registeredReport registered, results pending
partialSome results available
preliminaryEarly results, may change
finalComplete final results (default)
amendedModified after final
correctedCorrected after final
appendedAdditional info added after final
cancelledReport cancelled
entered-in-errorErroneous
unknownStatus cannot be determined

Report Categories (typical v2-0074 codes)

CategoryDescription
LABLaboratory
RADRadiology / imaging
PATPathology
CUSCardiac ultrasound
NRSNursing service measures

Attaching a Rendered PDF

presentedForm is not accepted on create or update. To keep the rendered report, upload the PDF with POST /files/upload and create a DocumentReference for the same patient whose content[].attachment.url points at /files/{id}.

Search Reports

ParameterMatching
patientExact patient id
statusExact
codeSubstring of the stored code JSON — pass a code, e.g. code=58410-2
categorySubstring of the stored category JSON, e.g. category=LAB
encounterExact encounter id
dateOn effectiveDateTime. Without a prefix, the same calendar day; supports gt, ge, lt, le, ne (e.g. date=ge2026-04-01). Repeat it for a range (date=ge2026-04-01&date=lt2026-05-01)
resultSubstring of the stored result JSON, e.g. an Observation id
# All reports for a patient
curl "https://api.esus.health/fhir/DiagnosticReport?patient=3fa85f64-5717-4562-b3fc-2c963f66afa6" \
  -H "Authorization: Bearer YOUR_TOKEN"

# Lab reports only
curl "https://api.esus.health/fhir/DiagnosticReport?patient=3fa85f64-5717-4562-b3fc-2c963f66afa6&category=LAB" \
  -H "Authorization: Bearer YOUR_TOKEN"

# Reports effective on a given day
curl "https://api.esus.health/fhir/DiagnosticReport?patient=3fa85f64-5717-4562-b3fc-2c963f66afa6&date=2026-04-21" \
  -H "Authorization: Bearer YOUR_TOKEN"