Skip to main content

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.

~34
modules
ever-api-financial
internal scope
internal
default port
NATS
message broker

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

ModulePurpose
salesOrderPriced order lines per encounter; auto-close scheduling
invoiceInvoice assembly from sales orders
claimInvoicePayor-specific claim invoice generation
accountReceivableAR records and settlement ledger
accountReceivableInstallmentInstallment / payment-plan tracking
accountReceivableStageAR progression state machine
accountAccountChart-of-account style account records
accountAssetCategoryAsset categorization
billingGroup / billingSubGroupBilling taxonomy for charge routing
billCycleSettlementPeriodic bill-cycle settlement runs
receiptPayment receipts
settlementSettlement records
reconciliationPayment-to-claim reconciliation
revenueCollectionRevenue collection pipeline / exports
debtCollectionOutstanding-debt collection workflow
disbursementGroup / disbursementSubGroupDisbursement taxonomy
payorPayor master
payorPlan / payorPlanEnrollmentPlans and patient enrollment
payorInscl / payorPlanSubInsclInsurance classification (Thai สิทธิ)
payorSchemaPer-payor configuration schema
productProduct / service catalog and pricing
discountItemDiscount line items
taxTax rules
orCaseCostingOperating-room case costing
socialWorkSocial-welfare / charity coverage
walletPatient wallet / deposit balances
rcmValidationValidation over coding output
nhsoAutoTaggerAuto-tagging of charges for NHSO claims
revenueOptimizerRevenue-optimization opportunity surfacing
eclaimConnectore-Claim submission connector
hipdataConnectorHIPData integration connector
krungthaiTransactionBank transaction channel
ktbDirectLinkTransactionBank Direct Link transaction channel
ePhisE-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.
Pricing

Product master

Catalog, discounts, and tax rules price every sales-order line.

RCM

Validation & optimization

rcmValidation, nhsoAutoTagger, and revenueOptimizer harden claims before submission.

Recovery

AR & collections

Installments, AR stages, debt collection, and reconciliation close the loop to settlement.

  • FIN-1FIN-10 — Financial / RCM
  • INT-22, INT-23 — Bank Direct Link, E-Claim connectors
  • AI-7, AI-8 — RCM discharge-unsettled reconcile, e-Claim submission pipeline