-
Notifications
You must be signed in to change notification settings - Fork 242
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-4136: Move lab-results components From esm-patient-orders-app To esm-patient-tests-app #2091
base: main
Are you sure you want to change the base?
Conversation
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, @Twiineenock. I’ve left some feedback.
packages/esm-patient-tests-app/src/lab-results/lab-results-form.test.tsx
Outdated
Show resolved
Hide resolved
import { type OpenmrsResource, type Visit } from '@openmrs/esm-framework'; | ||
import { type Order } from '@openmrs/esm-patient-common-lib'; | ||
|
||
export interface Encounter { |
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'm inclined to say we should add these instead to src/types/index.ts
Code looks good to me with the one caveat I mentioned. @ibacher could you just confirm that this work covers the extent of what you'd imagined with O3-4136? It really just moves the lab results entry workspace. |
Couple of quick comments:
|
@@ -0,0 +1,3 @@ | |||
export * from './lab.resource'; | |||
export * from './types/encounter'; | |||
export * from './types/order'; |
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.
nit:
export * from './types/order'; | |
export * from './types/order'; | |
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.
See this is, to me, the thing that should not exist, a shared reference to "lab orders"
@@ -0,0 +1,16 @@ | |||
import { type Order } from '@openmrs/esm-patient-common-lib'; | |||
|
|||
export interface PatientMedicationFetchResponse { |
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.
Why is this type in /lab-resource/types
. It seems like it definitely belongs somewhere else.
export interface OrderDiscontinuationPayload { | ||
previousOrder: string; | ||
type: string; | ||
action: string; |
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 feel like order action is a restricted (enum) type we already have defined. Please re-use that.
encounter: string; | ||
patient: string; | ||
concept: string; | ||
orderer: { display: string; person: { display: string }; uuid: string }; |
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.
Is this the result we get back or the type for the message we send? Display strings should never be sent to the backend under any circumstances.
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 , its the message we send! Should we get rid of this orderer: { display: string; person: { display: string }; uuid: string };
prop and all its instances in this context?
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.
It should hold the uuid
of the current practitioner for the user placing the order.
previousOrder: string; | ||
type: string; | ||
action: string; | ||
careSetting: string; |
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, also, could be more tightly-bound.
@@ -1,5 +1,5 @@ | |||
import { z } from 'zod'; | |||
import { type LabOrderConcept, useOrderConceptByUuid } from './lab-results.resource'; | |||
import { type LabOrderConcept, useOrderConceptByUuid } from '@openmrs/esm-patient-common-lib'; |
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 is probably minor, but do we really need a type for the concept for a lab order? That seems... decadent.
"indication": "Indication", | ||
"launchOrderBasket": "Launch order basket", | ||
"loading": "Loading", | ||
"loadingInitialValues": "Loading initial values", | ||
"loadingTestDetails": "Loading test details", |
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.
In this case, where we're moving strings between packages, it is important that we retain the existing translations in non-English languages. Unfortunately, the only way I know to do that is some tedious copy-and-paste work, but this would be the rare instance were manually updating the translation files is for the best.
@Twiineenock is it clear to you how to move forward with this? |
@brandones , a lot was merged in since my first commit, I am making changes locally and pushing soon. |
a2dc87e
to
938572d
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.
Hi @ibacher and @brandones,
What are your thoughts on setting up translations in the esm-patient-common-lib
? I recently added a file with translations.
Requirements
Summary
The
esm-patient-orders-app
should be limited to handling generic order-management functionalities. All laboratory-specific components and features should be contained within theesm-patient-tests-app
(see)Screenshots
Related Issue
https://openmrs.atlassian.net/browse/O3-4136
Other
After the move!
lab-results.webm