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
| Field | Value |
|---|---|
| CloudEvents type | ghasi.lis.accession.created |
| Source | ghasi/laboratory |
| Version | 1 |
| Retention | 30 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
| Field | Value |
|---|---|
| CloudEvents type | ghasi.lis.specimen.collected |
| Version | 1 |
| Retention | 30 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
| Field | Value |
|---|---|
| CloudEvents type | ghasi.lis.result.verified |
| Version | 1 |
| Retention | 30 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
| Field | Value |
|---|---|
| CloudEvents type | ghasi.lis.result.released |
| Version | 1 |
| Retention | 90 days |
| Consumers | patient-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
| Field | Value |
|---|---|
| CloudEvents type | ghasi.lis.critical.triggered |
| Version | 1 |
| Retention | 90 days |
| Consumers | communication-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
| Field | Value |
|---|---|
| CloudEvents type | ghasi.lis.result.acknowledged |
| Version | 1 |
| Retention | 90 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
| Field | Value |
|---|---|
| CloudEvents type | ghasi.lis.result.corrected |
| Version | 1 |
| Retention | 90 days |
{
"data": {
"resultId": "RES_01J...",
"priorResultId": "RES_old...",
"correctionReason": "Transcription error",
"patientId": "PAT_01J...",
"tenantId": "tenant_01J..."
}
}
3. Consumed Events
| Subject | CloudEvents type | Producer | Action |
|---|---|---|---|
clinical.orders.placed | ghasi.orders.placed | orders-service | Create 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.