@openmrs/esm-ward-app 9.2.1-pre.7244 → 9.2.1-pre.7261
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 +8 -8
- package/dist/1741.js +1 -1
- package/dist/1741.js.map +1 -1
- package/dist/1987.js +1 -0
- package/dist/1987.js.map +1 -0
- package/dist/2216.js +1 -0
- package/dist/2216.js.map +1 -0
- package/dist/2728.js +1 -1
- package/dist/2728.js.map +1 -1
- package/dist/283.js +1 -1
- package/dist/283.js.map +1 -1
- package/dist/2948.js +1 -1
- package/dist/2948.js.map +1 -1
- package/dist/3365.js +1 -1
- package/dist/3365.js.map +1 -1
- package/dist/3413.js +1 -1
- package/dist/3413.js.map +1 -1
- package/dist/3673.js +1 -0
- package/dist/3673.js.map +1 -0
- package/dist/3982.js +1 -1
- package/dist/3982.js.map +1 -1
- package/dist/4189.js +1 -0
- package/dist/4189.js.map +1 -0
- package/dist/4300.js +1 -1
- package/dist/5603.js +1 -0
- package/dist/5603.js.map +1 -0
- package/dist/581.js +1 -1
- package/dist/581.js.map +1 -1
- package/dist/7179.js +1 -1
- package/dist/7179.js.map +1 -1
- package/dist/7512.js +1 -1
- package/dist/7512.js.map +1 -1
- package/dist/7661.js +1 -1
- package/dist/7661.js.map +1 -1
- package/dist/8501.js +1 -1
- package/dist/8501.js.map +1 -1
- package/dist/8522.js +1 -1
- package/dist/8522.js.map +1 -1
- package/dist/8610.js +1 -1
- package/dist/8610.js.map +1 -1
- package/dist/89.js +2 -1
- package/dist/89.js.map +1 -1
- package/dist/9117.js +1 -1
- package/dist/9117.js.map +1 -1
- package/dist/917.js +1 -0
- package/dist/917.js.map +1 -0
- package/dist/9756.js +1 -0
- package/dist/9756.js.map +1 -0
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/openmrs-esm-ward-app.js +1 -1
- package/dist/openmrs-esm-ward-app.js.buildmanifest.json +226 -177
- package/dist/openmrs-esm-ward-app.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/action-menu-buttons/clinical-forms-workspace-siderail.component.tsx +16 -24
- package/src/action-menu-buttons/discharge-workspace-siderail.component.tsx +6 -6
- package/src/action-menu-buttons/order-basket-action-button.component.tsx +31 -0
- package/src/action-menu-buttons/transfer-workspace-siderail.component.tsx +7 -18
- package/src/hooks/useEmrConfiguration.ts +19 -19
- package/src/index.ts +14 -16
- package/src/routes.json +127 -80
- package/src/types/index.ts +7 -3
- package/src/ward-patient-card/row-elements/ward-patient-pending-transfer.component.tsx +9 -4
- package/src/ward-patient-card/ward-patient-card.component.tsx +3 -11
- package/src/ward-view-header/admission-requests-bar.component.tsx +10 -6
- package/src/ward-view-header/admission-requests-bar.test.tsx +3 -3
- package/src/ward-workspace/admission-request-card/admission-request-card-actions.component.tsx +8 -6
- package/src/ward-workspace/admission-request-workspace/admission-requests-action-button.extension.tsx +6 -7
- package/src/ward-workspace/admission-request-workspace/admission-requests-empty-state.component.tsx +16 -29
- package/src/ward-workspace/admission-request-workspace/admission-requests-workspace.test.tsx +23 -8
- package/src/ward-workspace/admission-request-workspace/admission-requests.workspace.tsx +28 -28
- package/src/ward-workspace/admit-patient-button.component.tsx +3 -2
- package/src/ward-workspace/admit-patient-form-workspace/admit-patient-form.test.tsx +17 -16
- package/src/ward-workspace/admit-patient-form-workspace/admit-patient-form.workspace.tsx +72 -69
- package/src/ward-workspace/cancel-admission-request-workspace/cancel-admission-request.component.tsx +176 -0
- package/src/ward-workspace/cancel-admission-request-workspace/cancel-admission-request.test.tsx +11 -9
- package/src/ward-workspace/cancel-admission-request-workspace/cancel-admission-request.workspace.tsx +17 -167
- package/src/ward-workspace/cancel-admission-request-workspace/ward-patient-cancel-admission-request.workspace.tsx +16 -0
- package/src/ward-workspace/create-admission-encounter/create-admission-encounter-action-button.extension.tsx +23 -34
- package/src/ward-workspace/create-admission-encounter/create-admission-encounter.test.tsx +9 -4
- package/src/ward-workspace/create-admission-encounter/create-admission-encounter.workspace.tsx +39 -19
- package/src/ward-workspace/patient-details/ward-patient-action-button.component.tsx +17 -0
- package/src/ward-workspace/patient-details/ward-patient.workspace.tsx +27 -7
- package/src/ward-workspace/patient-discharge/patient-discharge.workspace.tsx +46 -40
- package/src/ward-workspace/patient-transfer-bed-swap/patient-admit-or-transfer-request-form.component.tsx +21 -13
- package/src/ward-workspace/patient-transfer-bed-swap/patient-bed-swap-form.component.tsx +10 -14
- package/src/ward-workspace/patient-transfer-bed-swap/patient-transfer-swap.workspace.tsx +42 -24
- package/src/ward-workspace/patient-transfer-request-workspace/patient-transfer-request.workspace.tsx +22 -8
- package/src/ward-workspace/ward-patient-notes/notes-action-button.component.tsx +17 -0
- package/src/ward-workspace/ward-patient-notes/{form/notes-form.scss → notes.scss} +0 -1
- package/src/ward-workspace/ward-patient-notes/notes.test.tsx +134 -0
- package/src/ward-workspace/ward-patient-notes/notes.workspace.tsx +174 -13
- package/translations/en.json +3 -1
- package/dist/1663.js +0 -1
- package/dist/1663.js.map +0 -1
- package/dist/2557.js +0 -1
- package/dist/2557.js.map +0 -1
- package/dist/7232.js +0 -2
- package/dist/7232.js.map +0 -1
- package/dist/7886.js +0 -1
- package/dist/7886.js.map +0 -1
- package/dist/9045.js +0 -1
- package/dist/9045.js.map +0 -1
- package/src/ward-workspace/admission-request-workspace/admission-requests-context.ts +0 -20
- package/src/ward-workspace/patient-clinical-forms-workspace/patient-clinical-forms.workspace.tsx +0 -29
- package/src/ward-workspace/patient-details/ward-patient-action-button.extension.tsx +0 -18
- package/src/ward-workspace/ward-patient-notes/form/notes-form.component.tsx +0 -186
- package/src/ward-workspace/ward-patient-notes/form/notes-form.test.tsx +0 -116
- package/src/ward-workspace/ward-patient-notes/notes-action-button.extension.tsx +0 -18
- /package/dist/{7232.js.LICENSE.txt → 89.js.LICENSE.txt} +0 -0
package/src/routes.json
CHANGED
|
@@ -40,41 +40,16 @@
|
|
|
40
40
|
"name": "ward-patient-action-button",
|
|
41
41
|
"slot": "action-menu-ward-patient-items-slot"
|
|
42
42
|
},
|
|
43
|
-
{
|
|
44
|
-
"component": "wardPatientNotesActionButtonExtension",
|
|
45
|
-
"name": "ward-inpatient-notes-form-action-button",
|
|
46
|
-
"slot": "action-menu-ward-patient-items-slot"
|
|
47
|
-
},
|
|
48
43
|
{
|
|
49
44
|
"component": "coloredObsTagCardRowExtension",
|
|
50
45
|
"name": "colored-obs-tags-card-row",
|
|
51
46
|
"slot": "ward-patient-card-slot"
|
|
52
47
|
},
|
|
53
|
-
{
|
|
54
|
-
"name": "transfer-swap-patient-siderail-button",
|
|
55
|
-
"slot": "action-menu-ward-patient-items-slot",
|
|
56
|
-
"component": "patientTransferAndSwapWorkspaceSiderailIcon"
|
|
57
|
-
},
|
|
58
48
|
{
|
|
59
49
|
"name": "patient-discharge-siderail-button",
|
|
60
50
|
"slot": "action-menu-ward-patient-items-slot",
|
|
61
51
|
"component": "patientDischargeWorkspaceSideRailIcon"
|
|
62
52
|
},
|
|
63
|
-
{
|
|
64
|
-
"name": "clinical-forms-workspace-siderail-button",
|
|
65
|
-
"component": "clinicalFormWorkspaceSideRailIcon",
|
|
66
|
-
"slot": "action-menu-ward-patient-items-slot"
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
"name": "admission-requests-workspace-siderail-button",
|
|
70
|
-
"component": "admissionRequestsWorkspaceSideRailIcon",
|
|
71
|
-
"slot": "action-menu-ward-patient-admission-requests-items-slot"
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
"name": "create-admission-request-workspace-siderail-button",
|
|
75
|
-
"component": "createAdmissionEncounterWorkspaceSideRailIcon",
|
|
76
|
-
"slot": "action-menu-ward-patient-admission-requests-items-slot"
|
|
77
|
-
},
|
|
78
53
|
{
|
|
79
54
|
"component": "defaultWardView",
|
|
80
55
|
"name": "default-ward",
|
|
@@ -91,93 +66,165 @@
|
|
|
91
66
|
"slot": "ward-workspace-patient-banner-slot"
|
|
92
67
|
}
|
|
93
68
|
],
|
|
94
|
-
"
|
|
69
|
+
"workspaces2": [
|
|
95
70
|
{
|
|
96
71
|
"name": "admission-requests-workspace",
|
|
97
72
|
"component": "admissionRequestWorkspace",
|
|
98
|
-
"
|
|
99
|
-
"type": "pending-admission-requests",
|
|
100
|
-
"width": "wider"
|
|
101
|
-
},{
|
|
102
|
-
"name": "create-admission-encounter-workspace",
|
|
103
|
-
"component": "createAdmissionEncounterWorkspace",
|
|
104
|
-
"title": "admitPatient",
|
|
105
|
-
"type": "patient-search-workspace",
|
|
106
|
-
"width": "wider"
|
|
73
|
+
"window": "pending-admissions"
|
|
107
74
|
},
|
|
108
75
|
{
|
|
109
|
-
"name": "
|
|
110
|
-
"component": "
|
|
111
|
-
"
|
|
112
|
-
|
|
113
|
-
|
|
76
|
+
"name": "transfer-elsewhere-workspace",
|
|
77
|
+
"component": "patientTransferRequestWorkspace",
|
|
78
|
+
"window": "pending-admissions"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"name": "cancel-admission-request-workspace",
|
|
82
|
+
"component": "cancelAdmissionRequestWorkspace",
|
|
83
|
+
"window": "pending-admissions"
|
|
114
84
|
},
|
|
115
85
|
{
|
|
116
86
|
"name": "admit-patient-form-workspace",
|
|
117
87
|
"component": "admitPatientFormWorkspace",
|
|
118
|
-
"
|
|
119
|
-
|
|
88
|
+
"window": "pending-admissions"
|
|
89
|
+
},
|
|
90
|
+
|
|
91
|
+
{
|
|
92
|
+
"name": "ward-app-patient-search-workspace",
|
|
93
|
+
"component": "@openmrs/esm-patient-search-app#patientSearchWorkspace2",
|
|
94
|
+
"window": "add-patient-to-ward"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"name": "ward-app-start-visit-workspace",
|
|
98
|
+
"component": "@openmrs/esm-patient-chart-app#exportedVisitForm",
|
|
99
|
+
"window": "add-patient-to-ward"
|
|
120
100
|
},
|
|
101
|
+
{
|
|
102
|
+
"name": "create-admission-encounter-workspace",
|
|
103
|
+
"component": "createAdmissionEncounterWorkspace",
|
|
104
|
+
"window": "add-patient-to-ward"
|
|
105
|
+
},
|
|
106
|
+
|
|
107
|
+
|
|
121
108
|
{
|
|
122
109
|
"name": "ward-patient-workspace",
|
|
123
110
|
"component": "wardPatientWorkspace",
|
|
124
|
-
"
|
|
125
|
-
"title": "Ward patient",
|
|
126
|
-
"width": "extra-wide"
|
|
111
|
+
"window": "ward-patient"
|
|
127
112
|
},
|
|
128
113
|
{
|
|
129
|
-
"name": "patient-
|
|
130
|
-
"component": "
|
|
131
|
-
"
|
|
132
|
-
|
|
114
|
+
"name": "ward-patient-vitals-workspace",
|
|
115
|
+
"component": "@openmrs/esm-patient-vitals-app#exportedVitalsBiometricsFormWorkspace",
|
|
116
|
+
"window": "ward-patient"
|
|
117
|
+
},
|
|
118
|
+
|
|
119
|
+
{
|
|
120
|
+
"name": "ward-patient-notes-workspace",
|
|
121
|
+
"component": "wardPatientNotesWorkspace",
|
|
122
|
+
"window": "ward-patient-notes"
|
|
133
123
|
|
|
134
124
|
},
|
|
135
125
|
{
|
|
136
|
-
"name": "patient-transfer-
|
|
137
|
-
"component": "
|
|
138
|
-
"
|
|
139
|
-
"type": "transfer-request-form"
|
|
126
|
+
"name": "ward-patient-transfer-swap-workspace",
|
|
127
|
+
"component": "patientTransferAndSwapWorkspace",
|
|
128
|
+
"window": "ward-patient-transfer-swap"
|
|
140
129
|
},
|
|
141
130
|
{
|
|
142
131
|
"name": "patient-discharge-workspace",
|
|
143
132
|
"component": "patientDischargeWorkspace",
|
|
144
|
-
"
|
|
145
|
-
"type": "ward-patient-discharge"
|
|
133
|
+
"window": "ward-patient-discharge"
|
|
146
134
|
},
|
|
147
135
|
{
|
|
148
136
|
"name": "ward-patient-clinical-forms-workspace",
|
|
149
|
-
"component": "
|
|
150
|
-
"
|
|
151
|
-
|
|
137
|
+
"component": "@openmrs/esm-patient-forms-app#exportedClinicalFormsWorkspace",
|
|
138
|
+
"window": "ward-patient-clinical-forms"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"name": "ward-patient-form-entry-workspace",
|
|
142
|
+
"component": "@openmrs/esm-patient-forms-app#exportedPatientFormEntryWorkspace",
|
|
143
|
+
"window": "ward-patient-clinical-forms"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"name": "ward-patient-cancel-admission-request-workspace",
|
|
147
|
+
"component": "wardPatientCancelAdmissionRequestWorkspace",
|
|
148
|
+
"window": "ward-patient-cancel-admission-request"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"name": "ward-patient-order-basket-workspace",
|
|
152
|
+
"component": "@openmrs/esm-patient-orders-app#exportedOrderBasketWorkspace",
|
|
153
|
+
"window": "ward-patient-order-basket"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"name": "ward-patient-order-basket-add-drug-order-workspace",
|
|
157
|
+
"component": "@openmrs/esm-patient-medications-app#exportedAddDrugOrderWorkspace",
|
|
158
|
+
"window": "ward-patient-order-basket"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"name": "ward-patient-order-basket-add-lab-order-workspace",
|
|
162
|
+
"component": "@openmrs/esm-patient-tests-app#exportedAddLabOrderWorkspace",
|
|
163
|
+
"window": "ward-patient-order-basket"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"name": "ward-patient-order-basket-add-general-order-workspace",
|
|
167
|
+
"component": "@openmrs/esm-patient-orders-app#exportedOrderBasketWorkspace",
|
|
168
|
+
"window": "ward-patient-order-basket"
|
|
169
|
+
}
|
|
170
|
+
],
|
|
171
|
+
"workspaceWindows2": [
|
|
172
|
+
{
|
|
173
|
+
"name": "pending-admissions",
|
|
174
|
+
"group": "ward-manage-admissions",
|
|
175
|
+
"icon": "admissionRequestsWorkspaceSideRailIcon",
|
|
152
176
|
"width": "wider"
|
|
153
177
|
},
|
|
154
178
|
{
|
|
155
|
-
"name": "
|
|
156
|
-
"
|
|
157
|
-
"
|
|
158
|
-
|
|
179
|
+
"name": "add-patient-to-ward",
|
|
180
|
+
"group": "ward-manage-admissions",
|
|
181
|
+
"icon": "createAdmissionEncounterWorkspaceSideRailIcon"
|
|
182
|
+
},
|
|
183
|
+
|
|
184
|
+
{
|
|
185
|
+
"name": "ward-patient",
|
|
186
|
+
"group": "ward-patient",
|
|
187
|
+
"icon": "wardPatientActionButton",
|
|
188
|
+
"width": "wider"
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"name": "ward-patient-notes",
|
|
192
|
+
"group": "ward-patient",
|
|
193
|
+
"icon": "wardPatientNotesActionButton"
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"name": "ward-patient-transfer-swap",
|
|
197
|
+
"group": "ward-patient",
|
|
198
|
+
"icon": "patientTransferAndSwapWorkspaceSiderailIcon"
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
"name": "ward-patient-discharge",
|
|
202
|
+
"group": "ward-patient",
|
|
203
|
+
"icon": "patientDischargeWorkspaceSideRailIcon"
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
"name": "ward-patient-clinical-forms",
|
|
207
|
+
"group": "ward-patient",
|
|
208
|
+
"icon": "clinicalFormWorkspaceSideRailIcon"
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"name": "ward-patient-order-basket",
|
|
212
|
+
"group": "ward-patient",
|
|
213
|
+
"icon": "orderBasketWorkspaceSideRailIcon"
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"name": "ward-patient-cancel-admission-request",
|
|
217
|
+
"group": "ward-patient"
|
|
159
218
|
}
|
|
160
219
|
],
|
|
161
|
-
"
|
|
220
|
+
"workspaceGroups2": [
|
|
221
|
+
{
|
|
222
|
+
"name": "ward-manage-admissions",
|
|
223
|
+
"overlay": true
|
|
224
|
+
},
|
|
162
225
|
{
|
|
163
226
|
"name": "ward-patient",
|
|
164
|
-
"
|
|
165
|
-
"ward-patient-workspace",
|
|
166
|
-
"ward-patient-notes-workspace",
|
|
167
|
-
"patient-transfer-swap-workspace",
|
|
168
|
-
"patient-discharge-workspace",
|
|
169
|
-
"ward-patient-clinical-forms-workspace",
|
|
170
|
-
"add-drug-order",
|
|
171
|
-
"order-basket",
|
|
172
|
-
"add-lab-order"
|
|
173
|
-
]
|
|
174
|
-
},
|
|
175
|
-
{
|
|
176
|
-
"name": "ward-patient-admission-requests",
|
|
177
|
-
"members": [
|
|
178
|
-
"admission-requests-workspace",
|
|
179
|
-
"create-admission-encounter-workspace"
|
|
180
|
-
]
|
|
227
|
+
"overlay": true
|
|
181
228
|
}
|
|
182
229
|
]
|
|
183
230
|
}
|
package/src/types/index.ts
CHANGED
|
@@ -7,6 +7,7 @@ import type {
|
|
|
7
7
|
Patient,
|
|
8
8
|
Person,
|
|
9
9
|
Visit,
|
|
10
|
+
Workspace2DefinitionProps,
|
|
10
11
|
} from '@openmrs/esm-framework';
|
|
11
12
|
import type React from 'react';
|
|
12
13
|
import type { useWardPatientGrouping } from '../hooks/useWardPatientGrouping';
|
|
@@ -50,7 +51,7 @@ export type WardPatient = {
|
|
|
50
51
|
inpatientRequest: InpatientRequest;
|
|
51
52
|
};
|
|
52
53
|
|
|
53
|
-
export interface WardPatientWorkspaceProps
|
|
54
|
+
export interface WardPatientWorkspaceProps {
|
|
54
55
|
wardPatient: WardPatient;
|
|
55
56
|
|
|
56
57
|
/**
|
|
@@ -60,6 +61,11 @@ export interface WardPatientWorkspaceProps extends DefaultWorkspaceProps {
|
|
|
60
61
|
relatedTransferPatients?: WardPatient[];
|
|
61
62
|
}
|
|
62
63
|
|
|
64
|
+
/**
|
|
65
|
+
* props type of workspaces in the 'ward-patient` workspace group.
|
|
66
|
+
*/
|
|
67
|
+
export type WardPatientWorkspaceDefinition = Workspace2DefinitionProps<{}, {}, { wardPatient: WardPatient }>;
|
|
68
|
+
|
|
63
69
|
// server-side types defined in openmrs-module-bedmanagement:
|
|
64
70
|
|
|
65
71
|
// note "AdmissionLocationResponse" isn't the clearest name, but it matches the endpoint; endpoint fetches bed information (including info about patients in those beds) for a location (as provided by the bed management module)
|
|
@@ -271,5 +277,3 @@ export interface MaternalWardViewContext {
|
|
|
271
277
|
[key: number]: unknown;
|
|
272
278
|
[key: symbol]: unknown;
|
|
273
279
|
}
|
|
274
|
-
|
|
275
|
-
export type PatientWorkspaceAdditionalProps = Omit<WardPatientWorkspaceProps, keyof DefaultWorkspaceProps>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IconButton } from '@carbon/react';
|
|
2
2
|
import { Movement } from '@carbon/react/icons';
|
|
3
|
-
import { CloseOutlineIcon, launchWorkspace } from '@openmrs/esm-framework';
|
|
3
|
+
import { CloseOutlineIcon, launchWorkspace, launchWorkspace2 } from '@openmrs/esm-framework';
|
|
4
4
|
import React, { useMemo } from 'react';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
6
|
import { type WardPatient, type WardPatientWorkspaceProps } from '../../types';
|
|
@@ -28,9 +28,14 @@ const WardPatientPendingTransfer: React.FC<WardPatientTransferProps> = ({ wardPa
|
|
|
28
28
|
}, [dispositionType, dispositionLocation, t]);
|
|
29
29
|
|
|
30
30
|
const launchCancelAdmissionForm = () => {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
launchWorkspace2(
|
|
32
|
+
'ward-patient-cancel-admission-request-workspace',
|
|
33
|
+
{},
|
|
34
|
+
{},
|
|
35
|
+
{
|
|
36
|
+
wardPatient,
|
|
37
|
+
},
|
|
38
|
+
);
|
|
34
39
|
};
|
|
35
40
|
|
|
36
41
|
if (!(dispositionType === 'TRANSFER' || dispositionType === 'DISCHARGE')) return null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { type ReactNode } from 'react';
|
|
2
|
-
import { getPatientName,
|
|
2
|
+
import { getPatientName, launchWorkspace2 } from '@openmrs/esm-framework';
|
|
3
3
|
import { type WardPatient } from '../types';
|
|
4
4
|
import styles from './ward-patient-card.scss';
|
|
5
5
|
|
|
@@ -23,16 +23,8 @@ const WardPatientCard: React.FC<Props> = ({ children, wardPatient, relatedTransf
|
|
|
23
23
|
<button
|
|
24
24
|
className={styles.wardPatientCardButton}
|
|
25
25
|
onClick={() => {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
wardPatient,
|
|
29
|
-
patient,
|
|
30
|
-
patientUuid: patient.uuid,
|
|
31
|
-
relatedTransferPatients,
|
|
32
|
-
},
|
|
33
|
-
workspaceToLaunch: {
|
|
34
|
-
name: 'ward-patient-workspace',
|
|
35
|
-
},
|
|
26
|
+
launchWorkspace2('ward-patient-workspace', {}, {}, {
|
|
27
|
+
wardPatient
|
|
36
28
|
});
|
|
37
29
|
}}>
|
|
38
30
|
{getPatientName(patient.person)}
|
|
@@ -3,7 +3,14 @@ import classNames from 'classnames';
|
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import { Button, InlineNotification } from '@carbon/react';
|
|
5
5
|
import { Movement } from '@carbon/react/icons';
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
ArrowRightIcon,
|
|
8
|
+
isDesktop,
|
|
9
|
+
launchWorkspace2,
|
|
10
|
+
launchWorkspaceGroup,
|
|
11
|
+
useAppContext,
|
|
12
|
+
useLayoutType,
|
|
13
|
+
} from '@openmrs/esm-framework';
|
|
7
14
|
import { type WardViewContext } from '../types';
|
|
8
15
|
import styles from './admission-requests.scss';
|
|
9
16
|
|
|
@@ -46,11 +53,8 @@ const AdmissionRequestsBar: React.FC<AdmissionRequestsBarProps> = ({ wardPending
|
|
|
46
53
|
<Button
|
|
47
54
|
className={styles.manageButton}
|
|
48
55
|
onClick={() => {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
workspaceToLaunch: {
|
|
52
|
-
name: 'admission-requests-workspace',
|
|
53
|
-
},
|
|
56
|
+
launchWorkspace2('admission-requests-workspace', {
|
|
57
|
+
wardPendingPatients,
|
|
54
58
|
});
|
|
55
59
|
}}
|
|
56
60
|
renderIcon={ArrowRightIcon}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { launchWorkspaceGroup, useAppContext } from '@openmrs/esm-framework';
|
|
1
|
+
import { launchWorkspace2, launchWorkspaceGroup, useAppContext } from '@openmrs/esm-framework';
|
|
2
2
|
import { screen } from '@testing-library/react';
|
|
3
3
|
import userEvent from '@testing-library/user-event';
|
|
4
4
|
import React from 'react';
|
|
@@ -8,14 +8,14 @@ import { type WardViewContext } from '../types';
|
|
|
8
8
|
import AdmissionRequestsBar from './admission-requests-bar.component';
|
|
9
9
|
|
|
10
10
|
jest.mocked(useAppContext<WardViewContext>).mockReturnValue(mockWardViewContext);
|
|
11
|
-
const
|
|
11
|
+
const mockLaunchWorkspace = jest.mocked(launchWorkspace2);
|
|
12
12
|
describe('Admission Requests Button', () => {
|
|
13
13
|
it('should launch workspace when clicked on manage button', async () => {
|
|
14
14
|
const user = userEvent.setup();
|
|
15
15
|
renderWithSwr(<AdmissionRequestsBar wardPendingPatients={[]} />);
|
|
16
16
|
|
|
17
17
|
await user.click(screen.getByRole('button', { name: /manage/i }));
|
|
18
|
-
expect(
|
|
18
|
+
expect(mockLaunchWorkspace).toHaveBeenCalled();
|
|
19
19
|
});
|
|
20
20
|
|
|
21
21
|
it('should have one admission request', () => {
|
package/src/ward-workspace/admission-request-card/admission-request-card-actions.component.tsx
CHANGED
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Button } from '@carbon/react';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import {
|
|
5
|
-
import { useAdmissionRequestsWorkspaceContext } from '../admission-request-workspace/admission-requests-context';
|
|
4
|
+
import { closeWorkspaceGroup2, launchWorkspace2, useLayoutType, useWorkspace2Context } from '@openmrs/esm-framework';
|
|
6
5
|
import type { WardPatientCardType, WardPatientWorkspaceProps } from '../../types';
|
|
7
6
|
import AdmitPatientButton from '../admit-patient-button.component';
|
|
8
7
|
import styles from './admission-request-card.scss';
|
|
9
8
|
|
|
10
9
|
const AdmissionRequestCardActions: WardPatientCardType = ({ wardPatient }) => {
|
|
11
10
|
const { t } = useTranslation();
|
|
12
|
-
const { closeWorkspaceWithSavedChanges } = useAdmissionRequestsWorkspaceContext();
|
|
13
11
|
const responsiveSize = useLayoutType() === 'tablet' ? 'lg' : 'md';
|
|
12
|
+
const { closeWorkspace } = useWorkspace2Context();
|
|
14
13
|
|
|
15
14
|
const launchPatientTransferForm = () => {
|
|
16
|
-
|
|
15
|
+
launchWorkspace2<WardPatientWorkspaceProps, {}, {}>('transfer-elsewhere-workspace', {
|
|
17
16
|
wardPatient,
|
|
18
17
|
});
|
|
19
18
|
};
|
|
20
19
|
|
|
21
20
|
const launchCancelAdmissionForm = () => {
|
|
22
|
-
|
|
21
|
+
launchWorkspace2<WardPatientWorkspaceProps, {}, {}>('cancel-admission-request-workspace', {
|
|
23
22
|
wardPatient,
|
|
24
23
|
});
|
|
25
24
|
};
|
|
@@ -37,7 +36,10 @@ const AdmissionRequestCardActions: WardPatientCardType = ({ wardPatient }) => {
|
|
|
37
36
|
<AdmitPatientButton
|
|
38
37
|
wardPatient={wardPatient}
|
|
39
38
|
dispositionType={wardPatient.inpatientRequest.dispositionType}
|
|
40
|
-
onAdmitPatientSuccess={() =>
|
|
39
|
+
onAdmitPatientSuccess={async () => {
|
|
40
|
+
await closeWorkspace({ discardUnsavedChanges: true });
|
|
41
|
+
closeWorkspaceGroup2();
|
|
42
|
+
}}
|
|
41
43
|
/>
|
|
42
44
|
</div>
|
|
43
45
|
);
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { ActionMenuButton2, UserAvatarIcon } from '@openmrs/esm-framework';
|
|
2
3
|
import { useTranslation } from 'react-i18next';
|
|
3
|
-
import { ActionMenuButton, launchWorkspace, UserAvatarIcon } from '@openmrs/esm-framework';
|
|
4
|
-
import { type AdmissionRequestsWorkspaceContextProps } from './admission-requests-context';
|
|
5
4
|
|
|
6
5
|
export default function AdmissionRequestsActionButton() {
|
|
7
6
|
const { t } = useTranslation();
|
|
8
7
|
|
|
9
8
|
return (
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
handler={() => launchWorkspace<AdmissionRequestsWorkspaceContextProps>('admission-requests-workspace')}
|
|
13
|
-
iconDescription={t('pendingAdmissions', 'Pending admissions')}
|
|
9
|
+
<ActionMenuButton2
|
|
10
|
+
icon={(props) => <UserAvatarIcon {...props} />}
|
|
14
11
|
label={t('pendingAdmissions', 'Pending admissions')}
|
|
15
|
-
|
|
12
|
+
workspaceToLaunch={{
|
|
13
|
+
workspaceName: 'admission-requests-workspace',
|
|
14
|
+
}}
|
|
16
15
|
/>
|
|
17
16
|
);
|
|
18
17
|
}
|
package/src/ward-workspace/admission-request-workspace/admission-requests-empty-state.component.tsx
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import { Layer, Tile, Button } from '@carbon/react';
|
|
5
5
|
import { Add } from '@carbon/react/icons';
|
|
6
|
-
import {
|
|
7
|
-
import { type CreateAdmissionEncounterWorkspaceProps } from '../create-admission-encounter/create-admission-encounter.workspace';
|
|
6
|
+
import { launchWorkspace2, useLayoutType, type Workspace2DefinitionProps } from '@openmrs/esm-framework';
|
|
8
7
|
import { EmptyDataIllustration } from './empty-data-illustration.component';
|
|
9
8
|
import styles from './admission-requests-empty-state.scss';
|
|
10
9
|
|
|
@@ -12,36 +11,24 @@ const AdmissionRequestsEmptyState: React.FC = () => {
|
|
|
12
11
|
const { t } = useTranslation();
|
|
13
12
|
const isDesktop = useLayoutType() !== 'tablet';
|
|
14
13
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
handleSearchTermUpdated: (value: string) => {
|
|
31
|
-
setSearchTerm(value);
|
|
14
|
+
const handleAddPatient = () => {
|
|
15
|
+
launchWorkspace2('ward-app-patient-search-workspace', {
|
|
16
|
+
workspaceProps: {
|
|
17
|
+
workspaceTitle: t('addPatientToQueue', 'Add patient to queue'),
|
|
18
|
+
onPatientSelected(
|
|
19
|
+
patientUuid: string,
|
|
20
|
+
patient: fhir.Patient,
|
|
21
|
+
launchChildWorkspace: Workspace2DefinitionProps['launchChildWorkspace'],
|
|
22
|
+
closeWorkspace: Workspace2DefinitionProps['launchChildWorkspace'],
|
|
23
|
+
) {
|
|
24
|
+
launchChildWorkspace('create-admission-encounter-workspace', {
|
|
25
|
+
selectedPatientUuid: patient.id,
|
|
26
|
+
});
|
|
27
|
+
},
|
|
32
28
|
},
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
launchWorkspace('patient-search-workspace', {
|
|
36
|
-
...workspaceProps,
|
|
37
|
-
workspaceTitle: t('addPatientToWard', 'Add patient to ward'),
|
|
38
29
|
});
|
|
39
30
|
};
|
|
40
31
|
|
|
41
|
-
const handleAddPatient = () => {
|
|
42
|
-
launchSearchWorkspace();
|
|
43
|
-
};
|
|
44
|
-
|
|
45
32
|
return (
|
|
46
33
|
<Layer>
|
|
47
34
|
<Tile className={classNames(styles.emptyStateTile, { [styles.desktopTile]: isDesktop })}>
|
package/src/ward-workspace/admission-request-workspace/admission-requests-workspace.test.tsx
CHANGED
|
@@ -1,25 +1,30 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { screen } from '@testing-library/react';
|
|
3
|
-
import { useAppContext } from '@openmrs/esm-framework';
|
|
3
|
+
import { useAppContext, useWorkspace2Context, type Workspace2DefinitionProps } from '@openmrs/esm-framework';
|
|
4
4
|
import { renderWithSwr } from 'tools';
|
|
5
5
|
import { mockWardViewContext } from '../../../mock';
|
|
6
|
-
import { type AdmissionRequestsWorkspaceContextProps } from './admission-requests-context';
|
|
7
6
|
import { type WardViewContext } from '../../types';
|
|
8
7
|
import useEmrConfiguration from '../../hooks/useEmrConfiguration';
|
|
9
8
|
import DefaultWardPendingPatients from '../../ward-view/default-ward/default-ward-pending-patients.component';
|
|
10
|
-
import AdmissionRequestsWorkspace from './admission-requests.workspace';
|
|
9
|
+
import AdmissionRequestsWorkspace, { type AdmissionRequestsWorkspaceProps } from './admission-requests.workspace';
|
|
11
10
|
|
|
12
11
|
jest.mocked(useAppContext<WardViewContext>).mockReturnValue(mockWardViewContext);
|
|
12
|
+
const mockUseWorkspace2Context = jest.mocked(useWorkspace2Context);
|
|
13
13
|
|
|
14
14
|
jest.mock('../../hooks/useEmrConfiguration', () => jest.fn());
|
|
15
15
|
const mockedUseEmrConfiguration = jest.mocked(useEmrConfiguration);
|
|
16
16
|
|
|
17
|
-
const workspaceProps:
|
|
17
|
+
const workspaceProps: Workspace2DefinitionProps<AdmissionRequestsWorkspaceProps> = {
|
|
18
18
|
closeWorkspace: jest.fn(),
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
launchChildWorkspace: jest.fn(),
|
|
20
|
+
workspaceProps: {
|
|
21
|
+
wardPendingPatients: <DefaultWardPendingPatients />,
|
|
22
|
+
},
|
|
23
|
+
windowProps: undefined,
|
|
24
|
+
groupProps: undefined,
|
|
25
|
+
workspaceName: '',
|
|
26
|
+
windowName: '',
|
|
27
|
+
isRootWorkspace: false,
|
|
23
28
|
};
|
|
24
29
|
|
|
25
30
|
describe('Admission Requests Workspace', () => {
|
|
@@ -43,6 +48,16 @@ describe('Admission Requests Workspace', () => {
|
|
|
43
48
|
},
|
|
44
49
|
mutateEmrConfiguration: jest.fn(),
|
|
45
50
|
});
|
|
51
|
+
mockUseWorkspace2Context.mockReturnValue({
|
|
52
|
+
closeWorkspace: jest.fn(),
|
|
53
|
+
launchChildWorkspace: jest.fn(),
|
|
54
|
+
workspaceProps: undefined,
|
|
55
|
+
windowProps: undefined,
|
|
56
|
+
groupProps: undefined,
|
|
57
|
+
workspaceName: '',
|
|
58
|
+
windowName: '',
|
|
59
|
+
isRootWorkspace: false,
|
|
60
|
+
});
|
|
46
61
|
});
|
|
47
62
|
|
|
48
63
|
it('should render an admission request card', () => {
|