-
Notifications
You must be signed in to change notification settings - Fork 0
(feat) HSC-306: ERP billing status via widget #1
Conversation
80f4246
to
e531b00
Compare
Thank you for the great documentation on PR description, make sure this is shown in the README too. (One cosmetic change: could you use the "outline" icons instead of "filled"?) |
Yes @rbuisson, grouping is by day. |
Hi @rbuisson |
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.
LGTM. I let it to @vasharma05 to provide final approval.
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.
A lot of comments for re-checking and a few suggestions. Missed out on translations too, but I am happy to see the great effort you put into this, great work @usamaidrsk 👏
.github/workflows/e2e.yml
Outdated
@@ -52,7 +52,7 @@ jobs: | |||
|
|||
- name: Stop dev server | |||
if: "!cancelled()" | |||
run: docker stop $(docker ps -a -q) | |||
run: docker stop $(docker ps -a -q | xargs -r docker stop) |
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.
Did you add this referencing somewhere else?
orderExternalIdFieldName: 'external_order_id' | ||
} | ||
} | ||
``` |
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.
Amazing 👏
@@ -53,6 +54,7 @@ | |||
}, | |||
"devDependencies": { | |||
"@openmrs/esm-framework": "next", | |||
"@openmrs/esm-patient-common-lib": "next", |
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.
@usamaidrsk, do bump the framework and common lib in this PR again. Thanks!
const isTablet = layout === 'tablet'; | ||
const isDesktop = layout === 'small-desktop' || layout === 'large-desktop'; |
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.
Since we don't support phone layout, we can assume that isDesktop = !isTablet
const [orders, invoices] = await Promise.all([ | ||
fetchOrders(patientUuid, config), | ||
fetchInvoices(patientUuid, config), | ||
// TODO fetch patient visits fetchVisits(patientUuid) | ||
]); | ||
return processBillingLines(orders, invoices, config); |
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.
We can do all of this using SWR too, let's use SWR for data fetching.
You can write SWR hooks for each fetching, and final billingLines
will be calculated/ processed once all the data is present. All these requests will go parallel in this scenario too, and you don't have to handle promises
return response.data; | ||
}; | ||
|
||
const fetchInvoices = async (patientUuid: string, config: Config) => { |
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.
Fetch all these using SWR, have added a suggestion elsewhere.
src/root.component.tsx
Outdated
<Resources /> | ||
</div> | ||
); | ||
return <div>root</div>; | ||
}; | ||
|
||
export default Root; |
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.
We can remove this file altogether, if we are not using this
src/root.test.tsx
Outdated
expect(screen.getByRole('heading', { name: /data fetching/i })).toBeInTheDocument(); | ||
expect(screen.getByRole('heading', { name: /resources/i })).toBeInTheDocument(); | ||
expect(screen.getByRole('button', { name: /get a patient named 'test'/i })).toBeInTheDocument(); | ||
expect(screen.getByText('root')).toBeInTheDocument(); | ||
}); |
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.
This file too
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.
Few changes, else good to go!
Thanks @usamaidrsk for the great work!
src/index.ts
Outdated
export const blueBox = getAsyncLifecycle(() => import('./boxes/extensions/blue-box.component'), options); | ||
|
||
export const brandBox = getAsyncLifecycle(() => import('./boxes/extensions/brand-box.component'), options); | ||
export const patientBillingStatusOverview = getSyncLifecycle(patientBillingStatusSummary, options); |
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.
This should be async. The only items meant to be sync are the dashboard links and icon buttons which navigate to other pages.
startDate: visit.startDatetime, | ||
endDate: visit.stopDatetime, |
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.
Don't we need to use the order's datetime it was placed and the endDatetime
?
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.
Why are we fetching all the visits?
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.
Yes we do need all visits to group the orders in each visit. Though this is not working at he moment, I just left the code if we intend to group by visits someday
tags.push(BillingCondition.NOT_OVERDUE); | ||
} | ||
|
||
let orderId = ''; // TODO this should be the orderExternalId of the invoice order |
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.
Is this TODO still pending?
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.
Yeah, it is still pending
Requirements
For changes to apps
If applicable
Summary
Description
This PR introduces a comprehensive configuration schema for the patient billing status module, providing flexible control over billing line conditions and system field mappings.
Key Changes
Introduced strongly-typed billing conditions with the following states:
Added configuration options for:
Implemented validation logic to prevent conflicting condition states, such as:
Configuration Example
Screenshots
Related Issue
https://mekomsolutions.atlassian.net/issues/HSC-306?filter=-1
Other