Skip to content
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

Closed

Conversation

its-kios09
Copy link
Contributor

Requirements

  • This PR has a title that briefly describes the work done including a conventional commit type prefix and a Jira ticket number if applicable. See existing PR titles for inspiration.

For changes to apps

If applicable

  • My work includes tests or is validated by existing tests.

Summary

  • fixed Uncaught TypeError: (0 , w.closeWorkspace) is not a function error on order basket
  • added ability to show procedure prices on the order basket

Screenshots

procedure

Related Issue

Other

Copy link
Contributor

@makombe makombe left a 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

@donaldkibet donaldkibet changed the title Procedure order fixes (fix) fixes for uncaught typeerror in order basket and added procedure price display Jul 12, 2024
Copy link
Contributor

@donaldkibet donaldkibet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @its-kios09

Comment on lines +318 to +335
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,
};
};
Copy link
Contributor

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

its-kios09 and others added 2 commits July 12, 2024 11:52
…er-form.component.tsx

Co-authored-by: Makombe Kennedy <kennedymakombe@gmail.com>
…er-form.component.tsx

Co-authored-by: Makombe Kennedy <kennedymakombe@gmail.com>
@its-kios09
Copy link
Contributor Author

Reviewed the code and created another PR

@its-kios09 its-kios09 closed this Jul 12, 2024
@ojwanganto
Copy link
Contributor

@its-kios09 - Please avoid new PRs. We need to keep the review history.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants