@kenyaemr/esm-admin-app 5.4.4-pre.50 → 5.4.4-pre.501
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 +5 -5
- package/dist/1102.js +1 -0
- package/dist/{7988.js.map → 1102.js.map} +1 -1
- package/dist/1278.js +1 -0
- package/dist/1278.js.map +1 -0
- package/dist/1442.js +1 -0
- package/dist/1442.js.map +1 -0
- package/dist/15.js +1 -0
- package/dist/15.js.map +1 -0
- package/dist/162.js +1 -0
- package/dist/162.js.map +1 -0
- package/dist/1620.js +1 -0
- package/dist/1620.js.map +1 -0
- package/dist/1789.js +1 -0
- package/dist/1789.js.map +1 -0
- package/dist/1831.js +1 -0
- package/dist/1831.js.map +1 -0
- package/dist/1844.js +1 -0
- package/dist/1844.js.map +1 -0
- package/dist/1854.js +1 -0
- package/dist/1854.js.map +1 -0
- package/dist/1919.js +1 -0
- package/dist/1919.js.map +1 -0
- package/dist/193.js +1 -0
- package/dist/193.js.map +1 -0
- package/dist/1946.js +1 -0
- package/dist/1946.js.map +1 -0
- package/dist/2007.js +1 -1
- package/dist/2007.js.map +1 -1
- package/dist/2043.js +1 -0
- package/dist/2043.js.map +1 -0
- package/dist/2127.js +1 -0
- package/dist/2127.js.map +1 -0
- package/dist/2146.js +1 -0
- package/dist/2146.js.map +1 -0
- package/dist/2152.js +1 -0
- package/dist/2152.js.map +1 -0
- package/dist/2202.js +1 -0
- package/dist/2202.js.map +1 -0
- package/dist/2258.js +1 -0
- package/dist/2258.js.map +1 -0
- package/dist/2394.js +1 -0
- package/dist/2394.js.map +1 -0
- package/dist/2468.js +1 -0
- package/dist/2468.js.map +1 -0
- package/dist/2534.js +1 -1
- package/dist/2534.js.map +1 -1
- package/dist/2556.js +1 -0
- package/dist/2556.js.map +1 -0
- package/dist/26.js +1 -0
- package/dist/26.js.map +1 -0
- package/dist/2638.js +1 -0
- package/dist/2638.js.map +1 -0
- package/dist/2648.js +1 -0
- package/dist/2648.js.map +1 -0
- package/dist/2709.js +1 -0
- package/dist/2709.js.map +1 -0
- package/dist/2823.js +1 -0
- package/dist/2823.js.map +1 -0
- package/dist/2840.js +1 -0
- package/dist/2840.js.map +1 -0
- package/dist/2842.js +1 -0
- package/dist/2842.js.map +1 -0
- package/dist/2916.js +1 -0
- package/dist/2916.js.map +1 -0
- package/dist/2924.js +1 -0
- package/dist/2924.js.map +1 -0
- package/dist/3137.js +1 -0
- package/dist/3137.js.map +1 -0
- package/dist/3248.js +1 -1
- package/dist/3248.js.map +1 -1
- package/dist/3282.js +1 -0
- package/dist/3282.js.map +1 -0
- package/dist/3285.js +1 -0
- package/dist/3285.js.map +1 -0
- package/dist/3302.js +1 -0
- package/dist/3302.js.map +1 -0
- package/dist/3335.js +1 -0
- package/dist/3335.js.map +1 -0
- package/dist/3378.js +1 -0
- package/dist/3378.js.map +1 -0
- package/dist/3504.js +1 -0
- package/dist/3504.js.map +1 -0
- package/dist/356.js +1 -0
- package/dist/356.js.map +1 -0
- package/dist/3569.js +1 -0
- package/dist/3569.js.map +1 -0
- package/dist/3580.js +1 -0
- package/dist/3580.js.map +1 -0
- package/dist/3690.js +1 -0
- package/dist/3690.js.map +1 -0
- package/dist/3723.js +1 -0
- package/dist/3723.js.map +1 -0
- package/dist/3745.js +1 -0
- package/dist/3745.js.map +1 -0
- package/dist/3796.js +1 -0
- package/dist/3796.js.map +1 -0
- package/dist/3813.js +1 -0
- package/dist/3813.js.map +1 -0
- package/dist/393.js +6 -0
- package/dist/393.js.map +1 -0
- package/dist/3953.js +1 -0
- package/dist/3953.js.map +1 -0
- package/dist/3989.js +1 -0
- package/dist/3989.js.map +1 -0
- package/dist/4124.js +1 -0
- package/dist/4124.js.map +1 -0
- package/dist/4163.js +1 -0
- package/dist/4163.js.map +1 -0
- package/dist/4178.js +1 -1
- package/dist/4178.js.map +1 -1
- package/dist/4308.js +1 -1
- package/dist/4308.js.map +1 -1
- package/dist/4487.js +11 -0
- package/dist/4487.js.map +1 -0
- package/dist/4588.js +1 -0
- package/dist/4588.js.map +1 -0
- package/dist/4637.js +1 -1
- package/dist/4637.js.map +1 -1
- package/dist/466.js +1 -1
- package/dist/466.js.map +1 -1
- package/dist/4711.js +1 -0
- package/dist/4711.js.map +1 -0
- package/dist/4759.js +1 -0
- package/dist/4759.js.map +1 -0
- package/dist/4817.js +1 -0
- package/dist/4817.js.map +1 -0
- package/dist/4818.js +1 -0
- package/dist/4818.js.map +1 -0
- package/dist/4902.js +1 -0
- package/dist/4902.js.map +1 -0
- package/dist/4973.js +1 -0
- package/dist/4973.js.map +1 -0
- package/dist/500.js +1 -0
- package/dist/500.js.map +1 -0
- package/dist/5086.js +1 -1
- package/dist/5086.js.map +1 -1
- package/dist/5117.js +1 -0
- package/dist/5117.js.map +1 -0
- package/dist/5203.js +1 -0
- package/dist/5203.js.map +1 -0
- package/dist/5361.js +1 -1
- package/dist/5361.js.map +1 -1
- package/dist/5362.js +1 -0
- package/dist/5362.js.map +1 -0
- package/dist/5366.js +1 -0
- package/dist/5366.js.map +1 -0
- package/dist/5536.js +1 -0
- package/dist/5536.js.map +1 -0
- package/dist/5567.js +1 -0
- package/dist/5567.js.map +1 -0
- package/dist/5598.js +1 -0
- package/dist/5598.js.map +1 -0
- package/dist/5676.js +1 -1
- package/dist/5676.js.map +1 -1
- package/dist/5693.js +1 -0
- package/dist/5693.js.map +1 -0
- package/dist/5731.js +5 -0
- package/dist/5731.js.map +1 -0
- package/dist/5767.js +1 -0
- package/dist/5767.js.map +1 -0
- package/dist/5809.js +1 -1
- package/dist/5809.js.map +1 -1
- package/dist/5825.js +1 -0
- package/dist/5825.js.map +1 -0
- package/dist/5932.js +1 -0
- package/dist/5932.js.map +1 -0
- package/dist/5941.js +1 -0
- package/dist/5941.js.map +1 -0
- package/dist/6104.js +1 -1
- package/dist/6104.js.map +1 -1
- package/dist/6273.js +1 -0
- package/dist/6273.js.map +1 -0
- package/dist/6337.js +1 -0
- package/dist/6337.js.map +1 -0
- package/dist/6355.js +1 -0
- package/dist/{2797.js.map → 6355.js.map} +1 -1
- package/dist/6357.js +1 -0
- package/dist/6357.js.map +1 -0
- package/dist/6427.js +1 -1
- package/dist/6427.js.map +1 -1
- package/dist/6478.js +7 -0
- package/dist/6478.js.map +1 -0
- package/dist/6508.js +1 -0
- package/dist/6508.js.map +1 -0
- package/dist/6567.js +1 -0
- package/dist/6567.js.map +1 -0
- package/dist/6634.js +1 -0
- package/dist/6634.js.map +1 -0
- package/dist/6698.js +1 -0
- package/dist/6698.js.map +1 -0
- package/dist/682.js +1 -1
- package/dist/682.js.map +1 -1
- package/dist/6848.js +1 -0
- package/dist/6848.js.map +1 -0
- package/dist/689.js +1 -1
- package/dist/689.js.map +1 -1
- package/dist/6978.js +1 -0
- package/dist/6978.js.map +1 -0
- package/dist/7085.js +1 -1
- package/dist/7085.js.map +1 -1
- package/dist/7187.js +1 -0
- package/dist/7187.js.map +1 -0
- package/dist/7209.js +1 -0
- package/dist/7209.js.map +1 -0
- package/dist/740.js +1 -0
- package/dist/740.js.map +1 -0
- package/dist/7419.js +1 -1
- package/dist/7419.js.map +1 -1
- package/dist/7478.js +1 -1
- package/dist/7478.js.map +1 -1
- package/dist/7686.js +1 -0
- package/dist/7686.js.map +1 -0
- package/dist/770.js +1 -0
- package/dist/770.js.map +1 -0
- package/dist/7782.js +1 -0
- package/dist/7782.js.map +1 -0
- package/dist/7783.js +1 -0
- package/dist/7783.js.map +1 -0
- package/dist/7808.js +1 -0
- package/dist/7808.js.map +1 -0
- package/dist/781.js +1 -1
- package/dist/781.js.map +1 -1
- package/dist/8183.js +1 -0
- package/dist/8183.js.map +1 -0
- package/dist/8196.js +1 -1
- package/dist/8196.js.map +1 -1
- package/dist/820.js +1 -0
- package/dist/820.js.map +1 -0
- package/dist/8240.js +1 -1
- package/dist/8240.js.map +1 -1
- package/dist/8267.js +1 -0
- package/dist/8267.js.map +1 -0
- package/dist/8472.js +1 -0
- package/dist/8472.js.map +1 -0
- package/dist/8521.js +1 -0
- package/dist/8521.js.map +1 -0
- package/dist/8602.js +1 -0
- package/dist/8602.js.map +1 -0
- package/dist/8607.js +1 -0
- package/dist/8607.js.map +1 -0
- package/dist/8743.js +1 -0
- package/dist/8743.js.map +1 -0
- package/dist/8762.js +1 -0
- package/dist/8762.js.map +1 -0
- package/dist/8781.js +1 -0
- package/dist/8781.js.map +1 -0
- package/dist/8812.js +1 -0
- package/dist/8812.js.map +1 -0
- package/dist/8952.js +1 -0
- package/dist/8952.js.map +1 -0
- package/dist/8985.js +1 -0
- package/dist/8985.js.map +1 -0
- package/dist/8996.js +1 -0
- package/dist/8996.js.map +1 -0
- package/dist/9011.js +1 -1
- package/dist/9011.js.map +1 -1
- package/dist/9049.js +1 -0
- package/dist/9049.js.map +1 -0
- package/dist/9050.js +1 -0
- package/dist/9050.js.map +1 -0
- package/dist/9061.js +1 -1
- package/dist/9061.js.map +1 -1
- package/dist/9087.js +1 -0
- package/dist/9087.js.map +1 -0
- package/dist/9148.js +1 -0
- package/dist/9148.js.map +1 -0
- package/dist/9168.js +1 -0
- package/dist/9168.js.map +1 -0
- package/dist/935.js +1 -0
- package/dist/935.js.map +1 -0
- package/dist/9425.js +1 -1
- package/dist/944.js +1 -0
- package/dist/944.js.map +1 -0
- package/dist/9443.js +1 -0
- package/dist/9443.js.map +1 -0
- package/dist/9520.js +1 -1
- package/dist/9520.js.map +1 -1
- package/dist/9547.js +1 -0
- package/dist/9547.js.map +1 -0
- package/dist/9549.js +1 -0
- package/dist/9549.js.map +1 -0
- package/dist/9603.js +1 -0
- package/dist/9603.js.map +1 -0
- package/dist/9612.js +1 -0
- package/dist/9612.js.map +1 -0
- package/dist/9621.js +1 -0
- package/dist/9621.js.map +1 -0
- package/dist/9662.js +1 -0
- package/dist/9662.js.map +1 -0
- package/dist/9771.js +1 -0
- package/dist/9771.js.map +1 -0
- package/dist/9774.js +1 -0
- package/dist/9774.js.map +1 -0
- package/dist/9800.js +1 -0
- package/dist/9800.js.map +1 -0
- package/dist/9806.js +1 -0
- package/dist/9806.js.map +1 -0
- package/dist/992.js +1 -0
- package/dist/992.js.map +1 -0
- package/dist/kenyaemr-esm-admin-app.js +6 -5
- package/dist/kenyaemr-esm-admin-app.js.buildmanifest.json +1694 -719
- package/dist/kenyaemr-esm-admin-app.js.map +1 -1
- package/dist/main.js +6 -5
- package/dist/main.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +4 -6
- package/src/components/confirm-modal/confirmation-operation.test.tsx +8 -19
- package/src/components/dashboard/dashboard.component.tsx +4 -1
- package/src/components/empty-state/empty-state-log.test.tsx +3 -4
- package/src/components/facility-setup/constant/index.ts +3 -0
- package/src/components/facility-setup/facility-info.component.tsx +247 -108
- package/src/components/facility-setup/facility-info.scss +136 -55
- package/src/components/facility-setup/facility-setup.component.tsx +2 -2
- package/src/components/facility-setup/header/header.component.tsx +4 -10
- package/src/components/facility-setup/header/header.scss +3 -9
- package/src/components/facility-setup/shared/custom-info.component.tsx +9 -0
- package/src/components/facility-setup/shared/custom-section-card.component.tsx +10 -0
- package/src/components/facility-setup/shared/custom-status-tag.component.tsx +22 -0
- package/src/components/facility-setup/type/index.ts +61 -0
- package/src/components/facility-setup/useFacilityRegistry.ts +29 -0
- package/src/components/global-property/dashboard/global-property-dashboard.component.tsx +23 -0
- package/src/components/global-property/dashboard/global-property-dashboard.scss +6 -0
- package/src/components/global-property/hooks/useGlobalProperty.ts +64 -0
- package/src/components/global-property/hooks/useLogoUpload.ts +28 -0
- package/src/components/global-property/index.ts +14 -0
- package/src/components/global-property/modal/delete-global-property-modal.component.tsx +71 -0
- package/src/components/global-property/modal/delete-global-property-modal.test.tsx +131 -0
- package/src/components/global-property/table/global-property-table.component.tsx +241 -0
- package/src/components/global-property/table/global-property-table.scss +44 -0
- package/src/components/global-property/table/global-property-table.test.tsx +202 -0
- package/src/components/global-property/workspace/global-property-form-schema.ts +32 -0
- package/src/components/global-property/workspace/global-property.workspace.scss +40 -0
- package/src/components/global-property/workspace/global-property.workspace.test.tsx +172 -0
- package/src/components/global-property/workspace/global-property.workspace.tsx +260 -0
- package/src/components/global-property/workspace/upload-logo.workspace.scss +61 -0
- package/src/components/global-property/workspace/upload-logo.workspace.test.tsx +180 -0
- package/src/components/global-property/workspace/upload-logo.workspace.tsx +191 -0
- package/src/components/hook/healthWorkerRegistry.ts +78 -0
- package/src/components/hook/useProfessionalRegistryEnums.ts +59 -0
- package/src/components/locations/forms/add-location/add-location.workspace.tsx +96 -95
- package/src/components/locations/forms/search-location/search-location.workspace.tsx +90 -85
- package/src/components/locations/tables/locations-table.component.tsx +117 -121
- package/src/components/logs-table/operation-log-table.component.tsx +87 -75
- package/src/components/logs-table/operation-log.test.tsx +134 -28
- package/src/components/modal/hwr-confirmation.modal.scss +80 -4
- package/src/components/modal/hwr-confirmation.modal.tsx +118 -128
- package/src/components/modal/hwr-sync.modal.tsx +194 -106
- package/src/components/users/manage-users/manage-user-role-scope/user-role-scope-workspace/user-role-scope.workspace.tsx +14 -14
- package/src/components/users/manage-users/user-details/user-detail.scss +167 -39
- package/src/components/users/manage-users/user-details/user-details.component.tsx +130 -122
- package/src/components/users/manage-users/user-list/user-list.component.tsx +22 -9
- package/src/components/users/manage-users/user-management.workspace.scss +233 -95
- package/src/components/users/manage-users/user-management.workspace.tsx +800 -687
- package/src/components/users/userManagementFormSchema.tsx +17 -8
- package/src/config-schema.ts +48 -68
- package/src/index.ts +21 -7
- package/src/left-pannel-link.component.tsx +5 -3
- package/src/root.component.tsx +13 -13
- package/src/routes.json +60 -36
- package/src/types/index.ts +40 -3
- package/translations/am.json +213 -13
- package/translations/en.json +225 -25
- package/translations/fr.json +260 -58
- package/translations/sw.json +329 -129
- package/tsconfig.json +1 -1
- package/dist/1072.js +0 -1
- package/dist/1072.js.map +0 -1
- package/dist/1091.js +0 -1
- package/dist/1091.js.map +0 -1
- package/dist/1172.js +0 -1
- package/dist/1172.js.map +0 -1
- package/dist/132.js +0 -1
- package/dist/132.js.map +0 -1
- package/dist/1332.js +0 -1
- package/dist/1332.js.map +0 -1
- package/dist/1577.js +0 -1
- package/dist/1577.js.map +0 -1
- package/dist/1660.js +0 -1
- package/dist/1660.js.map +0 -1
- package/dist/1729.js +0 -17
- package/dist/1729.js.map +0 -1
- package/dist/1761.js +0 -1
- package/dist/1761.js.map +0 -1
- package/dist/1809.js +0 -7
- package/dist/1809.js.map +0 -1
- package/dist/1866.js +0 -1
- package/dist/1866.js.map +0 -1
- package/dist/1962.js +0 -1
- package/dist/1962.js.map +0 -1
- package/dist/2045.js +0 -1
- package/dist/2045.js.map +0 -1
- package/dist/2163.js +0 -1
- package/dist/2163.js.map +0 -1
- package/dist/2267.js +0 -1
- package/dist/2267.js.map +0 -1
- package/dist/2357.js +0 -1
- package/dist/2357.js.map +0 -1
- package/dist/2419.js +0 -1
- package/dist/2419.js.map +0 -1
- package/dist/2561.js +0 -1
- package/dist/2561.js.map +0 -1
- package/dist/2564.js +0 -1
- package/dist/2564.js.map +0 -1
- package/dist/2738.js +0 -1
- package/dist/2738.js.map +0 -1
- package/dist/2797.js +0 -1
- package/dist/2810.js +0 -2
- package/dist/2810.js.map +0 -1
- package/dist/2867.js +0 -1
- package/dist/2867.js.map +0 -1
- package/dist/3040.js +0 -1
- package/dist/3134.js +0 -1
- package/dist/3134.js.map +0 -1
- package/dist/3189.js +0 -1
- package/dist/3189.js.map +0 -1
- package/dist/3228.js +0 -1
- package/dist/3228.js.map +0 -1
- package/dist/3381.js +0 -1
- package/dist/3381.js.map +0 -1
- package/dist/3472.js +0 -1
- package/dist/3472.js.map +0 -1
- package/dist/3491.js +0 -1
- package/dist/3491.js.map +0 -1
- package/dist/3509.js +0 -1
- package/dist/3509.js.map +0 -1
- package/dist/3576.js +0 -1
- package/dist/3576.js.map +0 -1
- package/dist/3968.js +0 -1
- package/dist/3968.js.map +0 -1
- package/dist/4146.js +0 -1
- package/dist/4146.js.map +0 -1
- package/dist/4220.js +0 -1
- package/dist/4220.js.map +0 -1
- package/dist/4224.js +0 -1
- package/dist/4224.js.map +0 -1
- package/dist/4402.js +0 -1
- package/dist/4402.js.map +0 -1
- package/dist/4724.js +0 -1
- package/dist/4724.js.map +0 -1
- package/dist/4972.js +0 -1
- package/dist/4972.js.map +0 -1
- package/dist/509.js +0 -1
- package/dist/509.js.map +0 -1
- package/dist/5096.js +0 -1
- package/dist/5096.js.map +0 -1
- package/dist/5119.js +0 -1
- package/dist/5119.js.map +0 -1
- package/dist/5136.js +0 -1
- package/dist/5136.js.map +0 -1
- package/dist/5159.js +0 -13
- package/dist/5159.js.map +0 -1
- package/dist/5533.js +0 -1
- package/dist/5533.js.map +0 -1
- package/dist/5870.js +0 -1
- package/dist/5870.js.map +0 -1
- package/dist/5882.js +0 -1
- package/dist/5939.js +0 -5
- package/dist/5939.js.map +0 -1
- package/dist/6004.js +0 -1
- package/dist/6004.js.map +0 -1
- package/dist/6121.js +0 -3
- package/dist/6121.js.map +0 -1
- package/dist/6137.js +0 -1
- package/dist/6137.js.map +0 -1
- package/dist/6192.js +0 -1
- package/dist/6192.js.map +0 -1
- package/dist/6232.js +0 -1
- package/dist/6232.js.map +0 -1
- package/dist/6356.js +0 -1
- package/dist/6356.js.map +0 -1
- package/dist/6363.js +0 -1
- package/dist/6363.js.map +0 -1
- package/dist/6548.js +0 -1
- package/dist/6548.js.map +0 -1
- package/dist/6571.js +0 -1
- package/dist/6571.js.map +0 -1
- package/dist/6615.js +0 -1
- package/dist/6615.js.map +0 -1
- package/dist/6721.js +0 -1
- package/dist/6721.js.map +0 -1
- package/dist/6868.js +0 -1
- package/dist/6868.js.map +0 -1
- package/dist/6892.js +0 -1
- package/dist/6892.js.map +0 -1
- package/dist/7127.js +0 -1
- package/dist/7329.js +0 -1
- package/dist/7329.js.map +0 -1
- package/dist/754.js +0 -1
- package/dist/754.js.map +0 -1
- package/dist/7544.js +0 -1
- package/dist/7544.js.map +0 -1
- package/dist/7560.js +0 -1
- package/dist/7560.js.map +0 -1
- package/dist/7988.js +0 -1
- package/dist/8179.js +0 -6
- package/dist/8179.js.map +0 -1
- package/dist/8189.js +0 -1
- package/dist/8189.js.map +0 -1
- package/dist/8249.js +0 -1
- package/dist/8249.js.map +0 -1
- package/dist/8502.js +0 -1
- package/dist/8502.js.map +0 -1
- package/dist/8522.js +0 -1
- package/dist/8522.js.map +0 -1
- package/dist/8622.js +0 -1
- package/dist/8622.js.map +0 -1
- package/dist/8775.js +0 -11
- package/dist/8775.js.map +0 -1
- package/dist/8820.js +0 -1
- package/dist/8820.js.map +0 -1
- package/dist/887.js +0 -1
- package/dist/887.js.map +0 -1
- package/dist/8927.js +0 -1
- package/dist/8927.js.map +0 -1
- package/dist/8977.js +0 -1
- package/dist/8977.js.map +0 -1
- package/dist/916.js +0 -1
- package/dist/9303.js +0 -1
- package/dist/9303.js.map +0 -1
- package/dist/9466.js +0 -1
- package/dist/9466.js.map +0 -1
- package/dist/9675.js +0 -1
- package/dist/9675.js.map +0 -1
- package/dist/9787.js +0 -1
- package/dist/9787.js.map +0 -1
- package/dist/981.js +0 -1
- package/dist/981.js.map +0 -1
- package/dist/984.js +0 -1
- package/dist/984.js.map +0 -1
- package/dist/9931.js +0 -1
- package/dist/9931.js.map +0 -1
- package/dist/9947.js +0 -1
- package/dist/9947.js.map +0 -1
- package/jest.config.js +0 -8
- package/src/components/facility-setup/card.component.tsx +0 -16
- package/src/components/facility-setup/facility-setup.resource.tsx +0 -7
- package/src/components/hook/healthWorkerAdapter.ts +0 -213
- package/src/components/hook/useFacilityInfo.tsx +0 -37
package/dist/routes.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"kenyaemrCharts":"^1.6.7"},"extensions":[{"component":"adminLeftPanelLink","name":"admin-left-panel-link","slot":"admin-left-panel-slot"},{"component":"userManagementLeftPannelLink","name":"user-management-left-panel-link","slot":"admin-left-panel-slot"},{"component":"etlAdministrationLeftPannelLink","name":"etl-administration-left-panel-link","slot":"admin-left-panel-slot"},{"component":"locationsLeftPanelLink","name":"locations-left-panel-link","slot":"admin-left-panel-slot"},{"component":"facilitySetupLeftPanelLink","name":"facility-setup-left-panel-link","slot":"admin-left-panel-slot"},{"component":"providerBanner","name":"provider-banner","slot":"provider-banner-info-slot","order":1}
|
|
1
|
+
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"kenyaemrCharts":"^1.6.7"},"extensions":[{"component":"adminLeftPanelLink","name":"admin-left-panel-link","slot":"admin-left-panel-slot"},{"component":"userManagementLeftPannelLink","name":"user-management-left-panel-link","slot":"admin-left-panel-slot"},{"component":"etlAdministrationLeftPannelLink","name":"etl-administration-left-panel-link","slot":"admin-left-panel-slot"},{"component":"locationsLeftPanelLink","name":"locations-left-panel-link","slot":"admin-left-panel-slot"},{"component":"facilitySetupLeftPanelLink","name":"facility-setup-left-panel-link","slot":"admin-left-panel-slot"},{"name":"global-property-link","component":"globalPropertyLink","slot":"admin-left-panel-slot"},{"component":"providerBanner","name":"provider-banner","slot":"provider-banner-info-slot","order":1},{"component":"globalPropertyDashboard","name":"global-property-dashboard"}],"modals":[{"component":"operationConfirmationModal","name":"operation-confirmation-modal"},{"component":"hwrConfirmationModal","name":"hwr-confirmation-modal"},{"component":"hwrEmptyModal","name":"hwr-empty-modal"},{"component":"hwrSyncModal","name":"hwr-syncing-modal"},{"component":"deleteGlobalPropertyModal","name":"delete-global-property-modal"}],"workspaces2":[{"name":"manage-user-workspace","component":"manageUserWorkspace","window":"esm-admin-extra-wide-workspace-window"},{"name":"user-role-scope-workspace","component":"userRoleScopeWorkspace","window":"esm-admin-workspace-window"},{"name":"add-location-workspace","component":"addLocation","window":"esm-admin-workspace-window"},{"name":"search-location-workspace","component":"searchLocationWorkspace","window":"esm-admin-workspace-window"},{"name":"global-property-workspace","component":"globalPropertyWorkspace","window":"esm-admin-workspace-window"},{"name":"upload-logo-workspace","component":"uploadLogoWorkspace","window":"esm-admin-workspace-window"}],"workspaceWindows2":[{"name":"esm-admin-workspace-window","canMaximize":true,"group":"esm-admin-workspace-group","width":"wider"},{"name":"esm-admin-extra-wide-workspace-window","canMaximize":true,"group":"esm-admin-workspace-group","width":"extra-wide"}],"workspaceGroups2":[{"name":"esm-admin-workspace-group","scopePattern":"/admin","closeable":true}],"pages":[{"component":"root","route":"admin"}],"version":"5.4.4-pre.501"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kenyaemr/esm-admin-app",
|
|
3
|
-
"version": "5.4.4-pre.
|
|
3
|
+
"version": "5.4.4-pre.501",
|
|
4
4
|
"description": "Facilitates the management of ETL tables",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"openmrs"
|
|
@@ -20,14 +20,12 @@
|
|
|
20
20
|
"scripts": {
|
|
21
21
|
"analyze": "rspack build --mode=production --analyze",
|
|
22
22
|
"build": "rspack --mode=production",
|
|
23
|
-
"coverage": "
|
|
23
|
+
"coverage": "echo \"Jest has been removed; no unit test runner is configured\" && exit 0",
|
|
24
24
|
"debug": "npm run serve",
|
|
25
|
-
"extract-translations": "i18next 'src/**/*.
|
|
25
|
+
"extract-translations": "i18next 'src/**/*.{ts,tsx}' --config ../../tools/i18next-parser.config.js",
|
|
26
26
|
"lint": "eslint src --ext ts,tsx",
|
|
27
27
|
"serve": "rspack serve --mode=development",
|
|
28
28
|
"start": "openmrs develop",
|
|
29
|
-
"test": "cross-env TZ=UTC jest --config jest.config.js --verbose false --passWithNoTests",
|
|
30
|
-
"test:watch": "cross-env TZ=UTC jest --watch --config jest.config.js",
|
|
31
29
|
"typescript": "tsc"
|
|
32
30
|
},
|
|
33
31
|
"browserslist": [
|
|
@@ -39,7 +37,7 @@
|
|
|
39
37
|
},
|
|
40
38
|
"peerDependencies": {
|
|
41
39
|
"@carbon/react": "1.x",
|
|
42
|
-
"@openmrs/esm-framework": "
|
|
40
|
+
"@openmrs/esm-framework": "9.x",
|
|
43
41
|
"react": "^18.1.0",
|
|
44
42
|
"react-i18next": "11.x",
|
|
45
43
|
"react-router-dom": "6.x",
|
|
@@ -1,24 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { render, screen, fireEvent } from '@testing-library/react';
|
|
3
3
|
import '@testing-library/jest-dom';
|
|
4
|
-
import {
|
|
4
|
+
import { vi, describe, it, expect } from 'vitest';
|
|
5
5
|
import OperationConfirmation from './confirmation-operation-modal.component';
|
|
6
6
|
|
|
7
|
-
jest.mock('react-i18next', () => ({
|
|
8
|
-
useTranslation: jest.fn(),
|
|
9
|
-
}));
|
|
10
|
-
|
|
11
7
|
describe('OperationConfirmation', () => {
|
|
12
|
-
beforeEach(() => {
|
|
13
|
-
(useTranslation as jest.Mock).mockReturnValue({
|
|
14
|
-
t: (key, defaultValue, options) =>
|
|
15
|
-
options?.operationTypeOrName ? `Do you want to ${options.operationTypeOrName}?` : defaultValue || key,
|
|
16
|
-
});
|
|
17
|
-
});
|
|
18
|
-
|
|
19
8
|
it('renders the component with provided props', () => {
|
|
20
|
-
const closeMock =
|
|
21
|
-
const confirmMock =
|
|
9
|
+
const closeMock = vi.fn();
|
|
10
|
+
const confirmMock = vi.fn();
|
|
22
11
|
const operationName = 'refresh';
|
|
23
12
|
const operationType = 'refreshed';
|
|
24
13
|
|
|
@@ -32,14 +21,14 @@ describe('OperationConfirmation', () => {
|
|
|
32
21
|
);
|
|
33
22
|
|
|
34
23
|
expect(screen.getByRole('heading', { name: 'Confirmation' })).toBeInTheDocument();
|
|
35
|
-
expect(screen.getByText('Do you want to
|
|
24
|
+
expect(screen.getByText('Do you want to {{operationTypeOrName}}?')).toBeInTheDocument();
|
|
36
25
|
expect(screen.getByText('No')).toBeInTheDocument();
|
|
37
26
|
expect(screen.getByText('Yes')).toBeInTheDocument();
|
|
38
27
|
});
|
|
39
28
|
|
|
40
29
|
it('calls close when the No button is clicked', () => {
|
|
41
|
-
const closeMock =
|
|
42
|
-
const confirmMock =
|
|
30
|
+
const closeMock = vi.fn();
|
|
31
|
+
const confirmMock = vi.fn();
|
|
43
32
|
|
|
44
33
|
render(
|
|
45
34
|
<OperationConfirmation close={closeMock} confirm={confirmMock} operationName="delete" operationType="deleted" />,
|
|
@@ -53,8 +42,8 @@ describe('OperationConfirmation', () => {
|
|
|
53
42
|
});
|
|
54
43
|
|
|
55
44
|
it('calls confirm when the Yes button is clicked', () => {
|
|
56
|
-
const closeMock =
|
|
57
|
-
const confirmMock =
|
|
45
|
+
const closeMock = vi.fn();
|
|
46
|
+
const confirmMock = vi.fn();
|
|
58
47
|
|
|
59
48
|
render(
|
|
60
49
|
<OperationConfirmation close={closeMock} confirm={confirmMock} operationName="delete" operationType="deleted" />,
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
} from '../logs-table/operation-log-resource';
|
|
13
13
|
import LogTable from '../logs-table/operation-log-table.component';
|
|
14
14
|
import { showModal, showSnackbar } from '@openmrs/esm-framework';
|
|
15
|
+
import { extractErrorMessagesFromResponse } from '../locations/helpers';
|
|
15
16
|
|
|
16
17
|
const Dashboard: React.FC = () => {
|
|
17
18
|
const { t } = useTranslation();
|
|
@@ -59,7 +60,9 @@ const Dashboard: React.FC = () => {
|
|
|
59
60
|
} catch (error) {
|
|
60
61
|
showSnackbar({
|
|
61
62
|
title: t('operationError', '{{operationName}} failed', { operationName }),
|
|
62
|
-
subtitle: t('operationErrorSubtitle', 'An error occurred during the operation.'
|
|
63
|
+
subtitle: t('operationErrorSubtitle', 'An error occurred during the operation. {{error}}', {
|
|
64
|
+
error: extractErrorMessagesFromResponse(error),
|
|
65
|
+
}),
|
|
63
66
|
kind: 'error',
|
|
64
67
|
isLowContrast: true,
|
|
65
68
|
});
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { render, screen } from '@testing-library/react';
|
|
2
2
|
import '@testing-library/jest-dom';
|
|
3
|
-
import {
|
|
3
|
+
import { vi, describe, it, expect } from 'vitest';
|
|
4
4
|
import EmptyState from './empty-state-log.components';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
EmptyDataIllustration: jest.fn(() => <div>Mocked EmptyDataIllustration</div>),
|
|
7
|
+
vi.mock('@openmrs/esm-patient-common-lib', () => ({
|
|
8
|
+
EmptyDataIllustration: vi.fn(() => <div>Mocked EmptyDataIllustration</div>),
|
|
10
9
|
}));
|
|
11
10
|
|
|
12
11
|
describe('EmptyState', () => {
|
|
@@ -1,142 +1,281 @@
|
|
|
1
|
-
import { Button, Column, Grid, InlineLoading,
|
|
1
|
+
import { Button, Column, Grid, InlineLoading, Tag, Tile } from '@carbon/react';
|
|
2
|
+
import { Renew, Phone, Email } from '@carbon/react/icons';
|
|
2
3
|
import { formatDate, parseDate, showSnackbar } from '@openmrs/esm-framework';
|
|
3
|
-
import React, { useCallback
|
|
4
|
+
import React, { useCallback } from 'react';
|
|
4
5
|
import { useTranslation } from 'react-i18next';
|
|
5
|
-
import { useLocalFacilityInfo, useShaFacilityInfo } from '../hook/useFacilityInfo';
|
|
6
6
|
import styles from './facility-info.scss';
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
7
|
+
import { InfoRow } from './shared/custom-info.component';
|
|
8
|
+
import { SectionCard } from './shared/custom-section-card.component';
|
|
9
|
+
import { StatusTag } from './shared/custom-status-tag.component';
|
|
10
|
+
import { syncFacilityRegistry, useFacilityRegistry } from './useFacilityRegistry';
|
|
11
|
+
import { FacilityRegistryRecord } from './type';
|
|
12
|
+
import { CardHeader } from '@openmrs/esm-patient-common-lib';
|
|
13
|
+
import EmptyState from '../empty-state/empty-state-log.components';
|
|
10
14
|
|
|
11
|
-
const
|
|
15
|
+
const FacilityRegistryView: React.FC = () => {
|
|
12
16
|
const { t } = useTranslation();
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
shaFacility,
|
|
16
|
-
isLoading: isShaFacilityLoading,
|
|
17
|
-
error: shaFacilityError,
|
|
18
|
-
mutate: mutateShafacility,
|
|
19
|
-
} = useShaFacilityInfo(shouldSynchronize);
|
|
20
|
-
const {
|
|
21
|
-
localFacility,
|
|
22
|
-
isLoading: isLocalFacilityLoading,
|
|
23
|
-
mutate: mutateLocalFacility,
|
|
24
|
-
error: localFacilityError,
|
|
25
|
-
} = useLocalFacilityInfo();
|
|
26
|
-
const mutateFacility = useCallback(async () => {
|
|
27
|
-
const defaultFacility = await mutateLocalFacility();
|
|
28
|
-
const shaFacility = await mutateShafacility();
|
|
29
|
-
return {
|
|
30
|
-
shaFacility,
|
|
31
|
-
defaultFacility,
|
|
32
|
-
};
|
|
33
|
-
}, [mutateLocalFacility, mutateShafacility]);
|
|
34
|
-
const shaStatus = useMemo(
|
|
35
|
-
() =>
|
|
36
|
-
shaFacility?.operationalStatus
|
|
37
|
-
? `${shaFacility.operationalStatus.at(0).toUpperCase()}${shaFacility.operationalStatus
|
|
38
|
-
.slice(1)
|
|
39
|
-
?.toLocaleLowerCase()}`
|
|
40
|
-
: undefined,
|
|
41
|
-
[shaFacility],
|
|
42
|
-
);
|
|
43
|
-
const shaExpiry = useMemo(
|
|
44
|
-
() =>
|
|
45
|
-
shaFacility?.shaFacilityExpiryDate && dayjs(shaFacility.shaFacilityExpiryDate).isValid()
|
|
46
|
-
? formatDate(parseDate(shaFacility.shaFacilityExpiryDate))
|
|
47
|
-
: undefined,
|
|
48
|
-
[shaFacility],
|
|
49
|
-
);
|
|
17
|
+
const { facility, isLoading, error, notYetSynced, mutate } = useFacilityRegistry();
|
|
18
|
+
const [isSyncing, setIsSyncing] = React.useState(false);
|
|
50
19
|
|
|
51
|
-
const
|
|
20
|
+
const handleSync = useCallback(async () => {
|
|
21
|
+
setIsSyncing(true);
|
|
52
22
|
try {
|
|
53
|
-
|
|
54
|
-
|
|
23
|
+
const result = await syncFacilityRegistry();
|
|
24
|
+
await mutate();
|
|
55
25
|
showSnackbar({
|
|
56
|
-
title: t('
|
|
26
|
+
title: t('facilityRegistrySyncSuccess', 'Facility synced'),
|
|
27
|
+
subtitle: t('facilityRegistrySyncedFrom', 'Pulled {{name}} from the facility registry', {
|
|
28
|
+
name: result.official_name,
|
|
29
|
+
}),
|
|
57
30
|
kind: 'success',
|
|
58
31
|
isLowContrast: true,
|
|
59
32
|
});
|
|
60
|
-
|
|
61
|
-
showSnackbar({
|
|
62
|
-
kind: 'warning',
|
|
63
|
-
title: 'HIE Sync Failed. Pulling local info.',
|
|
64
|
-
isLowContrast: true,
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
// sync packages and intervensions
|
|
68
|
-
await syncPackagesAndInterventions();
|
|
69
|
-
} catch (error) {
|
|
70
|
-
const errorMessage =
|
|
71
|
-
error?.responseBody?.error?.message ??
|
|
72
|
-
t('hieSynchronizationError', 'An error occurred while synchronizing with HIE');
|
|
33
|
+
} catch (err: any) {
|
|
73
34
|
showSnackbar({
|
|
74
|
-
title: t('
|
|
75
|
-
subtitle:
|
|
35
|
+
title: t('facilityRegistrySyncFailed', 'Sync failed'),
|
|
36
|
+
subtitle:
|
|
37
|
+
err?.responseBody?.error ??
|
|
38
|
+
err?.message ??
|
|
39
|
+
t('facilityRegistrySyncError', 'Unable to reach the facility registry'),
|
|
76
40
|
kind: 'error',
|
|
77
41
|
isLowContrast: true,
|
|
78
42
|
});
|
|
43
|
+
} finally {
|
|
44
|
+
setIsSyncing(false);
|
|
79
45
|
}
|
|
80
|
-
}, [
|
|
46
|
+
}, [mutate, t]);
|
|
81
47
|
|
|
82
|
-
|
|
83
|
-
|
|
48
|
+
if (isLoading) {
|
|
49
|
+
return (
|
|
50
|
+
<div className={styles.root}>
|
|
51
|
+
<InlineLoading description={t('loadingFacility', 'Loading facility…')} />
|
|
52
|
+
</div>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (error) {
|
|
57
|
+
return (
|
|
58
|
+
<div className={styles.root}>
|
|
59
|
+
<Tile className={styles.errorTile}>
|
|
60
|
+
<p>{t('facilityRegistryLoadError', 'Failed to load the facility record.')}</p>
|
|
61
|
+
<Button kind="secondary" size="sm" renderIcon={Renew} onClick={handleSync} disabled={isSyncing}>
|
|
62
|
+
{isSyncing ? t('syncing', 'Syncing…') : t('retry', 'Retry sync')}
|
|
63
|
+
</Button>
|
|
64
|
+
</Tile>
|
|
65
|
+
</div>
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (notYetSynced || !facility) {
|
|
70
|
+
return (
|
|
84
71
|
<div>
|
|
85
|
-
<
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
72
|
+
<CardHeader title={t('facilityDetails', 'Facility details')}>
|
|
73
|
+
<Button kind="primary" size="sm" renderIcon={Renew} onClick={handleSync} disabled={isSyncing}>
|
|
74
|
+
{isSyncing ? t('syncing', 'Syncing…') : t('syncNow', 'Sync now')}
|
|
75
|
+
</Button>
|
|
76
|
+
</CardHeader>
|
|
77
|
+
<EmptyState
|
|
78
|
+
subTitle={t(
|
|
79
|
+
'facilityRegistryNotSyncedBody',
|
|
80
|
+
'This facility has not been pulled from the registry. Click sync to fetch the latest record.',
|
|
81
|
+
)}
|
|
82
|
+
/>
|
|
83
|
+
</div>
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return (
|
|
88
|
+
<div className={styles.root}>
|
|
89
|
+
<div className={styles.pageHeader}>
|
|
90
|
+
<div className={styles.pageActions}>
|
|
91
|
+
{facility.last_synced_at && (
|
|
92
|
+
<span className={styles.lastSynced}>
|
|
93
|
+
{t('lastSynced', 'Last synced')}: {formatDate(parseDate(facility.last_synced_at))}
|
|
94
|
+
</span>
|
|
95
|
+
)}
|
|
96
|
+
{isSyncing ? (
|
|
97
|
+
<InlineLoading description={t('syncing', 'Syncing…')} />
|
|
91
98
|
) : (
|
|
92
|
-
<Button kind="
|
|
93
|
-
{t('
|
|
99
|
+
<Button kind="secondary" size="sm" renderIcon={Renew} onClick={handleSync}>
|
|
100
|
+
{t('syncWithRegistry', 'Sync with facility registry')}
|
|
94
101
|
</Button>
|
|
95
102
|
)}
|
|
96
|
-
</
|
|
103
|
+
</div>
|
|
97
104
|
</div>
|
|
98
105
|
|
|
99
|
-
<Grid narrow>
|
|
100
|
-
{
|
|
106
|
+
<Grid narrow className={styles.grid}>
|
|
107
|
+
<Column sm={4} md={4} lg={8}>
|
|
108
|
+
<SectionCard title={t('generalInformation', 'General information')}>
|
|
109
|
+
<InfoRow label={t('facilityName', 'Facility name')} value={facility.official_name} />
|
|
110
|
+
<InfoRow label={t('registrationNumber', 'Registration no.')} value={facility.registration_number} />
|
|
111
|
+
<InfoRow label={t('frCode', 'FR code')} value={facility.fr_code} />
|
|
112
|
+
<InfoRow label={t('fidCode', 'FID code')} value={facility.fid_code} />
|
|
113
|
+
<InfoRow label={t('kephLevel', 'KEPH level')} value={facility.keph_level} />
|
|
114
|
+
<InfoRow label={t('facilityType', 'Facility type')} value={facility.facility_type} />
|
|
115
|
+
<InfoRow label={t('facilityOwnership', 'Ownership')} value={facility.facility_ownership} />
|
|
116
|
+
<InfoRow
|
|
117
|
+
label={t('hubFacility', 'Hub facility')}
|
|
118
|
+
value={
|
|
119
|
+
<Tag type={facility.is_hub ? 'blue' : 'gray'} size="sm">
|
|
120
|
+
{facility.is_hub ? t('yes', 'Yes') : t('no', 'No')}
|
|
121
|
+
</Tag>
|
|
122
|
+
}
|
|
123
|
+
/>
|
|
124
|
+
</SectionCard>
|
|
125
|
+
</Column>
|
|
126
|
+
|
|
127
|
+
<Column sm={4} md={4} lg={8}>
|
|
128
|
+
<SectionCard title={t('licenseAndShaStatus', 'License & SHA status')}>
|
|
129
|
+
<InfoRow label={t('licenseNumber', 'License no.')} value={facility.license_number} />
|
|
130
|
+
<InfoRow label={t('regulatoryBody', 'Regulatory body')} value={facility.regulatory_body} />
|
|
131
|
+
<InfoRow
|
|
132
|
+
label={t('licenseStatus', 'License status')}
|
|
133
|
+
value={<StatusTag value={facility.license_status} />}
|
|
134
|
+
/>
|
|
135
|
+
<InfoRow
|
|
136
|
+
label={t('licenseStart', 'License start')}
|
|
137
|
+
value={facility.license_start_date ? formatDate(parseDate(facility.license_start_date)) : '—'}
|
|
138
|
+
/>
|
|
139
|
+
<InfoRow
|
|
140
|
+
label={t('licenseExpiry', 'License expiry')}
|
|
141
|
+
value={facility.license_end_date ? formatDate(parseDate(facility.license_end_date)) : '—'}
|
|
142
|
+
/>
|
|
143
|
+
<InfoRow
|
|
144
|
+
label={t('regulatoryOperationalStatus', 'Regulatory status')}
|
|
145
|
+
value={<StatusTag value={facility.regulatory_operational_status} />}
|
|
146
|
+
/>
|
|
147
|
+
<InfoRow
|
|
148
|
+
label={t('shaOperationalStatus', 'SHA status')}
|
|
149
|
+
value={<StatusTag value={facility.sha_operational_status} />}
|
|
150
|
+
/>
|
|
151
|
+
<InfoRow
|
|
152
|
+
label={t('shaContractStatus', 'SHA contract')}
|
|
153
|
+
value={
|
|
154
|
+
facility.sha_contract_status && facility.sha_contract_status !== '' ? (
|
|
155
|
+
<StatusTag value={facility.sha_contract_status} />
|
|
156
|
+
) : (
|
|
157
|
+
<Tag type="gray" size="sm">
|
|
158
|
+
{t('notContracted', 'Not contracted')}
|
|
159
|
+
</Tag>
|
|
160
|
+
)
|
|
161
|
+
}
|
|
162
|
+
/>
|
|
163
|
+
{facility.bed_occupancy && (
|
|
164
|
+
<InfoRow label={t('totalBeds', 'Total beds')} value={facility.bed_occupancy.totalBeds?.toString()} />
|
|
165
|
+
)}
|
|
166
|
+
</SectionCard>
|
|
167
|
+
</Column>
|
|
168
|
+
|
|
101
169
|
<Column sm={4} md={4} lg={8}>
|
|
102
|
-
<
|
|
103
|
-
<
|
|
104
|
-
<
|
|
105
|
-
<
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
<
|
|
111
|
-
|
|
112
|
-
|
|
170
|
+
<SectionCard title={t('location', 'Location')}>
|
|
171
|
+
<InfoRow label={t('country', 'Country')} value={facility.address?.country} />
|
|
172
|
+
<InfoRow label={t('county', 'County')} value={facility.address?.county} />
|
|
173
|
+
<InfoRow label={t('subCounty', 'Sub-county')} value={facility.address?.sub_county} />
|
|
174
|
+
<InfoRow label={t('town', 'Town')} value={facility.address?.town} />
|
|
175
|
+
<InfoRow label={t('physicalLocation', 'Physical location')} value={facility.address?.physical_location} />
|
|
176
|
+
<InfoRow label={t('postalAddress', 'Postal address')} value={facility.address?.postal_address} />
|
|
177
|
+
{facility.address?.latitude != null && facility.address?.longitude != null && (
|
|
178
|
+
<InfoRow
|
|
179
|
+
label={t('coordinates', 'Coordinates')}
|
|
180
|
+
value={`${facility.address.latitude}, ${facility.address.longitude}`}
|
|
181
|
+
/>
|
|
182
|
+
)}
|
|
183
|
+
</SectionCard>
|
|
113
184
|
</Column>
|
|
114
185
|
|
|
115
|
-
{/* SHA Info Column */}
|
|
116
186
|
<Column sm={4} md={4} lg={8}>
|
|
117
|
-
<
|
|
118
|
-
<
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
187
|
+
<SectionCard title={t('contactAndAdministrator', 'Contact & administrator')}>
|
|
188
|
+
<InfoRow
|
|
189
|
+
label={t('facilityPhone', 'Phone')}
|
|
190
|
+
value={
|
|
191
|
+
facility.facility_phone_number ? (
|
|
192
|
+
<span className={styles.contactValue}>
|
|
193
|
+
<Phone size={14} />
|
|
194
|
+
{facility.facility_phone_number}
|
|
195
|
+
</span>
|
|
196
|
+
) : undefined
|
|
197
|
+
}
|
|
198
|
+
/>
|
|
199
|
+
<InfoRow
|
|
200
|
+
label={t('facilityEmail', 'Email')}
|
|
201
|
+
value={
|
|
202
|
+
facility.facility_email ? (
|
|
203
|
+
<span className={styles.contactValue}>
|
|
204
|
+
<Email size={14} />
|
|
205
|
+
{facility.facility_email}
|
|
206
|
+
</span>
|
|
207
|
+
) : undefined
|
|
208
|
+
}
|
|
209
|
+
/>
|
|
210
|
+
{facility.facility_administrator_name && (
|
|
211
|
+
<div className={styles.adminCard}>
|
|
212
|
+
<div>
|
|
213
|
+
<p className={styles.adminName}>{facility.facility_administrator_name}</p>
|
|
214
|
+
{facility.facility_administrator_phone && (
|
|
215
|
+
<p className={styles.adminDetail}>{facility.facility_administrator_phone}</p>
|
|
216
|
+
)}
|
|
217
|
+
{facility.facility_administrator_email && (
|
|
218
|
+
<p className={styles.adminDetail}>{facility.facility_administrator_email}</p>
|
|
219
|
+
)}
|
|
220
|
+
</div>
|
|
133
221
|
</div>
|
|
134
|
-
|
|
135
|
-
</
|
|
222
|
+
)}
|
|
223
|
+
</SectionCard>
|
|
224
|
+
</Column>
|
|
225
|
+
|
|
226
|
+
<Column sm={4} md={8} lg={16}>
|
|
227
|
+
<SectionCard title={t('bedOccupancy', 'Bed occupancy')}>
|
|
228
|
+
<BedOccupancyView facility={facility} />
|
|
229
|
+
</SectionCard>
|
|
230
|
+
</Column>
|
|
231
|
+
|
|
232
|
+
<Column sm={4} md={8} lg={16}>
|
|
233
|
+
<SectionCard title={t('shaContractedServices', 'SHA contracted services')}>
|
|
234
|
+
<ServicesView facility={facility} />
|
|
235
|
+
</SectionCard>
|
|
136
236
|
</Column>
|
|
137
237
|
</Grid>
|
|
138
238
|
</div>
|
|
139
239
|
);
|
|
140
240
|
};
|
|
141
241
|
|
|
142
|
-
|
|
242
|
+
const BedOccupancyView: React.FC<{ facility: FacilityRegistryRecord }> = ({ facility }) => {
|
|
243
|
+
const { t } = useTranslation();
|
|
244
|
+
const bo = facility.bed_occupancy;
|
|
245
|
+
if (!bo) {
|
|
246
|
+
return <p className={styles.emptyState}>{t('noBedOccupancyData', 'No bed occupancy data')}</p>;
|
|
247
|
+
}
|
|
248
|
+
return (
|
|
249
|
+
<div className={styles.bedGrid}>
|
|
250
|
+
<InfoRow label={t('totalBeds', 'Total')} value={bo.totalBeds?.toString()} />
|
|
251
|
+
<InfoRow label={t('normalBeds', 'Normal')} value={bo.normalBeds?.toString()} />
|
|
252
|
+
<InfoRow label={t('icuBeds', 'ICU')} value={bo.icuBeds?.toString()} />
|
|
253
|
+
<InfoRow label={t('hduBeds', 'HDU')} value={bo.hduBeds?.toString()} />
|
|
254
|
+
<InfoRow label={t('dialysisBeds', 'Dialysis')} value={bo.dialysisBeds?.toString()} />
|
|
255
|
+
<InfoRow label={t('cots', 'Cots')} value={bo.numberOfCots?.toString()} />
|
|
256
|
+
</div>
|
|
257
|
+
);
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
const ServicesView: React.FC<{ facility: FacilityRegistryRecord }> = ({ facility }) => {
|
|
261
|
+
const { t } = useTranslation();
|
|
262
|
+
const services = facility.sha_contracted_services ?? [];
|
|
263
|
+
if (services.length === 0) {
|
|
264
|
+
return (
|
|
265
|
+
<p className={styles.emptyState}>
|
|
266
|
+
{t('noContractedServices', 'No contracted services on record for this facility.')}
|
|
267
|
+
</p>
|
|
268
|
+
);
|
|
269
|
+
}
|
|
270
|
+
return (
|
|
271
|
+
<div className={styles.serviceList}>
|
|
272
|
+
{services.map((svc, idx) => (
|
|
273
|
+
<Tag key={idx} type="teal" size="sm">
|
|
274
|
+
{typeof svc === 'string' ? svc : svc.name ?? JSON.stringify(svc)}
|
|
275
|
+
</Tag>
|
|
276
|
+
))}
|
|
277
|
+
</div>
|
|
278
|
+
);
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
export default FacilityRegistryView;
|