This repository is for OpenMRS 3 to display the billing status of a patient on the patient chart OpenMRS Microfrontend.
yarn # to install dependencies
yarn start # to run the dev server
Once it is running, a browser window should open with the OpenMRS 3 application. Log in and then navigate
to /openmrs/spa/root
.
This module provides a comprehensive configuration schema for managing patient billing status, offering flexible control over billing line conditions and system field mappings.
The module supports the following strongly-typed billing conditions:
- Order status:
ORDER
- Invoice status:
INVOICED
NOT_INVOICED
FULLY_INVOICED
PARTIALLY_INVOICED
- Payment status:
PAID
NOT_PAID
- Due date status:
OVERDUE
NOT_OVERDUE
- Cancellation status:
CANCELLED
The module supports several configuration categories:
- Retire conditions: Define when billing lines should be removed from view
- Approval conditions: Specify combinations of states that indicate approved billing
- Non-approval conditions: Define state combinations that indicate pending/problematic billing
- Field mapping: Configure system field names for patient UUID and external order ID
The module includes validation logic to prevent conflicting condition states, such as:
INVOICED
vsNOT_INVOICED
FULLY_INVOICED
vsPARTIALLY_INVOICED
PAID
vsNOT_PAID
OVERDUE
vsNOT_OVERDUE
{
{
// Remove cancelled orders and fully invoiced orders from view
retireLinesConditions: ['CANCELLED', 'ORDER,FULLY_INVOICED']
// Define non-approved states
nonApprovedConditions: [
'INVOICED,NOT_PAID',
'ORDER,NOT_INVOICED',
'INVOICED,OVERDUE,NOT_PAID'
]
// Define approved states
approvedConditions: [
'INVOICED,PAID',
'INVOICED,NOT_OVERDUE',
'INVOICED,NOT_OVERDUE,PAID'
]
// System field mappings
patientUuidFieldName: 'partner_id'
orderExternalIdFieldName: 'external_order_id'
}
}
Make sure to bump the Common Lib version used here each time you cut a release of Patient Chart. Because Common Lib is marked as a peer dependency and a Webpack module federation shared dependency in the Appointments app, the copy of the Common Lib that the framework loads is the first one that gets loaded at runtime when frontend modules are registered. If this happens to be a different version than what the Patient Chart expects, you might get some unexpected behavior in the Patient Chart. You can bump the Common Lib version by running the following command:
yarn up @openmrs/esm-patient-common-lib
git checkout package.json
yarn
For more information, please see the OpenMRS Frontend Developer Documentation.
In particular, the Setup section can help you get started developing microfrontends in general.