4.5 KiB
4.5 KiB
| name | description |
|---|---|
| hms-billing | Use when building, debugging, modifying, or testing HMS billing workflows, including OPD consultation fees, IPD running charges, final discharge settlement, lab and radiology billing, pharmacy sales, multi-tender payments, and package management. |
HMS Billing & Financial Management Skill
This skill guides the agent through the complete billing workflows, ledger integrity, database structures, and calculation formulas in E-Atria HMS.
1. Overview of Billing Workflows
E-Atria HMS manages four distinct revenue streams:
- OPD Billing: Doctor consultation fees, registration charges, minor OPD procedures, emergency day care.
- IPD Billing: Bed charges, nursing fees, doctor daily rounds, ICU monitoring, OT/Surgery fees, package tariffs, final discharge settlement.
- Diagnostics Billing: Laboratory pathology investigations, radiology imaging procedures.
- Pharmacy Sales: Inpatient and outpatient drug dispensing, prescription fulfillment.
2. Key Database Tables
Master & Transactional Tables
invoice_master: Central invoice header containing patient reference, dates, totals, discounts, taxes, paid amount, and outstanding balance.invoice_item: Line items for services billed under aninvoice_masterrecord (item_type: 1=Consultation, 2=Procedure, 3=Lab, 4=Radiology, 5=Nursing, etc.).payment_history: Ledger recording every monetary transaction (Cash, UPI, Credit/Debit Card, NetBanking, Cheque, Advance Deposit).ipd_invoice_item: Running IPD ledger updated dynamically as daily nursing charges, doctor visits, and medications are consumed.doc_opd_fee: Doctor consultation fee schedule by fee type (1=New Patient,2=Revisit,3=Running,4=Emergency,5=Night/Off-time).doc_ipd_fee: Doctor IPD visit fee schedule (1=Regular Ward Visit,2=ICU Visit, etc.).doc_fee_type: Descriptive lookup for fee categories.hospital_bank_payment_source: Configured bank accounts / POS machines / UPI QR accounts for financial auditing.ayushman_package_master: Standard PM-JAY package procedure pricing.
3. OPD Consultation Billing Workflow
- Patient Lookup / Registration:
- Check if patient exists via
patient_master.p_fname,mphone1, or ABHA ID. - If new, insert into
patient_master(storing full name strictly inp_fname).
- Check if patient exists via
- Doctor & Fee Selection:
- Select doctor from
doctor_master. - Fetch active consultation fee from
doc_opd_feefor selecteddoc_fee_type(e.g. New Patient = ₹500, Revisit = ₹300).
- Select doctor from
- Invoice Generation:
- Insert invoice in
invoice_masterwithstatus = 'PAID'(or'PARTIAL'). - Insert corresponding item row into
invoice_item.
- Insert invoice in
- Payment Recording:
- Insert transaction row in
payment_historywithpayment_mode,amount, andreceived_by.
- Insert transaction row in
- OPD Token / Receipt Printing:
- Generate thermal or A4 receipt with hospital header, UHID, Doctor Name (
Dr. {p_fname}), Token No, and QR code.
- Generate thermal or A4 receipt with hospital header, UHID, Doctor Name (
4. IPD Running Charges to Final Settlement
- Daily Accumulation:
- Nursing staff and ward managers post daily items into
ipd_invoice_item:- Room/Bed tariff (based on
bed_master.bed_category_id). - Daily doctor visit charges (from
doc_ipd_fee). - Bedside monitoring, injections, consumables (
nursing_ipd_charges).
- Room/Bed tariff (based on
- Nursing staff and ward managers post daily items into
- Advance Payments:
- Inpatients make advance deposits during hospital stay.
- Advances are logged in
payment_historylinked to the patient'sipd_id.
- Discharge Settlement:
- Upon discharge approval, the billing clerk generates the final settlement:
\text{Gross Total} = \sum \text{ipd\_invoice\_item.item\_amount}\text{Net Due} = \text{Gross Total} - \text{Approved Discount} + \text{Taxes} - \sum \text{Advance Payments} - The final invoice is created in
invoice_master, and remaining balance is collected viapayment_history. - The
ipd_master.discharge_dateandipd_master.status = 'discharged'are marked.
- Upon discharge approval, the billing clerk generates the final settlement:
5. Safe Modification & Debugging Rules
- Zero-Sum Balance Rule: Never update
invoice_master.paid_amountorbalance_amountmanually without validating that\sum \text{payment\_history.amount} == \text{invoice\_master.paid\_amount}. - Patient Name: Always select
patient_master.p_fname. Columnpatient_master.p_lnamedoes not exist. - Doctor Share: Doctor commission calculations must be derived from
invoice_item.doctor_idand verified against activefinance_doctor_agreements.