Skip to main content

LabResultsWidget

Orders lab reports (FHIR DiagnosticReport) with LOINC coding, category classification, and effective date/period support.

Usage

import { LabResultsWidget } from '@clinikapi/react';

<LabResultsWidget
  proxyUrl="/api/clinik"
  patientId="pt_abc123"
  theme="light"
/>

Props

PropTypeRequiredDescription
proxyUrlstringYesBackend proxy URL
patientIdstringYesPatient ID
theme'light' | 'dark'NoColor theme

Features

  • Lab order creation with LOINC codes
  • Category classification (LAB, RAD, PAT)
  • Status tracking (registered → preliminary → final)
  • Support for effectiveDateTime and effectivePeriod
  • basedOn references to ServiceRequest orders
  • Media/image attachments
  • Conclusion text and coded findings
  • Linked observation results (resultIds)
  • Specimen references
  • Attached documents (presentedForm)

Proxy Action

The widget sends labs.create with:
{
  "action": "labs.create",
  "data": {
    "patientId": "pt_abc123",
    "status": "preliminary",
    "code": {
      "system": "http://loinc.org",
      "code": "24331-1",
      "display": "Lipid Panel"
    },
    "category": "LAB",
    "effectiveDateTime": "2025-01-15T10:30:00Z"
  }
}

Categories

CodeDescription
LABLaboratory
RADRadiology
PATPathology

Reading Lab Results

For displaying lab results, your proxy should return enriched data:
// Proxy endpoint for reading labs
const { data } = await clinik.labs.read(labId, {
  include: ['Observation'],
});
// Returns: report with linked observations, conclusion, effectivePeriod, etc.