-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(feat): include openmrs id on payment history #486
(feat): include openmrs id on payment history #486
Conversation
Could we adopt the standard approach of having the identifier in its own column? |
technically harder to implement but I will try see if its possible |
const { openMRSIDUUID } = useConfig<BillingConfig>(); | ||
const { patient, isLoading } = usePatient(patientUUID); | ||
|
||
const openMRSId = patient?.identifier | ||
?.filter((identifier) => identifier) | ||
.filter((identifier) => identifier.type.coding.some((coding) => coding.code === openMRSIDUUID)) | ||
.at(0)?.value; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @amosmachora, we already provide the OpenMRSID by default using the bill endpoint. IMO the current implementation adds a call to fetch patient for every row which is additional load on the server and might cause degraded performance.
See section of /cashier/bill
endpoint
From the above we could add function
const extractPatientIdentifier = patient => patient?.display?.split('-')[0]?.trim() || '';
that extracts the identifier. In the event more identifier are required we could ask support from backend to include full patient object
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wish I had thought of that. I agree the current approach does make a request for every row. Will update ASAP.
@donaldkibet turns out there is a property for that I just did not look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @amosmachora
...es/esm-billing-app/src/billable-services/payment-history/payment-history-table.component.tsx
Outdated
Show resolved
Hide resolved
…/payment-history-table.component.tsx Co-authored-by: Donald Kibet <[email protected]>
* feat: include openmrs id on bill history * refactor: use saved id * Update packages/esm-billing-app/src/billable-services/payment-history/payment-history-table.component.tsx Co-authored-by: Donald Kibet <[email protected]> --------- Co-authored-by: Donald Kibet <[email protected]>
Requirements
Summary
This PR adds the patient's openmrs id on the payment history page. The current implementation works but the slight downside is for every patient we have to fetch their openMRS ID from the backend therefore there is a loading state on the patient's name which is not the best user experience, if the bill could come prepopulated with the openMRS ID that would be ideal.
Screenshots
Related Issue
None.
Other
None.