Skip to content

Commit 78a05d1

Browse files
committed
(docs) Rewrite README and fix swapped policyNumber/insuranceScheme UUIDs
Rewrites the README with accurate configuration documentation, including a complete config example, visit attribute type reference table, bill creation prerequisites, and demo content alignment tables showing which default UUIDs are and aren't seeded. Also fixes `policyNumber` and `insuranceScheme` default UUIDs in the config schema which were swapped relative to the demo content's visit attribute type definitions.
1 parent d247b38 commit 78a05d1

2 files changed

Lines changed: 96 additions & 59 deletions

File tree

README.md

Lines changed: 94 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
1-
# OpenMRS 3.x Billing ESM
1+
# O3 Billing App
22

33
![OpenMRS CI](https://github.com/openmrs/openmrs-esm-billing-app/actions/workflows/ci.yml/badge.svg)
44

5-
The OpenMRS Billing Module is designed to streamline the financial operations within healthcare settings by facilitating the management of patient billing, payments, and service pricing. This module integrates seamlessly with the OpenMRS platform, allowing healthcare providers to generate bills, track payments, and manage various billable services. It is an essential tool for ensuring transparency and accuracy in financial transactions within healthcare facilities, contributing to efficient service delivery.
6-
7-
The **Billing ESM** is a microfrontend for OpenMRS 3.x designed to manage healthcare billing workflows. It allows users to:
5+
A frontend module for O3 that manages healthcare billing workflows. It allows users to:
86

97
- Generate and manage bills
108
- Capture payments and insurance details
119
- Configure billable services and categories
1210
- Integrate with visits and patient dashboards
1311

14-
Dependency: Note that this frontend module depends on the backend module called "Billing Module": <https://github.com/openmrs/openmrs-module-billing>
12+
This frontend module depends on the backend [Billing Module](https://github.com/openmrs/openmrs-module-billing). It also uses core OpenMRS REST APIs for visit attributes (to track payment status on visits) and concept lookups (to resolve service types and patient categories).
1513

1614
For more information, please see the
1715
[OpenMRS Frontend Developer Documentation](https://openmrs.atlassian.net/wiki/x/IABBHg).
@@ -20,7 +18,7 @@ For more information, please see the
2018

2119
Check out the developer documentation [in the OpenMRS Wiki](https://openmrs.atlassian.net/wiki/x/IABBHg).
2220

23-
This monorepo uses [yarn](https://yarnpkg.com).
21+
This repo uses [yarn](https://yarnpkg.com).
2422

2523
To install the dependencies, run:
2624

@@ -37,47 +35,34 @@ yarn start
3735
Once the dev server launches, log in and select a location. You will get redirected to the home page. Once there:
3836

3937
- Navigate to the Billing dashboard on the left panel to view the billing history. Additional billing functionality exists in the Patient Chart. You'll also find the Billable Services dashboard in the System Administration page.
40-
- For more information on how to navigate and use the billing module, please refer to this [documentation](https://www.notion.so/ucsf-ighs/Billing-User-Manual-7f0427617e714b7db14432312cbb7cad)
4138

4239
## Running tests
4340

44-
To run tests for all packages, run:
41+
To run tests, run:
4542

4643
```bash
47-
yarn turbo run test
44+
yarn test
4845
```
4946

5047
To run tests in `watch` mode, run:
5148

5249
```bash
53-
yarn turbo run test:watch
54-
```
55-
56-
To run a specific test file, run:
57-
58-
```bash
59-
yarn turbo run test -- visit-notes-form
50+
yarn test:watch
6051
```
6152

62-
The above command will only run tests in the file or files that match the provided string.
63-
64-
You can also run the matching tests from above in watch mode by running:
53+
To run a specific test file, pass a pattern:
6554

6655
```bash
67-
yarn turbo run test:watch -- visit-notes-form
56+
yarn test -- billing-dashboard
6857
```
6958

7059
To generate a `coverage` report, run:
7160

7261
```bash
73-
yarn turbo run coverage
62+
yarn coverage
7463
```
7564

76-
By default, `turbo` will cache test runs. This means that re-running tests wihout changing any of the related files will return the cached logs from the last run. To bypass the cache, run tests with the `force` flag, as follows:
77-
78-
```bash
79-
yarn turbo run test --force
80-
```
65+
This repo also includes a `yarn verify` script that runs linting, type checking, and tests via Turbo.
8166

8267
To run end-to-end tests, run:
8368

@@ -87,40 +72,94 @@ yarn test-e2e
8772

8873
Read the [e2e testing guide](https://openmrs.atlassian.net/wiki/x/Z8CEAQ) to learn more about End-to-End tests in this project.
8974

90-
### Updating Playwright
91-
92-
The Playwright version in the [Bamboo e2e Dockerfile](e2e/support/bamboo/playwright.Dockerfile#L2) and the `package.json` file must match. If you update the Playwright version in one place, you must update it in the other.
93-
94-
## ⚙️ Configuration
75+
## Configuration
9576

9677
You can customize billing behavior using OpenMRS frontend config overrides.
9778

98-
### 🔧 Example Config
79+
### Example Config
9980

100-
``` bash
81+
```json
10182
{
102-
"openmrs": {
103-
"config": {
104-
"billing": {
105-
"defaultCurrency": "UGX",
106-
"pageSize": 20,
107-
"patientCategory": {
108-
"paymentDetails": "fbc0702d-...",
109-
"insuranceScheme": "aac48226-..."
110-
},
111-
"nonPayingPatientCategories": {
112-
"childUnder5": "1528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
113-
}
114-
}
115-
}
83+
"@openmrs/esm-billing-app": {
84+
"defaultCurrency": "UGX",
85+
"pageSize": 20,
86+
"patientCategory": {
87+
"paymentDetails": "<visit-attribute-type-uuid>",
88+
"paymentMethods": "<visit-attribute-type-uuid>",
89+
"policyNumber": "<visit-attribute-type-uuid>",
90+
"insuranceScheme": "<visit-attribute-type-uuid>",
91+
"patientCategory": "<visit-attribute-type-uuid>",
92+
"formPayloadPending": "<visit-attribute-type-uuid>"
93+
},
94+
"categoryConcepts": {
95+
"payingDetails": "<concept-uuid>",
96+
"nonPayingDetails": "<concept-uuid>",
97+
"insuranceDetails": "<concept-uuid>"
98+
},
99+
"nonPayingPatientCategories": {
100+
"childUnder5": "<concept-uuid>",
101+
"student": "<concept-uuid>"
102+
},
103+
"postBilledItems": {
104+
"cashPoint": "<cash-point-uuid>",
105+
"cashier": "<provider-uuid>"
106+
},
107+
"serviceTypes": {
108+
"billableService": "<concept-set-uuid>"
109+
},
110+
"waiverPaymentModeUuid": "<payment-mode-uuid>"
116111
}
117112
}
118113
```
119114

120-
``` bash
121-
📌 Ensure all UUIDs used here exist in your OpenMRS instance.
122-
🧩 Configuration can be managed via your MF shell app or import-map-deployer
123-
```
115+
All UUIDs must reference resources that exist in your OpenMRS instance. See `src/config-schema.ts` for defaults and detailed descriptions of each property. Configuration can be managed via the app shell or import-map-deployer.
116+
117+
#### Visit attribute types
118+
119+
The `patientCategory` config keys map to visit attribute types that store billing information on each visit. The following must exist in your backend:
120+
121+
| Config key | Purpose | Default UUID |
122+
| --- | --- | --- |
123+
| `paymentDetails` | Whether the patient is paying or non-paying | `fbc0702d-b4c9-4968-be63-af8ad3ad6239` |
124+
| `paymentMethods` | Payment method (cash, insurance, etc.) | `8553afa0-bdb9-4d3c-8a98-05fa9350aa85` |
125+
| `policyNumber` | Insurance policy number | `aac48226-d143-4274-80e0-264db4e368ee` |
126+
| `insuranceScheme` | Insurance scheme name | `3a988e33-a6c0-4b76-b924-01abb998944b` |
127+
| `patientCategory` | Patient category classification | `3b9dfac8-9e4d-11ee-8c90-0242ac120002` |
128+
| `formPayloadPending` | Whether a billing form submission is pending | `919b51c9-8e2e-468f-8354-181bf3e55786` |
129+
130+
#### Bill creation prerequisites
131+
132+
Creating a bill requires a valid cash point and cashier (provider) UUID. The backend's `BillResource.save()` will attempt to load these from the cashier's active timesheet if the `billing.timesheetRequired` global property is set. Otherwise, the values from `postBilledItems.cashPoint` and `postBilledItems.cashier` in the frontend config are used. If neither is available, bill creation will fail.
133+
134+
### Demo content alignment
135+
136+
If you are using the [demo content package](https://github.com/openmrs/openmrs-content-referenceapplication-demo), the following backend seeds are relevant (paths relative to that repo):
137+
138+
- Billable services: `configuration/backend_configuration/billableservices/billableServices.csv`
139+
- Payment modes: `configuration/backend_configuration/paymentmodes/paymentModes.csv`
140+
- Cash points: `configuration/backend_configuration/cashpoints/cashPoints.csv`
141+
- Visit attribute types: `configuration/backend_configuration/attributetypes/attribute_types-core_demo.csv`
142+
- Receipt number generator: `configuration/backend_configuration/globalproperties/billing-core_demo.xml`
143+
144+
The following frontend config defaults match UUIDs seeded by the demo content:
145+
146+
| Config key | Default UUID | Demo content match |
147+
| --- | --- | --- |
148+
| `patientCategory.paymentDetails` | `fbc0702d...` | "Patient Type" visit attribute type |
149+
| `patientCategory.paymentMethods` | `8553afa0...` | "Payment Method" visit attribute type |
150+
| `patientCategory.policyNumber` | `aac48226...` | "Insurance Policy Number" visit attribute type |
151+
| `patientCategory.insuranceScheme` | `3a988e33...` | "Insurance Scheme" visit attribute type |
152+
| `postBilledItems.cashPoint` | `54065383...` | "OPD Cash Point" cash point |
153+
154+
The following defaults are **not seeded** by the demo content and must be created manually or overridden:
155+
156+
| Config key | Default UUID | What's needed |
157+
| --- | --- | --- |
158+
| `patientCategory.patientCategory` | `3b9dfac8...` | A visit attribute type for patient category classification |
159+
| `patientCategory.formPayloadPending` | `919b51c9...` | A visit attribute type for pending form status |
160+
| `postBilledItems.cashier` | `f9badd80...` | A provider UUID for the default cashier |
161+
| `waiverPaymentModeUuid` | `eb6173cb...` | A payment mode for bill waivers |
162+
| `serviceTypes.billableService` | `21b8cf43...` | A concept set whose members define billable service types |
124163

125164
## Troubleshooting
126165

@@ -143,20 +182,18 @@ git checkout package.json
143182
yarn
144183
```
145184

185+
Please see the [Implementer Documentation](https://wiki.openmrs.org/pages/viewpage.action?pageId=224527013) for more information about configuring modules.
186+
146187
## Design Patterns
147188

148189
For documentation about our design patterns, please visit our [design system](https://zeroheight.com/23a080e38/p/880723--introduction) documentation website.
149190

150-
## Configuration
151-
152-
Please see the [Implementer Documentation](https://wiki.openmrs.org/pages/viewpage.action?pageId=224527013) for information about configuring modules.
153-
154191
## Deployment
155192

156-
See [Creating a Distribution](https://openmrs.atlassian.net/wiki/x/IABBHg) for information about adding microfrontends to a distribution.
193+
See [Creating a Distribution](https://openmrs.atlassian.net/wiki/x/IABBHg) for information about adding frontend modules to a distribution.
157194

158195
## Contributing
159196

160197
For more information on how to get started, please refer to [OpenMRS Frontend Developer Documentation](https://openmrs.atlassian.net/wiki/x/94ABCQ).
161198

162-
Detailed documentation on Billing Module can be found [in the OpenMRS Wiki](https://openmrs.atlassian.net/wiki/x/0w2bAQ)
199+
Detailed documentation on the Billing Module can be found [in the OpenMRS Wiki](https://openmrs.atlassian.net/wiki/x/0w2bAQ).

src/config-schema.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ export const configSchema = {
3030
// Payment method attribute type (e.g., cash, insurance, mobile money)
3131
paymentMethods: '8553afa0-bdb9-4d3c-8a98-05fa9350aa85',
3232
// Insurance policy number attribute type
33-
policyNumber: '3a988e33-a6c0-4b76-b924-01abb998944b',
33+
policyNumber: 'aac48226-d143-4274-80e0-264db4e368ee',
3434
// Insurance scheme name attribute type
35-
insuranceScheme: 'aac48226-d143-4274-80e0-264db4e368ee',
35+
insuranceScheme: '3a988e33-a6c0-4b76-b924-01abb998944b',
3636
// Patient category classification attribute type
3737
patientCategory: '3b9dfac8-9e4d-11ee-8c90-0242ac120002',
3838
// Form payload pending status attribute type

0 commit comments

Comments
 (0)