-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
fix(lab): In New lab request make the visit field required #2552
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/hospitalrun/hospitalrun-frontend/8hgo1k2s2 |
Could you please sign our CLA? Thank you https://cla.js.foundation/HospitalRun/hospitalrun-frontend?pullRequest=2552 |
I have signed the CLA |
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 opened a new session in another chrome instance and I can see the visit option, which is not required, which i guess if why this bug occurs. So if you make the visit required then the issue should be resolved.
Looking good @SamuelQZQ I can see we are no longer crashing if there is no visit specified, however since the visit is required for each lab request we need to make the visit field required as it is on the imaging request.
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 @SamuelQZQ
This is now behaving the same as the Request Imaging. I did notice however that Request Imaging (like this latest change) does not prevent saving when visit is not selected, even though it shows visit as required.
Will create separate issues for these though unless you want to deal with the Lab issue in this PR? If you prefer we work on it in a separate issue that's also alright, I can go ahead and approve this one so we can create the new issue?
This somewhat relates to my PR #2555 to make sure |
@blestab I prefer to work on it in a separate issue. Let's complete this one. I will test more carefully in future work. |
Awesome! thanks @SamuelQZQ @tehkapa this one now looks good. |
Yeah just noticed that. I have since created a separate issue for enforcing the 'required visit' behavior |
Fixes #2551 .
Changes proposed in this pull request:
NewLabRequest
use the exact same method to solve thenull
visit issue.NewImagingRequest.tsx
line65as Option[]
at line 57. So that the type of the variablevisits
is not right. It should beOption[] | null
. Maybe we should do some refactor inNewImagingRequest.tsx
andNewLabRequest.tsx
to fix this wrong type. Otherwise, it may lead to other bugs in the future.