Skip to main content

Laboratory Service — Domain Model

Status: populated Owner: TBD Last updated: 2026-04-18 Companion: Service Template · 03 platform-services · 02 DDD


1. Aggregates

1.1 Accession

The root aggregate for a single laboratory work order. Groups specimens and results under one accession number.

InvariantRule
Unique accession numberGenerated at creation; {tenantShortCode}-{YYYYMMDD}-{seq6} format
Cannot release without verificationAt least one result must be in verified status before release
Cancellation preserves historyStatus → canceled; sub-entities retain full audit chain
Critical ack requiredAny result with criticalFlag=true must have a recorded acknowledgment before chart release

State machine:


1.2 LabResult

A single analyte result within an Accession. Owned by the Accession aggregate.

InvariantRule
Immutable once releasedAny change creates a new version; prior version status = superseded
Critical flag enforcementValue crossing threshold sets criticalFlag=true; requires ack before release
Unit/code requiredtestCode + unit mandatory for numeric results
Correction chainEach correction references priorResultId and supplies correctionReason

State machine:


1.3 ResultAcknowledgment

Clinician acknowledgment of a released result. Lives in the results sub-domain.

InvariantRule
One ack per clinician per result versionIdempotent on duplicate submission
Ack typesreviewed, forwarded, plan-documented, patient-notified
Escalation triggerCritical unacked results escalate after configurable timeout per site policy

2. Entities

EntityKey attributesAggregate
Specimenid, accessionId, type, status, collectedAt, receivedAt, collectorId, conditionAccession
TestCatalogItemid, name, loincCode?, specimenType, panel?, components[], referenceRanges[], tenantId?Catalog (independent)
CriticalValuePolicyid, testCode, lowCritical?, highCritical?, facilityId?, tenantIdConfig (independent)

3. Value Objects

Value ObjectFieldsRules
AccessionNumbervalue: stringUnique per tenant per day
ResultValuequantity?: number, unit?: string, text?: string, boolean?: booleanOne of quantity/text/boolean required
ReferenceRangelow?, high?, unit?, ageRange?, sex?, text?At least one bound or text
AbnormalFlagenum N | L | H | LL | HH | A | AAMaps to FHIR ObservationInterpretation
SpecimenConditionenum satisfactory | unsatisfactory | hemolyzed | lipemic | clottedDrives processing path
LabPriorityenum routine | urgent | statDrives worklist sort order

4. Domain Events

Event nameTriggerKey payload fields
LabAccessionCreatedAccession openedaccessionId, patientId, orderId?, priority, tenantId
LabSpecimenCollectedCollection recordedaccessionId, specimenId, collectedAt, collectorId, tenantId
LabSpecimenReceivedLab receipt confirmedaccessionId, specimenId, receivedAt, tenantId
LabResultEnteredValue enteredaccessionId, resultId, testCode, tenantId
LabResultVerifiedTech verifiedaccessionId, resultId, verifiedBy, tenantId
LabResultReleasedReleased to chartaccessionId, resultId, patientId, fhirObservationId, tenantId
LabCriticalValueTriggeredCritical threshold crossedaccessionId, resultId, patientId, testCode, value, tenantId
LabResultAcknowledgedClinician ackresultId, ackType, ackBy, tenantId
LabResultCorrectedCorrection appliedresultId, priorResultId, correctionReason, tenantId
LabAccessionCanceledAccession canceledaccessionId, reason, tenantId

5. Ubiquitous Language

TermDefinition
AccessionA laboratory work order grouping specimens and tests for one patient visit
Accession numberUnique ID printed on specimen labels; traceable from collection through release
BenchPhysical or logical grouping of analyzers/technologists (Chemistry, Hematology, etc.)
Critical valueA result outside a threshold indicating immediate patient risk; requires urgent notification
PanelA set of related tests ordered and reported together
Reference rangeExpected value interval for an analyte, potentially age/sex/location adjusted
TATTurnaround time — interval from accession creation to result release
VerificationTechnologist review and sign-off making a result eligible for release
ReleaseMaking verified results available to the clinical chart
CorrectionRevision to a verified/released result creating a new version
WorklistPrioritized queue of pending tests for a bench or technologist
LOINCLogical Observation Identifiers Names and Codes — standard lab test coding
UCUMUnified Code for Units of Measure