---
title: "Bill Transaction"
description: "How patient billing works in NICE HMS — creating invoices and credit notes for OPD, IPD, and pharmacy encounters, recording payments, handling TPA/interim bills, and printing invoices."
date: 2026-07-19
lastModified: 2026-07-25
category: "billing"
author: "Dr. Umesh Bilagi"
beta: false
---

## Overview

Bill Transactions are the patient-facing side of NICE HMS billing. Every service rendered during a patient encounter — consultation, lab test, medicine, procedure, room charge — is recorded as an **invoice** and settled via a **receipt** (payment received) or **payment** (refund returned). In the code, this is the Invoice component; "Bill" is the term used throughout the UI and this guide.

Invoices are always linked to a patient and encounter. The credit side (sales account) is auto-detected based on the encounter type: OPD, IPD, or Pharmacy.

## Voucher Types

Patient billing uses these voucher types:

| Type | Purpose |
|------|---------|
| INVOICE | Patient invoice — OPD, IPD, or hospital services |
| INVOICE_P | Pharmacy-specific patient invoice |
| CREDIT_NOTE | Credit note / refund against a patient invoice |
| CREDIT_NOTE_P | Pharmacy-specific credit note |
| ESTIMATE | Provisional estimate (non-posting, for patient reference) |

These are created from the Invoice page (`/admin/accounts/invoice/create`). Payment settlement uses RECEIPT and PAYMENT vouchers (see [Payment Settlement](#payment-settlement) below).

## Creating an Invoice

1. Open a patient encounter (OPD, IPD, or Pharmacy).
2. Navigate to the billing/invoice option for that encounter.
3. The invoice page loads with these query parameters:

| Parameter | Description |
|-----------|-------------|
| patientid | Patient ID |
| encounterid | FHIR Encounter ID |
| vouchertype | INVOICE, INVOICE_P, CREDIT_NOTE, CREDIT_NOTE_P, or ESTIMATE |
| tariffName | Pricing tariff (defaults to "Default") |
| servcieRequestid | (Optional) Links invoice to a specific prescription/service request |

### Auto-Detection

The system automatically determines the sales account based on context:

| Condition | Credit Account |
|-----------|---------------|
| vouchertype is INVOICE_P or CREDIT_NOTE_P | Pharmacy |
| Encounter class is IMP (inpatient) | IPD |
| All other encounters | OPD |

### Form Fields

| Field | Description |
|-------|-------------|
| **Date** | Invoice date and time |
| **Payor** | Who pays — Self (patient) or TPA/insurance. Sets the debit side (who owes) |
| **Items** | Billable items from the catalog. Filtered by category based on voucher type |
| **Quantity** | Number of units |
| **Consignee** | Referring doctor (for revenue sharing). Shown for non-pharmacy types only |
| **Store** | Inventory store for stock-tracked items |
| **Notes** | Free text |

### Item Sources

Items can come from two sources:
- **Catalog** — Items filtered by category: Hospital/Lab/Radiology for INVOICE, Pharmacy items for INVOICE_P
- **ServiceRequest** — When `servcieRequestid` is provided, items are pre-loaded from the linked prescription with tariff-based rates

### Tax Calculation

Tax is computed per item as CGST + SGST (intrastate). The tax rates are configured on each item in the Accounts Master. The formula:

```
itemAmount = quantity × salePrice
discounted  = itemAmount × (100 - discount%) / 100
gstAmount   = (cgst% × discounted) + (sgst% × discounted)
total       = discounted + gstAmount
```

## OPD Billing

For outpatient encounters:
- Credit account is auto-set to OPD
- Items are loaded from Hospital, Laboratory, Radiology, and Blood Bank categories
- One invoice per encounter — covers consultation, tests, and procedures done during that visit

## IPD Billing

For inpatient encounters:
- Credit account is auto-set to IPD
- Charges accumulate across the stay: room charges (daily), doctor visits, procedures, medicines, lab, radiology
- Consolidated into an invoice at discharge, or interim bills during the stay (see below)

## Interim & Final Bills

Every encounter has an `intrimOrFinal` property for **TPA/insurance billing**. While the toggle is available on any encounter, it is primarily designed for IPD stays where insurers need partial bills before discharge.

| State | Purpose |
|-------|---------|
| **Interim** | Provisional invoice during an ongoing stay. TPAs use interim bills to process partial claims before discharge |
| **Final** | Consolidated invoice when billing is complete. Typically set at discharge |

The `intrimOrFinal` property lives on the Encounter object. To toggle it:
1. Open the patient's billing page.
2. Use the **Set Bills as Interim** / **Set Bills as Final** button.
3. The encounter's bill status updates and reflects in the EncounterWise balance table.

### EncounterWise Balance Table

The balance table shows all encounters for a patient with columns:

| Column | Description |
|--------|-------------|
| Encounter | Clickable link to the encounter PDF |
| Status | Encounter status (e.g., active, discharged) |
| Bill Status | Interim or Final |
| Invoice & Credit Notes | Link to search all invoices for that encounter |
| Balance | Outstanding amount for the encounter |
| ABDM | Share invoice record with ABDM |

Access the balance table from the patient's billing view and click **Get Encounter Balances**.

## Pharmacy Billing

Pharmacy invoices use INVOICE_P and CREDIT_NOTE_P:
- Credit account = Pharmacy
- Items filtered from the Pharmacy category only
- Prints with the pharmacy letterhead (configurable in Organization Settings)
- Integrates with pharmacy inventory — dispensed items update stock

## Credit Notes

When a patient needs a refund or an invoice needs correction:

1. Create an invoice with vouchertype `CREDIT_NOTE` (or `CREDIT_NOTE_P` for pharmacy).
2. The form is the same as an invoice but with a red border (INVOICE = green).
3. After saving, the **Return Payment** button navigates to the receipt/payment page with vouchertype `PAYMENT` — money flows back to the patient.

## Payment Settlement

After an invoice is created, record payment through the receipt/payment page (`/admin/accounts/recive-pay`).

### Recording a Payment (RECEIPT)

1. After saving an INVOICE, click **Record Payment**.
2. The receipt page opens with `vouchertype=RECEIPT` and `invoiceid=<new invoice>`.
3. Fill in:

| Field | Description |
|-------|-------------|
| **Date** | Payment date |
| **Resource Account** | Where money goes — CASH (user's cash drawer), BANK, or DIGITAL |
| **Amount** | How much the patient paid (per encounter if multiple outstanding) |
| **Notes** | Payment reference or remarks |

4. Submit. This creates a RECEIPT voucher: debit to cash/bank, credit to patient.

### Processing a Refund (PAYMENT)

1. After saving a CREDIT_NOTE, click **Return Payment**.
2. The payment page opens with `vouchertype=PAYMENT`.
3. Enter the refund amount and the cash/bank account the money comes from.
4. Submit. This creates a PAYMENT voucher: debit to patient, credit to cash/bank.

### Invoice-Wise Tracking

When payment is recorded via the **Record Payment** button from an invoice, the receipt is linked to that specific invoice. The system tracks:
- `invoiceBalance` = invoice amount − sum of linked receipts
- An invoice is settled when its balance reaches zero

### Advance Adjustment

If the patient has an advance payment on file, it can be adjusted against the invoice during settlement. See [Advance Transaction](/docs/advance-transaction).

## Printing & Sharing

After saving an invoice or receipt:
1. A **Print** section appears with letterhead options.
2. Select the appropriate letterhead:
   - **Patient letterhead** — for OPD and IPD invoices
   - **Pharmacy letterhead** — for INVOICE_P and CREDIT_NOTE_P
3. Click to generate and download the PDF.

Invoices can also be shared via WhatsApp or email from the patient's record.

## FAQ

**Q: Can I split a bill between patient and TPA?**
A: Yes. Select the TPA as the Payor when creating the invoice. The debit account will be the TPA instead of Self. You can also create separate invoices for patient-payable vs TPA-payable items.

**Q: How are refunds handled?**
A: Create a CREDIT_NOTE for the items being refunded, then process a PAYMENT from the receipt/payment page to return the money.

**Q: When should I use Interim vs Final?**
A: Use Interim for partial bills during a long IPD stay (e.g., weekly TPA claims). Set to Final at discharge when the bill is complete and ready to lock.

**Q: Can I add a custom charge not in the item list?**
A: Yes. Add a Miscellaneous item in Item Management first, then select it on the invoice. See [Item Management](/docs/item-management).

**Q: How do I correct an invoice after it is saved?**
A: Only an admin can edit an invoice, and only when the encounter is still in-progress. If editing is not possible (wrong role or encounter closed), create a CREDIT_NOTE to offset the incorrect amount and issue a new invoice.

**Q: Does creating an invoice update stock?**
A: Pharmacy invoices (INVOICE_P) update medicine stock. Hospital invoices update store inventory if the items are linked to a store account.
