medOS Financial
Scope: Billing, invoicing, sales orders, accounts receivable, RCM, and product/pricing master data.
The medOS Financial service (ever-api-financial) owns the money side of the patient lifecycle. It turns clinical activity into priced sales orders, accumulates them into invoices and claims, tracks accounts receivable through to settlement, and reconciles payments against payor and bank channels. It also holds the product/pricing master data and the rule engines that tag and optimize charges for revenue-cycle management (RCM). The service runs as a NestJS + Moleculer microservice on NATS and writes to MongoDB as its primary store.
Responsibilities
- Charge capture and sales orders — materialize priced order lines from clinical/diagnostic/medication activity, with auto-close scheduling for open orders.
- Invoicing and claims — assemble invoices and payor-specific claim invoices for submission.
- Accounts receivable — manage the AR lifecycle, installment plans, and progression stages.
- Collections and settlement — drive debt collection, revenue collection, receipts, bill-cycle settlement, and reconciliation.
- Payor management — model payors, plans, enrollments, schemas, and Thai insurance classifications (Inscl / sub-Inscl).
- Product and pricing master data — maintain the product catalog, discount items, and tax rules used to price every line.
- RCM intelligence — validate coding output, auto-tag charges, and surface revenue-optimization opportunities.
- External connectors — bridge to e-Claim, HIPData, and bank/payor transaction channels.
Major modules
| Module | Purpose |
|---|---|
salesOrder | Priced order lines per encounter; auto-close scheduling |
invoice | Invoice assembly from sales orders |
claimInvoice | Payor-specific claim invoice generation |
accountReceivable | AR records and settlement ledger |
accountReceivableInstallment | Installment / payment-plan tracking |
accountReceivableStage | AR progression state machine |
accountAccount | Chart-of-account style account records |
accountAssetCategory | Asset categorization |
billingGroup / billingSubGroup | Billing taxonomy for charge routing |
billCycleSettlement | Periodic bill-cycle settlement runs |
receipt | Payment receipts |
settlement | Settlement records |
reconciliation | Payment-to-claim reconciliation |
revenueCollection | Revenue collection pipeline / exports |
debtCollection | Outstanding-debt collection workflow |
disbursementGroup / disbursementSubGroup | Disbursement taxonomy |
payor | Payor master |
payorPlan / payorPlanEnrollment | Plans and patient enrollment |
payorInscl / payorPlanSubInscl | Insurance classification (Thai สิทธิ) |
payorSchema | Per-payor configuration schema |
product | Product / service catalog and pricing |
discountItem | Discount line items |
tax | Tax rules |
orCaseCosting | Operating-room case costing |
socialWork | Social-welfare / charity coverage |
wallet | Patient wallet / deposit balances |
rcmValidation | Validation over coding output |
nhsoAutoTagger | Auto-tagging of charges for NHSO claims |
revenueOptimizer | Revenue-optimization opportunity surfacing |
eclaimConnector | e-Claim submission connector |
hipdataConnector | HIPData integration connector |
krungthaiTransaction | Bank transaction channel |
ktbDirectLinkTransaction | Bank Direct Link transaction channel |
ePhis | E-PHIS reporting integration |
Charge-to-settlement flow
Clinical / Diagnostic / Medication activity
│ (Moleculer events over NATS)
▼
salesOrder ──── product · discountItem · tax (pricing master)
│
▼
invoice ──▶ claimInvoice ──▶ eclaimConnector / hipdataConnector
│ │
▼ ▼
accountReceivable ◀──── reconciliation ◀── payor response / bank txn
│
├─ accountReceivableInstallment
├─ accountReceivableStage
▼
receipt · settlement · billCycleSettlement ──▶ revenueCollection
Events & integration
- Communicates with the rest of the platform over NATS via the Moleculer service mesh; emits and consumes domain events (for example, sales-order lifecycle events and a coding-completed listener that feeds RCM validation).
- A financial cache-clean event mixin keeps cached pricing/AR state consistent on upstream changes.
- Payor and bank connectors (
eclaimConnector,hipdataConnector,krungthaiTransaction,ktbDirectLinkTransaction) provide outbound submission and inbound transaction reconciliation.
Product master
Catalog, discounts, and tax rules price every sales-order line.
Validation & optimization
rcmValidation, nhsoAutoTagger, and revenueOptimizer harden claims before submission.
AR & collections
Installments, AR stages, debt collection, and reconciliation close the loop to settlement.
Related pages
Related catalog items
FIN-1…FIN-10— Financial / RCMINT-22,INT-23— Bank Direct Link, E-Claim connectorsAI-7,AI-8— RCM discharge-unsettled reconcile, e-Claim submission pipeline