-
Notifications
You must be signed in to change notification settings - Fork 228
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-4009: Display stock and price information upon ordering #2028
base: main
Are you sure you want to change the base?
Conversation
a2c05fd
to
46990a4
Compare
Size Change: +682 B (0%) Total Size: 15.9 MB ℹ️ View Unchanged
|
@usamaidrsk, showing the price and stock directly on the order search screen will likely make an enormous amount of calls to the backend, right? Or is it simply one call? If so, then we probably want to only implement stock and price visibility after having selected a given drug. |
packages/esm-patient-labs-app/src/lab-orders/add-lab-order/test-type-search.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-labs-app/src/lab-orders/add-lab-order/test-type-search.scss
Outdated
Show resolved
Hide resolved
...ient-labs-app/src/lab-orders/lab-order-basket-panel/lab-order-basket-item-tile.component.tsx
Outdated
Show resolved
Hide resolved
...esm-patient-medications-app/src/drug-order-basket-panel/order-basket-item-tile.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-medications-app/src/drug-order-basket-panel/order-basket-item-tile.scss
Outdated
Show resolved
Hide resolved
packages/esm-patient-orders-app/src/components/order-price-details.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-orders-app/src/components/order-price-details.scss
Outdated
Show resolved
Hide resolved
packages/esm-patient-orders-app/src/components/order-stock-details.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-orders-app/src/components/order-stock-details.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-orders-app/src/components/order-stock-details.component.tsx
Outdated
Show resolved
Hide resolved
Thanks @rbuisson! |
@usamaidrsk , unless I'm mistaken, I don't see any test. |
@usamaidrsk is this configurable. ?? |
Hello @slubwama , it's not currently configurable. However, if you’d like it to be, could you clarify the specific aspects you'd like to be configurable? |
It's great to see a feature like this! When we built our local EMR many years ago, we had a "billboard" at the top of each order form (e.g., under the orderable name) that included helpful details that could be tweaked by the implementation (e.g., "The P&T committee recommends not giving doses over 10 mg in children"). This "billboard text" space was where we put estimated pricing information and it would be a good place for stock status as well. The benefit is having the information for the user before the item is added to the cart. Maybe something to consider for future iterations. |
Users will like having it this way. |
2358271
to
7a47e5e
Compare
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.
Great work @usamaidrsk!
A few suggestions before merging this PR.
Thanks!
packages/esm-patient-orders-app/src/components/order-price-details.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-orders-app/src/components/order-price-details.scss
Outdated
Show resolved
Hide resolved
packages/esm-patient-orders-app/src/components/order-stock-details.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-orders-app/src/components/order-stock-details.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-orders-app/src/components/order-stock-details.scss
Outdated
Show resolved
Hide resolved
packages/esm-patient-orders-app/src/components/order-stock-details.scss
Outdated
Show resolved
Hide resolved
262005e
to
493ef5f
Compare
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.
Good start, @usamaidrsk. I've left some suggestions. Feel free to ignore the ones prefix with Nit
.
...esm-patient-medications-app/src/drug-order-basket-panel/order-basket-item-tile.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-orders-app/src/components/order-price-details.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-orders-app/src/components/order-price-details.scss
Outdated
Show resolved
Hide resolved
packages/esm-patient-orders-app/src/components/order-price-details.test.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-orders-app/src/components/order-price-details.test.tsx
Show resolved
Hide resolved
packages/esm-patient-orders-app/src/hooks/useOrderStockInfo.test.ts
Outdated
Show resolved
Hide resolved
...ent-tests-app/src/lab-orders/lab-order-basket-panel/lab-order-basket-item-tile.component.tsx
Outdated
Show resolved
Hide resolved
...ent-tests-app/src/lab-orders/lab-order-basket-panel/lab-order-basket-item-tile.component.tsx
Show resolved
Hide resolved
packages/esm-patient-medications-app/src/drug-order-basket-panel/order-basket-item-tile.scss
Outdated
Show resolved
Hide resolved
.../esm-patient-tests-app/src/lab-orders/lab-order-basket-panel/lab-order-basket-item-tile.scss
Outdated
Show resolved
Hide resolved
packages/esm-patient-orders-app/src/components/order-stock-details.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-orders-app/src/components/order-stock-details.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-orders-app/src/components/order-price-details.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-orders-app/src/hooks/useIsBackendModuleInstalled.tsx
Outdated
Show resolved
Hide resolved
import { useIsBackendModuleInstalled } from './useIsBackendModuleInstalled'; | ||
|
||
export const useOrderPrice = (orderItemUuid: string) => { | ||
const { isInstalled, isLoading: isCheckingModules } = useIsBackendModuleInstalled(['fhirproxy', 'billing']); |
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.
const { isInstalled, isLoading: isCheckingModules } = useIsBackendModuleInstalled(['fhirproxy', 'billing']); | |
const { isInstalled, isLoading: isCheckingModules } = useAreBackendModuleInstalled(['fhirproxy', 'billing']); |
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.
@ibacher we'd still need to make sure these are added to the routes.json
's backendDependencies
, right?
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.
I had initially added them, @vasharma05 pointed out that since this is a major use-case for all user, it would not be good to always have a snackbar popup for them that some modules are missing
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.
@usamaidrsk I should clarify - I meant specifying them as optionalBackendDependencies in the route registries (see openmrs/openmrs-esm-core#1015). Per @ibacher, optionalBackendDependencies
don't get reported as missing - so that should not be a concern. The upside of doing that is that you get to opt in to future functionality that makes it easier to enable optional features in an application without the overhead of configuration boilerplate.
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.
Got it now @denniskigen ,
Thanks for clarifying, let me update that.
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.
I have added that @denniskigen
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.
Via an existing commit? I don't see it in the diff...
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.
The push didn't go through, I have just updated it now.
packages/esm-patient-orders-app/src/hooks/useIsBackendModuleInstalled.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-orders-app/src/hooks/useOrderPrice.test.tsx
Outdated
Show resolved
Hide resolved
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.
This file doesn't contain any JSX, so it should use the .ts
suffix instead.
packages/esm-patient-orders-app/src/hooks/useIsBackendModuleInstalled.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-orders-app/src/hooks/useIsBackendModuleInstalled.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-orders-app/src/components/order-price-details.component.tsx
Outdated
Show resolved
Hide resolved
…reBackendModuleInstalled.tsx
c15e806
to
17feaf3
Compare
* (chore) Bump RFE version for QA * bump rfe to the latest version --------- Co-authored-by: Usama Idriss Kakumba <[email protected]>
Bump form engine version
Co-authored-by: OpenMRS Bot <[email protected]>
…ut on the Test Order Form (#2111) * feat: add config to show lab reference number input * change to showLabReferenceNumberField Co-authored-by: Dennis Kigen <[email protected]> * update config description Co-authored-by: Dennis Kigen <[email protected]> * fix: fix build --------- Co-authored-by: Dennis Kigen <[email protected]>
@usamaidrsk , the stock information should not show for services (since, those are not stockable products). |
Not really @rbuisson |
@corneliouzbett , is this intended ☝🏻 ? |
No, that's not right. |
Well, instead of even returning |
That's the ideal behavior and we should implement it. We just need to figure out smart way to differentiate stockable products and those that are not in the backend. |
Requirements
Summary
This PR introduces the
order-item-additional-info-slot
to enhance the display of order information in the patient medications app and labs app. The slot is implemented on the order-basket tiles (for drugs and lab orders). Additionally, two new components from theesm-patient-orders-app
are added to populate this slot:OrderPriceDetailsComponent
andOrderStockDetailsComponent
.Screenshots
Related Issue
https://openmrs.atlassian.net/browse/O3-4009
Other