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.
Responsibilities
- Drug master & catalog — medication items, categories, types, generics, substances, dosage forms, NLEM values, and substance-interaction data.
- Order entry — a single
orderRequestfront 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
| Module | Purpose |
|---|---|
orderRequest | Unified order umbrella — create, route, populate, and screen orders; fans out to downstream request types. |
orderRequestItem / orderSet / orderFavoriteItem | Per-line items, reusable order sets, and clinician favorites. |
medicationItem / medicationCategory / medicationGroup | Drug master records, classification, and grouping. |
medicationItemGenericLink / medicationSubstance | Generic linkage and active-substance data. |
medicationSubstanceInteraction | Drug–drug interaction reference data. |
medicationRequest | Prescription / medication order lifecycle and status tracking. |
medicationAdministration / medicationAdministrationEvent | e-MAR administration records and per-event timeline. |
e-kardex (nursing care record) | Consolidated nursing medication / care view. |
medicationDisbursement / medicationCart | Dispensing and cart batching. |
medicationReturnSystem | Medication return / restock workflow. |
administrationUsage / administrationRoute / administrationMethod / administrationSite | Dose-pattern, route, method, and site reference data. |
dosageForm / mixDrug / medicationItemRegimentSet | Dosage forms, admixtures, and regimen sets. |
pharmacy / pharmacyLabelPrint | Pharmacy workflow and dispensing-label printing. |
labRequest / labItem / labStandardItem | Laboratory ordering and lab master data. |
imagingRequest / imagingItem / imagingModality | Imaging ordering, item catalog, and modalities. |
nuclearMedicineRequest / radiationOncology / oncology | Nuclear-medicine, radiation-oncology, and oncology flows. |
bloodRequest / bloodProductRequest | Blood-bank and blood-product ordering. |
consultRequest / procedureRequest | Consult and procedure ordering. |
operatingRoomRequest / recoveryRoomRequest | OR scheduling and recovery-room requests. |
labourRoomRequest | Labour / delivery-room requests. |
anesthesiology | Anesthesia records and request handling. |
dentalRoom / dentistRequestItem / toothItemPoisition | Dental workflow and per-tooth charting. |
nutritionItem / nutritionMenu / nutritionRequest / nutritionAdministration | Diet catalog, menus, ordering, and consumption. |
inventoryCheckPriceRequest / stockBalance / stockBatch / stockLocation | Inventory and price-check integration. |
encounterJourney / healthTimeline / imageHistory | Encounter 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.
Related catalog items
RX-1…RX-8— Pharmacy & prescribingIPD-5— E-KardexOT-3…OT-6— AnesthesiaOT-7…OT-9— Labour RoomBB-3— Blood Bank patient workflow