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

O3-2879 Add billing form and billing history to patient chart #8

Merged
merged 5 commits into from
Feb 23, 2024

Conversation

ODORA0
Copy link
Member

@ODORA0 ODORA0 commented Feb 21, 2024

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

This PR adds the ability to launch the billing form from the billing history in the patient chart

Screenshots

Screen.Recording.2024-02-21.at.20.14.20.mov

Related Issue

Other

@ODORA0 ODORA0 marked this pull request as draft February 21, 2024 12:24
@ODORA0 ODORA0 marked this pull request as ready for review February 21, 2024 18:10
@@ -64,10 +68,21 @@ const BillHistory: React.FC<BillHistoryProps> = ({ patientUuid }) => {
const setBilledItems = (bill) =>
bill.lineItems.reduce((acc, item) => acc + (acc ? ' & ' : '') + (item.billableService || item.item || ''), '');

const formatCurrency = (amount) => {
Copy link
Member

Choose a reason for hiding this comment

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

Extract this utility to a utils file so it can be reused

Copy link
Member Author

Choose a reason for hiding this comment

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

This would be duplication actually, using the function Cynthia adjusted

Comment on lines 72 to 73
const currencyCode = defaultCurrency._default || 'UGX';

Copy link
Member

Choose a reason for hiding this comment

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

Do we still need this? there's a PR from Cynthia that was merged and resolves this

Copy link
Contributor

@CynthiaKamau CynthiaKamau left a comment

Choose a reason for hiding this comment

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

Thanks @ODORA0 , i have left a few comments

@@ -42,6 +44,8 @@ const BillHistory: React.FC<BillHistoryProps> = ({ patientUuid }) => {
const { paginated, goTo, results, currentPage } = usePagination(bills, PAGE_SIZE);
Copy link
Contributor

Choose a reason for hiding this comment

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

You can add the page sizes to the config

Copy link
Member Author

Choose a reason for hiding this comment

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

Makes sense


const postBillItems = () => {
const bill = {
cashPoint: '54065383-b4d4-42d2-af4d-d250a1fd2590',
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these concepts or uuids from the api?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, UUID from the API not concepts

quantity: parseInt(item.Qnty),
price: item.Price,
priceName: 'Default',
priceUuid: '7b9171ac-d3c1-49b4-beff-c9902aee5245',
Copy link
Contributor

Choose a reason for hiding this comment

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

Also these

Copy link
Member Author

Choose a reason for hiding this comment

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

Same here

<TableCell></TableCell>
<TableCell></TableCell>
<TableCell style={{ fontWeight: 'bold' }}>Grand Total:</TableCell>
<TableCell id="GrandTotalSum">{grandTotal}</TableCell>
Copy link
Contributor

Choose a reason for hiding this comment

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

You could try adding the prefix of the currency from the config

@pirupius pirupius changed the title O3-2879 Add billing form in Patient's billing history to RefApp O3-2879 Add billing form and billing history to patient chart Feb 23, 2024
@pirupius pirupius merged commit 52bd3c8 into openmrs:main Feb 23, 2024
5 checks passed
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.

3 participants