@kenyaemr/esm-ward-app 8.1.1-pre.124 → 8.1.2-pre.152

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.
Files changed (125) hide show
  1. package/.turbo/turbo-build.log +25 -22
  2. package/dist/109.js +1 -1
  3. package/dist/109.js.map +1 -1
  4. package/dist/124.js +1 -1
  5. package/dist/124.js.map +1 -1
  6. package/dist/125.js +1 -1
  7. package/dist/125.js.map +1 -1
  8. package/dist/126.js +1 -0
  9. package/dist/126.js.map +1 -0
  10. package/dist/130.js +1 -1
  11. package/dist/130.js.map +1 -1
  12. package/dist/146.js +1 -1
  13. package/dist/146.js.map +1 -1
  14. package/dist/15.js +1 -1
  15. package/dist/15.js.map +1 -1
  16. package/dist/348.js +1 -1
  17. package/dist/362.js +1 -0
  18. package/dist/362.js.map +1 -0
  19. package/dist/443.js +1 -0
  20. package/dist/443.js.map +1 -0
  21. package/dist/471.js +1 -1
  22. package/dist/471.js.map +1 -1
  23. package/dist/481.js +1 -1
  24. package/dist/481.js.map +1 -1
  25. package/dist/53.js +1 -1
  26. package/dist/53.js.map +1 -1
  27. package/dist/534.js +1 -0
  28. package/dist/534.js.map +1 -0
  29. package/dist/559.js +1 -1
  30. package/dist/559.js.map +1 -1
  31. package/dist/574.js +1 -1
  32. package/dist/576.js +1 -1
  33. package/dist/576.js.map +1 -1
  34. package/dist/577.js +1 -1
  35. package/dist/577.js.map +1 -1
  36. package/dist/598.js +1 -0
  37. package/dist/598.js.map +1 -0
  38. package/dist/662.js +1 -1
  39. package/dist/662.js.map +1 -1
  40. package/dist/767.js +1 -1
  41. package/dist/921.js +1 -1
  42. package/dist/921.js.map +1 -1
  43. package/dist/922.js +1 -1
  44. package/dist/922.js.map +1 -1
  45. package/dist/925.js +2 -0
  46. package/dist/925.js.LICENSE.txt +40 -0
  47. package/dist/925.js.map +1 -0
  48. package/dist/kenyaemr-esm-ward-app.js +1 -1
  49. package/dist/kenyaemr-esm-ward-app.js.buildmanifest.json +169 -139
  50. package/dist/kenyaemr-esm-ward-app.js.map +1 -1
  51. package/dist/main.js +1 -1
  52. package/dist/main.js.LICENSE.txt +35 -0
  53. package/dist/main.js.map +1 -1
  54. package/dist/routes.json +1 -1
  55. package/mock.tsx +5 -4
  56. package/package-lock.json +2 -2
  57. package/package.json +4 -4
  58. package/src/action-menu-buttons/clinical-forms-workspace-siderail.component.tsx +1 -1
  59. package/src/action-menu-buttons/discharge-workspace-siderail.component.tsx +1 -1
  60. package/src/beds/bed-share-divider.component.tsx +21 -0
  61. package/src/beds/bed-share-divider.scss +18 -0
  62. package/src/beds/ward-bed.component.tsx +7 -17
  63. package/src/beds/ward-bed.scss +1 -15
  64. package/src/beds/ward-bed.test.tsx +3 -3
  65. package/src/config-schema.ts +6 -0
  66. package/src/hooks/useEmrConfiguration.ts +8 -0
  67. package/src/index.ts +6 -6
  68. package/src/location-selector/location-selector.component.tsx +8 -7
  69. package/src/root.component.tsx +0 -2
  70. package/src/routes.json +20 -6
  71. package/src/types/index.ts +9 -4
  72. package/src/ward-patient-card/row-elements/ward-patient-identifier.tsx +2 -2
  73. package/src/ward-patient-card/row-elements/ward-patient-pending-transfer.tsx +22 -4
  74. package/src/ward-patient-card/ward-patient-card.component.tsx +24 -6
  75. package/src/ward-patient-card/ward-patient-card.scss +6 -0
  76. package/src/ward-view/default-ward/default-ward-beds.component.tsx +3 -5
  77. package/src/ward-view/default-ward/default-ward-patient-card-header.component.tsx +1 -1
  78. package/src/ward-view/default-ward/default-ward-patient-card.component.tsx +2 -2
  79. package/src/ward-view/default-ward/default-ward-unassigned-patients.component.tsx +2 -2
  80. package/src/ward-view/materal-ward/maternal-ward-beds.component.tsx +9 -2
  81. package/src/ward-view/materal-ward/maternal-ward-patient-card-header.component.tsx +1 -1
  82. package/src/ward-view/materal-ward/maternal-ward-patient-card.component.tsx +2 -2
  83. package/src/ward-view/materal-ward/maternal-ward-view.resource.ts +7 -7
  84. package/src/ward-view/ward-view.component.tsx +1 -2
  85. package/src/ward-view/ward.component.tsx +19 -11
  86. package/src/ward-view-header/admission-requests-bar.component.tsx +4 -2
  87. package/src/ward-view-header/admission-requests.scss +11 -1
  88. package/src/ward-view-header/ward-metrics.test.tsx +5 -13
  89. package/src/ward-workspace/admission-request-card/admission-request-card-actions.component.tsx +17 -62
  90. package/src/ward-workspace/admission-request-card/admission-request-card-header.component.tsx +1 -1
  91. package/src/ward-workspace/admission-request-card/admission-request-card.component.tsx +2 -2
  92. package/src/ward-workspace/admit-patient-button.component.tsx +82 -0
  93. package/src/ward-workspace/admit-patient-form-workspace/admit-patient-form.scss +7 -0
  94. package/src/ward-workspace/admit-patient-form-workspace/admit-patient-form.test.tsx +28 -13
  95. package/src/ward-workspace/admit-patient-form-workspace/admit-patient-form.workspace.tsx +72 -66
  96. package/src/ward-workspace/cancel-admission-request-workspace/cancel-admission-request.scss +55 -0
  97. package/src/ward-workspace/cancel-admission-request-workspace/cancel-admission-request.test.tsx +99 -0
  98. package/src/ward-workspace/cancel-admission-request-workspace/cancel-admission-request.workspace.tsx +174 -0
  99. package/src/ward-workspace/patient-banner/patient-banner.component.tsx +9 -7
  100. package/src/ward-workspace/patient-banner/style.scss +3 -19
  101. package/src/ward-workspace/patient-clinical-forms-workspace/patient-clinical-forms.workspace.tsx +8 -2
  102. package/src/ward-workspace/patient-details/ward-patient-action-button.extension.tsx +2 -3
  103. package/src/ward-workspace/patient-details/ward-patient.style.scss +12 -0
  104. package/src/ward-workspace/patient-details/ward-patient.workspace.tsx +18 -47
  105. package/src/ward-workspace/patient-discharge/patient-discharge.workspace.tsx +14 -24
  106. package/src/ward-workspace/patient-transfer-bed-swap/patient-bed-swap-form.component.tsx +12 -34
  107. package/src/ward-workspace/patient-transfer-bed-swap/patient-transfer-request-form.component.tsx +48 -35
  108. package/src/ward-workspace/patient-transfer-bed-swap/patient-transfer-swap.scss +4 -0
  109. package/src/ward-workspace/patient-transfer-bed-swap/patient-transfer-swap.workspace.tsx +1 -1
  110. package/src/ward-workspace/ward-patient-notes/form/notes-form.component.tsx +30 -25
  111. package/src/ward-workspace/ward-patient-notes/notes.workspace.tsx +1 -1
  112. package/src/ward.resource.ts +32 -22
  113. package/translations/en.json +7 -1
  114. package/dist/153.js +0 -1
  115. package/dist/153.js.map +0 -1
  116. package/dist/169.js +0 -1
  117. package/dist/169.js.map +0 -1
  118. package/dist/303.js +0 -2
  119. package/dist/303.js.LICENSE.txt +0 -5
  120. package/dist/303.js.map +0 -1
  121. package/dist/501.js +0 -1
  122. package/dist/501.js.map +0 -1
  123. package/dist/920.js +0 -1
  124. package/dist/920.js.map +0 -1
  125. package/src/ward-workspace/admit-patient-form-workspace/types.ts +0 -7
package/dist/routes.json CHANGED
@@ -1 +1 @@
1
- {"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"webservices.rest":"^2.2.0","emrapi":"^2.0.0 || 2.0.0-SNAPSHOT"},"optionalBackendDependencies":{"bedmanagement":{"version":"^6.0.0 || 6.0.0-SNAPSHOT","feature":{"flagName":"bedmanagement-module","label":"Ward App Patient Service","description":"This module, if installed, provides services for managing patients admitted to the ward."}}},"extensions":[{"name":"ward-dashboard-link","component":"wardDashboardLink","slot":"homepage-dashboard-slot","meta":{"name":"ward","slot":"ward-dashboard-slot","title":"Wards"}},{"component":"root","name":"ward-dashboard","slot":"ward-dashboard-slot"},{"component":"wardPatientActionButtonExtension","name":"ward-patient-action-button","slot":"action-menu-ward-patient-items-slot"},{"component":"wardPatientNotesActionButtonExtension","name":"ward-inpatient-notes-form-action-button","slot":"action-menu-ward-patient-items-slot"},{"component":"coloredObsTagCardRowExtension","name":"colored-obs-tags-card-row","slot":"ward-patient-card-slot"},{"name":"transfer-swap-patient-siderail-button","slot":"action-menu-ward-patient-items-slot","component":"patientTransferAndSwapWorkspaceSiderailIcon"},{"name":"patient-discharge-siderail-button","slot":"action-menu-ward-patient-items-slot","component":"patientDischargeWorkspaceSideRailIcon"},{"name":"clinical-forms-workspace-siderail-button","component":"clinicalFormWorkspaceSideRailIcon","slot":"action-menu-ward-patient-items-slot"},{"component":"defaultWardView","name":"default-ward","slot":"default-ward"},{"component":"maternalWardView","name":"maternal-ward","slot":"maternal-ward"}],"workspaces":[{"name":"admission-requests-workspace","component":"admissionRequestWorkspace","title":"admissionRequests","type":"admission-requests"},{"name":"ward-patient-notes-workspace","component":"wardPatientNotesWorkspace","type":"ward-patient-notes","title":"inpatientNotesWorkspaceTitle","sidebarFamily":"ward-patient","hasOwnSidebar":true},{"name":"admit-patient-form-workspace","component":"admitPatientFormWorkspace","title":"admissionRequests","type":"admission-requests"},{"name":"ward-patient-workspace","component":"wardPatientWorkspace","type":"ward","title":"Ward Patient","width":"extra-wide","hasOwnSidebar":true,"sidebarFamily":"ward-patient"},{"name":"patient-transfer-swap-workspace","component":"patientTransferAndSwapWorkspace","title":"transfers","type":"transfer-swap-bed-form","hasOwnSidebar":true,"sidebarFamily":"ward-patient"},{"name":"patient-transfer-request-workspace","component":"patientTransferRequestWorkspace","title":"transferRequest","type":"transfer-request-form"},{"name":"patient-discharge-workspace","component":"patientDischargeWorkspace","title":"discharge","type":"ward-patient-discharge","hasOwnSidebar":true,"sidebarFamily":"ward-patient"},{"name":"ward-patient-clinical-forms-workspace","component":"patientClinicalFormsWorkspace","title":"clinicalForms","type":"ward-patient-clinical-forms","hasOwnSidebar":true,"sidebarFamily":"ward-patient","width":"wider"}],"version":"8.1.1-pre.124"}
1
+ {"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"webservices.rest":"^2.2.0","emrapi":"^2.0.0 || 2.0.0-SNAPSHOT"},"optionalBackendDependencies":{"bedmanagement":{"version":"^6.0.0 || 6.0.0-SNAPSHOT","feature":{"flagName":"bedmanagement-module","label":"Ward App Patient Service","description":"This module, if installed, provides services for managing patients admitted to the ward."}}},"extensions":[{"name":"ward-dashboard-link","component":"wardDashboardLink","slot":"homepage-dashboard-slot","meta":{"name":"ward","slot":"ward-dashboard-slot","title":"Wards"}},{"component":"root","name":"ward-dashboard","slot":"ward-dashboard-slot"},{"component":"wardPatientActionButtonExtension","name":"ward-patient-action-button","slot":"action-menu-ward-patient-items-slot"},{"component":"wardPatientNotesActionButtonExtension","name":"ward-inpatient-notes-form-action-button","slot":"action-menu-ward-patient-items-slot"},{"component":"coloredObsTagCardRowExtension","name":"colored-obs-tags-card-row","slot":"ward-patient-card-slot"},{"name":"transfer-swap-patient-siderail-button","slot":"action-menu-ward-patient-items-slot","component":"patientTransferAndSwapWorkspaceSiderailIcon"},{"name":"patient-discharge-siderail-button","slot":"action-menu-ward-patient-items-slot","component":"patientDischargeWorkspaceSideRailIcon"},{"name":"clinical-forms-workspace-siderail-button","component":"clinicalFormWorkspaceSideRailIcon","slot":"action-menu-ward-patient-items-slot"},{"component":"defaultWardView","name":"default-ward","slot":"default-ward"},{"component":"maternalWardView","name":"maternal-ward","slot":"maternal-ward"}],"workspaces":[{"name":"admission-requests-workspace","component":"admissionRequestWorkspace","title":"admissionRequests","type":"admission-requests"},{"name":"ward-patient-notes-workspace","component":"wardPatientNotesWorkspace","type":"ward-patient-notes","title":"inpatientNotesWorkspaceTitle","sidebarFamily":"ward-patient","hasOwnSidebar":true,"groups":["ward-patient"]},{"name":"admit-patient-form-workspace","component":"admitPatientFormWorkspace","title":"admissionRequests","type":"admission-requests"},{"name":"ward-patient-workspace","component":"wardPatientWorkspace","type":"ward","title":"Ward patient","width":"extra-wide","hasOwnSidebar":true,"sidebarFamily":"ward-patient","groups":["ward-patient"]},{"name":"patient-transfer-swap-workspace","component":"patientTransferAndSwapWorkspace","title":"transfers","type":"transfer-swap-bed-form","hasOwnSidebar":true,"sidebarFamily":"ward-patient","groups":["ward-patient"]},{"name":"patient-transfer-request-workspace","component":"patientTransferRequestWorkspace","title":"transferRequest","type":"transfer-request-form"},{"name":"patient-discharge-workspace","component":"patientDischargeWorkspace","title":"discharge","type":"ward-patient-discharge","hasOwnSidebar":true,"sidebarFamily":"ward-patient","groups":["ward-patient"]},{"name":"ward-patient-clinical-forms-workspace","component":"patientClinicalFormsWorkspace","title":"clinicalForms","type":"ward-patient-clinical-forms","hasOwnSidebar":true,"sidebarFamily":"ward-patient","width":"wider","groups":["ward-patient"]},{"name":"cancel-admission-request-workspace","component":"cancelAdmissionRequestWorkspace","title":"cancelAdmissionRequest","type":"cancel-admission-request","sidebarFamily":"ward-patient"}],"version":"8.1.2-pre.152"}
package/mock.tsx CHANGED
@@ -1,4 +1,4 @@
1
- import { mockAdmissionLocation, mockInpatientAdmissions, mockInpatientRequest } from '__mocks__';
1
+ import { mockAdmissionLocation, mockInpatientAdmissions, mockInpatientRequests } from '__mocks__';
2
2
  import { useAdmissionLocation } from './src/hooks/useAdmissionLocation';
3
3
  import { useInpatientAdmission } from './src/hooks/useInpatientAdmission';
4
4
  import { createAndGetWardPatientGrouping } from './src/ward-view/ward-view.resource';
@@ -38,22 +38,23 @@ const mockInpatientAdmissionResponse = jest.mocked(useInpatientAdmission).mockRe
38
38
  });
39
39
 
40
40
  const mockInpatientRequestResponse = jest.mocked(useInpatientRequest).mockReturnValue({
41
- inpatientRequests: mockInpatientRequest,
41
+ inpatientRequests: mockInpatientRequests,
42
42
  hasMore: false,
43
43
  loadMore: jest.fn(),
44
44
  isValidating: false,
45
45
  isLoading: false,
46
46
  error: undefined,
47
47
  mutate: jest.fn(),
48
- totalCount: mockInpatientRequest.length,
48
+ totalCount: mockInpatientRequests.length,
49
49
  });
50
50
 
51
51
  export const mockWardPatientGroupDetails = jest.mocked(useWardPatientGrouping).mockReturnValue({
52
52
  admissionLocationResponse: mockAdmissionLocationResponse(),
53
53
  inpatientAdmissionResponse: mockInpatientAdmissionResponse(),
54
54
  inpatientRequestResponse: mockInpatientRequestResponse(),
55
- ...createAndGetWardPatientGrouping(mockInpatientAdmissions, mockAdmissionLocation, mockInpatientRequest),
55
+ ...createAndGetWardPatientGrouping(mockInpatientAdmissions, mockAdmissionLocation, mockInpatientRequests),
56
56
  isLoading: false,
57
+ mutate: jest.fn(),
57
58
  });
58
59
 
59
60
  export const mockWardViewContext: WardViewContext = {
package/package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@kenyaemr/esm-ward-app",
3
- "version": "8.0.0",
3
+ "version": "8.0.2",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@kenyaemr/esm-ward-app",
9
- "version": "8.0.0",
9
+ "version": "8.0.2",
10
10
  "license": "MPL-2.0",
11
11
  "dependencies": {
12
12
  "@carbon/react": "~1.37.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kenyaemr/esm-ward-app",
3
- "version": "8.1.1-pre.124",
3
+ "version": "8.1.2-pre.152",
4
4
  "description": "Ward and bed management module for O3",
5
5
  "browser": "dist/kenyaemr-esm-ward-app.js",
6
6
  "main": "src/index.ts",
@@ -37,11 +37,11 @@
37
37
  "url": "https://github.com/openmrs/openmrs-esm-patient-management/issues"
38
38
  },
39
39
  "dependencies": {
40
- "@carbon/react": "~1.37.0",
40
+ "@carbon/react": "^1.71.0",
41
41
  "lodash-es": "^4.17.15"
42
42
  },
43
43
  "peerDependencies": {
44
- "@openmrs/esm-framework": "5.x",
44
+ "@openmrs/esm-framework": "6.x",
45
45
  "react": "^18.1.0",
46
46
  "react-i18next": "11.x",
47
47
  "react-router-dom": "6.x",
@@ -50,5 +50,5 @@
50
50
  "devDependencies": {
51
51
  "webpack": "^5.74.0"
52
52
  },
53
- "stableVersion": "8.1.0"
53
+ "stableVersion": "8.0.2"
54
54
  }
@@ -29,7 +29,7 @@ const ClinicalFormsWorkspaceSideRailIcon: React.FC = () => {
29
29
  label={t('clinicalForms', 'Clinical forms')}
30
30
  iconDescription={t('clinicalForms', 'Clinical forms')}
31
31
  handler={launchPatientWorkspaceCb}
32
- type="ward-patient-clinical-form"
32
+ type="ward-patient-clinical-forms"
33
33
  />
34
34
  );
35
35
  };
@@ -14,7 +14,7 @@ export default function PatientDischargeSideRailIcon() {
14
14
  label={t('discharge', 'Discharge')}
15
15
  iconDescription={t('discharge', 'Discharge')}
16
16
  handler={handler}
17
- type="patient-discharge-workspace"
17
+ type="ward-patient-discharge"
18
18
  />
19
19
  );
20
20
  }
@@ -0,0 +1,21 @@
1
+ import { SkeletonText, Tag } from '@carbon/react';
2
+ import React from 'react';
3
+ import { useTranslation } from 'react-i18next';
4
+ import styles from './bed-share-divider.scss';
5
+
6
+ interface BedShareDividerProps {
7
+ isLoading?: boolean;
8
+ }
9
+
10
+ const BedShareDivider: React.FC<BedShareDividerProps> = ({ isLoading }) => {
11
+ const { t } = useTranslation();
12
+ return (
13
+ <div className={styles.bedDivider}>
14
+ <div className={styles.bedDividerLine}></div>
15
+ {isLoading ? <SkeletonText /> : <Tag>{t('bedShare', 'Bed share')}</Tag>}
16
+ <div className={styles.bedDividerLine}></div>
17
+ </div>
18
+ );
19
+ };
20
+
21
+ export default BedShareDivider;
@@ -0,0 +1,18 @@
1
+ @use '@carbon/layout';
2
+ @use '@openmrs/esm-styleguide/src/vars' as *;
3
+ @use '@carbon/type';
4
+
5
+ .bedDivider {
6
+ background-color: $ui-02;
7
+ color: $text-02;
8
+ padding: layout.$spacing-01;
9
+ display: flex;
10
+ align-items: center;
11
+ justify-content: space-between;
12
+ }
13
+
14
+ .bedDividerLine {
15
+ height: 1px;
16
+ background-color: $ui-05;
17
+ width: 30%;
18
+ }
@@ -2,40 +2,30 @@ import React, { type ReactNode } from 'react';
2
2
  import { type Bed } from '../types';
3
3
  import EmptyBed from './empty-bed.component';
4
4
  import styles from './ward-bed.scss';
5
- import { useTranslation } from 'react-i18next';
6
- import { Tag } from '@carbon/react';
5
+ import BedShareDivider from './bed-share-divider.component';
7
6
 
8
7
  export interface WardBedProps {
9
8
  patientCards: Array<ReactNode>;
10
9
  bed: Bed;
10
+ isLoadingDivider?: boolean;
11
11
  }
12
12
 
13
- const WardBed: React.FC<WardBedProps> = ({ bed, patientCards }) => {
14
- return patientCards?.length > 0 ? <OccupiedBed bed={bed} patientCards={patientCards} /> : <EmptyBed bed={bed} />;
13
+ const WardBed: React.FC<WardBedProps> = (props) => {
14
+ const { bed, patientCards } = props;
15
+ return patientCards?.length > 0 ? <OccupiedBed {...props} /> : <EmptyBed bed={bed} />;
15
16
  };
16
17
 
17
- const OccupiedBed: React.FC<WardBedProps> = ({ patientCards }) => {
18
+ const OccupiedBed: React.FC<WardBedProps> = ({ patientCards, isLoadingDivider }) => {
18
19
  // interlace patient card with bed dividers between each of them
19
20
  const patientCardsWithDividers = patientCards.flatMap((patientCard, index) => {
20
21
  if (index == 0) {
21
22
  return [patientCard];
22
23
  } else {
23
- return [<BedShareDivider key={'divider-' + index} />, patientCard];
24
+ return [<BedShareDivider key={'divider-' + index} isLoading={isLoadingDivider} />, patientCard];
24
25
  }
25
26
  });
26
27
 
27
28
  return <div className={styles.occupiedBed}>{patientCardsWithDividers}</div>;
28
29
  };
29
30
 
30
- const BedShareDivider = () => {
31
- const { t } = useTranslation();
32
- return (
33
- <div className={styles.bedDivider}>
34
- <div className={styles.bedDividerLine}></div>
35
- <Tag>{t('bedShare', 'Bed share')}</Tag>
36
- <div className={styles.bedDividerLine}></div>
37
- </div>
38
- );
39
- };
40
-
41
31
  export default WardBed;
@@ -9,20 +9,6 @@
9
9
  height: fit-content;
10
10
  }
11
11
 
12
- .bedDivider {
13
- background-color: vars.$ui-02;
14
- color: vars.$text-02;
15
- padding: layout.$spacing-01;
16
- display: flex;
17
- align-items: center;
18
- justify-content: space-between;
19
- }
20
-
21
- .bedDividerLine {
22
- height: 1px;
23
- background-color: vars.$ui-05;
24
- width: 30%;
25
- }
26
12
  .emptyBed {
27
13
  display: flex;
28
14
  gap: layout.$spacing-04;
@@ -42,4 +28,4 @@
42
28
  .emptyBedText {
43
29
  @include type.type-style('heading-compact-01');
44
30
  color: vars.$text-02;
45
- }
31
+ }
@@ -64,7 +64,7 @@ describe('Ward bed', () => {
64
64
  it('renders a single bed with patient details', () => {
65
65
  render(
66
66
  <WardBed
67
- patientCards={[<DefaultWardPatientCard key={mockPatientAlice.uuid} {...mockWardPatientAliceProps} />]}
67
+ patientCards={[<DefaultWardPatientCard key={mockPatientAlice.uuid} wardPatient={mockWardPatientAliceProps} />]}
68
68
  bed={mockBed}
69
69
  />,
70
70
  );
@@ -79,8 +79,8 @@ describe('Ward bed', () => {
79
79
  <WardBed
80
80
  bed={mockBed}
81
81
  patientCards={[
82
- <DefaultWardPatientCard key={mockPatientAlice.uuid} {...mockWardPatientAliceProps} />,
83
- <DefaultWardPatientCard key={mockPatientBrian.uuid} {...mockWardPatientBrianProps} />,
82
+ <DefaultWardPatientCard key={mockPatientAlice.uuid} wardPatient={mockWardPatientAliceProps} />,
83
+ <DefaultWardPatientCard key={mockPatientBrian.uuid} wardPatient={mockWardPatientAliceProps} />,
84
84
  ]}
85
85
  />,
86
86
  );
@@ -254,6 +254,11 @@ export const configSchema: ConfigSchema = {
254
254
  },
255
255
  },
256
256
  },
257
+ hideWorkspaceVitalsLinks: {
258
+ _description: 'Configure whether to hide vital history and record vital links in the ward patient workspace.',
259
+ _type: Type.Boolean,
260
+ _default: false,
261
+ },
257
262
  };
258
263
 
259
264
  export interface WardConfigObject {
@@ -266,6 +271,7 @@ export interface WardConfigObject {
266
271
  admissionRequestNote: Array<AdmissionRequestNoteElementConfig>;
267
272
  };
268
273
  wards: Array<WardDefinition>;
274
+ hideWorkspaceVitalsLinks: boolean;
269
275
  }
270
276
 
271
277
  export interface PendingItemsElementConfig {
@@ -39,6 +39,10 @@ interface EmrApiConfigurationResponse {
39
39
  excludedEncounterTypes: Array<string>;
40
40
  uuid: string;
41
41
  }>;
42
+ bedAssignmentEncounterType: OpenmrsResource;
43
+ cancelADTRequestEncounterType: OpenmrsResource;
44
+ denyAdmissionConcept: OpenmrsResource;
45
+ admissionDecisionConcept: OpenmrsResource;
42
46
  // There are many more keys to this object, but we only need these for now
43
47
  // Add more keys as needed
44
48
  }
@@ -94,6 +98,10 @@ const customRepProps = [
94
98
  ['unknownPatientPersonAttributeType', 'ref'],
95
99
  ['supportsVisitsLocationTag', '(uuid,display,name,links)'],
96
100
  ['transferForm', 'ref'],
101
+ ['bedAssignmentEncounterType', 'ref'],
102
+ ['cancelADTRequestEncounterType', 'ref'],
103
+ ['admissionDecisionConcept', 'ref'],
104
+ ['denyAdmissionConcept', 'ref'],
97
105
  ];
98
106
 
99
107
  const customRep = `custom:${customRepProps.map((prop) => prop.join(':')).join(',')}`;
package/src/index.ts CHANGED
@@ -88,6 +88,12 @@ export const patientClinicalFormsWorkspace = getAsyncLifecycle(
88
88
  options,
89
89
  );
90
90
 
91
+ // t('cancelAdmissionRequest', 'Cancel admission request')
92
+ export const cancelAdmissionRequestWorkspace = getAsyncLifecycle(
93
+ () => import('./ward-workspace/cancel-admission-request-workspace/cancel-admission-request.workspace'),
94
+ options,
95
+ );
96
+
91
97
  export const clinicalFormWorkspaceSideRailIcon = getAsyncLifecycle(
92
98
  () => import('./action-menu-buttons/clinical-forms-workspace-siderail.component'),
93
99
  options,
@@ -112,10 +118,4 @@ export function startupApp() {
112
118
  'Bed management module',
113
119
  'Enables features related to bed management / assignment. Requires the backend bed management module to be installed.',
114
120
  );
115
-
116
- registerFeatureFlag(
117
- 'ward-view-vertical-tiling',
118
- 'Ward view vertical tiling',
119
- 'Enable tiling of bed cards vertically in the ward view.',
120
- );
121
121
  }
@@ -15,10 +15,11 @@ import useEmrConfiguration from '../hooks/useEmrConfiguration';
15
15
  import useLocations from '../hooks/useLocations';
16
16
  import styles from './location-selector.scss';
17
17
 
18
- interface LocationSelectorProps extends RadioButtonGroupProps {}
18
+ interface LocationSelectorProps extends RadioButtonGroupProps {
19
+ paginationSize?: number;
20
+ }
19
21
 
20
- export default function LocationSelector(props: LocationSelectorProps) {
21
- const size = 5;
22
+ export default function LocationSelector({ paginationSize = 15, ...props }: LocationSelectorProps) {
22
23
  const { t } = useTranslation();
23
24
  const { emrConfiguration, isLoadingEmrConfiguration } = useEmrConfiguration();
24
25
  const isTablet = !isDesktop(useLayoutType());
@@ -42,7 +43,7 @@ export default function LocationSelector(props: LocationSelectorProps) {
42
43
  totalPages,
43
44
  goToNext,
44
45
  goToPrevious,
45
- } = useLocations(filterCriteria, size, !emrConfiguration);
46
+ } = useLocations(filterCriteria, paginationSize, !emrConfiguration);
46
47
 
47
48
  const handleSearch = useCallback(
48
49
  (event: React.ChangeEvent<HTMLInputElement>) => {
@@ -81,12 +82,12 @@ export default function LocationSelector(props: LocationSelectorProps) {
81
82
  </RadioButtonGroup>
82
83
  </ResponsiveWrapper>
83
84
  )}
84
- {totalCount > size && (
85
+ {totalCount > paginationSize && (
85
86
  <div className={styles.pagination}>
86
87
  <span className={styles.bodyShort01}>
87
88
  {t('showingLocations', '{{start}}-{{end}} of {{count}} locations', {
88
- start: (currentPage - 1) * size + 1,
89
- end: Math.min(currentPage * size, totalCount),
89
+ start: (currentPage - 1) * paginationSize + 1,
90
+ end: Math.min(currentPage * paginationSize, totalCount),
90
91
  count: totalCount,
91
92
  })}
92
93
  </span>
@@ -15,8 +15,6 @@ const Root: React.FC = () => {
15
15
  <Route path="/:locationUuid" element={<WardView />} />
16
16
  </Routes>
17
17
  </BrowserRouter>
18
-
19
- <WorkspaceContainer overlay contextKey="ward" />
20
18
  </main>
21
19
  );
22
20
  };
package/src/routes.json CHANGED
@@ -84,7 +84,9 @@
84
84
  "type": "ward-patient-notes",
85
85
  "title": "inpatientNotesWorkspaceTitle",
86
86
  "sidebarFamily": "ward-patient",
87
- "hasOwnSidebar": true
87
+ "hasOwnSidebar": true,
88
+ "groups": ["ward-patient"]
89
+
88
90
  },
89
91
  {
90
92
  "name": "admit-patient-form-workspace",
@@ -96,10 +98,11 @@
96
98
  "name": "ward-patient-workspace",
97
99
  "component": "wardPatientWorkspace",
98
100
  "type": "ward",
99
- "title": "Ward Patient",
101
+ "title": "Ward patient",
100
102
  "width": "extra-wide",
101
103
  "hasOwnSidebar": true,
102
- "sidebarFamily": "ward-patient"
104
+ "sidebarFamily": "ward-patient",
105
+ "groups": ["ward-patient"]
103
106
  },
104
107
  {
105
108
  "name": "patient-transfer-swap-workspace",
@@ -107,7 +110,9 @@
107
110
  "title": "transfers",
108
111
  "type": "transfer-swap-bed-form",
109
112
  "hasOwnSidebar": true,
110
- "sidebarFamily": "ward-patient"
113
+ "sidebarFamily": "ward-patient",
114
+ "groups": ["ward-patient"]
115
+
111
116
  },
112
117
  {
113
118
  "name": "patient-transfer-request-workspace",
@@ -121,7 +126,8 @@
121
126
  "title": "discharge",
122
127
  "type": "ward-patient-discharge",
123
128
  "hasOwnSidebar": true,
124
- "sidebarFamily": "ward-patient"
129
+ "sidebarFamily": "ward-patient",
130
+ "groups": ["ward-patient"]
125
131
  },
126
132
  {
127
133
  "name": "ward-patient-clinical-forms-workspace",
@@ -130,7 +136,15 @@
130
136
  "type": "ward-patient-clinical-forms",
131
137
  "hasOwnSidebar": true,
132
138
  "sidebarFamily": "ward-patient",
133
- "width": "wider"
139
+ "width": "wider",
140
+ "groups": ["ward-patient"]
141
+ },
142
+ {
143
+ "name": "cancel-admission-request-workspace",
144
+ "component": "cancelAdmissionRequestWorkspace",
145
+ "title": "cancelAdmissionRequest",
146
+ "type": "cancel-admission-request",
147
+ "sidebarFamily": "ward-patient"
134
148
  }
135
149
  ]
136
150
  }
@@ -11,7 +11,11 @@ import type {
11
11
  import type React from 'react';
12
12
  import type { useWardPatientGrouping } from '../hooks/useWardPatientGrouping';
13
13
 
14
- export type WardPatientCardType = React.FC<WardPatient>;
14
+ interface WardPatientCardProps {
15
+ wardPatient: WardPatient;
16
+ }
17
+
18
+ export type WardPatientCardType = React.FC<WardPatientCardProps>;
15
19
 
16
20
  // WardPatient is a patient admitted to a ward, and/or in a bed on a ward
17
21
  export type WardPatient = {
@@ -44,7 +48,7 @@ export type WardPatient = {
44
48
 
45
49
  export interface WardPatientWorkspaceProps extends DefaultWorkspaceProps {
46
50
  wardPatient: WardPatient;
47
- WardPatientHeader: React.FC<WardPatient>;
51
+ WardPatientHeader: WardPatientCardType;
48
52
  }
49
53
 
50
54
  // server-side types defined in openmrs-module-bedmanagement:
@@ -226,14 +230,14 @@ export interface EncounterPayload {
226
230
 
227
231
  export interface ObsPayload {
228
232
  concept: Concept | string;
229
- value?: string;
233
+ value?: string | OpenmrsResource;
230
234
  groupMembers?: Array<ObsPayload>;
231
235
  }
232
236
 
233
237
  export type WardPatientGroupDetails = ReturnType<typeof useWardPatientGrouping>;
234
238
  export interface WardViewContext {
235
239
  wardPatientGroupDetails: WardPatientGroupDetails;
236
- WardPatientHeader: React.FC<WardPatient>;
240
+ WardPatientHeader: WardPatientCardType;
237
241
  }
238
242
 
239
243
  export interface PatientAndAdmission {
@@ -244,6 +248,7 @@ export interface PatientAndAdmission {
244
248
  export interface MotherChildRelationships {
245
249
  motherByChildUuid: Map<string, PatientAndAdmission>;
246
250
  childrenByMotherUuid: Map<string, PatientAndAdmission[]>;
251
+ isLoading: boolean;
247
252
  }
248
253
 
249
254
  export interface MaternalWardViewContext {
@@ -1,5 +1,5 @@
1
- import { type Patient, type PatientIdentifier, PatientBannerPatientIdentifier } from '@openmrs/esm-framework';
2
1
  import React from 'react';
2
+ import { type Patient, type PatientIdentifier, PatientBannerPatientIdentifiers } from '@openmrs/esm-framework';
3
3
  import { useElementConfig } from '../../ward-view/ward-view.resource';
4
4
 
5
5
  export interface WardPatientIdentifierProps {
@@ -23,7 +23,7 @@ const WardPatientIdentifier: React.FC<WardPatientIdentifierProps> = ({ id, patie
23
23
  }));
24
24
 
25
25
  return (
26
- <PatientBannerPatientIdentifier identifier={fhirIdentifiers} showIdentifierLabel={config?.showIdentifierLabel} />
26
+ <PatientBannerPatientIdentifiers identifiers={fhirIdentifiers} showIdentifierLabel={config?.showIdentifierLabel} />
27
27
  );
28
28
  };
29
29
 
@@ -1,8 +1,10 @@
1
1
  import React, { useMemo } from 'react';
2
+ import { IconButton } from '@carbon/react';
2
3
  import { Movement } from '@carbon/react/icons';
3
- import styles from '../ward-patient-card.scss';
4
4
  import { useTranslation } from 'react-i18next';
5
- import { type WardPatient } from '../../types';
5
+ import { CloseOutlineIcon, launchWorkspace, useAppContext } from '@openmrs/esm-framework';
6
+ import { type WardPatientWorkspaceProps, type WardViewContext, type WardPatient } from '../../types';
7
+ import styles from '../ward-patient-card.scss';
6
8
 
7
9
  export interface WardPatientTransferProps {
8
10
  wardPatient: WardPatient;
@@ -10,6 +12,7 @@ export interface WardPatientTransferProps {
10
12
 
11
13
  const WardPatientPendingTransfer: React.FC<WardPatientTransferProps> = ({ wardPatient }) => {
12
14
  const { t } = useTranslation();
15
+ const { WardPatientHeader } = useAppContext<WardViewContext>('ward-view-context') ?? {};
13
16
 
14
17
  const { dispositionType, dispositionLocation } = wardPatient?.inpatientRequest;
15
18
  const message = useMemo(() => {
@@ -23,14 +26,29 @@ const WardPatientPendingTransfer: React.FC<WardPatientTransferProps> = ({ wardPa
23
26
  return t('pendingDischarge', 'Pending Discharge');
24
27
  }
25
28
  return '';
26
- }, [dispositionType, dispositionLocation]);
29
+ }, [dispositionType, dispositionLocation, t]);
30
+
31
+ const launchCancelAdmissionForm = () => {
32
+ launchWorkspace<WardPatientWorkspaceProps>('cancel-admission-request-workspace', {
33
+ wardPatient,
34
+ WardPatientHeader,
35
+ });
36
+ };
27
37
 
28
38
  if (!(dispositionType === 'TRANSFER' || dispositionType === 'DISCHARGE')) return null;
29
39
 
30
40
  return (
31
41
  <div className={styles.wardPatientCardDispositionTypeContainer}>
32
- <Movement className={styles.movementIcon} size="24" />
42
+ <Movement className={styles.movementIcon} size={24} />
33
43
  {message}
44
+ <IconButton
45
+ label={t('cancel', 'Cancel')}
46
+ kind={'secondary'}
47
+ className={styles.cancelTransferRequestButton}
48
+ size={'sm'}
49
+ onClick={launchCancelAdmissionForm}>
50
+ <CloseOutlineIcon />
51
+ </IconButton>
34
52
  </div>
35
53
  );
36
54
  };
@@ -1,7 +1,8 @@
1
- import { getPatientName, launchWorkspace, useAppContext } from '@openmrs/esm-framework';
1
+ import { getPatientName, useAppContext, launchWorkspaceGroup } from '@openmrs/esm-framework';
2
2
  import React, { type ReactNode } from 'react';
3
- import { type WardViewContext, type WardPatient,type PatientWorkspaceAdditionalProps } from '../types';
3
+ import { type WardViewContext, type WardPatient } from '../types';
4
4
  import styles from './ward-patient-card.scss';
5
+ import { getPatientChartStore } from '@openmrs/esm-patient-common-lib';
5
6
 
6
7
  interface Props {
7
8
  children: ReactNode;
@@ -18,11 +19,28 @@ const WardPatientCard: React.FC<Props> = ({ children, wardPatient }) => {
18
19
  <button
19
20
  className={styles.wardPatientCardButton}
20
21
  onClick={() => {
21
- launchWorkspace<PatientWorkspaceAdditionalProps>('ward-patient-workspace', {
22
- wardPatient,
23
- WardPatientHeader
22
+ launchWorkspaceGroup('ward-patient', {
23
+ state: {
24
+ wardPatient,
25
+ WardPatientHeader,
26
+ },
27
+ onWorkspaceGroupLaunch: () => {
28
+ const store = getPatientChartStore();
29
+ store.setState({
30
+ patientUuid: patient.uuid,
31
+ });
32
+ },
33
+ workspaceToLaunch: {
34
+ name: 'ward-patient-workspace',
35
+ },
36
+ workspaceGroupCleanup: () => {
37
+ const store = getPatientChartStore();
38
+ store.setState({
39
+ patientUuid: undefined,
40
+ });
41
+ },
24
42
  });
25
- }}>
43
+ }}>
26
44
  {/* Name will not be displayed; just there for a11y */}
27
45
  {getPatientName(patient.person)}
28
46
  </button>
@@ -145,6 +145,12 @@
145
145
  margin-right: layout.$spacing-02;
146
146
  }
147
147
 
148
+ .cancelTransferRequestButton {
149
+ fill: $ui-03;
150
+ margin-left: layout.$spacing-02;
151
+ z-index: 2;
152
+ }
153
+
148
154
  .chemistryReferenceIcon {
149
155
  padding: layout.$spacing-02;
150
156
  border-radius: 50%;
@@ -6,7 +6,7 @@ import { bedLayoutToBed } from '../ward-view.resource';
6
6
  import DefaultWardPatientCard from './default-ward-patient-card.component';
7
7
 
8
8
  function DefaultWardBeds() {
9
- const {wardPatientGroupDetails} = useAppContext<WardViewContext>('ward-view-context') ?? {};
9
+ const { wardPatientGroupDetails } = useAppContext<WardViewContext>('ward-view-context') ?? {};
10
10
  const { bedLayouts, wardAdmittedPatientsWithBed } = wardPatientGroupDetails ?? {};
11
11
 
12
12
  const wardBeds = bedLayouts?.map((bedLayout) => {
@@ -28,10 +28,8 @@ function DefaultWardBeds() {
28
28
  };
29
29
  }
30
30
  });
31
- const patientCards = wardPatients.map(wardPatient => (
32
- <DefaultWardPatientCard
33
- key={wardPatient.patient.uuid}
34
- {...wardPatient} />
31
+ const patientCards = wardPatients.map((wardPatient) => (
32
+ <DefaultWardPatientCard key={wardPatient.patient.uuid} {...{ wardPatient }} />
35
33
  ));
36
34
  return <WardBed key={bed.uuid} bed={bed} patientCards={patientCards} />;
37
35
  });
@@ -10,7 +10,7 @@ import styles from '../../ward-patient-card/ward-patient-card.scss';
10
10
  import { type WardPatientCardType } from '../../types';
11
11
  import WardPatientGender from '../../ward-patient-card/row-elements/ward-patient-gender.component';
12
12
 
13
- const DefaultWardPatientCardHeader: WardPatientCardType = (wardPatient) => {
13
+ const DefaultWardPatientCardHeader: WardPatientCardType = ({ wardPatient }) => {
14
14
  const { patient, bed, inpatientAdmission } = wardPatient;
15
15
  const { encounterAssigningToCurrentInpatientLocation, firstAdmissionOrTransferEncounter } = inpatientAdmission ?? {};
16
16