-
Notifications
You must be signed in to change notification settings - Fork 230
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(feat) HIE-9: Add MPI workflows to OpenMRS frontend (#1313)
* (feat) HIE-9: Add MPI workflows to OpenMRS frontend * Fix tests * Address comments * Add unit test * Fix failing test * Minor fixes * Add feature flag * Move feature flag definition to routes * Minor fix * Move logic to patient search work space * Fix lint issues post-rebase --------- Co-authored-by: Dennis Kigen <[email protected]>
- Loading branch information
1 parent
fc5c77b
commit e009969
Showing
24 changed files
with
587 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
packages/esm-patient-registration-app/src/patient-registration/mpi/mpi-patient.resource.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { fhirBaseUrl, openmrsFetch } from '@openmrs/esm-framework'; | ||
import useSWR from 'swr'; | ||
|
||
export function useMpiPatient(patientId: string) { | ||
const url = `${fhirBaseUrl}/Patient/${patientId}/$cr`; | ||
|
||
const { | ||
data: patient, | ||
error: error, | ||
isLoading: isLoading, | ||
} = useSWR<{ data: fhir.Patient }, Error>(url, openmrsFetch); | ||
|
||
return { | ||
isLoading, | ||
patient, | ||
error: error, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.