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

5648 prescriptions directions section #6362

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

aimee-mcneil-melville
Copy link
Contributor

Fixes #5648

👩🏻‍💻 What does this PR do?

Add inputs to Prescription Line Edit Form -> Description

This form now consists of:
Abbreviation Input

  • recognises abbreviations and matches them to an expanded direction
  • the user can enter multiple words (determined by a space) which can be a mix or abbreviations and non abbreviations
  • populates the Directions field with expanded directions and unmatched words/characters, in the same order as entered
  • abbreviations are not case sensitive, unmatched words remain in the case they are entered in
  • text remains after save (tab or click elsewhere) can be added to, which will continue adding to the direction

Default Input

  • a dropdown where pre defined directions can be selected from a list to go into the Directions field
  • there is no default - the user must open the dropdown and choose one
  • a selection overwrites any existing direction
  • sorted by priority (ascending)

Directions Input

  • field that receives data from the other fields, and a user can also type in directly
  • saves the direction to the database

A test file has also been created for the abbreviation handler

Screenshot 2025-01-31 at 10 35 14 AM Screenshot 2025-01-31 at 10 34 30 AM

💌 Any notes for the reviewer?

Form alignment is slightly off and top row fields are smaller than design. Could do with another pass for styling improvements

🧪 Testing

  • Go to Prescriptions -> New Prescription -> Search for a Patient

  • Add Item -> Choose any item and quantity

  • In the abbreviations field, type in some abbreviations, and include other words as well. (see below for current mock data - not hooked up to database yet)

  • EG: TAKE One -> output is: TAKE 1 per day in the AM

  • Tab or click out of the field, see the abbreviation data remain and expanded directions appear in the directions field

  • Abbreviations are not case sensitive, and anything not recognised as an abbreviation will remain in the original case

  • Select a direction from the dropdown - see that this replaces everything in the directions

  • Edit the directions field directly

  • Go to another screen and navigate back to the same prescription - see that the direction is saved

-[ ] Automated tests will pass

Configured abbreviations:
Type: One -> Result: 1 per day in the AM
Type: Two -> Result: 2 per Day
Type: 3_5 -> Result: 3 1/2 per day

📃 Documentation

  • Part of an epic: documentation will be completed for the feature as a whole
  • No documentation required: no user facing changes or a bug fix which isn't a change in behaviour
  • These areas should be updated or checked:
    1.
    2.

Copy link

github-actions bot commented Jan 30, 2025

Bundle size difference

Comparing this PR to main

Old size New size Diff
5.28 MB 5.28 MB 1.22 KB (0.02%)

@lache-melvin lache-melvin self-assigned this Feb 2, 2025
Copy link
Contributor

@lache-melvin lache-melvin left a comment

Choose a reason for hiding this comment

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

Looking great! Requested a few little things, mostly want to ensure disabled when disabled, and fix the state error 🙏

if (!abbreviation) return;
3_5;
const note = getPrescriptionDirections(abbreviation, options);
updateNotes(note);
Copy link
Contributor

Choose a reason for hiding this comment

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

Possible idea: could clear default option selection when saving abbreviation, and vice versa... maybe clear both when manually typing? Save situations like this:

Screenshot 2025-02-03 at 11 20 29 AM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have set it so that when setting the abbreviation the default selection will clear and vice versa.. For the Directions, are there any pros or cons to the relevant abbreviation or default remaining? Particularly for the abbreviations, the user can go back and add more if they exit too early, if it clears they will need to start them again

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

Successfully merging this pull request may close these issues.

Prescription: Item Edit : Directions Section
2 participants