-
Notifications
You must be signed in to change notification settings - Fork 248
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(refactor) Refactor Mark patient deceased form and Mark patient alive…
… modal (#1872) * (refactor) Refactor Mark patient deceased form and Mark patient alive modal * Fixup * Show cause of death in banner tag
- Loading branch information
1 parent
0819080
commit 9380680
Showing
16 changed files
with
453 additions
and
430 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
28 changes: 28 additions & 0 deletions
28
packages/esm-patient-banner-app/src/banner-tags/useCauseOfDeath.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,28 @@ | ||
import { openmrsFetch } from '@openmrs/esm-framework'; | ||
import { useMemo } from 'react'; | ||
import useSWR from 'swr'; | ||
|
||
interface CauseOfDeathResponse { | ||
data: { | ||
causeOfDeath: { | ||
display: string; | ||
}; | ||
}; | ||
} | ||
|
||
export function useCauseOfDeath(patientUuid: string) { | ||
const customRepresentation = 'custom:(causeOfDeath:(display)'; | ||
const url = `/ws/rest/v1/person/${patientUuid}?v=${customRepresentation}`; | ||
|
||
const { data, error } = useSWR<CauseOfDeathResponse, Error>(patientUuid ? url : null, openmrsFetch); | ||
|
||
const results = useMemo( | ||
() => ({ | ||
causeOfDeath: data?.data?.causeOfDeath?.display, | ||
error, | ||
}), | ||
[data?.data?.causeOfDeath, error], | ||
); | ||
|
||
return results; | ||
} |
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
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
86 changes: 0 additions & 86 deletions
86
packages/esm-patient-chart-app/src/deceased/base-concept-answer.component.tsx
This file was deleted.
Oops, something went wrong.
36 changes: 0 additions & 36 deletions
36
packages/esm-patient-chart-app/src/deceased/confirmation-dialog.component.tsx
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.