Skip to main content

medOS Medication

Internal scope: ever-api-medications — the pharmacy, ordering, and medication-administration engine of the platform.

medOS Medication owns the full medication lifecycle — from the drug master and order entry through clinical safety screening, dispensing, e-MAR administration, and returns. It is also the home of the unified order request umbrella that fans out to lab, imaging, blood-bank, consult, procedure, nutrition, operating-room, and labour-room requests. With roughly 113 modules, it is the second-largest service in the platform after Administration.

The service runs as a NestJS + Moleculer node on the NATS mesh, persists to MongoDB as its primary write store, and emits domain events that downstream read-model and orchestration layers project into the clinic UI.

~113
modules
MongoDB
primary write store
NATS
service mesh
8+
order request types

Responsibilities

  • Drug master & catalog — medication items, categories, types, generics, substances, dosage forms, NLEM values, and substance-interaction data.
  • Order entry — a single orderRequest front door that creates and routes orders across many downstream request types.
  • Clinical safety screening — allergy, drug-interaction, age, pregnancy, lactation, dosage-limit, therapeutic-duplication, and stale-data checks at order time.
  • Dose & schedule handling — administration usage, method, route, site, and schedule-policy resolution that drives dose patterns and frequency.
  • Dispensing & inventory — disbursement, carts, stock balance / batch / location, returns, and price-check requests.
  • Medication administration — the e-MAR and e-Kardex records plus per-administration events.
  • Specialty & procedural requests — operating-room, labour-room, recovery-room, anesthesiology, oncology, radiation-oncology, dental, and nuclear-medicine flows.
  • Nutrition — diet items, menus, assessment, consumption, receiving, and purchasing.
  • Audit — append-only audit logs across orders, medication requests, blood requests, imaging requests, home medication, and returns.

Major modules

ModulePurpose
orderRequestUnified order umbrella — create, route, populate, and screen orders; fans out to downstream request types.
orderRequestItem / orderSet / orderFavoriteItemPer-line items, reusable order sets, and clinician favorites.
medicationItem / medicationCategory / medicationGroupDrug master records, classification, and grouping.
medicationItemGenericLink / medicationSubstanceGeneric linkage and active-substance data.
medicationSubstanceInteractionDrug–drug interaction reference data.
medicationRequestPrescription / medication order lifecycle and status tracking.
medicationAdministration / medicationAdministrationEvente-MAR administration records and per-event timeline.
e-kardex (nursing care record)Consolidated nursing medication / care view.
medicationDisbursement / medicationCartDispensing and cart batching.
medicationReturnSystemMedication return / restock workflow.
administrationUsage / administrationRoute / administrationMethod / administrationSiteDose-pattern, route, method, and site reference data.
dosageForm / mixDrug / medicationItemRegimentSetDosage forms, admixtures, and regimen sets.
pharmacy / pharmacyLabelPrintPharmacy workflow and dispensing-label printing.
labRequest / labItem / labStandardItemLaboratory ordering and lab master data.
imagingRequest / imagingItem / imagingModalityImaging ordering, item catalog, and modalities.
nuclearMedicineRequest / radiationOncology / oncologyNuclear-medicine, radiation-oncology, and oncology flows.
bloodRequest / bloodProductRequestBlood-bank and blood-product ordering.
consultRequest / procedureRequestConsult and procedure ordering.
operatingRoomRequest / recoveryRoomRequestOR scheduling and recovery-room requests.
labourRoomRequestLabour / delivery-room requests.
anesthesiologyAnesthesia records and request handling.
dentalRoom / dentistRequestItem / toothItemPoisitionDental workflow and per-tooth charting.
nutritionItem / nutritionMenu / nutritionRequest / nutritionAdministrationDiet catalog, menus, ordering, and consumption.
inventoryCheckPriceRequest / stockBalance / stockBatch / stockLocationInventory and price-check integration.
encounterJourney / healthTimeline / imageHistoryEncounter and patient-history tracking surfaces.
*AuditLog (many)Append-only audit trails for orders, requests, and returns.

Order-time clinical safety screening

The orderRequest module performs synchronous safety screening before an order is accepted. Each check is an independent guard so deployments can tune which alerts hard-block versus warn:

  • Allergy and cross-allergy matching
  • Drug–drug interaction calculation
  • Age-appropriateness
  • Pregnancy and lactation safety
  • Dosage-limit checks
  • Therapeutic-duplication detection
  • Stale-data guards on the order context

Schedule and frequency are resolved through a dedicated schedule-policy step that feeds the platform's dose-pattern handling (fixed, PRN, taper, titration, continuous infusion, and related kinds).

Order flow

Clinician order


orderRequest.service ── safety screening (allergy / interaction /
│ age / pregnancy / lactation / dosage /
│ duplication / stale-data)

fan-out by type ──► medicationRequest ► pharmacy / dispense / e-MAR
├─► labRequest ► diagnostics
├─► imagingRequest ► imaging / RIS
├─► bloodRequest ► blood bank
├─► consultRequest ► consult queue
├─► procedureRequest ► procedure queue
├─► operatingRoomRequest► OR scheduling
├─► labourRoomRequest ► labour ward
└─► nutritionRequest ► diet / nutrition


domain events → read-model projection → clinic UI

Events & integration

Status transitions across orders, medication requests, and administrations are published as domain events on the mesh. Downstream read-model and orchestration layers project these into department queues and the per-patient journey cache. The service participates in:

  • HL7v2 order (ORM) and result (ORU) flows via the interoperability layer — see Interoperability.
  • FHIR R4 mappings for MedicationRequest, MedicationAdministration, ServiceRequest, and related resources — see FHIR.

Note: This page describes capabilities at a high level. Specific behaviors (which safety checks block versus warn, dispensing cycles, and dose-pattern rendering) are configurable per deployment.

  • RX-1RX-8 — Pharmacy & prescribing
  • IPD-5 — E-Kardex
  • OT-3OT-6 — Anesthesia
  • OT-7OT-9 — Labour Room
  • BB-3 — Blood Bank patient workflow