medOS Diagnostics
Lab and imaging orders and results, specimen management, and the diagnosis / ICD coding masters.
Scope: ever-api-diagnostics · Stack: NestJS + Moleculer + MongoDB
medOS Diagnostics owns the clinical knowledge and result surfaces that sit between an order and a coded outcome. It manages the diagnosis records on an encounter, the ICD-10 / ICD-9 coding masters and disease groupings used for reporting, imaging study and body-site templates, observation capture, and the specimen transport chain that moves samples toward the lab. All modules communicate over NATS as part of the Moleculer service mesh and persist to MongoDB as the system of record.
Responsibilities
- Diagnosis records — primary/secondary diagnoses attached to encounters, plus reusable diagnosis templates.
- Coding masters — ICD-10, ICD-9 and disease-group tables with locale labels, used by typeahead and reporting.
- Observations — transient (temporary) observation capture and promotion into permanent observation records.
- Imaging templates — body-site / organ and human-figure templates that back imaging study annotation.
- Specimen transport — tracking the movement and custody of specimens toward the diagnostic lab.
- Encounter close enumerations — discharge status and discharge type masters consumed when an encounter is finalized.
- Allergy & intolerance — coded substance registry for clinical safety checks.
- Physical examination — exam template catalog for structured documentation.
Major modules
| Module | Purpose |
|---|---|
diagnosis | Per-encounter diagnosis records (primary / secondary). |
diagnosisTemplate | Reusable diagnosis sets for common presentations. |
icd10 | ICD-10 master with locale labels and typeahead search. |
icd9 | ICD-9-CM procedure / legacy code master. |
diseaseGroup | Grouping of diagnoses for reporting and case-mix. |
observation | Permanent, validated observation records. |
observationTemporary | Transient observations awaiting validation/promotion. |
imagingStudy | Imaging study records and result linkage. |
imageStandardHumanTemplate | Human-figure templates for image annotation. |
imageStandardHumanCategory | Categorization of standard human templates. |
organ | Body-site / organ catalog used by imaging templates. |
specimenTransport | Specimen custody and transport tracking. |
allergyIntolerance | Coded allergy / intolerance registry. |
physicalExaminate | Physical examination template catalog. |
treatmentDoctor | Treating-doctor association for diagnostic records. |
dischargeStatus / dischargeType | Enumerations applied at encounter close. |
icd10 / icd9 / diseaseGroup
Diagnosis code tables with grouping for reporting and case-mix.
diagnosis / diagnosisTemplate
Per-encounter diagnosis records plus reusable templates.
specimenTransport
Custody and transport tracking as samples move toward the lab.
observation / observationTemporary
Transient capture promoted into validated observations.
imagingStudy / templates / organ
Imaging studies plus body-site templates for annotation.
allergyIntolerance / physicalExaminate
Coded allergy registry and physical-exam template catalog.
Flow
Encounter ──▶ diagnosis.upsert ──▶ icd10 / icd9 master lookup
│
├──▶ observationTemporary ──validate──▶ observation
│
└──▶ imagingStudy ──annotate──▶ imageStandardHumanTemplate / organ
Specimen ──▶ specimenTransport (custody / transit / arrival)
Encounter close ──▶ dischargeStatus / dischargeType
Events & integration
The service ships a small set of internal cache-invalidation events
(diagnostic.cache.clean.*) so that masters such as ICD tables stay consistent
across the mesh after edits. Diagnosis, observation and imaging records emitted
here are projected into the read-model layer that powers worklists and journey
caches; coded diagnoses are also consumed by downstream coding and claims
surfaces. ICD coding masters and disease groupings are bilingual (local language
plus English) so the same data serves every supported locale.
For specimen handling that spans services, see the bounded-context split between patient transport and specimen transport in the platform architecture.
Key actions
diagnosis.upsert— add / update a diagnosis on an encounter.icd10.search— typeahead over ICD-10 with locale labels.observationTemporary.validate— promote a transient observation to permanent.
Related catalog items
dx-*— diagnosis and ICD coding master entities.obs-*— observation capture and validation.img-*— imaging study and body-site template entities.spec-*— specimen transport tracking.