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

(feat) O3-2825: Flag discontinued medications with a tag #2037

Merged
merged 35 commits into from
Nov 1, 2024

Conversation

jwnasambu
Copy link
Contributor

@jwnasambu jwnasambu commented Sep 26, 2024

Requirements

  • This PR has a title that briefly describes the work done including the ticket number. If there is a ticket, make sure your PR title includes a conventional commit label. See existing PR titles for inspiration.
  • My work conforms to the OpenMRS 3.0 Styleguide and design documentation.
  • My work includes tests or is validated by existing tests.

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

@jwnasambu jwnasambu closed this Sep 26, 2024
@jwnasambu jwnasambu reopened this Sep 26, 2024
@jwnasambu
Copy link
Contributor Author

@brandones, @denniskigen, @dkayiwa, @ibacher , @njiddasalifu kindly this is the new PR. Ref #1691

@ibacher
Copy link
Member

ibacher commented Sep 27, 2024

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).

@jwnasambu
Copy link
Contributor Author

@ibacher Kindly feel free to confirm the position of the tag, please!

@denniskigen denniskigen changed the title fix/03-2825: Medications that have been discontinued should have a "Discontinued" label (feat) O3-2825: Add "Discontinued" label for discontinued medications Oct 1, 2024
@denniskigen
Copy link
Member

denniskigen commented Oct 1, 2024

This PR

CleanShot 2024-10-01 at 11  27 23@2x

Same screen on dev3

CleanShot 2024-10-01 at 11  27 32@2x

Why is there a discrepancy with the extra orders with indefinite durations with this PR vs on dev3?

@jwnasambu
Copy link
Contributor Author

Why is there a discrepancy with the extra orders with indefinite durations with this PR vs on dev3?

@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.

@denniskigen
Copy link
Member

I wouldn't expect to see discontinued medications in the active medications list:

CleanShot 2024-10-02 at 10  35 02@2x

@jwnasambu jwnasambu marked this pull request as ready for review October 29, 2024 11:52
@jwnasambu
Copy link
Contributor Author

jwnasambu commented Oct 29, 2024

@denniskigen I have fixed all proposed changes. Kindly feel free to review my PR at your convenient, please.

@jwnasambu
Copy link
Contributor Author

@denniskigen Kindly feel free to review the proposed changes, please!

@jwnasambu
Copy link
Contributor Author

@denniskigen thanks for the guidance and patience. What appeared to be impossible is now fixed. Kindly feel free to request any changes.

Copy link
Member

@denniskigen denniskigen left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks, @jwnasambu!

@denniskigen denniskigen changed the title (feat) O3-2825: Add "Discontinued" label for discontinued medications (feat) O3-2825: Flag discontinued medications with a tag Nov 1, 2024
@denniskigen denniskigen merged commit 812fff5 into openmrs:main Nov 1, 2024
6 checks passed
senthil-athiban pushed a commit to senthil-athiban/openmrs-esm-patient-chart that referenced this pull request Nov 19, 2024
* (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>
@denniskigen denniskigen mentioned this pull request Dec 17, 2024
3 tasks
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