Skip to main content

Laboratory Service — Event Schemas

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


1. Transport

All events use the CloudEvents envelope via @ghasi/nats-client CloudEventsBuilder. JetStream stream: DIAG_LAB — subject wildcard diag.laboratory.>.


2. Produced Events

diag.laboratory.accession.created

FieldValue
CloudEvents typeghasi.lis.accession.created
Sourceghasi/laboratory
Version1
Retention30 days
{
"id": "uuid",
"time": "2026-04-18T08:00:00Z",
"source": "ghasi/laboratory",
"type": "ghasi.lis.accession.created",
"tenantid": "tenant_01J...",
"actorid": "USR_01J...",
"correlationid": "uuid",
"dataversion": "1",
"data": {
"accessionId": "ACC_01J...",
"accessionNumber": "AFG-20260418-000123",
"patientId": "PAT_01J...",
"encounterId": "ENC_01J...",
"orderId": "SRQ_01J...",
"priority": "routine",
"tenantId": "tenant_01J..."
}
}

diag.laboratory.specimen.collected

FieldValue
CloudEvents typeghasi.lis.specimen.collected
Version1
Retention30 days
{
"data": {
"accessionId": "ACC_01J...",
"specimenId": "SPM_01J...",
"specimenType": "serum",
"collectedAt": "2026-04-18T07:45:00Z",
"collectorId": "PRV_01J...",
"tenantId": "tenant_01J..."
}
}

diag.laboratory.result.verified

FieldValue
CloudEvents typeghasi.lis.result.verified
Version1
Retention30 days
{
"data": {
"accessionId": "ACC_01J...",
"resultId": "RES_01J...",
"testCode": "2823-3",
"loincDisplay": "Potassium [Moles/volume] in Serum or Plasma",
"verifiedBy": "USR_01J...",
"criticalFlag": false,
"tenantId": "tenant_01J..."
}
}

diag.laboratory.result.released

FieldValue
CloudEvents typeghasi.lis.result.released
Version1
Retention90 days
Consumerspatient-chart-service, patient-portal-service, audit-service
{
"data": {
"accessionId": "ACC_01J...",
"resultId": "RES_01J...",
"patientId": "PAT_01J...",
"encounterId": "ENC_01J...",
"fhirObservationId": "obs_01J...",
"fhirDiagnosticReportId": "dr_01J...",
"testCode": "2823-3",
"tenantId": "tenant_01J..."
}
}

diag.laboratory.critical.triggered

FieldValue
CloudEvents typeghasi.lis.critical.triggered
Version1
Retention90 days
Consumerscommunication-service
{
"data": {
"accessionId": "ACC_01J...",
"resultId": "RES_01J...",
"patientId": "PAT_01J...",
"encounterId": "ENC_01J...",
"testCode": "2823-3",
"testDisplay": "Potassium",
"value": "2.1 mmol/L",
"criticalLow": 2.5,
"responsibleProviderId": "PRV_01J...",
"tenantId": "tenant_01J..."
}
}

diag.laboratory.result.acknowledged

FieldValue
CloudEvents typeghasi.lis.result.acknowledged
Version1
Retention90 days
{
"data": {
"resultId": "RES_01J...",
"patientId": "PAT_01J...",
"ackType": "reviewed",
"ackBy": "USR_01J...",
"ackAt": "2026-04-18T09:00:00Z",
"tenantId": "tenant_01J..."
}
}

diag.laboratory.result.corrected

FieldValue
CloudEvents typeghasi.lis.result.corrected
Version1
Retention90 days
{
"data": {
"resultId": "RES_01J...",
"priorResultId": "RES_old...",
"correctionReason": "Transcription error",
"patientId": "PAT_01J...",
"tenantId": "tenant_01J..."
}
}

3. Consumed Events

SubjectCloudEvents typeProducerAction
clinical.orders.placedghasi.orders.placedorders-serviceCreate accession from ServiceRequest

4. DLQ Pattern

Failed delivery subject pattern: dlq.diag.laboratory.{originalSubject}. Persisted in event_dlq table with event_id, subject, error, attempt_count, last_attempt_at.