-
Notifications
You must be signed in to change notification settings - Fork 240
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-4200 Make visit form usable in other apps #2134
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.
I'll defer to other on the specifics of the code, but your description sounds great, thanks so much for taking the time to clean this up.
I did have one question, and noticed that tests were failing.
name="visit-form-queue-slot" | ||
patientUuid={patientUuid} | ||
visitFormOpenedFrom={openedFrom} | ||
setOnVisitCreatedOrUpdatedCallbacks={setOnVisitCreatedOrUpdatedCallbacks} |
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.
More a question than a request for a change... why do the queues and appointments have specific extension slots, rather than a single "visit-form-extension-slot" that both queues and appointments insert into? As we have it now, if another ESM wanted to insert it's own functionality into the visit form, would it have to add another extension slot to the form?
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.
Yeah, with this change, those 2 extensions look more similar than before. I'm keeping it as is because where the extensions appear are different (the appointments extension is near the top, close to where the visit start time fields are, vs the queues extension is near the bottom). It might be possible to slot them into one single slot (and keeping the existing ordering) if we slice up the visit form further so that even the visit form fields are extensions themselves , but I think that's a pretty drastic change.
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 don't love that the slots are named after specific apps ... It kind of violates the idea that slots are just a location on a screen that extensions can appear. I'm kind of ok with having multiple slots if it makes sense, e.g., there are two places on a screen we want extensions to appear.
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.
Ok, I changed the slot named to visit-form-top-slot
and visit-form-bottom-slot
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 @chibongho and @ibacher !
name="visit-form-queue-slot" | ||
patientUuid={patientUuid} | ||
visitFormOpenedFrom={openedFrom} | ||
setOnVisitCreatedOrUpdatedCallbacks={setOnVisitCreatedOrUpdatedCallbacks} |
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 don't love that the slots are named after specific apps ... It kind of violates the idea that slots are just a location on a screen that extensions can appear. I'm kind of ok with having multiple slots if it makes sense, e.g., there are two places on a screen we want extensions to appear.
Size Change: -301 kB (-1.85%) Total Size: 16 MB
ℹ️ View Unchanged
|
Thanks so much @chibongho for standardizing the UX. It makes a lot of sense to me. I know this may sound off at this point but do you think we can provide better wordings for the visit attributes? I know most users will not even know what visit attributes mean. |
"Additional visit information" maybe? |
@ojwanganto Sure. Easy change. |
Requirements
Summary
This PR refactors the patient chart visit form for it to be re-usable in different apps (like appointments and queues), without needing logic specific to those apps in the visit form. See corresponding changes in esm-patient-management here. While some changes are opinionated, there is no breaking change.
Despite having extension slots for queues and appointments UIs (which can be turned on via config), the visit form still contains code related to submitting queue entry and checking in an appointment. This change provides a way for those extensions to supply their own callbacks to run after a visit has been created / updated. This allows us to decouple the visit form from any unrelated logic.
Notes:
showServiceQueueFields
andshowUpcomingAppointments
to specify whether those corresponding extensions should show, but now, the code to actually check for those values live within the extensions themselves. Arguably, we should make a breaking change to have those configs be within their respective apps.extra-visit-attribute-slot
, currently used by the Billing app, could benefit from a similar refactoring as other extension slots to supply its own onVisitCreatedOrUpdated callback, but I'm leaving it untouched for now as I'm not that familiar with that code base.Screenshots
The visit form, when opened from the queues app:
On submit:
Related Issue
https://issues.openmrs.org/browse/O3-4200
Other