-
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
(refactor) Various tweaks to the MPI workflow #1374
Conversation
Size Change: +418 B (+0.01%) Total Size: 6.68 MB ℹ️ View Unchanged
|
error: error, | ||
isLoading: isLoading, | ||
} = useSWR<{ data: fhir.Patient }, Error>(url, openmrsFetch); | ||
const { data, error, isLoading } = useSWR<{ data: fhir.Patient }, Error>(url, openmrsFetch); |
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 main change here is that instead of returning the whole patient object and requiring consumers of the hook to use patient.data
to access the actual FHIR Patient resource, we unwrap the FHIR patient resource directly and return it as the mpiPatient
variable.
fieldConfigurations.identifier, | ||
fieldConfigurations.phone.personAttributeUuid, | ||
initialFormValues, | ||
isLoadingMpiPatient, | ||
mpiPatient, |
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 adds missing dependencies to the effect hook. I don't know why the exhaustive-deps
eslint rule is not enabled for this repo. It should be so we can catch subtle bugs related to violations of rules of hooks.
</Routes> | ||
</MemoryRouter>, | ||
); | ||
renderWithRouter(<PatientSearchButton />); |
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.
Refactored to use the custom renderWithRouter wrapper.
237d809
to
9d618a6
Compare
Will reopen once #1313 gets in |
Requirements
Summary
This PR provides several tweaks to support #1313.
Screenshots
Both adapted to align with this design.
Empty state from search with button to trigger MPI lookup
Error state tile for MPI lookup
Related Issue
Other