@kenyaemr/esm-ward-app 8.1.2-pre.214 → 8.5.1-pre.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +25 -35
- package/README.md +38 -0
- package/dist/1119.js +1 -0
- package/dist/1197.js +1 -0
- package/dist/1663.js +1 -0
- package/dist/1663.js.map +1 -0
- package/dist/1741.js +1 -0
- package/dist/1741.js.map +1 -0
- package/dist/1776.js +1 -0
- package/dist/1776.js.map +1 -0
- package/dist/1879.js +1 -0
- package/dist/1879.js.map +1 -0
- package/dist/1899.js +1 -0
- package/dist/1899.js.map +1 -0
- package/dist/1917.js +1 -0
- package/dist/1917.js.map +1 -0
- package/dist/2146.js +1 -0
- package/dist/2372.js +1 -0
- package/dist/2372.js.map +1 -0
- package/dist/2470.js +1 -0
- package/dist/2470.js.map +1 -0
- package/dist/2537.js +1 -0
- package/dist/2537.js.map +1 -0
- package/dist/2557.js +1 -0
- package/dist/2557.js.map +1 -0
- package/dist/2690.js +1 -0
- package/dist/2728.js +2 -0
- package/dist/{372.js.LICENSE.txt → 2728.js.LICENSE.txt} +2 -2
- package/dist/2728.js.map +1 -0
- package/dist/2775.js +2 -0
- package/dist/2775.js.LICENSE.txt +59 -0
- package/dist/2775.js.map +1 -0
- package/dist/2913.js +2 -0
- package/dist/2913.js.map +1 -0
- package/dist/2932.js +1 -0
- package/dist/2932.js.map +1 -0
- package/dist/2948.js +1 -0
- package/dist/2948.js.map +1 -0
- package/dist/3099.js +1 -0
- package/dist/3161.js +2 -0
- package/dist/{649.js.LICENSE.txt → 3161.js.LICENSE.txt} +2 -2
- package/dist/3161.js.map +1 -0
- package/dist/3365.js +1 -0
- package/dist/3365.js.map +1 -0
- package/dist/3373.js +2 -0
- package/dist/3373.js.LICENSE.txt +5 -0
- package/dist/3373.js.map +1 -0
- package/dist/3399.js +1 -0
- package/dist/3399.js.map +1 -0
- package/dist/3413.js +1 -0
- package/dist/3413.js.map +1 -0
- package/dist/3423.js +1 -0
- package/dist/3423.js.map +1 -0
- package/dist/3584.js +1 -0
- package/dist/3737.js +1 -0
- package/dist/3737.js.map +1 -0
- package/dist/3982.js +1 -0
- package/dist/3982.js.map +1 -0
- package/dist/4041.js +2 -0
- package/dist/4041.js.map +1 -0
- package/dist/4055.js +1 -0
- package/dist/4132.js +1 -0
- package/dist/4300.js +1 -0
- package/dist/4335.js +1 -0
- package/dist/4430.js +2 -0
- package/dist/4430.js.LICENSE.txt +29 -0
- package/dist/4430.js.map +1 -0
- package/dist/4618.js +1 -0
- package/dist/465.js +1 -0
- package/dist/465.js.map +1 -0
- package/dist/4652.js +1 -0
- package/dist/4701.js +2 -0
- package/dist/4701.js.LICENSE.txt +9 -0
- package/dist/4701.js.map +1 -0
- package/dist/4743.js +2 -0
- package/dist/4743.js.LICENSE.txt +9 -0
- package/dist/4743.js.map +1 -0
- package/dist/4944.js +1 -0
- package/dist/5173.js +1 -0
- package/dist/5241.js +1 -0
- package/dist/5442.js +1 -0
- package/dist/5661.js +1 -0
- package/dist/6012.js +2 -0
- package/dist/6012.js.LICENSE.txt +5 -0
- package/dist/6012.js.map +1 -0
- package/dist/6022.js +1 -0
- package/dist/6468.js +1 -0
- package/dist/6679.js +1 -0
- package/dist/6840.js +1 -0
- package/dist/6859.js +1 -0
- package/dist/7097.js +1 -0
- package/dist/7159.js +1 -0
- package/dist/7179.js +2 -0
- package/dist/7179.js.LICENSE.txt +9 -0
- package/dist/7179.js.map +1 -0
- package/dist/723.js +1 -0
- package/dist/7232.js +2 -0
- package/dist/7232.js.LICENSE.txt +9 -0
- package/dist/7232.js.map +1 -0
- package/dist/7524.js +1 -0
- package/dist/7524.js.map +1 -0
- package/dist/7617.js +1 -0
- package/dist/7661.js +1 -0
- package/dist/7661.js.map +1 -0
- package/dist/7886.js +1 -0
- package/dist/7886.js.map +1 -0
- package/dist/795.js +1 -0
- package/dist/8163.js +1 -0
- package/dist/8205.js +1 -0
- package/dist/8205.js.map +1 -0
- package/dist/8317.js +2 -0
- package/dist/8317.js.LICENSE.txt +15 -0
- package/dist/8317.js.map +1 -0
- package/dist/8349.js +1 -0
- package/dist/8501.js +1 -0
- package/dist/8501.js.map +1 -0
- package/dist/8522.js +1 -0
- package/dist/8522.js.map +1 -0
- package/dist/8618.js +1 -0
- package/dist/8622.js +1 -0
- package/dist/8622.js.map +1 -0
- package/dist/89.js +1 -0
- package/dist/89.js.map +1 -0
- package/dist/890.js +1 -0
- package/dist/9045.js +1 -0
- package/dist/9045.js.map +1 -0
- package/dist/9117.js +1 -0
- package/dist/9117.js.map +1 -0
- package/dist/9214.js +1 -0
- package/dist/9538.js +1 -0
- package/dist/9569.js +1 -0
- package/dist/986.js +1 -0
- package/dist/9876.js +2 -0
- package/dist/9876.js.LICENSE.txt +9 -0
- package/dist/9876.js.map +1 -0
- package/dist/9879.js +1 -0
- package/dist/9880.js +1 -0
- package/dist/9880.js.map +1 -0
- package/dist/9895.js +1 -0
- package/dist/9900.js +1 -0
- package/dist/9913.js +1 -0
- package/dist/kenyaemr-esm-ward-app.js +1 -1
- package/dist/kenyaemr-esm-ward-app.js.buildmanifest.json +1479 -235
- package/dist/kenyaemr-esm-ward-app.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.LICENSE.txt +0 -35
- package/dist/main.js.map +1 -1
- package/dist/routes.json +1 -1
- package/mock.tsx +15 -2
- package/package.json +10 -5
- package/src/beds/{empty-bed-skeleton.tsx → empty-bed-skeleton.component.tsx} +2 -2
- package/src/config-schema.ts +48 -0
- package/src/declarations.d.ts +8 -0
- package/src/hooks/useAdmissionLocation.ts +24 -4
- package/src/hooks/useInpatientAdmission.ts +14 -10
- package/src/hooks/useInpatientAdmissionByPatients.ts +29 -0
- package/src/hooks/useInpatientRequest.ts +5 -1
- package/src/hooks/useInpatientRequestByPatients.ts +34 -0
- package/src/hooks/useIpdDischargeEncounter.ts +137 -0
- package/src/hooks/usePatientPendingOrders.ts +1 -1
- package/src/hooks/useRestPatient.ts +11 -3
- package/src/hooks/useSummaryMetrics.ts +103 -0
- package/src/hooks/useWardLocation.test.ts +1 -1
- package/src/hooks/useWardLocation.ts +18 -5
- package/src/hooks/useWardPatientGrouping.ts +63 -10
- package/src/index.ts +24 -4
- package/src/location-selector/location-selector.component.tsx +38 -5
- package/src/root.component.tsx +2 -2
- package/src/routes.json +60 -26
- package/src/types/index.ts +17 -6
- package/src/ward-patient-card/card-rows/admission-request-note-row.component.tsx +1 -1
- package/src/ward-patient-card/card-rows/coded-obs-tags-row.component.tsx +4 -4
- package/src/ward-patient-card/card-rows/mother-child-row.component.tsx +6 -6
- package/src/ward-patient-card/card-rows/pending-items-row.component.tsx +2 -3
- package/src/ward-patient-card/row-elements/{ward-patient-coded-obs-tags.tsx → ward-patient-coded-obs-tags.component.tsx} +5 -5
- package/src/ward-patient-card/row-elements/{ward-patient-header-address.tsx → ward-patient-header-address.component.tsx} +2 -2
- package/src/ward-patient-card/row-elements/{ward-patient-identifier.tsx → ward-patient-identifier.component.tsx} +7 -1
- package/src/ward-patient-card/row-elements/ward-patient-identifier.scss +3 -0
- package/src/ward-patient-card/row-elements/{ward-patient-obs.tsx → ward-patient-obs.component.tsx} +5 -5
- package/src/ward-patient-card/row-elements/{ward-patient-pending-transfer.tsx → ward-patient-pending-transfer.component.tsx} +3 -5
- package/src/ward-patient-card/row-elements/ward-patient-time-on-ward.component.tsx +73 -0
- package/src/ward-patient-card/row-elements/ward-patient-time-since-admission.component.tsx +29 -0
- package/src/ward-patient-card/ward-patient-card.component.tsx +5 -5
- package/src/ward-patient-card/ward-patient-card.scss +2 -6
- package/src/ward-patients/admitted-patients.tsx +218 -0
- package/src/ward-patients/awaiting-admission-patients.tsx +158 -0
- package/src/ward-patients/discharge-in-patients.tsx +183 -0
- package/src/ward-patients/discharge-patients.tsx +129 -0
- package/src/ward-patients/patient-cells.tsx +75 -0
- package/src/ward-patients/table-state-components.tsx +40 -0
- package/src/ward-patients/ward-patient.scss +24 -0
- package/src/ward-patients/ward-patients-table.tsx +38 -0
- package/src/ward-view/default-ward/default-ward-patient-card-header.component.tsx +8 -8
- package/src/ward-view/default-ward/default-ward-pending-patients.component.tsx +3 -3
- package/src/ward-view/default-ward/default-ward-view.component.tsx +33 -6
- package/src/ward-view/linelist-wards/Filters.tsx +25 -0
- package/src/ward-view/linelist-wards/Header.tsx +27 -0
- package/src/ward-view/linelist-wards/LineListTable.tsx +145 -0
- package/src/ward-view/linelist-wards/Metrics.tsx +21 -0
- package/src/ward-view/linelist-wards/WardPendingOutCell.tsx +15 -0
- package/src/ward-view/linelist-wards/WardsLineList.tsx +30 -0
- package/src/ward-view/linelist-wards/linelist-wards.scss +100 -0
- package/src/ward-view/materal-ward/maternal-ward-patient-card-header.component.tsx +8 -8
- package/src/ward-view/materal-ward/maternal-ward-patient-card.component.tsx +2 -2
- package/src/ward-view/materal-ward/maternal-ward-patient-card.test.tsx +1 -1
- package/src/ward-view/materal-ward/maternal-ward-pending-patients.component.tsx +1 -1
- package/src/ward-view/materal-ward/maternal-ward-view.component.tsx +4 -4
- package/src/ward-view/ward-view-content-wrapper.tsx +36 -0
- package/src/ward-view/ward-view.resource.ts +26 -8
- package/src/ward-view/ward-view.scss +15 -8
- package/src/ward-view/ward-view.test.tsx +8 -8
- package/src/ward-view/ward.component.tsx +2 -2
- package/src/ward-view-header/admission-requests-bar.component.tsx +18 -8
- package/src/ward-view-header/admission-requests-bar.test.tsx +3 -3
- package/src/ward-view-header/ward-metric.component.tsx +2 -3
- package/src/ward-workspace/admission-request-card/admission-request-card-actions.component.tsx +12 -14
- package/src/ward-workspace/admission-request-card/admission-request-card-header.component.tsx +5 -5
- package/src/ward-workspace/admission-request-card/admission-request-card.component.tsx +1 -1
- package/src/ward-workspace/admission-request-workspace/admission-requests-action-button.extension.tsx +18 -0
- package/src/ward-workspace/admission-request-workspace/admission-requests-context.ts +20 -0
- package/src/ward-workspace/admission-request-workspace/admission-requests-workspace.test.tsx +7 -6
- package/src/ward-workspace/admission-request-workspace/admission-requests.workspace.tsx +15 -25
- package/src/ward-workspace/admit-patient-button.component.tsx +41 -18
- package/src/ward-workspace/admit-patient-form-workspace/admit-patient-form.test.tsx +14 -16
- package/src/ward-workspace/admit-patient-form-workspace/admit-patient-form.workspace.tsx +2 -2
- package/src/ward-workspace/bed-selector.component.tsx +1 -1
- package/src/ward-workspace/cancel-admission-request-workspace/cancel-admission-request.test.tsx +1 -1
- package/src/ward-workspace/cancel-admission-request-workspace/cancel-admission-request.workspace.tsx +4 -6
- package/src/ward-workspace/create-admission-encounter/create-admission-encounter-action-button.extension.tsx +46 -0
- package/src/ward-workspace/create-admission-encounter/create-admission-encounter.test.tsx +241 -0
- package/src/ward-workspace/create-admission-encounter/create-admission-encounter.workspace.tsx +152 -0
- package/src/ward-workspace/kenya-emr-patient-discharge/discharge-workspace-siderail.component.tsx +23 -0
- package/src/ward-workspace/kenya-emr-patient-discharge/patient-discharge.resource.tsx +123 -0
- package/src/ward-workspace/kenya-emr-patient-discharge/patient-discharge.workspace.tsx +101 -0
- package/src/ward-workspace/patient-discharge/patient-discharge.workspace.tsx +6 -15
- package/src/ward-workspace/patient-transfer-bed-swap/{patient-transfer-request-form.component.tsx → patient-admit-or-transfer-request-form.component.tsx} +56 -37
- package/src/ward-workspace/patient-transfer-bed-swap/patient-bed-swap-form.component.tsx +13 -3
- package/src/ward-workspace/patient-transfer-bed-swap/patient-transfer-swap.workspace.tsx +11 -5
- package/src/ward-workspace/patient-transfer-request-workspace/patient-transfer-request.scss +5 -0
- package/src/ward-workspace/patient-transfer-request-workspace/patient-transfer-request.workspace.tsx +20 -6
- package/src/ward-workspace/ward-patient-notes/form/notes-form.component.tsx +2 -1
- package/src/ward-workspace/ward-patient-notes/history/note.component.tsx +3 -3
- package/src/ward.resource.ts +9 -3
- package/translations/am.json +123 -0
- package/translations/ar.json +123 -0
- package/translations/ar_SY.json +123 -0
- package/translations/bn.json +123 -0
- package/translations/de.json +123 -0
- package/translations/en.json +31 -3
- package/translations/en_US.json +123 -0
- package/translations/es.json +123 -0
- package/translations/es_MX.json +123 -0
- package/translations/fr.json +123 -0
- package/translations/he.json +123 -0
- package/translations/hi.json +123 -0
- package/translations/hi_IN.json +123 -0
- package/translations/id.json +123 -0
- package/translations/it.json +123 -0
- package/translations/ka.json +123 -0
- package/translations/km.json +123 -0
- package/translations/ku.json +123 -0
- package/translations/ky.json +123 -0
- package/translations/lg.json +123 -0
- package/translations/ne.json +123 -0
- package/translations/pl.json +123 -0
- package/translations/pt.json +123 -0
- package/translations/pt_BR.json +123 -0
- package/translations/qu.json +123 -0
- package/translations/ro_RO.json +123 -0
- package/translations/ru_RU.json +123 -0
- package/translations/si.json +123 -0
- package/translations/sw.json +123 -0
- package/translations/sw_KE.json +123 -0
- package/translations/tr.json +123 -0
- package/translations/tr_TR.json +123 -0
- package/translations/uk.json +123 -0
- package/translations/uz.json +123 -0
- package/translations/uz@Latn.json +123 -0
- package/translations/uz_UZ.json +123 -0
- package/translations/vi.json +123 -0
- package/translations/zh.json +123 -0
- package/translations/zh_CN.json +123 -0
- package/dist/109.js +0 -1
- package/dist/109.js.map +0 -1
- package/dist/124.js +0 -1
- package/dist/124.js.map +0 -1
- package/dist/125.js +0 -1
- package/dist/125.js.map +0 -1
- package/dist/126.js +0 -1
- package/dist/126.js.map +0 -1
- package/dist/130.js +0 -2
- package/dist/130.js.LICENSE.txt +0 -5
- package/dist/130.js.map +0 -1
- package/dist/146.js +0 -1
- package/dist/146.js.map +0 -1
- package/dist/15.js +0 -1
- package/dist/15.js.map +0 -1
- package/dist/325.js +0 -1
- package/dist/325.js.map +0 -1
- package/dist/348.js +0 -1
- package/dist/348.js.map +0 -1
- package/dist/362.js +0 -1
- package/dist/362.js.map +0 -1
- package/dist/372.js +0 -2
- package/dist/372.js.map +0 -1
- package/dist/443.js +0 -1
- package/dist/443.js.map +0 -1
- package/dist/471.js +0 -1
- package/dist/471.js.map +0 -1
- package/dist/481.js +0 -1
- package/dist/481.js.map +0 -1
- package/dist/53.js +0 -1
- package/dist/53.js.map +0 -1
- package/dist/559.js +0 -1
- package/dist/559.js.map +0 -1
- package/dist/574.js +0 -1
- package/dist/576.js +0 -1
- package/dist/576.js.map +0 -1
- package/dist/577.js +0 -1
- package/dist/577.js.map +0 -1
- package/dist/591.js +0 -2
- package/dist/591.js.map +0 -1
- package/dist/598.js +0 -1
- package/dist/598.js.map +0 -1
- package/dist/649.js +0 -2
- package/dist/649.js.map +0 -1
- package/dist/662.js +0 -1
- package/dist/662.js.map +0 -1
- package/dist/767.js +0 -1
- package/dist/767.js.map +0 -1
- package/dist/784.js +0 -2
- package/dist/784.js.map +0 -1
- package/dist/921.js +0 -1
- package/dist/921.js.map +0 -1
- package/dist/922.js +0 -1
- package/dist/922.js.map +0 -1
- package/dist/925.js +0 -2
- package/dist/925.js.LICENSE.txt +0 -40
- package/dist/925.js.map +0 -1
- package/dist/940.js +0 -1
- package/dist/940.js.map +0 -1
- package/dist/969.js +0 -1
- package/dist/969.js.map +0 -1
- package/dist/983.js +0 -1
- package/dist/983.js.map +0 -1
- package/package-lock.json +0 -5001
- package/src/ward-patient-card/row-elements/ward-patient-time-on-ward.tsx +0 -22
- package/src/ward-patient-card/row-elements/ward-patient-time-since-admission.tsx +0 -22
- /package/dist/{591.js.LICENSE.txt → 2913.js.LICENSE.txt} +0 -0
- /package/dist/{784.js.LICENSE.txt → 4041.js.LICENSE.txt} +0 -0
- /package/src/ward-patient-card/row-elements/{ward-patient-age.tsx → ward-patient-age.component.tsx} +0 -0
- /package/src/ward-patient-card/row-elements/{ward-patient-bed-number.tsx → ward-patient-bed-number.component.tsx} +0 -0
- /package/src/ward-patient-card/row-elements/{ward-patient-location.tsx → ward-patient-location.component.tsx} +0 -0
- /package/src/ward-patient-card/row-elements/{ward-patient-name.tsx → ward-patient-name.component.tsx} +0 -0
- /package/src/ward-patient-card/row-elements/{ward-patient-responsive-tooltip.tsx → ward-patient-responsive-tooltip.component.tsx} +0 -0
- /package/src/ward-patient-card/row-elements/{ward-patient-skeleton-text.tsx → ward-patient-skeleton-text.component.tsx} +0 -0
|
@@ -1,24 +1,37 @@
|
|
|
1
1
|
import { type Location, useSession } from '@openmrs/esm-framework';
|
|
2
|
-
import {
|
|
2
|
+
import { last } from 'lodash-es';
|
|
3
3
|
import useLocation from './useLocation';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
const isUUID = (value?: string) => {
|
|
6
|
+
const regex = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/;
|
|
7
|
+
return regex.test(value);
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export default function useWardLocation(overrideLocation?: string): {
|
|
6
11
|
location: Location;
|
|
7
12
|
isLoadingLocation: boolean;
|
|
8
13
|
errorFetchingLocation: Error | undefined;
|
|
9
14
|
invalidLocation: boolean;
|
|
10
15
|
} {
|
|
11
|
-
|
|
16
|
+
// useParams not retriving uuid since its rendered on extension slot and lacks route context
|
|
17
|
+
// UseLocation also throwing and expeption
|
|
18
|
+
const { pathname } = window.location;
|
|
19
|
+
const segement = last(pathname.split('/'));
|
|
20
|
+
let locationUuidFromUrl: string;
|
|
21
|
+
if (isUUID(segement)) {
|
|
22
|
+
locationUuidFromUrl = segement;
|
|
23
|
+
}
|
|
24
|
+
|
|
12
25
|
const { sessionLocation } = useSession();
|
|
13
26
|
const {
|
|
14
27
|
data: locationResponse,
|
|
15
28
|
isLoading: isLoadingLocation,
|
|
16
29
|
error: errorFetchingLocation,
|
|
17
|
-
} = useLocation(locationUuidFromUrl ? locationUuidFromUrl : null);
|
|
30
|
+
} = useLocation(overrideLocation ? overrideLocation : locationUuidFromUrl ? locationUuidFromUrl : null);
|
|
18
31
|
const invalidLocation = locationUuidFromUrl && errorFetchingLocation;
|
|
19
32
|
|
|
20
33
|
return {
|
|
21
|
-
location: locationUuidFromUrl ? locationResponse?.data : sessionLocation,
|
|
34
|
+
location: locationUuidFromUrl || overrideLocation ? locationResponse?.data : sessionLocation,
|
|
22
35
|
isLoadingLocation,
|
|
23
36
|
errorFetchingLocation,
|
|
24
37
|
invalidLocation,
|
|
@@ -3,30 +3,83 @@ import { createAndGetWardPatientGrouping } from '../ward-view/ward-view.resource
|
|
|
3
3
|
import { useAdmissionLocation } from './useAdmissionLocation';
|
|
4
4
|
import { useInpatientAdmission } from './useInpatientAdmission';
|
|
5
5
|
import { useInpatientRequest } from './useInpatientRequest';
|
|
6
|
+
import { useInpatientAdmissionByPatients } from './useInpatientAdmissionByPatients';
|
|
7
|
+
import useWardLocation from './useWardLocation';
|
|
6
8
|
|
|
7
|
-
export function useWardPatientGrouping() {
|
|
8
|
-
const admissionLocationResponse = useAdmissionLocation();
|
|
9
|
-
const
|
|
10
|
-
const inpatientRequestResponse = useInpatientRequest();
|
|
9
|
+
export function useWardPatientGrouping(overrideLocation?: string) {
|
|
10
|
+
const admissionLocationResponse = useAdmissionLocation(undefined, overrideLocation);
|
|
11
|
+
const inpatientAdmissionAtCurrentLocationResponse = useInpatientAdmission(overrideLocation);
|
|
12
|
+
const inpatientRequestResponse = useInpatientRequest(undefined, undefined, overrideLocation);
|
|
13
|
+
const { location: currentLocation } = useWardLocation(overrideLocation);
|
|
11
14
|
|
|
12
|
-
const { data: inpatientAdmissions } =
|
|
15
|
+
const { data: inpatientAdmissions } = inpatientAdmissionAtCurrentLocationResponse;
|
|
13
16
|
const { admissionLocation } = admissionLocationResponse;
|
|
14
17
|
const { inpatientRequests } = inpatientRequestResponse;
|
|
15
18
|
|
|
19
|
+
// set of patients that are not in current ward, that we still
|
|
20
|
+
// need to fetch info about their current location because they either:
|
|
21
|
+
// - have a pending admission request to the current ward, or
|
|
22
|
+
// - have a bed assignment in current ward but somehow not admitted (edge case)
|
|
23
|
+
const patientsNotInCurrentWard = useMemo(() => {
|
|
24
|
+
if (admissionLocation && inpatientAdmissions && inpatientRequests) {
|
|
25
|
+
const _patientsNotInCurrentWard = new Set<string>();
|
|
26
|
+
|
|
27
|
+
for (const bedLayout of admissionLocation.bedLayouts) {
|
|
28
|
+
for (const bedPatient of bedLayout.patients) {
|
|
29
|
+
_patientsNotInCurrentWard.add(bedPatient.uuid);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
for (const inpatientRequest of inpatientRequests) {
|
|
33
|
+
_patientsNotInCurrentWard.add(inpatientRequest.patient.uuid);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
for (const admission of inpatientAdmissions) {
|
|
37
|
+
_patientsNotInCurrentWard.delete(admission.patient.uuid);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return _patientsNotInCurrentWard;
|
|
41
|
+
} else {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
}, [admissionLocation, inpatientAdmissions, inpatientRequests]);
|
|
45
|
+
|
|
46
|
+
const inpatientAdmissionsAtOtherLocationsResponse = useInpatientAdmissionByPatients(
|
|
47
|
+
patientsNotInCurrentWard ? Array.from(patientsNotInCurrentWard) : null,
|
|
48
|
+
);
|
|
49
|
+
const { data: inpatientAdmissionsAtOtherLocations } = inpatientAdmissionsAtOtherLocationsResponse;
|
|
50
|
+
|
|
16
51
|
const groupings = useMemo(() => {
|
|
17
|
-
return {
|
|
18
|
-
|
|
52
|
+
return {
|
|
53
|
+
...createAndGetWardPatientGrouping(
|
|
54
|
+
inpatientAdmissions,
|
|
55
|
+
admissionLocation,
|
|
56
|
+
inpatientRequests,
|
|
57
|
+
inpatientAdmissionsAtOtherLocations,
|
|
58
|
+
currentLocation,
|
|
59
|
+
),
|
|
60
|
+
};
|
|
61
|
+
}, [
|
|
62
|
+
admissionLocation,
|
|
63
|
+
inpatientAdmissions,
|
|
64
|
+
inpatientRequests,
|
|
65
|
+
inpatientAdmissionsAtOtherLocations,
|
|
66
|
+
currentLocation,
|
|
67
|
+
]) as ReturnType<typeof createAndGetWardPatientGrouping>;
|
|
19
68
|
return {
|
|
20
69
|
...groupings,
|
|
21
70
|
admissionLocationResponse,
|
|
22
|
-
inpatientAdmissionResponse,
|
|
71
|
+
inpatientAdmissionResponse: inpatientAdmissionAtCurrentLocationResponse,
|
|
23
72
|
inpatientRequestResponse,
|
|
24
73
|
isLoading:
|
|
25
|
-
admissionLocationResponse.isLoading ||
|
|
74
|
+
admissionLocationResponse.isLoading ||
|
|
75
|
+
inpatientAdmissionAtCurrentLocationResponse.isLoading ||
|
|
76
|
+
inpatientRequestResponse.isLoading ||
|
|
77
|
+
inpatientAdmissionsAtOtherLocationsResponse.isLoading,
|
|
26
78
|
mutate() {
|
|
27
79
|
admissionLocationResponse?.mutate();
|
|
28
|
-
|
|
80
|
+
inpatientAdmissionAtCurrentLocationResponse?.mutate();
|
|
29
81
|
inpatientRequestResponse?.mutate();
|
|
82
|
+
inpatientAdmissionsAtOtherLocationsResponse?.mutate();
|
|
30
83
|
},
|
|
31
84
|
};
|
|
32
85
|
}
|
package/src/index.ts
CHANGED
|
@@ -8,20 +8,20 @@ import {
|
|
|
8
8
|
import { configSchema } from './config-schema';
|
|
9
9
|
import { moduleName } from './constant';
|
|
10
10
|
import { createDashboardLink } from './createDashboardLink.component';
|
|
11
|
-
import rootComponent from './root.component';
|
|
12
11
|
|
|
13
12
|
export const importTranslation = require.context('../translations', false, /.json$/, 'lazy');
|
|
14
13
|
|
|
15
|
-
|
|
16
14
|
const options = {
|
|
17
15
|
featureName: 'ward',
|
|
18
16
|
moduleName,
|
|
19
17
|
};
|
|
20
18
|
|
|
21
|
-
export const root =
|
|
19
|
+
export const root = getAsyncLifecycle(() => import('./root.component'), options);
|
|
22
20
|
|
|
23
21
|
export const wardDashboardLink = getSyncLifecycle(createDashboardLink({ name: 'ward', title: 'wards' }), options);
|
|
24
22
|
|
|
23
|
+
export const wardView = getAsyncLifecycle(() => import('./ward-view/ward-view.component'), options);
|
|
24
|
+
|
|
25
25
|
// t('admissionRequests', 'Admission Requests')
|
|
26
26
|
export const admissionRequestWorkspace = getAsyncLifecycle(
|
|
27
27
|
() => import('./ward-workspace/admission-request-workspace/admission-requests.workspace'),
|
|
@@ -63,7 +63,7 @@ export const patientTransferAndSwapWorkspace = getAsyncLifecycle(
|
|
|
63
63
|
|
|
64
64
|
// t('discharge', 'Discharge')
|
|
65
65
|
export const patientDischargeWorkspace = getAsyncLifecycle(
|
|
66
|
-
() => import('./ward-workspace/patient-discharge/patient-discharge.workspace'),
|
|
66
|
+
() => import('./ward-workspace/kenya-emr-patient-discharge/patient-discharge.workspace'),
|
|
67
67
|
options,
|
|
68
68
|
);
|
|
69
69
|
|
|
@@ -99,6 +99,21 @@ export const clinicalFormWorkspaceSideRailIcon = getAsyncLifecycle(
|
|
|
99
99
|
options,
|
|
100
100
|
);
|
|
101
101
|
|
|
102
|
+
export const admissionRequestsWorkspaceSideRailIcon = getAsyncLifecycle(
|
|
103
|
+
() => import('./ward-workspace/admission-request-workspace/admission-requests-action-button.extension'),
|
|
104
|
+
options,
|
|
105
|
+
);
|
|
106
|
+
|
|
107
|
+
export const createAdmissionEncounterWorkspaceSideRailIcon = getAsyncLifecycle(
|
|
108
|
+
() => import('./ward-workspace/create-admission-encounter/create-admission-encounter-action-button.extension'),
|
|
109
|
+
options,
|
|
110
|
+
);
|
|
111
|
+
|
|
112
|
+
export const createAdmissionEncounterWorkspace = getAsyncLifecycle(
|
|
113
|
+
() => import('./ward-workspace/create-admission-encounter/create-admission-encounter.workspace'),
|
|
114
|
+
options,
|
|
115
|
+
);
|
|
116
|
+
|
|
102
117
|
export const defaultWardView = getAsyncLifecycle(
|
|
103
118
|
() => import('./ward-view/default-ward/default-ward-view.component'),
|
|
104
119
|
options,
|
|
@@ -109,6 +124,11 @@ export const maternalWardView = getAsyncLifecycle(
|
|
|
109
124
|
options,
|
|
110
125
|
);
|
|
111
126
|
|
|
127
|
+
export const wardPatientWorkspaceBanner = getAsyncLifecycle(
|
|
128
|
+
() => import('./ward-workspace/patient-banner/patient-banner.component'),
|
|
129
|
+
options,
|
|
130
|
+
);
|
|
131
|
+
|
|
112
132
|
export function startupApp() {
|
|
113
133
|
registerBreadcrumbs([]);
|
|
114
134
|
defineConfigSchema(moduleName, configSchema);
|
|
@@ -10,16 +10,42 @@ import {
|
|
|
10
10
|
ResponsiveWrapper,
|
|
11
11
|
useDebounce,
|
|
12
12
|
useLayoutType,
|
|
13
|
+
type Location,
|
|
13
14
|
} from '@openmrs/esm-framework';
|
|
14
15
|
import useEmrConfiguration from '../hooks/useEmrConfiguration';
|
|
15
16
|
import useLocations from '../hooks/useLocations';
|
|
16
17
|
import styles from './location-selector.scss';
|
|
18
|
+
import { type ControllerRenderProps } from 'react-hook-form';
|
|
17
19
|
|
|
18
20
|
interface LocationSelectorProps extends RadioButtonGroupProps {
|
|
19
21
|
paginationSize?: number;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* If provided, limits the locations to child locations of the given ancestor location.
|
|
25
|
+
*/
|
|
26
|
+
ancestorLocation?: Location;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* a list of locations that should be filtered from the location selector
|
|
30
|
+
*/
|
|
31
|
+
excludeLocations?: Location[];
|
|
32
|
+
|
|
33
|
+
field: ControllerRenderProps<
|
|
34
|
+
{
|
|
35
|
+
note?: string;
|
|
36
|
+
location?: string;
|
|
37
|
+
transferType?: string;
|
|
38
|
+
},
|
|
39
|
+
'location'
|
|
40
|
+
>;
|
|
20
41
|
}
|
|
21
42
|
|
|
22
|
-
export default function LocationSelector({
|
|
43
|
+
export default function LocationSelector({
|
|
44
|
+
paginationSize = 15,
|
|
45
|
+
ancestorLocation,
|
|
46
|
+
excludeLocations: locationsToFilter,
|
|
47
|
+
field,
|
|
48
|
+
}: LocationSelectorProps) {
|
|
23
49
|
const { t } = useTranslation();
|
|
24
50
|
const { emrConfiguration, isLoadingEmrConfiguration } = useEmrConfiguration();
|
|
25
51
|
const isTablet = !isDesktop(useLayoutType());
|
|
@@ -31,10 +57,15 @@ export default function LocationSelector({ paginationSize = 15, ...props }: Loca
|
|
|
31
57
|
criteria.push(['name:contains', debouncedSearchTerm]);
|
|
32
58
|
}
|
|
33
59
|
if (emrConfiguration) {
|
|
60
|
+
// limit to locations tagged as transfer locations
|
|
34
61
|
criteria.push(['_tag', emrConfiguration.supportsTransferLocationTag.name]);
|
|
35
62
|
}
|
|
63
|
+
if (ancestorLocation) {
|
|
64
|
+
// limit to locations that are "part of" the facility where the patient has an active visit
|
|
65
|
+
criteria.push(['partof:below', ancestorLocation.uuid]);
|
|
66
|
+
}
|
|
36
67
|
return criteria;
|
|
37
|
-
}, [debouncedSearchTerm, emrConfiguration]);
|
|
68
|
+
}, [debouncedSearchTerm, emrConfiguration, ancestorLocation]);
|
|
38
69
|
const {
|
|
39
70
|
data: locations,
|
|
40
71
|
isLoading,
|
|
@@ -45,6 +76,8 @@ export default function LocationSelector({ paginationSize = 15, ...props }: Loca
|
|
|
45
76
|
goToPrevious,
|
|
46
77
|
} = useLocations(filterCriteria, paginationSize, !emrConfiguration);
|
|
47
78
|
|
|
79
|
+
const filteredLocations = locations?.filter((l) => !locationsToFilter?.some((fl) => fl.uuid === l.id));
|
|
80
|
+
|
|
48
81
|
const handleSearch = useCallback(
|
|
49
82
|
(event: React.ChangeEvent<HTMLInputElement>) => {
|
|
50
83
|
setSearchTerm(event.target.value);
|
|
@@ -71,9 +104,9 @@ export default function LocationSelector({ paginationSize = 15, ...props }: Loca
|
|
|
71
104
|
</div>
|
|
72
105
|
) : (
|
|
73
106
|
<ResponsiveWrapper>
|
|
74
|
-
<RadioButtonGroup {...
|
|
75
|
-
{
|
|
76
|
-
|
|
107
|
+
<RadioButtonGroup {...field} className={styles.radioButtonGroup} orientation="vertical">
|
|
108
|
+
{filteredLocations?.length > 0 ? (
|
|
109
|
+
filteredLocations?.map((location) => (
|
|
77
110
|
<RadioButton key={location.id} labelText={location.name} value={location.id} />
|
|
78
111
|
))
|
|
79
112
|
) : (
|
package/src/root.component.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { WorkspaceContainer } from '@openmrs/esm-framework';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import { BrowserRouter, Route, Routes } from 'react-router-dom';
|
|
4
3
|
import WardView from './ward-view/ward-view.component';
|
|
4
|
+
import WardsLineList from './ward-view/linelist-wards/WardsLineList';
|
|
5
5
|
|
|
6
6
|
const Root: React.FC = () => {
|
|
7
7
|
// t('wards', 'Wards')
|
|
@@ -11,7 +11,7 @@ const Root: React.FC = () => {
|
|
|
11
11
|
<main>
|
|
12
12
|
<BrowserRouter basename={wardViewBasename}>
|
|
13
13
|
<Routes>
|
|
14
|
-
<Route path="/" element={<
|
|
14
|
+
<Route path="/" element={<WardsLineList />} />
|
|
15
15
|
<Route path="/:locationUuid" element={<WardView />} />
|
|
16
16
|
</Routes>
|
|
17
17
|
</BrowserRouter>
|
package/src/routes.json
CHANGED
|
@@ -30,6 +30,11 @@
|
|
|
30
30
|
"name": "ward-dashboard",
|
|
31
31
|
"slot": "ward-dashboard-slot"
|
|
32
32
|
},
|
|
33
|
+
{
|
|
34
|
+
"component": "wardView",
|
|
35
|
+
"name": "ward-view",
|
|
36
|
+
"slot": "ward-view-slot"
|
|
37
|
+
},
|
|
33
38
|
{
|
|
34
39
|
"component": "wardPatientActionButtonExtension",
|
|
35
40
|
"name": "ward-patient-action-button",
|
|
@@ -60,6 +65,16 @@
|
|
|
60
65
|
"component": "clinicalFormWorkspaceSideRailIcon",
|
|
61
66
|
"slot": "action-menu-ward-patient-items-slot"
|
|
62
67
|
},
|
|
68
|
+
{
|
|
69
|
+
"name": "admission-requests-workspace-siderail-button",
|
|
70
|
+
"component": "admissionRequestsWorkspaceSideRailIcon",
|
|
71
|
+
"slot": "action-menu-ward-patient-admission-requests-items-slot"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"name": "create-admission-request-workspace-siderail-button",
|
|
75
|
+
"component": "createAdmissionEncounterWorkspaceSideRailIcon",
|
|
76
|
+
"slot": "action-menu-ward-patient-admission-requests-items-slot"
|
|
77
|
+
},
|
|
63
78
|
{
|
|
64
79
|
"component": "defaultWardView",
|
|
65
80
|
"name": "default-ward",
|
|
@@ -69,6 +84,11 @@
|
|
|
69
84
|
"component": "maternalWardView",
|
|
70
85
|
"name": "maternal-ward",
|
|
71
86
|
"slot": "maternal-ward"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"component": "wardPatientWorkspaceBanner",
|
|
90
|
+
"name": "ward-patient-workspace-banner",
|
|
91
|
+
"slot": "ward-workspace-patient-banner-slot"
|
|
72
92
|
}
|
|
73
93
|
],
|
|
74
94
|
"workspaces": [
|
|
@@ -76,17 +96,21 @@
|
|
|
76
96
|
"name": "admission-requests-workspace",
|
|
77
97
|
"component": "admissionRequestWorkspace",
|
|
78
98
|
"title": "admissionRequests",
|
|
79
|
-
"type": "admission-requests"
|
|
99
|
+
"type": "pending-admission-requests",
|
|
100
|
+
"width": "wider"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"name": "create-admission-encounter-workspace",
|
|
104
|
+
"component": "createAdmissionEncounterWorkspace",
|
|
105
|
+
"title": "admitPatient",
|
|
106
|
+
"type": "patient-search-workspace",
|
|
107
|
+
"width": "wider"
|
|
80
108
|
},
|
|
81
109
|
{
|
|
82
110
|
"name": "ward-patient-notes-workspace",
|
|
83
111
|
"component": "wardPatientNotesWorkspace",
|
|
84
112
|
"type": "ward-patient-notes",
|
|
85
|
-
"title": "inpatientNotesWorkspaceTitle"
|
|
86
|
-
"sidebarFamily": "ward-patient",
|
|
87
|
-
"hasOwnSidebar": true,
|
|
88
|
-
"groups": ["ward-patient"]
|
|
89
|
-
|
|
113
|
+
"title": "inpatientNotesWorkspaceTitle"
|
|
90
114
|
},
|
|
91
115
|
{
|
|
92
116
|
"name": "admit-patient-form-workspace",
|
|
@@ -99,20 +123,13 @@
|
|
|
99
123
|
"component": "wardPatientWorkspace",
|
|
100
124
|
"type": "ward",
|
|
101
125
|
"title": "Ward patient",
|
|
102
|
-
"width": "extra-wide"
|
|
103
|
-
"hasOwnSidebar": true,
|
|
104
|
-
"sidebarFamily": "ward-patient",
|
|
105
|
-
"groups": ["ward-patient"]
|
|
126
|
+
"width": "extra-wide"
|
|
106
127
|
},
|
|
107
128
|
{
|
|
108
129
|
"name": "patient-transfer-swap-workspace",
|
|
109
130
|
"component": "patientTransferAndSwapWorkspace",
|
|
110
131
|
"title": "transfers",
|
|
111
|
-
"type": "transfer-swap-bed-form"
|
|
112
|
-
"hasOwnSidebar": true,
|
|
113
|
-
"sidebarFamily": "ward-patient",
|
|
114
|
-
"groups": ["ward-patient"]
|
|
115
|
-
|
|
132
|
+
"type": "transfer-swap-bed-form"
|
|
116
133
|
},
|
|
117
134
|
{
|
|
118
135
|
"name": "patient-transfer-request-workspace",
|
|
@@ -124,27 +141,44 @@
|
|
|
124
141
|
"name": "patient-discharge-workspace",
|
|
125
142
|
"component": "patientDischargeWorkspace",
|
|
126
143
|
"title": "discharge",
|
|
127
|
-
"
|
|
128
|
-
"
|
|
129
|
-
"
|
|
130
|
-
"groups": ["ward-patient"]
|
|
144
|
+
"width": "extra-wide",
|
|
145
|
+
"canMaximize": true,
|
|
146
|
+
"type": "ward-patient-discharge"
|
|
131
147
|
},
|
|
132
148
|
{
|
|
133
149
|
"name": "ward-patient-clinical-forms-workspace",
|
|
134
150
|
"component": "patientClinicalFormsWorkspace",
|
|
135
151
|
"title": "clinicalForms",
|
|
136
152
|
"type": "ward-patient-clinical-forms",
|
|
137
|
-
"
|
|
138
|
-
"sidebarFamily": "ward-patient",
|
|
139
|
-
"width": "wider",
|
|
140
|
-
"groups": ["ward-patient"]
|
|
153
|
+
"width": "wider"
|
|
141
154
|
},
|
|
142
155
|
{
|
|
143
156
|
"name": "cancel-admission-request-workspace",
|
|
144
157
|
"component": "cancelAdmissionRequestWorkspace",
|
|
145
158
|
"title": "cancelAdmissionRequest",
|
|
146
|
-
"type": "cancel-admission-request"
|
|
147
|
-
|
|
159
|
+
"type": "cancel-admission-request"
|
|
160
|
+
}
|
|
161
|
+
],
|
|
162
|
+
"workspaceGroups": [
|
|
163
|
+
{
|
|
164
|
+
"name": "ward-patient",
|
|
165
|
+
"members": [
|
|
166
|
+
"ward-patient-workspace",
|
|
167
|
+
"ward-patient-notes-workspace",
|
|
168
|
+
"patient-transfer-swap-workspace",
|
|
169
|
+
"patient-discharge-workspace",
|
|
170
|
+
"ward-patient-clinical-forms-workspace",
|
|
171
|
+
"add-drug-order",
|
|
172
|
+
"order-basket",
|
|
173
|
+
"add-lab-order"
|
|
174
|
+
]
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
"name": "ward-patient-admission-requests",
|
|
178
|
+
"members": [
|
|
179
|
+
"admission-requests-workspace",
|
|
180
|
+
"create-admission-encounter-workspace"
|
|
181
|
+
]
|
|
148
182
|
}
|
|
149
183
|
]
|
|
150
|
-
}
|
|
184
|
+
}
|
package/src/types/index.ts
CHANGED
|
@@ -15,16 +15,20 @@ interface WardPatientCardProps {
|
|
|
15
15
|
wardPatient: WardPatient;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
export type WardPatientCardType = React.
|
|
18
|
+
export type WardPatientCardType = React.ComponentType<WardPatientCardProps>;
|
|
19
19
|
|
|
20
20
|
// WardPatient is a patient admitted to a ward, and/or in a bed on a ward
|
|
21
21
|
export type WardPatient = {
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
24
|
-
* from either the inpatientAdmission object, the inpatientRequest object
|
|
23
|
+
* Taken either from the inpatientAdmission object, the inpatientRequest object
|
|
25
24
|
* or the admissionLocation object (which contains the bed)
|
|
26
25
|
*/
|
|
27
26
|
patient: Patient;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Taken either from the inpatientAdmission object, the inpatientRequest object
|
|
30
|
+
* or the admissionLocation object (which contains the bed)
|
|
31
|
+
*/
|
|
28
32
|
visit: Visit;
|
|
29
33
|
|
|
30
34
|
/**
|
|
@@ -48,7 +52,6 @@ export type WardPatient = {
|
|
|
48
52
|
|
|
49
53
|
export interface WardPatientWorkspaceProps extends DefaultWorkspaceProps {
|
|
50
54
|
wardPatient: WardPatient;
|
|
51
|
-
WardPatientHeader: WardPatientCardType;
|
|
52
55
|
}
|
|
53
56
|
|
|
54
57
|
// server-side types defined in openmrs-module-bedmanagement:
|
|
@@ -73,7 +76,7 @@ export interface Bed {
|
|
|
73
76
|
|
|
74
77
|
export interface BedDetail {
|
|
75
78
|
bedId: number;
|
|
76
|
-
bedNumber:
|
|
79
|
+
bedNumber: string;
|
|
77
80
|
bedType: BedType;
|
|
78
81
|
physicalLocation: Location;
|
|
79
82
|
patients: Array<Patient>;
|
|
@@ -152,6 +155,8 @@ export interface InpatientAdmission {
|
|
|
152
155
|
|
|
153
156
|
// the current in patient request
|
|
154
157
|
currentInpatientRequest: InpatientRequest;
|
|
158
|
+
|
|
159
|
+
currentInpatientLocation: Location;
|
|
155
160
|
}
|
|
156
161
|
|
|
157
162
|
export interface MotherAndChild {
|
|
@@ -237,7 +242,10 @@ export interface ObsPayload {
|
|
|
237
242
|
export type WardPatientGroupDetails = ReturnType<typeof useWardPatientGrouping>;
|
|
238
243
|
export interface WardViewContext {
|
|
239
244
|
wardPatientGroupDetails: WardPatientGroupDetails;
|
|
240
|
-
WardPatientHeader:
|
|
245
|
+
WardPatientHeader: React.ComponentType<WardPatientCardProps>;
|
|
246
|
+
[key: string]: unknown;
|
|
247
|
+
[key: number]: unknown;
|
|
248
|
+
[key: symbol]: unknown;
|
|
241
249
|
}
|
|
242
250
|
|
|
243
251
|
export interface PatientAndAdmission {
|
|
@@ -253,6 +261,9 @@ export interface MotherChildRelationships {
|
|
|
253
261
|
|
|
254
262
|
export interface MaternalWardViewContext {
|
|
255
263
|
motherChildRelationships: MotherChildRelationships;
|
|
264
|
+
[key: string]: unknown;
|
|
265
|
+
[key: number]: unknown;
|
|
266
|
+
[key: symbol]: unknown;
|
|
256
267
|
}
|
|
257
268
|
|
|
258
269
|
export type PatientWorkspaceAdditionalProps = Omit<WardPatientWorkspaceProps, keyof DefaultWorkspaceProps>;
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { type ObsElementConfig } from '../../config-schema';
|
|
3
3
|
import { type WardPatient } from '../../types';
|
|
4
4
|
import { useElementConfig } from '../../ward-view/ward-view.resource';
|
|
5
|
-
import WardPatientObs from '../row-elements/ward-patient-obs';
|
|
5
|
+
import WardPatientObs from '../row-elements/ward-patient-obs.component';
|
|
6
6
|
import styles from '../ward-patient-card.scss';
|
|
7
7
|
|
|
8
8
|
interface AdmissionRequestNoteRowProps {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
+
import React, { type ReactNode } from 'react';
|
|
1
2
|
import { Tag } from '@carbon/react';
|
|
2
3
|
import { type OpenmrsResource, type Patient, type Visit } from '@openmrs/esm-framework';
|
|
3
|
-
import React, { type ReactNode } from 'react';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
5
|
import { useObs } from '../../hooks/useObs';
|
|
6
6
|
import { useElementConfig } from '../../ward-view/ward-view.resource';
|
|
7
|
-
import styles from '../ward-patient-card.scss';
|
|
8
|
-
import WardPatientSkeletonText from '../row-elements/ward-patient-skeleton-text';
|
|
9
7
|
import {
|
|
10
8
|
getObsEncounterString,
|
|
11
9
|
obsCustomRepresentation,
|
|
12
10
|
useConceptToTagColorMap,
|
|
13
11
|
} from '../row-elements/ward-patient-obs.resource';
|
|
14
|
-
import
|
|
12
|
+
import WardPatientSkeletonText from '../row-elements/ward-patient-skeleton-text.component';
|
|
13
|
+
import WardPatientResponsiveTooltip from '../row-elements/ward-patient-responsive-tooltip.component';
|
|
14
|
+
import styles from '../ward-patient-card.scss';
|
|
15
15
|
|
|
16
16
|
interface WardPatientCodedObsTagsRowProps {
|
|
17
17
|
id: string;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { BabyIcon, MotherIcon, type Patient, useAppContext } from '@openmrs/esm-framework';
|
|
2
|
-
import classNames from 'classnames';
|
|
3
1
|
import React from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import { BabyIcon, MotherIcon, type Patient, useAppContext } from '@openmrs/esm-framework';
|
|
4
4
|
import { type InpatientAdmission, type MaternalWardViewContext } from '../../types';
|
|
5
5
|
import { type MaternalWardPatientCardProps } from '../../ward-view/materal-ward/maternal-ward-patient-card.component';
|
|
6
|
-
import WardPatientAge from '../row-elements/ward-patient-age';
|
|
7
|
-
import WardPatientIdentifier from '../row-elements/ward-patient-identifier';
|
|
8
|
-
import WardPatientLocation from '../row-elements/ward-patient-location';
|
|
9
|
-
import WardPatientName from '../row-elements/ward-patient-name';
|
|
6
|
+
import WardPatientAge from '../row-elements/ward-patient-age.component';
|
|
7
|
+
import WardPatientIdentifier from '../row-elements/ward-patient-identifier.component';
|
|
8
|
+
import WardPatientLocation from '../row-elements/ward-patient-location.component';
|
|
9
|
+
import WardPatientName from '../row-elements/ward-patient-name.component';
|
|
10
10
|
import wardPatientCardStyles from '../ward-patient-card.scss';
|
|
11
11
|
import styles from './mother-child-row.scss';
|
|
12
12
|
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { Hourglass } from '@carbon/react/icons';
|
|
2
1
|
import React, { useCallback, useEffect } from 'react';
|
|
2
|
+
import { Hourglass } from '@carbon/react/icons';
|
|
3
3
|
import { type WardPatient } from '../../types';
|
|
4
|
-
|
|
5
4
|
import { useElementConfig } from '../../ward-view/ward-view.resource';
|
|
6
5
|
import { WardPatientPendingOrder } from '../row-elements/ward-patient-pending-order.component';
|
|
7
|
-
import WardPatientPendingTransfer from '../row-elements/ward-patient-pending-transfer';
|
|
6
|
+
import WardPatientPendingTransfer from '../row-elements/ward-patient-pending-transfer.component';
|
|
8
7
|
import styles from '../ward-patient-card.scss';
|
|
9
8
|
|
|
10
9
|
export interface PendingItemsRowProps {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Tag } from '@carbon/react';
|
|
2
|
-
import { type OpenmrsResource, type Patient, type Visit } from '@openmrs/esm-framework';
|
|
3
1
|
import React, { type ReactNode } from 'react';
|
|
2
|
+
import { getObsEncounterString, obsCustomRepresentation, useConceptToTagColorMap } from './ward-patient-obs.resource';
|
|
3
|
+
import { type OpenmrsResource, type Patient, type Visit } from '@openmrs/esm-framework';
|
|
4
|
+
import { Tag } from '@carbon/react';
|
|
4
5
|
import { useTranslation } from 'react-i18next';
|
|
5
6
|
import { useObs } from '../../hooks/useObs';
|
|
6
7
|
import { useElementConfig } from '../../ward-view/ward-view.resource';
|
|
8
|
+
import WardPatientSkeletonText from './ward-patient-skeleton-text.component';
|
|
9
|
+
import WardPatientResponsiveTooltip from './ward-patient-responsive-tooltip.component';
|
|
7
10
|
import styles from '../ward-patient-card.scss';
|
|
8
|
-
import WardPatientSkeletonText from './ward-patient-skeleton-text';
|
|
9
|
-
import { getObsEncounterString, obsCustomRepresentation, useConceptToTagColorMap } from './ward-patient-obs.resource';
|
|
10
|
-
import WardPatientResponsiveTooltip from './ward-patient-responsive-tooltip';
|
|
11
11
|
|
|
12
12
|
interface WardPatientCodedObsTagsProps {
|
|
13
13
|
id: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type Patient } from '@openmrs/esm-framework';
|
|
2
1
|
import React from 'react';
|
|
2
|
+
import { type Patient } from '@openmrs/esm-framework';
|
|
3
3
|
import { useElementConfig } from '../../ward-view/ward-view.resource';
|
|
4
4
|
|
|
5
5
|
export interface WardPatientAddressProps {
|
|
@@ -9,7 +9,7 @@ export interface WardPatientAddressProps {
|
|
|
9
9
|
|
|
10
10
|
const WardPatientAddress: React.FC<WardPatientAddressProps> = ({ patient, id }) => {
|
|
11
11
|
const preferredAddress = patient?.person?.preferredAddress;
|
|
12
|
-
const config = useElementConfig(
|
|
12
|
+
const config = useElementConfig('patientAddress', id);
|
|
13
13
|
|
|
14
14
|
return (
|
|
15
15
|
<>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type Patient, type PatientIdentifier, PatientBannerPatientIdentifiers } from '@openmrs/esm-framework';
|
|
3
3
|
import { useElementConfig } from '../../ward-view/ward-view.resource';
|
|
4
|
+
import styles from './ward-patient-identifier.scss';
|
|
4
5
|
|
|
5
6
|
export interface WardPatientIdentifierProps {
|
|
6
7
|
patient: Patient;
|
|
@@ -23,7 +24,12 @@ const WardPatientIdentifier: React.FC<WardPatientIdentifierProps> = ({ id, patie
|
|
|
23
24
|
}));
|
|
24
25
|
|
|
25
26
|
return (
|
|
26
|
-
<
|
|
27
|
+
<div className={styles.wardPatientIdentifierWrapper}>
|
|
28
|
+
<PatientBannerPatientIdentifiers
|
|
29
|
+
identifiers={fhirIdentifiers}
|
|
30
|
+
showIdentifierLabel={config?.showIdentifierLabel}
|
|
31
|
+
/>
|
|
32
|
+
</div>
|
|
27
33
|
);
|
|
28
34
|
};
|
|
29
35
|
|