-
Notifications
You must be signed in to change notification settings - Fork 248
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-2430: User should be able to look up frequency in dropdown by abbreviation #1767
Conversation
Hello @brandones, could you kindly review this Pull Request? |
Thank you for your work on this, @piyushmishra1416 ! Unfortunately, I think this ticket is much more non-trivial than I expected. I don't think we want to hard-code the frequencies, if we can avoid it. Ideally we would want to pull the abbreviations from the short names of the frequency concepts. These concepts right now are obtained using the Requesting support from @denniskigen, @ibacher, or @mogoodrich. If it's too much of a pain I say we just hard-code the abbreviations (though we'll need to make it more robust to non-default metadata). |
Thanks @brandones I agree we want to avoid hardcoding. What do we need beyond uuid and display? Can we build the order around uuid rather than abbrievations (sorry if the answer is obvious, I haven't dug too deeply into the code yet) |
@mogoodrich The thing we would need besides uuid and display would be the concept short names, which would be the actual abbreviations. The idea of this ticket is that we want to make it so the user can type an abbreviation into the input box and it will select the correct frequency concept. We do indeed build the order using the uuids. |
Seems doable without even hardcoding the UUIDs per se, just changing how we load the order configuration to something like: @brandones The short name isn't always the correct thing. For example, the short name for twice daily is "BD". |
Thanks so much @ibacher !
That's... odd. Should we forge ahead, and consider adding BID as a short name in the twice daily concept ? |
I mean, it makes sense to me. We probably need to talk to Andy about this, since I think we're just using a CIEL concept. |
@piyushmishra1416 Is it clear to you how to move forward with this, and will you move it forward? |
I am on this now @brandones. I was unable to fetch the short names from the backend. I was trying to work around this URL: |
We're you able to fetch the order frequency short names from the |
Yeah sorry for the lack of response from my end; this is not my area of expertise. Perhaps @mogoodrich would know how to get the |
Yeah. Some extra context: |
Yes @denniskigen, I was getting the short names. |
I have updated the PR. Please review it @denniskigen @brandones. Below is the attached video of the functionality. feature.mov |
export interface CommonConfigProps { | ||
uuid: string; | ||
display: string; | ||
concept?: { | ||
names: Names[]; | ||
}; // |
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.
}; // | |
}; |
@@ -34,7 +41,7 @@ export function useOrderConfig(): { | |||
}; | |||
} { | |||
const { data, error, isLoading, isValidating } = useSWRImmutable<{ data: OrderConfig }, Error>( | |||
`${restBaseUrl}/orderentryconfig`, | |||
`${restBaseUrl}/orderentryconfig?v=full`, |
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.
Were you not able to get it working with the custom format @piyushmishra1416 ? If not, please report the request payload size difference between the old call and the new one.
Fetching the data through this URL
What would be the correct approach to proceed from here @brandones ? |
Hmm, that is annoying. And that's a pretty big payload for |
What about using I'm inclined to think that this should be reported as an issue in the backend. The problem is that only the |
Should I create a ticket for this @ibacher? |
Yes, that's what I meant. It's a weird endpoint, so maybe there's a principled way to deal with this. |
In the meantime, can we do this for this PR so we can close it?
|
Hello @brandones, can you please review this PR? |
packages/esm-patient-medications-app/src/add-drug-order/drug-order-form.component.tsx
Outdated
Show resolved
Hide resolved
Hello @ibacher, I fixed the changes could you please review the code? |
Hello @brandones @ibacher @denniskigen, could you please review this PR? |
() => (menu) => { | ||
return menu?.item?.names?.some((abbr) => abbr.toLowerCase().includes(menu?.inputValue?.toLowerCase())); | ||
}, | ||
[], |
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.
Since this is wrapping a function, its preferable to use useCallback()
instead of useMemo()
.
I'd probably also do something like:
menu?.inputValue?.length ? menu.item?.names?.some((abbr) => abbr.toLowerCase().includes(menu.inputValue.toLowerCase())) : menu.item?.names ?? [];
And the complexity of that I think points to the fact that this shouldn't be a one-liner.
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.
Thanks!
Yes!!! So glad to see this having made it across the finish line. I want to highlight that while often it's a bad sign if PRs get as old as this one, I think this is a clear exception— @piyushmishra1416 I really appreciate your responsiveness and collaborative effort as we figured out how to fix this one. That quick turnaround time makes a world of difference. Great work, much appreciated. |
Thank you so much @brandones for your kind words and recognition. It means a lot. |
I'm so happy that we have finalized this PR. It was a great team effort, and your constant guidance and support on this PR was invaluable. It was filled with lots of learning. Thanks a ton, @ibacher, @denniskigen, and @brandones for all your help and support. |
…by abbreviation (openmrs#1767) Co-authored-by: Dennis Kigen <[email protected]> Co-authored-by: Ian <[email protected]>
* (feat) O3-3156: Submitting the start visit form should mutate appointments (#1825) * (fix) O3-2852: Fix the viewport size of the Start Visit form on tablet (#1765) * Overlapping issue fixed in visit-form * Make viewport height responsive - different values for desktop and tablet --------- Co-authored-by: Mutesasira Moses <[email protected]> Co-authored-by: Dennis Kigen <[email protected]> * (refactor) O3-2626: Reuse useAllowedFileExtensions hook from Common Lib (#1827) (refactor) Reuse allowedFileExtensions hook from Common Lib * (feat) O3-3158: Conditionally render Patient Header in the Start Visit form (#1823) * (feat) O3-3158: Visit Form should support (optionally) rendering Patient Header * (feat) O3-3158: Visit Form should support (optionally) rendering Patient Header --------- Co-authored-by: Dennis Kigen <[email protected]> * (chore) Bump form-engine lib (#1828) Bump form-engine lib * (chore) Bump form-engine lib (#1829) Bump form-engine lib * (fix) Widen range to detect "current" data entry * (fix) O3-3158: Follow-up commit fixing patientUuid sometimes undefined (#1831) * (feat) O3 3128: Add extension slots to lab and drug order forms (#1818) * (feat) Add slots to labs and drug form * O3-3128 (feat) Enhance lab, orders and dispensing form with addition slot * Fixup --------- Co-authored-by: Dennis Kigen <[email protected]> * (chore) Bump RFE version (#1833) * Bump RFE version * Update to next * (fix) O3-3196: Fix diagnoses tags display on tablet (#1834) * (fix) O3-3195: Fix rendering logic for the weight tile (#1835) * (fix) return encounter type uuid from encounter type object (#1836) return uuid from encounter type object * (chore) Bump React form engine and yarn (#1837) * (chore) Release v8.0.0 (#1839) * (feat) O3-2430: User should be able to look up frequency in dropdown by abbreviation (#1767) Co-authored-by: Dennis Kigen <[email protected]> Co-authored-by: Ian <[email protected]> * (chore) Release v8.0.1 (#1841) Co-authored-by: Dennis Kigen <[email protected]> * (chore) Bump react and related types (#1842) * (chore) Bump react and related types * Fixup * Bump test deps to remove warnings * (fix) O3-3158: Restore abortControllers * Revert "(fix) O3-3158: Restore abortControllers" This reverts commit 0895e27. * (fix) O3-3158: Restore abortControllers (#1843) * (chore) Bump react form engine * (fix) O3-3175: Remove Breadcrumbs menu from Patient Chart (#1832) * (fix)- O3-3175 Remove Breadcrumbs * Remove translation strings * Remove more occurrences of breadcrumbs --------- Co-authored-by: Dennis Kigen <[email protected]> * (feat) Update custom representation to match required properties for encounter observation (#1845) * Make attachment upload modal span full-width * (chore) Bump react form engine (#1846) * (feat) O3-2626: Add the ability to upload multiple images in the Visit Note form (#1826) Co-authored-by: Dennis Kigen <[email protected]> * (fix) O3-3284: Display correctly formatted patient name throughout patient chart apps (#1849) * Display formatted patient name in visit-header and patient-details-tile components * Display formatted patient name in patient-banner component. * Display formatted patient name in esm-patient-labs-app * Display formatted patient name in esm-patient-medications-app * Display formatted patient name in esm-patient-orders-app * Display formatted patient name in esm-patient-vitals-app * Bump core tooling * (feat) O3-3165: Add confirmation modal when deleting repeat question (#1840) * (feat): Add confirmation modal when deleting repeat question * (refactor): register modal as extension * (refactor): change modal registration name * Bump form engine and core tooling --------- Co-authored-by: Dennis Kigen <[email protected]> --------- Co-authored-by: Mark Goodrich <[email protected]> Co-authored-by: Madhu Lokesh <[email protected]> Co-authored-by: Mutesasira Moses <[email protected]> Co-authored-by: Dennis Kigen <[email protected]> Co-authored-by: Samuel Male <[email protected]> Co-authored-by: Ian <[email protected]> Co-authored-by: Ian <[email protected]> Co-authored-by: Donald Kibet <[email protected]> Co-authored-by: Jamie Arodi <[email protected]> Co-authored-by: Thembo Jonathan <[email protected]> Co-authored-by: Piyush Mishra <[email protected]> Co-authored-by: Vineet Sharma <[email protected]> Co-authored-by: Bhargav kodali <[email protected]> Co-authored-by: jwnasambu <[email protected]> Co-authored-by: Gavin Falconer <[email protected]> Co-authored-by: Nethmi Rodrigo <[email protected]>
…by abbreviation (openmrs#1767) Co-authored-by: Dennis Kigen <[email protected]> Co-authored-by: Ian <[email protected]>
Requirements
Summary
The medication frequency dropdown menu displays options such as "three times per day." With this update, users can now input "tid" in the dropdown menu and have "three times per day" as an option.
Screenshots
Screen.Recording.2024-03-31.at.11.48.45.AM.mov
Related Issue
https://issues.openmrs.org/browse/O3-2430
Other