Skip to main content
clinik.labs manages FHIR R4 DiagnosticReport resources — the records that aggregate laboratory, radiology, and pathology results into a structured report. A lab report references one or more Observation resources that hold the individual result values. Use the include option on read to fetch those observations in a single request.

create

const { data, meta } = await clinik.labs.create(
  request: LabCreateRequest
): Promise<ApiResponse<DiagnosticReport>>
status
string
required
Report status: registered, partial, preliminary, final, amended, corrected, appended, or cancelled.
code
string | object
required
LOINC report type. Pass a string for free text, or an object with system, code, and display.
patientId
string
required
The ID of the patient this report belongs to.
encounterId
string
Encounter associated with this lab report.
effectiveDateTime
string
Clinically relevant time for the report (ISO 8601).
resultIds
string[]
IDs of Observation resources included in this report.
category
string
Report category: LAB, RAD, or PAT.
conclusion
string
Free-text clinical conclusion.
conclusionCodes
object[]
Coded SNOMED CT findings, each with system, code, and display.
performer
string
Name or ID of who performed the diagnostic service.
resultsInterpreter
string
Name or ID of who interpreted the results.
specimenIds
string[]
IDs of specimen resources used in this report.
presentedForm
object[]
Attached document representations, each with contentType, optional data (base64), url, and title.
const { data: report } = await clinik.labs.create({
  status: 'final',
  code: {
    system: 'http://loinc.org',
    code: '24323-8',
    display: 'Comprehensive metabolic panel',
  },
  patientId: 'pt_abc123',
  encounterId: 'enc_xyz789',
  effectiveDateTime: '2025-01-15T08:00:00Z',
  category: 'LAB',
  resultIds: ['obs_001', 'obs_002', 'obs_003'],
  conclusion: 'All values within normal range.',
  performer: 'Austin Lab Services',
});

read

const { data, meta } = await clinik.labs.read(
  id: string,
  options?: ReadOptions
): Promise<ApiResponse<DiagnosticReport>>
Pass include: ['Observation'] to fetch the referenced result observations alongside the report.
const { data } = await clinik.labs.read('lab_abc123', {
  include: ['Observation'],
});

update

const { data, meta } = await clinik.labs.update(
  id: string,
  request: LabUpdateRequest
): Promise<ApiResponse<DiagnosticReport>>
await clinik.labs.update('lab_abc123', {
  status: 'amended',
  conclusion: 'Glucose slightly elevated. Follow up recommended.',
});

delete

const { data, meta } = await clinik.labs.delete(
  id: string
): Promise<ApiResponse<void>>
await clinik.labs.delete('lab_abc123');
const { data, meta } = await clinik.labs.search(
  params?: ResourceSearchParams
): Promise<ApiResponse<PaginatedResponse<DiagnosticReport>>>
patientId
string
Filter by patient ID.
status
string
Filter by report status.
category
string
Filter by category: LAB, RAD, or PAT.
dateFrom
string
Return reports on or after this date (ISO 8601).
dateTo
string
Return reports on or before this date (ISO 8601).
count
number
default:"20"
Results per page. Maximum: 100.
cursor
string
Pagination cursor from a previous response.
const { data } = await clinik.labs.search({
  patientId: 'pt_abc123',
  status: 'final',
  category: 'LAB',
});