Skip to main content

Order Labs and Imaging

This guide covers how to order laboratory tests and imaging studies using Medplum, from building order forms through tracking results. For the FHIR data model overview, see Labs & Imaging. For medication ordering, see the Medications section.

End-to-End Ordering Flow

A typical diagnostic ordering workflow moves through five stages, each represented by FHIR resources and status transitions.

  1. A clinician identifies the need for a diagnostic test or imaging study during a patient encounter.
  2. The order is captured through a Computerized Physician Order Entry (CPOE) form, creating a ServiceRequest resource.
  3. The order is transmitted to the performing laboratory or imaging facility, either via an integration (e.g. Health Gorilla) or an internal process.
  4. The ServiceRequest.status is updated as the order progresses through its lifecycle.
  5. Results arrive as DiagnosticReport and Observation resources linked back to the original order. See Results and Review for details.

Order Form (CPOE)

Certified EHRs are required to support CPOE for Medications, Labs, and Imaging. These correspond to the ONC (a)(1), (a)(2), and (a)(3) criteria described on HealthIT.gov.

Building a custom CPOE form that represents an organization's Diagnostic Catalog and enabling the appropriate provider integrations are the first steps. The form needs to capture:

  • Which tests to order (e.g. HbA1c) and which performing lab (e.g. ACME Clinical Lab)
  • Ask on Entry (AOE) questions specific to the test (e.g. whether the patient is fasted for a Renal Panel)
  • Specimen details including collection time and specimen type
  • Billing and insurance information indicating which account or payor should cover the test

This questionnaire demonstrates a sample CPOE order form and can be added to your Medplum app or provider-facing application.

ServiceRequest Lifecycle

The ServiceRequest resource tracks the full lifecycle of a diagnostic order. FHIR R4 defines the following status values:

StatusMeaning
draftOrder is being composed but not yet finalized
activeOrder has been placed and is awaiting fulfillment
on-holdOrder is temporarily paused or suspended
completedResults have been received and the order is fulfilled
revokedOrder was cancelled before completion
entered-in-errorOrder was created by mistake and should be disregarded

Creating an Order

When a clinician finalizes an order, create a ServiceRequest linked to the patient and, when applicable, the encounter:

{
"resourceType": "ServiceRequest",
"status": "active",
"intent": "order",
"category": [{
"coding": [{
"system": "http://snomed.info/sct",
"code": "108252007",
"display": "Laboratory procedure"
}]
}],
"code": {
"coding": [{
"system": "http://loinc.org",
"code": "24323-8",
"display": "Comprehensive metabolic 2000 panel - Serum or Plasma"
}]
},
"subject": { "reference": "Patient/example" },
"encounter": { "reference": "Encounter/visit-123" },
"requester": { "reference": "Practitioner/dr-smith" },
"performer": [{ "reference": "Organization/acme-lab" }],
"priority": "routine"
}

The intent field is always order for clinician-placed orders. Use priority to distinguish routine orders from urgent/stat requests (routine, urgent, asap, stat).

Cancelling and Amending Orders

To cancel an order that has not yet been fulfilled, update the ServiceRequest.status to revoked. If the order was created by mistake, use entered-in-error instead.

To amend an order (e.g. adding tests or changing the performing lab), update the existing ServiceRequest rather than creating a duplicate. If the integration partner requires a new transmission, coordinate cancellation of the original and creation of a replacement, linking them via ServiceRequest.replaces.

Linking Orders to Encounters

When an order is placed during a visit, set ServiceRequest.encounter to reference the active Encounter. This allows the encounter chart to display all orders associated with the visit via a search like ServiceRequest?encounter=Encounter/{id}.

Laboratory vs. Imaging Orders

While both laboratory and imaging orders use ServiceRequest, there are differences in the ordering workflow:

AspectLaboratoryImaging
SpecimenPhysical sample is collected (blood, urine, etc.) with collection time and handling requirementsNo specimen; patient is scheduled for a study
AOE questionsCommon (e.g. fasting status, last menstrual period)Less common; clinical indication and contrast preferences are typical
SchedulingSpecimen collection may happen at point of care or at a draw stationStudy is typically scheduled as a separate appointment at a facility
ResultsStructured Observation values with reference rangesDiagnosticReport often includes an attached imaging report (PDF or narrative) with fewer structured observations
Category codinglaboratory (SNOMED 108252007)imaging (SNOMED 363679005)

For imaging orders, use ServiceRequest.locationReference or ServiceRequest.locationCode to indicate the facility where the study should be performed.

Logistics

CPOE should account for the logistics workflow a provider organization wants to enable:

ScenarioImplications
Specimen collected on siteCPOE must collect specimen time and details; support printing requisitions to attach to specimens
Specimen collected elsewhereNo specimen collection details on the form; patients informed of draw station location
At-home labPatient data must include an accurate mailing address

Integrations

Medplum is provider-agnostic and supports connecting to lab and imaging orders of all types when an integration is in place. Common integrations can be found in the Integrations section.

For lab ordering specifically, the Health Gorilla integration provides end-to-end support including sending orders and receiving results, with React components and bot-based automation. Quest, Labcorp, and regional labs are commonly connected through Health Gorilla.

Organizations that connect directly to a performing lab (e.g. via HL7v2 or a proprietary API) follow the same FHIR resource patterns described here. The HL7 Interface and On-Prem Agent docs cover connectivity options.

caution

Lab and imaging ordering requires setup. Contact us at info@medplum.com to enable a provider.

ONC Certification

CPOE for labs and imaging corresponds to ONC criteria (a)(2) and (a)(3). Certification is in progress; follow the GitHub issue for updates.

See Also