-
Notifications
You must be signed in to change notification settings - Fork 245
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) O3-2825: Flag discontinued medications with a tag #2037
Conversation
@brandones, @denniskigen, @dkayiwa, @ibacher , @njiddasalifu kindly this is the new PR. Ref #1691 |
Code seems fine. However, I think we want to make this more prominent. Instead of just saying "— DISCONTINUED" at the end of the block, I think we should put the text "Discontinued" in a grey pill in the first line (using the Carbon Tag element IIRC). |
@ibacher Kindly feel free to confirm the position of the tag, please! |
packages/esm-patient-medications-app/src/components/medications-details-table.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-medications-app/src/components/medications-details-table.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-medications-app/src/components/medications-details-table.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-medications-app/src/components/medications-details-table.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-medications-app/src/components/medications-details-table.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-medications-app/src/components/medications-details-table.scss
Outdated
Show resolved
Hide resolved
@denniskigen I believe this issue is occurring because of how the orders are fetched and rendered. After removing the 'ACTIVE' filter(on the api), When a medication is active, it is stored in the system as an active order. When it is discontinued, the same order might get updated or create a new record that reflects its discontinued status. This means: One entry represents the medication when it was active. Another entry represents the medication when it was discontinued. I think applying filtering to ensure that only the correct version (discontinued) is displayed in the past medications section will solve the issue if that is the way to go. |
packages/esm-patient-medications-app/src/components/medications-details-table.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-medications-app/src/components/medications-details-table.component.tsx
Show resolved
Hide resolved
packages/esm-patient-medications-app/src/components/medications-details-table.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-medications-app/src/medications-summary/medications-summary.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-medications-app/src/medications-summary/medications-summary.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-medications-app/src/medications-summary/medications-summary.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-medications-app/src/medications-summary/medications-summary.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-medications-app/src/medications-summary/medications-summary.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-medications-app/src/medications-summary/medications-summary.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-medications-app/src/active-medications/active-medications.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-medications-app/src/active-medications/active-medications.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-medications-app/src/medications-summary/medications-summary.component.tsx
Outdated
Show resolved
Hide resolved
@denniskigen I have fixed all proposed changes. Kindly feel free to review my PR at your convenient, please. |
packages/esm-patient-medications-app/src/medications-summary/medications-summary.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-medications-app/src/medications-summary/medications-summary.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-medications-app/src/medications-summary/medications-summary.component.tsx
Outdated
Show resolved
Hide resolved
@denniskigen Kindly feel free to review the proposed changes, please! |
packages/esm-patient-medications-app/src/active-medications/active-medications.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-medications-app/src/components/medications-details-table.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-medications-app/src/components/medications-details-table.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-medications-app/src/medications-summary/medications-summary.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-medications-app/src/components/medications-details-table.scss
Outdated
Show resolved
Hide resolved
packages/esm-patient-medications-app/src/components/medications-details-table.scss
Outdated
Show resolved
Hide resolved
packages/esm-patient-medications-app/src/active-medications/active-medications.test.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-medications-app/src/components/medications-details-table.component.tsx
Outdated
Show resolved
Hide resolved
@denniskigen thanks for the guidance and patience. What appeared to be impossible is now fixed. Kindly feel free to request any changes. |
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. Thanks, @jwnasambu!
* (feat) O3-2825: Flag discontinued medications with a tag * fix build error * DISCONTINUED' should be a grey Carbon Tag * Add margin on Discontinued Label * Code refactor * Remove the black borders on Tag * Flag discontinued requests with a tooltip * Discontinued date appears in the tooltip * Display Discontinued date in the tooltip * Add the Discontinued Date Label Inside the Tooltip * Only discontinued medication to display the tag * Active medication to be displayed on all the Active tables * fix build error * Fix Active medications conditions * Add hooks separate active patient orders and past patient orders * Remove filtering logic in the MedicationsSummary component * Ensure past medication is displayed * fix exclude discontinue orders parameter * Remove redundant conditions * Code refactor * Revert changes * Refactor hooks * Code refactor * Code refactor * Updates the hook from usePatientOrders to useActivePatientOrders * Display Discontinued tag * Display Discontinued tag on past medication * Code refactor * fix the failing test * Fix the tooltip position --------- Co-authored-by: jwnasambu <wamalwa1844.com>
Requirements
Summary
This PR tweaks the display of medications details table, adding a discontinued tag to medications that have been explicitly discontinued. This helps distinguish between medications that have been explicitly stopped and those that were modified or that automatically expired based on their end date.
Screenshots
screencast.2024-11-01.12.AM-44-52.mp4
Related Issue
https://openmrs.atlassian.net/browse/O3-2825
Other