-
Notifications
You must be signed in to change notification settings - Fork 13
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
(fix) fixes for uncaught typeerror in order basket and added procedure price display #58
Conversation
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 @its-kios09 LGTM
src/form/procedures-orders/add-procedures-order/procedures-order-form.component.tsx
Outdated
Show resolved
Hide resolved
src/form/procedures-orders/add-procedures-order/procedures-order-form.component.tsx
Outdated
Show resolved
Hide resolved
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 @its-kios09
export const useBillableItem = (billableItemId: string) => { | ||
const customRepresentation = `v=custom:(uuid,name,concept:(uuid,display),servicePrices:(uuid,price,paymentMode:(uuid,name)))`; | ||
const { data, error, isLoading } = useSWRImmutable<{ | ||
data: { results: Array<BillableItemResponse> }; | ||
}>( | ||
`${restBaseUrl}/cashier/billableService?${customRepresentation}`, | ||
openmrsFetch | ||
); | ||
const billableItem = data?.data?.results?.find( | ||
(item) => item?.concept?.uuid === billableItemId | ||
); | ||
|
||
return { | ||
billableItem: billableItem, | ||
isLoading: isLoading, | ||
error, | ||
}; | ||
}; |
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 should not be handling billing information and work on the procedure repo. We should have an extension-slot then implement the logic of retrieving prices from esm-billing-app. something like this https://github.com/openmrs/openmrs-esm-patient-chart/blob/eea68c63846af39892bdf2e6bc1d08dc9fcc4824/packages/esm-patient-labs-app/src/lab-orders/add-lab-order/lab-order-form.component.tsx#L170 and logic is here
for lab and drug orders https://github.com/palladiumkenya/kenyaemr-esm-3.x/tree/main/packages/esm-billing-app/src/billable-services/billiable-item
I think Ted will also need to align with the design. The initial work wasn't informed on any designs
…er-form.component.tsx Co-authored-by: Makombe Kennedy <kennedymakombe@gmail.com>
…er-form.component.tsx Co-authored-by: Makombe Kennedy <kennedymakombe@gmail.com>
Reviewed the code and created another PR |
@its-kios09 - Please avoid new PRs. We need to keep the review history. |
Requirements
For changes to apps
If applicable
Summary
Screenshots
Related Issue
Other