@kenyaemr/esm-bed-management-app 1.0.1-pre.4 → 8.1.1-pre.116
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 +36 -0
- package/README.md +6 -38
- package/dist/130.js +2 -0
- package/dist/{800.js.LICENSE.txt → 130.js.LICENSE.txt} +2 -0
- package/dist/130.js.map +1 -0
- package/dist/148.js +1 -0
- package/dist/148.js.map +1 -0
- package/dist/169.js +1 -0
- package/dist/169.js.map +1 -0
- package/dist/271.js +1 -0
- package/dist/319.js +1 -0
- package/dist/325.js +1 -0
- package/dist/325.js.map +1 -0
- package/dist/339.js +1 -0
- package/dist/339.js.map +1 -0
- package/dist/455.js +1 -1
- package/dist/455.js.LICENSE.txt +6 -0
- package/dist/455.js.map +1 -1
- package/dist/460.js +1 -0
- package/dist/501.js +1 -0
- package/dist/501.js.map +1 -0
- package/dist/542.js +1 -0
- package/dist/542.js.map +1 -0
- package/dist/574.js +1 -1
- package/dist/591.js +2 -0
- package/dist/{26.js.LICENSE.txt → 591.js.LICENSE.txt} +3 -3
- package/dist/591.js.map +1 -0
- package/dist/644.js +1 -0
- package/dist/757.js +1 -0
- package/dist/766.js +2 -0
- package/dist/{330.js.LICENSE.txt → 766.js.LICENSE.txt} +0 -9
- package/dist/766.js.map +1 -0
- package/dist/{294.js → 784.js} +2 -2
- package/dist/{294.js.map → 784.js.map} +1 -1
- package/dist/788.js +1 -0
- package/dist/807.js +1 -0
- package/dist/833.js +1 -0
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/openmrs-esm-bed-management-app.js +1 -0
- package/dist/{esm-kenyaemr-bed-management-app.js.buildmanifest.json → openmrs-esm-bed-management-app.js.buildmanifest.json} +202 -155
- package/dist/openmrs-esm-bed-management-app.js.map +1 -0
- package/dist/routes.json +1 -1
- package/jest.config.js +3 -0
- package/package.json +25 -82
- package/src/__mocks__/react-i18next.js +18 -14
- package/src/admin-card-link.component.tsx +7 -10
- package/src/bed-administration/bed-administration-form.component.tsx +65 -99
- package/src/bed-administration/bed-administration-table.component.tsx +68 -127
- package/src/bed-administration/bed-administration-table.scss +12 -16
- package/src/bed-administration/bed-administration-types.ts +8 -0
- package/src/bed-administration/bed-administration.resource.ts +16 -18
- package/src/bed-administration/edit-bed-form.component.tsx +20 -31
- package/src/bed-administration/new-bed-form.component.tsx +28 -44
- package/src/bed-tag/bed-tag-administration-table.component.tsx +192 -0
- package/src/bed-tag/bed-tags-admin-form.component.tsx +127 -0
- package/src/bed-tag/edit-tag-form.component.tsx +72 -0
- package/src/bed-tag/new-tag-form.component.tsx +76 -0
- package/src/bed-type/bed-type-admin-form.component.tsx +166 -0
- package/src/bed-type/bed-type-administration-table.component.tsx +198 -0
- package/src/bed-type/edit-bed-type.component.tsx +72 -0
- package/src/bed-type/new-bed-type-form.component.tsx +80 -0
- package/src/card-header/card-header.component.tsx +20 -0
- package/src/card-header/card-header.scss +45 -0
- package/src/config-schema.ts +9 -17
- package/src/declarations.d.ts +5 -5
- package/src/empty-state/empty-state.component.tsx +6 -21
- package/src/empty-state/empty-state.scss +10 -10
- package/src/header/header.component.tsx +14 -23
- package/src/header/header.scss +11 -11
- package/src/header/illustration.component.tsx +3 -3
- package/src/home.component.tsx +4 -4
- package/src/index.ts +26 -40
- package/src/left-panel/left-panel.component.tsx +7 -17
- package/src/left-panel/left-panel.scss +8 -7
- package/src/left-panel-link.component.tsx +14 -24
- package/src/root.component.tsx +14 -10
- package/src/root.scss +2 -2
- package/src/routes.json +12 -2
- package/src/setup-tests.ts +1 -1
- package/src/summary/summary.component.tsx +16 -30
- package/src/summary/summary.resource.ts +169 -60
- package/src/summary/summary.scss +31 -29
- package/src/types.ts +50 -29
- package/src/ward-card/ward-card.component.tsx +5 -12
- package/src/ward-card/ward-card.scss +2 -2
- package/src/ward-with-beds/ward-with-beds.component.tsx +28 -47
- package/src/ward-with-beds/ward-with-beds.scss +5 -5
- package/translations/am.json +51 -0
- package/translations/ar.json +51 -0
- package/translations/en.json +48 -4
- package/translations/es.json +51 -0
- package/translations/fr.json +51 -0
- package/translations/he.json +51 -0
- package/translations/km.json +51 -0
- package/translations/zh.json +51 -0
- package/translations/zh_CN.json +51 -0
- package/tsconfig.json +3 -21
- package/webpack.config.js +1 -1
- package/.editorconfig +0 -12
- package/.eslintignore +0 -2
- package/.eslintrc +0 -37
- package/.husky/pre-commit +0 -4
- package/.idea/inspectionProfiles/Project_Default.xml +0 -6
- package/.idea/modules.xml +0 -8
- package/.idea/vcs.xml +0 -6
- package/.prettierignore +0 -14
- package/.turbo.json +0 -18
- package/.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs +0 -541
- package/.yarn/plugins/@yarnpkg/plugin-version.cjs +0 -550
- package/.yarn/versions/6816f0d4.yml +0 -0
- package/LICENSE +0 -373
- package/dist/187.js +0 -1
- package/dist/187.js.map +0 -1
- package/dist/207.js +0 -1
- package/dist/207.js.map +0 -1
- package/dist/26.js +0 -2
- package/dist/26.js.map +0 -1
- package/dist/283.js +0 -1
- package/dist/283.js.map +0 -1
- package/dist/330.js +0 -2
- package/dist/330.js.map +0 -1
- package/dist/352.js +0 -1
- package/dist/352.js.map +0 -1
- package/dist/404.js +0 -1
- package/dist/404.js.map +0 -1
- package/dist/558.js +0 -2
- package/dist/558.js.LICENSE.txt +0 -14
- package/dist/558.js.map +0 -1
- package/dist/629.js +0 -1
- package/dist/629.js.map +0 -1
- package/dist/707.js +0 -1
- package/dist/707.js.map +0 -1
- package/dist/800.js +0 -2
- package/dist/800.js.map +0 -1
- package/dist/884.js +0 -1
- package/dist/884.js.map +0 -1
- package/dist/933.js +0 -1
- package/dist/933.js.map +0 -1
- package/dist/959.js +0 -1
- package/dist/959.js.map +0 -1
- package/dist/esm-kenyaemr-bed-management-app.js +0 -1
- package/dist/esm-kenyaemr-bed-management-app.js.map +0 -1
- package/i18next-parser.config.js +0 -89
- package/src/assets/landing-page.png +0 -0
- package/src/assets/logo.svg +0 -1
- package/src/bed-admission/active-patients/active-patients-table.component.tsx +0 -299
- package/src/bed-admission/active-patients/active-visits.resource.ts +0 -171
- package/src/bed-admission/active-patients/admission-action-button-styles.scss +0 -0
- package/src/bed-admission/active-patients/admission-action-button.component.tsx +0 -26
- package/src/bed-admission/active-patients/index.tsx +0 -15
- package/src/bed-admission/active-patients/patient-queues.resource.ts +0 -136
- package/src/bed-admission/active-patients/styles.scss +0 -284
- package/src/bed-admission/active-patients/view-action-menu.component.tsx +0 -33
- package/src/bed-admission/admitted-patients/active-admissions.resource.ts +0 -121
- package/src/bed-admission/admitted-patients/admitted-patients-table.component.tsx +0 -280
- package/src/bed-admission/admitted-patients/admitted-patients.component.tsx +0 -22
- package/src/bed-admission/admitted-patients/location-combo-box.component.tsx +0 -55
- package/src/bed-admission/admitted-patients/styles.scss +0 -284
- package/src/bed-admission/bed-admission-tabs-styles.scss +0 -30
- package/src/bed-admission/bed-admission-tabs.component.tsx +0 -69
- package/src/bed-admission/bed-admission.component.tsx +0 -15
- package/src/bed-admission/bed-admission.resource.ts +0 -35
- package/src/bed-admission/bed-layout/bed-layout-list.component.tsx +0 -101
- package/src/bed-admission/bed-layout/bed-layout.component.tsx +0 -64
- package/src/bed-admission/bed-layout/bed-layout.scss +0 -118
- package/src/bed-admission/bed-layout/min-bed-layout.component.tsx +0 -26
- package/src/bed-admission/createDashboardLink.tsx +0 -47
- package/src/bed-admission/discharged-patients/discharged-patients.componet.tsx +0 -19
- package/src/bed-admission/helpers/functions.ts +0 -102
- package/src/bed-admission/types.ts +0 -133
- package/src/workspace/allocate-bed-workspace.component.tsx +0 -141
- package/src/workspace/allocate-bed.scss +0 -117
- package/src/workspace/overlay.component.tsx +0 -55
- package/src/workspace/overlay.scss +0 -96
- /package/dist/{294.js.LICENSE.txt → 784.js.LICENSE.txt} +0 -0
package/src/assets/logo.svg
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg width="320" height="100" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><path fill="#409184" d="M0 0h320v100H0z"/><g fill-rule="nonzero"><path d="M57.97 55.541c0 6.26-5.85 9.37-12.48 9.37-6.63 0-12.49-3.11-12.49-9.37v-21.19s5.56 0 5.56 2.7v17.88c0 3.73 2.86 5.68 6.93 5.68s6.93-1.95 6.93-5.68v-20.58s5.56 0 5.56 2.7v18.49h-.01Zm48.45-6.14c0-1.49-.83-2.82-4.02-2.82-3.48 0-6.64 1.2-6.64 4.69-1.2-1.62-1.58-2.9-1.58-4.02 0-3.61 4.85-4.69 8.25-4.69 6.1 0 9.33 2.57 9.33 7.09v15.18c-1.08-.54-2.16-.66-3.19-.66-2.07 0-4.15.75-6.51.75-4.27 0-8.46-1.58-8.46-6.51 0-7.76 11.12-5.73 12.82-9.01Zm.12 4.23c-.95 2.2-7.59 1-7.59 4.69 0 1.87 1.37 2.82 3.73 2.82 2.2 0 3.86-.75 3.86-.75v-6.76Zm23.27-3.61c0-2.2-1.04-3.44-3.98-3.44-2.12 0-3.94.58-3.94.58v17.54s-5.39 0-5.39-2.7v-19.44s1.62.87 3.73.87c2.03 0 3.94-.87 6.18-.87 4.27 0 8.79 1.45 8.79 6.84v15.3s-5.39-.08-5.39-2.7v-11.98Zm23.27-17.21c.37 0 5.39-.04 5.39 3.11v28.99c-1.08-.54-2.2-.71-3.32-.71-2.2 0-4.31.71-6.05.71-5.93 0-9.33-2.61-9.33-7.22v-7.96c0-4.48 3.86-7.17 8.29-7.17 3.44 0 5.35 1.62 5.35 1.62s-.33-1.37-.33-2.41v-8.96Zm0 17.13c0-2.03-2.24-3.44-4.48-3.44-1.99 0-3.44 1.16-3.44 3.86v6.72c0 2.61 1 3.9 4.44 3.9 1.87 0 3.48-.5 3.48-.5v-10.54Zm22.44-.54c0-1.49-.83-2.82-4.02-2.82-3.48 0-6.64 1.2-6.64 4.69-1.2-1.62-1.58-2.9-1.58-4.02 0-3.61 4.85-4.69 8.25-4.69 6.1 0 9.33 2.57 9.33 7.09v15.18c-1.08-.54-2.16-.66-3.19-.66-2.07 0-4.15.75-6.51.75-4.27 0-8.46-1.58-8.46-6.51 0-7.76 11.12-5.73 12.82-9.01Zm.12 4.23c-.95 2.2-7.59 1-7.59 4.69 0 1.87 1.37 2.82 3.73 2.82 2.2 0 3.86-.75 3.86-.75v-6.76Zm17.3-2.53v8.29h14.81c0 .29-.08 5.02-3.86 5.02h-12.73s-5.35 0-5.35-3.19v-26.95h21.94s0 5.06-3.86 5.06h-10.95v6.72h7.8c4.11 0 5.35-.66 5.35-.66 0 2.86-.58 5.72-4.69 5.72h-8.46v-.01Zm41.93-.16c0-2.03.54-4.65.54-4.65l-6.3 13.4s-4.31 0-6.3-3.11l-4.44-10.04s.46 2.36.46 4.4v13.89s-7.13 0-7.13-3.19v-27.37h4.4c.25 0 3.36-.04 4.65 2.78l6.1 13.52 7.63-16.3c1.58 0 7.55 0 7.55 3.19v27.37s-7.13 0-7.13-3.19v-10.7h-.03Zm27 .41c5.23 3.44 6.68 8.38 9.75 12.73 0 0-2.53.66-3.53.66-1.74 0-4.15-.54-5.64-2.95-1.7-2.7-3.82-7.92-7.92-9.7v12.73s-7.13-.12-7.13-3.19v-27.36h10.41c6.72 0 11.57 1.91 11.57 7.88v1.24c0 4.35-2.7 7.88-7.51 7.96Zm-7.34-12.03v7.51h3.61c3.03 0 4.11-1.33 4.11-4.06 0-2.7-1.45-3.44-4.44-3.44h-3.28v-.01Z" fill="#FDFFFF"/><path d="M103.92 73.601c0-.59.07-1.22.07-1.22l-3.51 7.12s-.43 0-.83-.64l-3.09-6.52s.07.67.07 1.26v8.17s-.84 0-.84-.64v-9.57h.71s.57 0 .88.68l2.87 6.1 3.26-6.77s1.25.01 1.25.64v9.57s-.84 0-.84-.64v-7.54Zm9.66 6.76c0 1-1.44 1.45-2.73 1.45-1.67 0-2.74-.83-2.74-2.25v-3.01c0-1.41.94-2.25 2.67-2.25s2.73.84 2.73 2.1c0 1.15-.78 2.03-2.8 2.03-.94 0-1.8-.38-1.8-.38v1.29c0 1.09.46 1.68 1.94 1.68 1.32 0 2.39-.52 2.39-1.59.26.35.34.65.34.93Zm-4.66-3.05c-.06.03 1 .33 1.73.33 1.54 0 2.07-.48 2.07-1.25 0-.8-.48-1.35-1.9-1.35-1.54 0-1.9.64-1.9 1.71v.56Zm12.24-6.41c.13 0 .8-.01.8.77v10.03c-.26-.1-.52-.14-.77-.14-.59 0-1.32.25-2.04.25-1.67 0-2.64-.87-2.64-2.2v-3.1c0-1.38 1.09-2.19 2.36-2.19 2.03 0 2.45.9 2.45.9s-.16-.28-.16-1.52v-2.8Zm0 5.67c0-.9-1.06-1.51-2.1-1.51-1 0-1.75.51-1.75 1.65v2.67c0 1.12.51 1.67 2.1 1.67 1.07 0 1.75-.35 1.75-.35v-4.13Zm4.1-4.72h.75c.13 0 .16.12.16.2v.8h-.75c-.09 0-.16-.1-.16-.19v-.81Zm.06 2.52c.09 0 .8.03.8.64v6.73s-.8 0-.8-.64v-6.73Zm9.58 5.97c0 1.01-1.38 1.46-2.68 1.46-1.74 0-2.88-.83-2.88-2.25v-3.01c0-1.41 1.01-2.25 2.74-2.25 1.51 0 2.51.57 2.51 1.44 0 .28-.1.58-.32.87 0-.91-.81-1.52-2.22-1.52-1.48 0-1.91.71-1.91 1.62v2.71c0 .96.68 1.61 2.09 1.61 1.32 0 2.32-.52 2.32-1.59.22.33.35.65.35.91Zm7.22-3.81c0-.84-.36-1.45-1.83-1.45-1.41 0-2.23.61-2.23 1.52-.22-.29-.3-.61-.3-.87 0-.86 1.01-1.44 2.54-1.44 1.8 0 2.62.87 2.62 2.28v5.13c-.26-.1-.64-.14-.88-.14-.45 0-1.17.25-1.78.25-1.81 0-2.74-.86-2.74-2.06-.01-2.71 4.11-1.74 4.6-3.22Zm-1.75 4.54c1.07 0 1.75-.38 1.75-.38v-3.22c-.29 1.01-3.78.39-3.78 2.29 0 .76.59 1.31 2.03 1.31Zm5.76-10.21c.06 0 .8.01.8.64v7.8c0 1.12.25 2.16.94 2.16 0 0-.19.28-.57.28-.81 0-1.17-.88-1.17-2.06v-8.82Zm15.67 3.52c0 1.74-1.3 2.52-3.1 2.45 2.12.67 3.04 3.96 3.65 4.91-.67.09-.94.01-1.35-.77-1.23-2.41-1.87-3.94-4.41-4.13v4.93s-.84-.01-.84-.64v-9.57h2.81c1.87 0 3.23.62 3.23 2.38v.44h.01Zm-5.2-2.03v3.78h2.09c1.68 0 2.28-.71 2.28-1.97 0-1.28-.78-1.81-2.39-1.81h-1.98Zm13.45 8.01c0 1-1.44 1.45-2.73 1.45-1.67 0-2.74-.83-2.74-2.25v-3.01c0-1.41.94-2.25 2.67-2.25s2.73.84 2.73 2.1c0 1.15-.78 2.03-2.8 2.03-.94 0-1.8-.38-1.8-.38v1.29c0 1.09.46 1.68 1.94 1.68 1.32 0 2.39-.52 2.39-1.59.25.35.34.65.34.93Zm-4.67-3.05c-.06.03 1 .33 1.73.33 1.54 0 2.07-.48 2.07-1.25 0-.8-.48-1.35-1.9-1.35-1.54 0-1.9.64-1.9 1.71v.56Zm13.16 3.03c0 1.01-1.38 1.46-2.68 1.46-1.74 0-2.88-.83-2.88-2.25v-3.01c0-1.41 1.01-2.25 2.74-2.25 1.51 0 2.51.57 2.51 1.44 0 .28-.1.58-.32.87 0-.91-.81-1.52-2.22-1.52-1.48 0-1.91.71-1.91 1.62v2.71c0 .96.68 1.61 2.09 1.61 1.32 0 2.32-.52 2.32-1.59.22.33.35.65.35.91Zm8.67-.78c0 1.42-.94 2.25-2.94 2.25-2.01 0-2.96-.83-2.96-2.25v-3.01c0-1.41.94-2.25 2.96-2.25 2 0 2.94.84 2.94 2.25v3.01Zm-.8-2.8c0-1.07-.36-1.71-2.15-1.71-1.8 0-2.16.64-2.16 1.71v2.58c0 1.09.36 1.72 2.16 1.72 1.78 0 2.15-.64 2.15-1.72v-2.58Zm6.45-1.61c-.62 0-1.29.12-1.64.3v6.28s-.8 0-.8-.64v-6.68c.29.14.46.2.7.2.59 0 1.3-.32 2.06-.32 1.19 0 1.64.67 1.12 1.75-.03-.7-.7-.89-1.44-.89Zm8.49-4.25c.13 0 .8-.01.8.77v10.03c-.26-.1-.52-.14-.77-.14-.59 0-1.32.25-2.04.25-1.67 0-2.64-.87-2.64-2.2v-3.1c0-1.38 1.09-2.19 2.36-2.19 2.03 0 2.45.9 2.45.9s-.16-.28-.16-1.52v-2.8Zm0 5.67c0-.9-1.06-1.51-2.1-1.51-1 0-1.75.51-1.75 1.65v2.67c0 1.12.51 1.67 2.1 1.67 1.07 0 1.75-.35 1.75-.35v-4.13Zm3.73-.07c0-1.45.91-2.2 2.67-2.2 1.29 0 2.54.36 2.54 1.39 0 .3-.12.65-.35 1.07.01-.07.01-.16.01-.23 0-.87-.61-1.48-2.2-1.48-1.42 0-1.87.51-1.87 1.38 0 2.1 4.67-.12 4.67 3.25 0 1.25-.94 2.13-2.8 2.13-1.26 0-2.64-.3-2.64-1.46 0-.26.07-.55.22-.9 0 .91.71 1.61 2.42 1.61 1.58 0 2-.68 2-1.45 0-2.31-4.6-.15-4.67-3.11Zm17.1-5.12c1.52 0 3.3.33 3.3 1.67 0 .28-.09.64-.26 1.04 0-1.51-1.57-1.9-3.15-1.9-1.54 0-2.78.42-2.78 1.94 0 2.94 6.51.51 6.51 4.68 0 2.03-1.52 2.99-3.68 2.99-1.52 0-3.48-.45-3.48-1.7 0-.29.07-.65.23-1.06 0 1.46 1.67 1.94 3.33 1.94 1.83 0 2.72-.83 2.72-2.13 0-3.26-6.51-.91-6.51-4.65.01-2.17 1.8-2.82 3.77-2.82Zm11.01 6.16.26-2.45c.06-.59.55-.65.84-.7l-.28 2.8c-.19 1.97-1.26 3.15-2.07 3.77l-.57.44c-1.04.81-1.77 1.33-1.77 2.46 0 .36.12.78.33 1.29-.06.01-.15.03-.22.03-.39 0-.94-.23-.94-1.38 0-1.26 1-2.17 2.06-2.88-.7-.44-1.91-1.7-2.12-3.73l-.29-2.81s.77 0 .84.64l.29 2.52c.2 1.8 1.81 2.94 1.81 2.94s1.65-1.21 1.83-2.94Zm3.45-1.04c0-1.45.91-2.2 2.67-2.2 1.29 0 2.54.36 2.54 1.39 0 .3-.12.65-.35 1.07.01-.07.01-.16.01-.23 0-.87-.61-1.48-2.2-1.48-1.42 0-1.87.51-1.87 1.38 0 2.1 4.67-.12 4.67 3.25 0 1.25-.94 2.13-2.8 2.13-1.26 0-2.64-.3-2.64-1.46 0-.26.07-.55.22-.9 0 .91.71 1.61 2.42 1.61 1.58 0 2-.68 2-1.45 0-2.31-4.6-.15-4.67-3.11Zm8.39-3.93s.8.01.8.64v1.43h3.03s-.01.78-.54.78h-2.49v3.84c0 1.09.59 1.75 1.75 1.75.94 0 1.75-.59 1.75-1.48.19.35.26.61.26.87 0 .94-.99 1.39-2.03 1.39-1.39 0-2.54-.75-2.54-2.17v-7.05h.01Zm12.31 7.79c0 1-1.44 1.45-2.73 1.45-1.67 0-2.74-.83-2.74-2.25v-3.01c0-1.41.94-2.25 2.67-2.25s2.73.84 2.73 2.1c0 1.15-.78 2.03-2.8 2.03-.94 0-1.8-.38-1.8-.38v1.29c0 1.09.46 1.68 1.94 1.68 1.32 0 2.39-.52 2.39-1.59.25.35.34.65.34.93Zm-4.67-3.05c-.06.03 1 .33 1.73.33 1.54 0 2.07-.48 2.07-1.25 0-.8-.48-1.35-1.9-1.35-1.54 0-1.9.64-1.9 1.71v.56Zm12.39-.71c0-1.1-.62-1.52-1.93-1.52-1.22 0-1.93.35-1.93.35v6.31s-.8 0-.8-.62v-6.7s.36.2.65.2c.75 0 1.44-.32 2.28-.32 1.7 0 2.16.87 2.16.87.41-.38 1.2-.86 2.52-.86 1.17 0 2.49.58 2.49 2.09v5.33s-.8-.01-.8-.62v-4.55c0-1.03-.61-1.46-1.94-1.46-.91 0-1.91.46-1.91 1.26v5.38s-.8 0-.8-.62v-4.52h.01Z" fill="#FAFCFC"/><path d="M276.95 30.661c.3-.52.49-1.1.7-1.71.21-.63.43-1.28.78-1.89a5.25 5.25 0 0 1 1.93-1.9v-4.96c0-.63.12-3.99 0-6.2-1.85-.08-6.36 3.4-6.81 6.2v5.91h-5.91c-.63 0-1.14.51-1.14 1.14v4.54c0 .63.51 1.14 1.14 1.14h5.87c1.41-.17 2.74-1.03 3.44-2.27Z" fill="#FFF"/><path d="M286.28 26.811h-5.9c-.5.36-.93.82-1.24 1.36-.31.53-.51 1.12-.72 1.74-.21.62-.42 1.26-.76 1.85-.84 1.47-2.42 2.49-4.1 2.67v12.31c2.37-.49 6.93-2.44 6.81-7.21v-5.91h5.91c.63 0 1.14-.51 1.14-1.14v-4.54c-.01-.63-.52-1.13-1.14-1.13Z" fill="#FDFFFF"/><path d="M66.09 61.081c-1.51-1.46-2.36-4.37-2.36-6.45v-2.64c0-6.67 5.55-9.14 11.22-9.14 3.08 0 6 1.18 8.75 1.18 1.29 0 2.8-.34 4.77-1.12v11.72c0 6.22-4.32 9.93-12.34 9.93-4.21 0-7.07-1.57-7.07-1.57-.17.56-.34 1.46-.34 2.19 0 2.52 2.58 2.92 6.45 2.92h1.85c5.94 0 12.45-.06 12.45 7.96 0 5.94-4.21 9.93-13.35 9.93-7.63 0-12.28-2.41-12.28-6.11 0-1.46.56-2.97 1.91-4.71.5 4.43 5.16 5.5 9.87 5.5 4.99 0 6.73-1.63 6.73-4.21 0-2.63-2.24-2.92-5.5-2.92H74.1c-5.89 0-11.05-.73-11.05-6.39.01-2.25 1.25-3.94 3.04-6.07Zm10.04-1.85c4.15 0 5.1-1.96 5.1-5.44v-4.77s-2.52-.95-4.99-.95c-3.81 0-5.27 1.35-5.27 4.77v.95c0 3.48.95 5.44 5.16 5.44Z" fill="#FFF"/></g></g></svg>
|
|
@@ -1,299 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
DataTable,
|
|
3
|
-
DataTableSkeleton,
|
|
4
|
-
DefinitionTooltip,
|
|
5
|
-
Pagination,
|
|
6
|
-
Table,
|
|
7
|
-
TableBody,
|
|
8
|
-
TableCell,
|
|
9
|
-
TableContainer,
|
|
10
|
-
TableHead,
|
|
11
|
-
TableHeader,
|
|
12
|
-
TableRow,
|
|
13
|
-
Tag,
|
|
14
|
-
Layer,
|
|
15
|
-
TableToolbar,
|
|
16
|
-
TableToolbarContent,
|
|
17
|
-
TableToolbarSearch,
|
|
18
|
-
TableExpandedRow,
|
|
19
|
-
TableExpandHeader,
|
|
20
|
-
TableExpandRow,
|
|
21
|
-
} from "@carbon/react";
|
|
22
|
-
|
|
23
|
-
import {
|
|
24
|
-
isDesktop,
|
|
25
|
-
useConfig,
|
|
26
|
-
useLayoutType,
|
|
27
|
-
usePagination,
|
|
28
|
-
useSession,
|
|
29
|
-
} from "@openmrs/esm-framework";
|
|
30
|
-
import React, { useCallback, useMemo, useState } from "react";
|
|
31
|
-
import { useTranslation } from "react-i18next";
|
|
32
|
-
import {
|
|
33
|
-
formatWaitTime,
|
|
34
|
-
getOriginFromPathName,
|
|
35
|
-
getTagColor,
|
|
36
|
-
getTagType,
|
|
37
|
-
trimVisitNumber,
|
|
38
|
-
} from "../helpers/functions";
|
|
39
|
-
import styles from "./styles.scss";
|
|
40
|
-
import { usePatientQueuesList } from "./patient-queues.resource";
|
|
41
|
-
import { useActiveVisits } from "./active-visits.resource";
|
|
42
|
-
import EmptyState from "../../empty-state/empty-state.component";
|
|
43
|
-
import AssignBedWorkSpace from "../../workspace/allocate-bed-workspace.component";
|
|
44
|
-
import AdmissionActionButton from "./admission-action-button.component";
|
|
45
|
-
import { patientDetailsProps } from "../types";
|
|
46
|
-
import ViewActionsMenu from "./view-action-menu.component";
|
|
47
|
-
|
|
48
|
-
interface ActiveVisitsTableProps {
|
|
49
|
-
status: string;
|
|
50
|
-
setPatientCount?: (value: number) => void;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const ActivePatientsTable: React.FC<ActiveVisitsTableProps> = ({
|
|
54
|
-
status,
|
|
55
|
-
setPatientCount,
|
|
56
|
-
}) => {
|
|
57
|
-
const { t } = useTranslation();
|
|
58
|
-
const session = useSession();
|
|
59
|
-
const currentPathName: string = window.location.pathname;
|
|
60
|
-
const fromPage: string = getOriginFromPathName(currentPathName);
|
|
61
|
-
const pageSizes = [10, 20, 30, 40, 50];
|
|
62
|
-
const [currentPageSize, setPageSize] = useState(10);
|
|
63
|
-
const [showOverlay, setShowOverlay] = useState(false);
|
|
64
|
-
const [selectedPatientDetails, setSelectedPatientDetails] =
|
|
65
|
-
useState<patientDetailsProps>();
|
|
66
|
-
|
|
67
|
-
const layout = useLayoutType();
|
|
68
|
-
|
|
69
|
-
const { patientQueueEntries, isLoading } = useActiveVisits();
|
|
70
|
-
const { restrictWardAdministrationToLoginLocation } = useConfig();
|
|
71
|
-
|
|
72
|
-
const handleBedAssigmentModal = useCallback(
|
|
73
|
-
(entry) => {
|
|
74
|
-
setSelectedPatientDetails({
|
|
75
|
-
name: entry.name,
|
|
76
|
-
patientUuid: entry.patientUuid,
|
|
77
|
-
encounter: entry.encounter,
|
|
78
|
-
locationUuid: session?.sessionLocation?.uuid,
|
|
79
|
-
locationTo: entry.locationTo,
|
|
80
|
-
locationFrom: entry.locationFrom,
|
|
81
|
-
queueUuid: entry.uuid,
|
|
82
|
-
});
|
|
83
|
-
setShowOverlay(true);
|
|
84
|
-
},
|
|
85
|
-
[session?.sessionLocation?.uuid]
|
|
86
|
-
);
|
|
87
|
-
|
|
88
|
-
const renderActionButton = useCallback(
|
|
89
|
-
(entry) => {
|
|
90
|
-
const buttonTexts = {
|
|
91
|
-
pending: "Assign Bed",
|
|
92
|
-
completed: "Transfer",
|
|
93
|
-
};
|
|
94
|
-
const buttonText = buttonTexts[status] || "Un-assign";
|
|
95
|
-
|
|
96
|
-
return (
|
|
97
|
-
<AdmissionActionButton
|
|
98
|
-
entry={entry}
|
|
99
|
-
handleBedAssigmentModal={handleBedAssigmentModal}
|
|
100
|
-
buttonText={buttonText}
|
|
101
|
-
/>
|
|
102
|
-
);
|
|
103
|
-
},
|
|
104
|
-
[handleBedAssigmentModal, status]
|
|
105
|
-
);
|
|
106
|
-
|
|
107
|
-
const {
|
|
108
|
-
goTo,
|
|
109
|
-
results: paginatedQueueEntries,
|
|
110
|
-
currentPage,
|
|
111
|
-
} = usePagination(patientQueueEntries, currentPageSize);
|
|
112
|
-
|
|
113
|
-
const tableHeaders = useMemo(
|
|
114
|
-
() => [
|
|
115
|
-
{
|
|
116
|
-
id: 0,
|
|
117
|
-
header: t("name", "Name"),
|
|
118
|
-
key: "name",
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
id: 1,
|
|
122
|
-
header: t("idNumber", "ID Number"),
|
|
123
|
-
key: "idNumber",
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
id: 2,
|
|
127
|
-
header: t("gender", "Gender"),
|
|
128
|
-
key: "gender",
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
id: 3,
|
|
132
|
-
header: t("age", "Age"),
|
|
133
|
-
key: "age",
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
id: 4,
|
|
137
|
-
header: t("visitType", "Visit type"),
|
|
138
|
-
key: "visitType",
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
id: 5,
|
|
142
|
-
header: t("visitStartTime", "Visit start date/time"),
|
|
143
|
-
key: "visitStartTime",
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
id: 6,
|
|
147
|
-
header: t("action", "Action"),
|
|
148
|
-
key: "actions",
|
|
149
|
-
},
|
|
150
|
-
],
|
|
151
|
-
[t]
|
|
152
|
-
);
|
|
153
|
-
|
|
154
|
-
const tableRows = useMemo(() => {
|
|
155
|
-
return paginatedQueueEntries?.map((entry) => ({
|
|
156
|
-
...entry,
|
|
157
|
-
actions: {
|
|
158
|
-
content: (
|
|
159
|
-
<div className={styles.displayFlex}>{renderActionButton(entry)}</div>
|
|
160
|
-
),
|
|
161
|
-
},
|
|
162
|
-
}));
|
|
163
|
-
}, [paginatedQueueEntries, status, t, renderActionButton, fromPage]);
|
|
164
|
-
|
|
165
|
-
if (isLoading) {
|
|
166
|
-
return <DataTableSkeleton role="progressbar" />;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
if (
|
|
170
|
-
(!isLoading && patientQueueEntries && status === "pending") ||
|
|
171
|
-
status === "completed" ||
|
|
172
|
-
status === ""
|
|
173
|
-
) {
|
|
174
|
-
setPatientCount(patientQueueEntries.length);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
if (patientQueueEntries?.length) {
|
|
178
|
-
return (
|
|
179
|
-
<div className={styles.container}>
|
|
180
|
-
<div className={styles.headerBtnContainer}></div>
|
|
181
|
-
|
|
182
|
-
<DataTable
|
|
183
|
-
data-floating-menu-container
|
|
184
|
-
headers={tableHeaders}
|
|
185
|
-
overflowMenuOnHover={isDesktop(layout) ? true : false}
|
|
186
|
-
rows={tableRows}
|
|
187
|
-
isSortable
|
|
188
|
-
size="xs"
|
|
189
|
-
useZebraStyles
|
|
190
|
-
>
|
|
191
|
-
{({ rows, headers, getTableProps, getRowProps, onInputChange }) => (
|
|
192
|
-
<TableContainer className={styles.tableContainer}>
|
|
193
|
-
<TableToolbar
|
|
194
|
-
style={{
|
|
195
|
-
position: "static",
|
|
196
|
-
height: "3rem",
|
|
197
|
-
overflow: "visible",
|
|
198
|
-
backgroundColor: "color",
|
|
199
|
-
}}
|
|
200
|
-
>
|
|
201
|
-
<TableToolbarContent className={styles.toolbarContent}>
|
|
202
|
-
<Layer>
|
|
203
|
-
<TableToolbarSearch
|
|
204
|
-
className={styles.search}
|
|
205
|
-
onChange={onInputChange}
|
|
206
|
-
placeholder={t("searchThisList", "Search this list")}
|
|
207
|
-
size="sm"
|
|
208
|
-
/>
|
|
209
|
-
</Layer>
|
|
210
|
-
</TableToolbarContent>
|
|
211
|
-
</TableToolbar>
|
|
212
|
-
<Table {...getTableProps()} className={styles.activeVisitsTable}>
|
|
213
|
-
<TableHead>
|
|
214
|
-
<TableRow>
|
|
215
|
-
<TableExpandHeader />
|
|
216
|
-
{headers.map((header) => (
|
|
217
|
-
<TableHeader>
|
|
218
|
-
{header.header?.content ?? header.header}
|
|
219
|
-
</TableHeader>
|
|
220
|
-
))}
|
|
221
|
-
</TableRow>
|
|
222
|
-
</TableHead>
|
|
223
|
-
<TableBody>
|
|
224
|
-
{rows.map((row, index) => {
|
|
225
|
-
return (
|
|
226
|
-
<>
|
|
227
|
-
<TableExpandRow {...getRowProps({ row })} key={row.id}>
|
|
228
|
-
{row.cells.map((cell) => (
|
|
229
|
-
<TableCell key={cell.id}>
|
|
230
|
-
{cell.value?.content ?? cell.value}
|
|
231
|
-
</TableCell>
|
|
232
|
-
))}
|
|
233
|
-
</TableExpandRow>
|
|
234
|
-
|
|
235
|
-
{row.isExpanded ? (
|
|
236
|
-
<TableExpandedRow
|
|
237
|
-
className={styles.expandedLabQueueVisitRow}
|
|
238
|
-
colSpan={headers.length + 2}
|
|
239
|
-
>
|
|
240
|
-
<>
|
|
241
|
-
{/* <span>{tableRows[index]?.comment ?? ""}</span> */}
|
|
242
|
-
</>
|
|
243
|
-
</TableExpandedRow>
|
|
244
|
-
) : (
|
|
245
|
-
<TableExpandedRow
|
|
246
|
-
className={styles.hiddenRow}
|
|
247
|
-
colSpan={headers.length + 2}
|
|
248
|
-
/>
|
|
249
|
-
)}
|
|
250
|
-
</>
|
|
251
|
-
);
|
|
252
|
-
})}
|
|
253
|
-
</TableBody>
|
|
254
|
-
</Table>
|
|
255
|
-
<Pagination
|
|
256
|
-
forwardText="Next page"
|
|
257
|
-
backwardText="Previous page"
|
|
258
|
-
page={currentPage}
|
|
259
|
-
pageSize={currentPageSize}
|
|
260
|
-
pageSizes={pageSizes}
|
|
261
|
-
totalItems={patientQueueEntries?.length}
|
|
262
|
-
className={styles.pagination}
|
|
263
|
-
onChange={({ pageSize, page }) => {
|
|
264
|
-
if (pageSize !== currentPageSize) {
|
|
265
|
-
setPageSize(pageSize);
|
|
266
|
-
}
|
|
267
|
-
if (page !== currentPage) {
|
|
268
|
-
goTo(page);
|
|
269
|
-
}
|
|
270
|
-
}}
|
|
271
|
-
/>
|
|
272
|
-
</TableContainer>
|
|
273
|
-
)}
|
|
274
|
-
</DataTable>
|
|
275
|
-
{showOverlay && (
|
|
276
|
-
<AssignBedWorkSpace
|
|
277
|
-
patientDetails={selectedPatientDetails}
|
|
278
|
-
closePanel={() => setShowOverlay(false)}
|
|
279
|
-
queueStatus={status}
|
|
280
|
-
headerTitle={t(
|
|
281
|
-
"assignBedToPatient",
|
|
282
|
-
restrictWardAdministrationToLoginLocation === true
|
|
283
|
-
? `Assign Bed to Patient ${selectedPatientDetails.name} in the ${session?.sessionLocation?.display} Ward`
|
|
284
|
-
: `Assign Bed to Patient ${selectedPatientDetails.name}`
|
|
285
|
-
)}
|
|
286
|
-
/>
|
|
287
|
-
)}
|
|
288
|
-
</div>
|
|
289
|
-
);
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
return (
|
|
293
|
-
<EmptyState
|
|
294
|
-
msg={t("noQueueItems", "No queue items to display")}
|
|
295
|
-
helper=""
|
|
296
|
-
/>
|
|
297
|
-
);
|
|
298
|
-
};
|
|
299
|
-
export default ActivePatientsTable;
|
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
import { useEffect } from "react";
|
|
2
|
-
import useSWRInfinite from "swr/infinite";
|
|
3
|
-
import dayjs from "dayjs";
|
|
4
|
-
import isToday from "dayjs/plugin/isToday";
|
|
5
|
-
import last from "lodash-es/last";
|
|
6
|
-
import {
|
|
7
|
-
openmrsFetch,
|
|
8
|
-
type Visit,
|
|
9
|
-
useSession,
|
|
10
|
-
type FetchResponse,
|
|
11
|
-
formatDatetime,
|
|
12
|
-
parseDate,
|
|
13
|
-
useConfig,
|
|
14
|
-
} from "@openmrs/esm-framework";
|
|
15
|
-
|
|
16
|
-
dayjs.extend(isToday);
|
|
17
|
-
|
|
18
|
-
export interface ActiveVisit {
|
|
19
|
-
age: string;
|
|
20
|
-
id: string;
|
|
21
|
-
idNumber: string;
|
|
22
|
-
gender: string;
|
|
23
|
-
location: string;
|
|
24
|
-
name: string;
|
|
25
|
-
patientUuid: string;
|
|
26
|
-
visitStartTime: string;
|
|
27
|
-
visitType: string;
|
|
28
|
-
visitUuid: string;
|
|
29
|
-
[identifier: string]: string;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
interface VisitResponse {
|
|
33
|
-
results: Array<Visit>;
|
|
34
|
-
links: Array<{ rel: "prev" | "next" }>;
|
|
35
|
-
totalCount: number;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export function useActiveVisits() {
|
|
39
|
-
const session = useSession();
|
|
40
|
-
const config = useConfig();
|
|
41
|
-
const { inpatientVisitUuid } = useConfig();
|
|
42
|
-
const sessionLocation = session?.sessionLocation?.uuid;
|
|
43
|
-
|
|
44
|
-
const customRepresentation =
|
|
45
|
-
"custom:(uuid,patient:(uuid,identifiers:(identifier,uuid,identifierType:(name,uuid)),person:(age,display,gender,uuid,attributes:(value,attributeType:(uuid,display))))," +
|
|
46
|
-
"visitType:(uuid,name,display),location:(uuid,name,display),startDatetime,stopDatetime)";
|
|
47
|
-
|
|
48
|
-
const getUrl = (
|
|
49
|
-
pageIndex,
|
|
50
|
-
previousPageData: FetchResponse<VisitResponse>
|
|
51
|
-
) => {
|
|
52
|
-
if (
|
|
53
|
-
pageIndex &&
|
|
54
|
-
!previousPageData?.data?.links?.some((link) => link.rel === "next")
|
|
55
|
-
) {
|
|
56
|
-
return null;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
const url = `/ws/rest/v1/visit?v=${customRepresentation}&`;
|
|
60
|
-
const urlSearchParams = new URLSearchParams();
|
|
61
|
-
|
|
62
|
-
urlSearchParams.append("includeInactive", "false");
|
|
63
|
-
urlSearchParams.append("visitType", `${inpatientVisitUuid}`);
|
|
64
|
-
urlSearchParams.append("totalCount", "true");
|
|
65
|
-
//urlSearchParams.append("location", `${sessionLocation}`);
|
|
66
|
-
|
|
67
|
-
if (pageIndex) {
|
|
68
|
-
urlSearchParams.append("startIndex", `${pageIndex * 50}`);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
return url + urlSearchParams.toString();
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
const {
|
|
75
|
-
data,
|
|
76
|
-
error,
|
|
77
|
-
isLoading,
|
|
78
|
-
isValidating,
|
|
79
|
-
size: pageNumber,
|
|
80
|
-
setSize,
|
|
81
|
-
mutate,
|
|
82
|
-
} = useSWRInfinite<FetchResponse<VisitResponse>, Error>(
|
|
83
|
-
sessionLocation ? getUrl : null,
|
|
84
|
-
openmrsFetch
|
|
85
|
-
);
|
|
86
|
-
|
|
87
|
-
useEffect(() => {
|
|
88
|
-
if (
|
|
89
|
-
data &&
|
|
90
|
-
data?.[pageNumber - 1]?.data?.links?.some((link) => link.rel === "next")
|
|
91
|
-
) {
|
|
92
|
-
setSize((currentSize) => currentSize + 1);
|
|
93
|
-
}
|
|
94
|
-
}, [data, pageNumber]);
|
|
95
|
-
|
|
96
|
-
const mapVisitProperties = (visit: Visit): ActiveVisit => {
|
|
97
|
-
// create base object
|
|
98
|
-
const activeVisits: ActiveVisit = {
|
|
99
|
-
age: visit?.patient?.person?.age,
|
|
100
|
-
id: visit.uuid,
|
|
101
|
-
idNumber: null,
|
|
102
|
-
gender: visit?.patient?.person?.gender,
|
|
103
|
-
location: visit?.location?.uuid,
|
|
104
|
-
name: visit?.patient?.person?.display,
|
|
105
|
-
patientUuid: visit?.patient?.uuid,
|
|
106
|
-
visitStartTime: formatDatetime(parseDate(visit?.startDatetime)),
|
|
107
|
-
visitType: visit?.visitType?.display,
|
|
108
|
-
visitUuid: visit.uuid,
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
// in case no configuration is given the previous behavior remains the same
|
|
112
|
-
if (!config?.activeVisits?.identifiers) {
|
|
113
|
-
activeVisits.idNumber =
|
|
114
|
-
visit?.patient?.identifiers[0]?.identifier ?? "--";
|
|
115
|
-
} else {
|
|
116
|
-
// map identifiers on config
|
|
117
|
-
config?.activeVisits?.identifiers?.map((configIdentifier) => {
|
|
118
|
-
// check if in the current visit the patient has in his identifiers the current identifierType name
|
|
119
|
-
const visitIdentifier = visit?.patient?.identifiers.find(
|
|
120
|
-
(visitIdentifier) =>
|
|
121
|
-
visitIdentifier?.identifierType?.name ===
|
|
122
|
-
configIdentifier?.identifierName
|
|
123
|
-
);
|
|
124
|
-
|
|
125
|
-
// add the new identifier or rewrite existing one to activeVisit object
|
|
126
|
-
// the parameter will corresponds to the name of the key value of the configuration
|
|
127
|
-
// and the respective value is the visit identifier
|
|
128
|
-
// If there isn't a identifier we display this default text '--'
|
|
129
|
-
activeVisits[configIdentifier.header?.key] =
|
|
130
|
-
visitIdentifier?.identifier ?? "--";
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
// map attributes on config
|
|
135
|
-
config?.activeVisits?.attributes?.map(({ display, header }) => {
|
|
136
|
-
// check if in the current visit the person has in his attributes the current display
|
|
137
|
-
const personAttributes = visit?.patient?.person?.attributes.find(
|
|
138
|
-
(personAttributes) =>
|
|
139
|
-
personAttributes?.attributeType?.display === display
|
|
140
|
-
);
|
|
141
|
-
|
|
142
|
-
// add the new attribute or rewrite existing one to activeVisit object
|
|
143
|
-
// the parameter will correspond to the name of the key value of the configuration
|
|
144
|
-
// and the respective value is the persons value
|
|
145
|
-
// If there isn't a attribute we display this default text '--'
|
|
146
|
-
activeVisits[header?.key] = personAttributes?.value ?? "--";
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
return activeVisits;
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
const formattedActiveVisits: Array<ActiveVisit> = data
|
|
153
|
-
? [].concat(
|
|
154
|
-
...data?.map((res) => res?.data?.results?.map(mapVisitProperties))
|
|
155
|
-
)
|
|
156
|
-
: [];
|
|
157
|
-
|
|
158
|
-
return {
|
|
159
|
-
patientQueueEntries: formattedActiveVisits,
|
|
160
|
-
isError: error,
|
|
161
|
-
isLoading,
|
|
162
|
-
isValidating,
|
|
163
|
-
patientQueueCount: data?.[0]?.data?.totalCount ?? 0,
|
|
164
|
-
mutate,
|
|
165
|
-
};
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
export const getOriginFromPathName = (pathname = "") => {
|
|
169
|
-
const from = pathname.split("/");
|
|
170
|
-
return last(from);
|
|
171
|
-
};
|
|
File without changes
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Button, Tooltip } from "@carbon/react";
|
|
3
|
-
import { HospitalBed } from "@carbon/react/icons";
|
|
4
|
-
import { useTranslation } from "react-i18next";
|
|
5
|
-
import styles from "./admission-action-button-styles.scss";
|
|
6
|
-
|
|
7
|
-
const AdmissionActionButton = ({
|
|
8
|
-
entry,
|
|
9
|
-
handleBedAssigmentModal,
|
|
10
|
-
buttonText,
|
|
11
|
-
}) => {
|
|
12
|
-
const { t } = useTranslation();
|
|
13
|
-
return (
|
|
14
|
-
<Tooltip align="bottom" label={t("buttonTooltip", buttonText)}>
|
|
15
|
-
<Button
|
|
16
|
-
className={styles.actionButton}
|
|
17
|
-
kind="ghost"
|
|
18
|
-
renderIcon={HospitalBed}
|
|
19
|
-
onClick={() => handleBedAssigmentModal(entry)}
|
|
20
|
-
iconDescription={t("buttonText", buttonText)}
|
|
21
|
-
></Button>
|
|
22
|
-
</Tooltip>
|
|
23
|
-
);
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export default AdmissionActionButton;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import Header from "../../header/header.component";
|
|
3
|
-
import styles from "./styles.scss";
|
|
4
|
-
import BedAdmissionTabs from "../bed-admission-tabs.component";
|
|
5
|
-
|
|
6
|
-
const ActivePatientsHome: React.FC = () => {
|
|
7
|
-
return (
|
|
8
|
-
<section className={styles.section}>
|
|
9
|
-
<Header route="In Patient" headerTitle="" />
|
|
10
|
-
<BedAdmissionTabs />
|
|
11
|
-
</section>
|
|
12
|
-
);
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export default ActivePatientsHome;
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import dayjs from "dayjs";
|
|
2
|
-
import useSWR from "swr";
|
|
3
|
-
|
|
4
|
-
import { formatDate, openmrsFetch, parseDate } from "@openmrs/esm-framework";
|
|
5
|
-
import { PatientQueue, UuidDisplay } from "../types";
|
|
6
|
-
|
|
7
|
-
export interface MappedPatientQueueEntry {
|
|
8
|
-
id: string;
|
|
9
|
-
name: string;
|
|
10
|
-
patientAge: number;
|
|
11
|
-
patientSex: string;
|
|
12
|
-
patientDob: string;
|
|
13
|
-
patientUuid: string;
|
|
14
|
-
priority: string;
|
|
15
|
-
priorityComment: string;
|
|
16
|
-
status: string;
|
|
17
|
-
waitTime: string;
|
|
18
|
-
locationFrom?: string;
|
|
19
|
-
locationToName?: string;
|
|
20
|
-
visitNumber: string;
|
|
21
|
-
identifiers: Array<UuidDisplay>;
|
|
22
|
-
dateCreated: string;
|
|
23
|
-
creatorUuid: string;
|
|
24
|
-
creatorUsername: string;
|
|
25
|
-
creatorDisplay: string;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export function usePatientQueuesList(
|
|
29
|
-
currentQueueRoomLocationUuid: string,
|
|
30
|
-
status: string
|
|
31
|
-
) {
|
|
32
|
-
const apiUrl = `/ws/rest/v1/patientqueue?v=full&room=${currentQueueRoomLocationUuid}&status=${status}`;
|
|
33
|
-
return usePatientQueueRequest(apiUrl);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export function usePatientQueueRequest(apiUrl: string) {
|
|
37
|
-
const { data, error, isLoading, isValidating, mutate } = useSWR<
|
|
38
|
-
{ data: { results: Array<PatientQueue> } },
|
|
39
|
-
Error
|
|
40
|
-
>(apiUrl, openmrsFetch, { refreshInterval: 3000 });
|
|
41
|
-
|
|
42
|
-
const mapppedQueues = data?.data?.results.map((queue: PatientQueue) => {
|
|
43
|
-
return {
|
|
44
|
-
...queue,
|
|
45
|
-
id: queue.uuid,
|
|
46
|
-
name: queue.patient?.person.display,
|
|
47
|
-
patientUuid: queue.patient?.uuid,
|
|
48
|
-
priorityComment: queue.priorityComment,
|
|
49
|
-
priority:
|
|
50
|
-
queue.priorityComment === "Urgent" ? "Priority" : queue.priorityComment,
|
|
51
|
-
priorityLevel: queue.priority,
|
|
52
|
-
waitTime: queue.dateCreated
|
|
53
|
-
? `${dayjs().diff(dayjs(queue.dateCreated), "minutes")}`
|
|
54
|
-
: "--",
|
|
55
|
-
status: queue.status,
|
|
56
|
-
patientAge: queue.patient?.person?.age,
|
|
57
|
-
patientSex: queue.patient?.person?.gender === "M" ? "MALE" : "FEMALE",
|
|
58
|
-
patientDob: queue.patient?.person?.birthdate
|
|
59
|
-
? formatDate(parseDate(queue.patient.person.birthdate), { time: false })
|
|
60
|
-
: "--",
|
|
61
|
-
identifiers: queue.patient?.identifiers,
|
|
62
|
-
locationFrom: queue.locationFrom?.uuid,
|
|
63
|
-
locationTo: queue.locationTo?.uuid,
|
|
64
|
-
locationFromName: queue.locationFrom?.name,
|
|
65
|
-
locationToName: queue.locationTo?.name,
|
|
66
|
-
queueRoom: queue.locationTo?.display,
|
|
67
|
-
visitNumber: queue.visitNumber,
|
|
68
|
-
dateCreated: queue.dateCreated
|
|
69
|
-
? formatDate(parseDate(queue.dateCreated), { time: false })
|
|
70
|
-
: "--",
|
|
71
|
-
creatorUuid: queue.creator?.uuid,
|
|
72
|
-
creatorUsername: queue.creator?.username,
|
|
73
|
-
creatorDisplay: queue.creator?.display,
|
|
74
|
-
};
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
return {
|
|
78
|
-
patientQueueEntries: mapppedQueues || [],
|
|
79
|
-
patientQueueCount: mapppedQueues?.length,
|
|
80
|
-
isLoading,
|
|
81
|
-
isError: error,
|
|
82
|
-
isValidating,
|
|
83
|
-
mutate,
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export function usePatientActiveListRequest(apiUrl: string) {
|
|
88
|
-
const { data, error, isLoading, isValidating, mutate } = useSWR<
|
|
89
|
-
{ data: { results: Array<PatientQueue> } },
|
|
90
|
-
Error
|
|
91
|
-
>(apiUrl, openmrsFetch, { refreshInterval: 3000 });
|
|
92
|
-
|
|
93
|
-
const mapppedQueues = data?.data?.results.map((queue: PatientQueue) => {
|
|
94
|
-
return {
|
|
95
|
-
...queue,
|
|
96
|
-
id: queue.uuid,
|
|
97
|
-
name: queue.patient?.person.display,
|
|
98
|
-
patientUuid: queue.patient?.uuid,
|
|
99
|
-
priorityComment: queue.priorityComment,
|
|
100
|
-
priority:
|
|
101
|
-
queue.priorityComment === "Urgent" ? "Priority" : queue.priorityComment,
|
|
102
|
-
priorityLevel: queue.priority,
|
|
103
|
-
waitTime: queue.dateCreated
|
|
104
|
-
? `${dayjs().diff(dayjs(queue.dateCreated), "minutes")}`
|
|
105
|
-
: "--",
|
|
106
|
-
status: queue.status,
|
|
107
|
-
patientAge: queue.patient?.person?.age,
|
|
108
|
-
patientSex: queue.patient?.person?.gender === "M" ? "MALE" : "FEMALE",
|
|
109
|
-
patientDob: queue.patient?.person?.birthdate
|
|
110
|
-
? formatDate(parseDate(queue.patient.person.birthdate), { time: false })
|
|
111
|
-
: "--",
|
|
112
|
-
identifiers: queue.patient?.identifiers,
|
|
113
|
-
locationFrom: queue.locationFrom?.uuid,
|
|
114
|
-
locationTo: queue.locationTo?.uuid,
|
|
115
|
-
locationFromName: queue.locationFrom?.name,
|
|
116
|
-
locationToName: queue.locationTo?.name,
|
|
117
|
-
queueRoom: queue.locationTo?.display,
|
|
118
|
-
visitNumber: queue.visitNumber,
|
|
119
|
-
dateCreated: queue.dateCreated
|
|
120
|
-
? formatDate(parseDate(queue.dateCreated), { time: false })
|
|
121
|
-
: "--",
|
|
122
|
-
creatorUuid: queue.creator?.uuid,
|
|
123
|
-
creatorUsername: queue.creator?.username,
|
|
124
|
-
creatorDisplay: queue.creator?.display,
|
|
125
|
-
};
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
return {
|
|
129
|
-
patientQueueEntries: mapppedQueues || [],
|
|
130
|
-
patientQueueCount: mapppedQueues?.length,
|
|
131
|
-
isLoading,
|
|
132
|
-
isError: error,
|
|
133
|
-
isValidating,
|
|
134
|
-
mutate,
|
|
135
|
-
};
|
|
136
|
-
}
|