Skip to main content
The clinik.observations namespace manages FHIR Observation resources — the building blocks for recording clinical measurements, vital signs, laboratory values, social history, and exam findings. Observations are always linked to a patient and optionally to an encounter and a performer. For multi-component readings like blood pressure, use the component array.

create

Create a new Observation. The status, code, and patientId fields are required.
const { data, meta } = await clinik.observations.create(request: ObservationCreateRequest): Promise<ApiResponse<Observation>>
status
string
required
Observation status. Accepted values: registered, preliminary, final, amended, corrected, cancelled.
code
string | { system?: string; code: string; display?: string }
required
The observation type. Pass a LOINC code object or a plain text string for unmapped codes.
patientId
string
required
ID of the patient this observation belongs to.
encounterId
string
Encounter during which the observation was made.
performerId
string
ID of the practitioner who performed or recorded the observation.
effectiveDateTime
string
ISO 8601 datetime for when the observation is clinically relevant.
valueQuantity
{ value: number; unit?: string; system?: string; code?: string }
A numeric measurement value with optional unit and coding.
valueString
string
A free-text observation value.
valueCodeableConcept
{ system?: string; code: string; display?: string }
A coded observation value, for example a SNOMED CT concept.
component
Array
Array of sub-observations for multi-component readings (e.g. systolic and diastolic blood pressure). Each component follows the same structure as the top-level observation.
category
string
Observation category. Common values: vital-signs, laboratory, social-history, exam.
interpretation
string
Clinical interpretation code. Common values: H (high), L (low), N (normal), A (abnormal), HH (critically high), LL (critically low).
referenceRange
{ low?: number; high?: number; text?: string }
Normal reference range for the observation.
bodySite
string
Body site where the observation was recorded.
method
string
Method used to collect the observation.
note
string
Free-text notes about the observation.

Examples

const { data } = await clinik.observations.create({
  status: 'final',
  category: 'vital-signs',
  code: {
    system: 'http://loinc.org',
    code: '8867-4',
    display: 'Heart rate',
  },
  patientId: 'pt_abc123',
  encounterId: 'enc_xyz789',
  effectiveDateTime: '2025-06-01T09:15:00Z',
  valueQuantity: {
    value: 72,
    unit: 'beats/min',
    system: 'http://unitsofmeasure.org',
    code: '/min',
  },
  interpretation: 'N',
});

read

Fetch a single observation by ID.
const { data, meta } = await clinik.observations.read(id: string, options?: ReadOptions): Promise<ApiResponse<Observation>>

update

Partially update an observation. Only the fields you include are changed.
const { data, meta } = await clinik.observations.update(id: string, request: ObservationUpdateRequest): Promise<ApiResponse<Observation>>

delete

Permanently delete an observation.
const { data, meta } = await clinik.observations.delete(id: string): Promise<ApiResponse<void>>
Search observations with optional filters and cursor pagination. The sort parameter accepts any field name prefixed with - for descending order.
const { data, meta } = await clinik.observations.search(params?: ResourceSearchParams): Promise<ApiResponse<PaginatedResponse<Observation>>>
patientId
string
Filter by patient.
category
string
Filter by category (e.g. vital-signs, laboratory).
status
string
Filter by status.
dateFrom
string
Return observations on or after this date.
dateTo
string
Return observations on or before this date.
sort
string
Sort field. Prefix with - for descending order.
count
number
Results per page.
cursor
string
Pagination cursor from a previous response.