-
Notifications
You must be signed in to change notification settings - Fork 234
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
(fix) - O3-4017 - Ward App - ward view should refresh data after actions on patients #1327
Conversation
Size Change: +1.02 kB (+0.02%) Total Size: 6.1 MB ℹ️ View Unchanged
|
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.
LGTM, thanks @chibongho !
@@ -20,7 +19,8 @@ export default function PatientDischargeWorkspace(props: WardPatientWorkspacePro | |||
const { emrConfiguration, isLoadingEmrConfiguration, errorFetchingEmrConfiguration } = useEmrConfiguration(); | |||
const wardGroupingDetails = useAppContext<WardPatientGroupDetails>('ward-patients-group'); | |||
const { mutate: mutateAdmissionLocation } = wardGroupingDetails?.admissionLocationResponse ?? {}; | |||
const { mutate: mutateInpatientRequest } = useInpatientRequest(); | |||
const { mutate: mutateInpatientRequest } = wardGroupingDetails?.inpatientRequestResponse ?? {}; | |||
const { mutate: mutateInpatientAdmission } = wardGroupingDetails?.inpatientAdmissionResponse ?? {}; |
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.
Just curious, were these functions just not properly getting pulled in before?
@chibongho do we need to ping others for a review of this? |
Oh shoot... forgot about this PR. I'll just merge it in. |
Requirements
Summary
This PR fixes the following:
The root cause is mostly from not calling the right mutate functions after those actions. Calling the right mutate functions in most cases fixed this.
I also refactored most places to not call
inpatientRequests
,inpatientAdmission
andadmissionLocation
endpoints directly, and instead rely on the results of those calls already stored inuseAppContext()
.Also cleaned up some of our unit tests to have consolidate mocked hooks.
Screenshots
Related Issue
https://openmrs.atlassian.net/browse/O3-4017
Other