@openmrs/esm-service-queues-app 5.0.1-pre.2087
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 +40 -0
- package/LICENSE.md +401 -0
- package/README.md +23 -0
- package/__mocks__/active-visits.mock.ts +97 -0
- package/__mocks__/appointments-data.mock.ts +283 -0
- package/__mocks__/search.mock.ts +35 -0
- package/__mocks__/visits.mock.ts +42 -0
- package/dist/121.js +1 -0
- package/dist/121.js.map +1 -0
- package/dist/130.js +2 -0
- package/dist/130.js.LICENSE.txt +5 -0
- package/dist/130.js.map +1 -0
- package/dist/176.js +1 -0
- package/dist/176.js.map +1 -0
- package/dist/227.js +1 -0
- package/dist/227.js.map +1 -0
- package/dist/242.js +1 -0
- package/dist/242.js.map +1 -0
- package/dist/252.js +1 -0
- package/dist/252.js.map +1 -0
- package/dist/286.js +1 -0
- package/dist/286.js.map +1 -0
- package/dist/308.js +1 -0
- package/dist/308.js.map +1 -0
- package/dist/319.js +1 -0
- package/dist/328.js +1 -0
- package/dist/328.js.map +1 -0
- package/dist/330.js +1 -0
- package/dist/330.js.map +1 -0
- package/dist/364.js +1 -0
- package/dist/364.js.map +1 -0
- package/dist/425.js +1 -0
- package/dist/425.js.map +1 -0
- package/dist/457.js +1 -0
- package/dist/457.js.map +1 -0
- package/dist/469.js +1 -0
- package/dist/469.js.map +1 -0
- package/dist/521.js +1 -0
- package/dist/521.js.map +1 -0
- package/dist/53.js +1 -0
- package/dist/53.js.map +1 -0
- package/dist/574.js +1 -0
- package/dist/591.js +2 -0
- package/dist/591.js.LICENSE.txt +32 -0
- package/dist/591.js.map +1 -0
- package/dist/610.js +1 -0
- package/dist/610.js.map +1 -0
- package/dist/611.js +1 -0
- package/dist/611.js.map +1 -0
- package/dist/616.js +1 -0
- package/dist/616.js.map +1 -0
- package/dist/644.js +1 -0
- package/dist/644.js.map +1 -0
- package/dist/670.js +2 -0
- package/dist/670.js.LICENSE.txt +57 -0
- package/dist/670.js.map +1 -0
- package/dist/733.js +1 -0
- package/dist/733.js.map +1 -0
- package/dist/757.js +1 -0
- package/dist/764.js +1 -0
- package/dist/764.js.map +1 -0
- package/dist/766.js +1 -0
- package/dist/766.js.map +1 -0
- package/dist/784.js +2 -0
- package/dist/784.js.LICENSE.txt +9 -0
- package/dist/784.js.map +1 -0
- package/dist/788.js +1 -0
- package/dist/807.js +1 -0
- package/dist/833.js +1 -0
- package/dist/86.js +1 -0
- package/dist/86.js.map +1 -0
- package/dist/981.js +1 -0
- package/dist/981.js.map +1 -0
- package/dist/main.js +1 -0
- package/dist/main.js.map +1 -0
- package/dist/openmrs-esm-service-queues-app.js +1 -0
- package/dist/openmrs-esm-service-queues-app.js.buildmanifest.json +930 -0
- package/dist/openmrs-esm-service-queues-app.js.map +1 -0
- package/dist/routes.json +1 -0
- package/jest.config.js +3 -0
- package/package.json +53 -0
- package/src/active-visits/active-visits-tab.component.tsx +71 -0
- package/src/active-visits/active-visits-tab.test.tsx +19 -0
- package/src/active-visits/active-visits-table.component.tsx +543 -0
- package/src/active-visits/active-visits-table.resource.ts +443 -0
- package/src/active-visits/active-visits-table.scss +271 -0
- package/src/active-visits/active-visits-table.test.tsx +131 -0
- package/src/active-visits/change-status-dialog.component.tsx +233 -0
- package/src/active-visits/change-status-dialog.scss +32 -0
- package/src/active-visits/change-status-dialog.test.tsx +107 -0
- package/src/add-patient-toqueue/add-patient-toqueue-dialog.component.tsx +218 -0
- package/src/add-patient-toqueue/add-patient-toqueue-dialog.scss +32 -0
- package/src/add-provider-queue-room/add-provider-queue-room.component.tsx +236 -0
- package/src/add-provider-queue-room/add-provider-queue-room.resource.tsx +76 -0
- package/src/add-provider-queue-room/add-provider-queue-room.scss +17 -0
- package/src/add-provider-queue-room/add-provider-queue-room.test.tsx +98 -0
- package/src/clear-queue-entries-dialog/clear-queue-entries-dialog.component.tsx +74 -0
- package/src/clear-queue-entries-dialog/clear-queue-entries-dialog.resource.tsx +46 -0
- package/src/clear-queue-entries-dialog/clear-queue-entries-dialog.scss +15 -0
- package/src/clear-queue-entries-dialog/clear-queue-entries-dialog.test.tsx +42 -0
- package/src/clear-queue-entries-dialog/clear-queue-entries.component.tsx +36 -0
- package/src/config-schema.ts +177 -0
- package/src/constants.ts +7 -0
- package/src/createDashboardLink.tsx +35 -0
- package/src/current-visit/current-visit-summary.component.tsx +38 -0
- package/src/current-visit/current-visit-summary.test.tsx +47 -0
- package/src/current-visit/current-visit.resource.ts +84 -0
- package/src/current-visit/current-visit.scss +34 -0
- package/src/current-visit/hooks/useVitalsConceptMetadata.tsx +101 -0
- package/src/current-visit/visit-details/biometrics-config-schema.ts +14 -0
- package/src/current-visit/visit-details/current-visit-details.component.tsx +96 -0
- package/src/current-visit/visit-details/triage-note.component.tsx +53 -0
- package/src/current-visit/visit-details/triage-note.scss +89 -0
- package/src/current-visit/visit-details/vitals-config-schema.ts +17 -0
- package/src/current-visit/visit-details/vitals.component.tsx +164 -0
- package/src/dashboard.meta.ts +5 -0
- package/src/declarations.d.ts +2 -0
- package/src/helpers/functions.ts +67 -0
- package/src/helpers/helpers.ts +170 -0
- package/src/helpers/time-helpers.ts +15 -0
- package/src/home.component.tsx +29 -0
- package/src/home.test.tsx +58 -0
- package/src/index.ts +100 -0
- package/src/overlay.component.tsx +46 -0
- package/src/overlay.scss +96 -0
- package/src/overlay.test.tsx +49 -0
- package/src/past-visit/past-visit-details/encounter-list.component.tsx +51 -0
- package/src/past-visit/past-visit-details/medications-list.component.tsx +95 -0
- package/src/past-visit/past-visit-details/notes-list.component.tsx +40 -0
- package/src/past-visit/past-visit-details/past-visit-summary.component.tsx +172 -0
- package/src/past-visit/past-visit-details/past-visit-summary.scss +58 -0
- package/src/past-visit/past-visit.component.tsx +37 -0
- package/src/past-visit/past-visit.resource.ts +83 -0
- package/src/past-visit/past-visit.scss +126 -0
- package/src/past-visit/past-visit.test.tsx +41 -0
- package/src/patient-info/appointment-details.component.tsx +98 -0
- package/src/patient-info/appointment-details.scss +34 -0
- package/src/patient-info/appointment-details.test.tsx +36 -0
- package/src/patient-info/appointments.resource.tsx +43 -0
- package/src/patient-info/contact-details.component.tsx +71 -0
- package/src/patient-info/contact-details.scss +31 -0
- package/src/patient-info/contact-details.test.tsx +94 -0
- package/src/patient-info/hooks/usePatientAttributes.tsx +42 -0
- package/src/patient-info/patient-info.component.tsx +78 -0
- package/src/patient-info/patient-info.scss +60 -0
- package/src/patient-info/patient-info.test.tsx +45 -0
- package/src/patient-queue-header/patient-queue-header.component.tsx +64 -0
- package/src/patient-queue-header/patient-queue-header.scss +88 -0
- package/src/patient-queue-header/patient-queue-illustration.component.tsx +22 -0
- package/src/patient-queue-metrics/clinic-metrics.component.tsx +93 -0
- package/src/patient-queue-metrics/clinic-metrics.resource.tsx +51 -0
- package/src/patient-queue-metrics/clinic-metrics.scss +11 -0
- package/src/patient-queue-metrics/clinic-metrics.test.tsx +87 -0
- package/src/patient-queue-metrics/metrics-card.component.tsx +64 -0
- package/src/patient-queue-metrics/metrics-card.scss +80 -0
- package/src/patient-queue-metrics/metrics-header.component.tsx +74 -0
- package/src/patient-queue-metrics/metrics-header.scss +22 -0
- package/src/patient-queue-metrics/queue-metrics.resource.ts +54 -0
- package/src/patient-search/advanced-search.component.tsx +190 -0
- package/src/patient-search/advanced-search.scss +154 -0
- package/src/patient-search/advanced-search.test.tsx +29 -0
- package/src/patient-search/basic-search.component.tsx +112 -0
- package/src/patient-search/basic-search.scss +139 -0
- package/src/patient-search/basic-search.test.tsx +23 -0
- package/src/patient-search/empty-data-illustration.component.tsx +41 -0
- package/src/patient-search/hooks/useActivePatientEnrollment.tsx +29 -0
- package/src/patient-search/hooks/useDefaultLocation.tsx +14 -0
- package/src/patient-search/hooks/usePatients.tsx +25 -0
- package/src/patient-search/hooks/useQueueLocations.tsx +20 -0
- package/src/patient-search/hooks/useRecommendedVisitTypes.tsx +36 -0
- package/src/patient-search/hooks/useScheduledVisits.tsx +50 -0
- package/src/patient-search/patient-scheduled-visits.component.tsx +350 -0
- package/src/patient-search/patient-scheduled-visits.scss +131 -0
- package/src/patient-search/patient-scheduled-visits.test.tsx +55 -0
- package/src/patient-search/patient-search.component.tsx +64 -0
- package/src/patient-search/search-illustration.component.tsx +27 -0
- package/src/patient-search/search-results.component.tsx +75 -0
- package/src/patient-search/search-results.scss +80 -0
- package/src/patient-search/search-results.test.tsx +77 -0
- package/src/patient-search/search.resource.ts +10 -0
- package/src/patient-search/visit-form/base-visit-type.component.tsx +82 -0
- package/src/patient-search/visit-form/base-visit-type.scss +100 -0
- package/src/patient-search/visit-form/base-visit-type.test.tsx +41 -0
- package/src/patient-search/visit-form/queue.resource.ts +73 -0
- package/src/patient-search/visit-form/recommended-visit-type.component.tsx +38 -0
- package/src/patient-search/visit-form/visit-form.component.tsx +366 -0
- package/src/patient-search/visit-form/visit-form.scss +96 -0
- package/src/patient-search/visit-form-queue-fields/visit-form-queue-fields.component.tsx +160 -0
- package/src/patient-search/visit-form-queue-fields/visit-form-queue-fields.scss +21 -0
- package/src/patient-search/visit-form-queue-fields/visit-form-queue-fields.test.tsx +67 -0
- package/src/queue-entry-table-components/actions-menu.component.tsx +51 -0
- package/src/queue-entry-table-components/actions-menu.scss +3 -0
- package/src/queue-entry-table-components/edit-entry.component.tsx +28 -0
- package/src/queue-entry-table-components/edit-entry.scss +14 -0
- package/src/queue-entry-table-components/open-chart.component.tsx +33 -0
- package/src/queue-entry-table-components/open-chart.resource.tsx +14 -0
- package/src/queue-entry-table-components/open-chart.scss +14 -0
- package/src/queue-entry-table-components/status-icon.component.tsx +17 -0
- package/src/queue-entry-table-components/transition-entry.component.tsx +53 -0
- package/src/queue-entry-table-components/transition-entry.scss +22 -0
- package/src/queue-patient-linelists/queue-linelist-base-table.component.tsx +230 -0
- package/src/queue-patient-linelists/queue-linelist-base-table.scss +110 -0
- package/src/queue-patient-linelists/queue-linelist-base-table.test.tsx +118 -0
- package/src/queue-patient-linelists/queue-linelist-filter.component.tsx +172 -0
- package/src/queue-patient-linelists/queue-linelist-filter.scss +63 -0
- package/src/queue-patient-linelists/queue-linelist-filter.test.tsx +76 -0
- package/src/queue-patient-linelists/queue-linelist.component.tsx +29 -0
- package/src/queue-patient-linelists/queue-linelist.resource.tsx +84 -0
- package/src/queue-patient-linelists/queue-linelist.test.tsx +22 -0
- package/src/queue-patient-linelists/queue-services-table.component.tsx +63 -0
- package/src/queue-patient-linelists/scheduled-appointments-table.component.tsx +300 -0
- package/src/queue-patient-linelists/scheduled-appointments-table.test.tsx +42 -0
- package/src/queue-rooms/queue-room-form.component.tsx +168 -0
- package/src/queue-rooms/queue-room-form.test.tsx +65 -0
- package/src/queue-rooms/queue-room.resource.tsx +20 -0
- package/src/queue-rooms/queue-room.scss +58 -0
- package/src/queue-screen/queue-screen.component.tsx +47 -0
- package/src/queue-screen/queue-screen.scss +39 -0
- package/src/queue-screen/queue-screen.test.tsx +47 -0
- package/src/queue-screen/useActiveTickets.tsx +13 -0
- package/src/queue-services/queue-service-form.component.tsx +183 -0
- package/src/queue-services/queue-service-form.test.tsx +56 -0
- package/src/queue-services/queue-service.resource.tsx +38 -0
- package/src/queue-services/queue-service.scss +54 -0
- package/src/remove-queue-entry-dialog/remove-queue-entry.component.tsx +95 -0
- package/src/remove-queue-entry-dialog/remove-queue-entry.resource.tsx +93 -0
- package/src/remove-queue-entry-dialog/remove-queue-entry.scss +8 -0
- package/src/remove-queue-entry-dialog/remove-queue-entry.test.tsx +44 -0
- package/src/root.component.tsx +28 -0
- package/src/root.scss +15 -0
- package/src/root.test.tsx +28 -0
- package/src/routes.json +91 -0
- package/src/side-menu/nav-group/createNavGroup.tsx +17 -0
- package/src/side-menu/nav-group/nav-group.component.tsx +24 -0
- package/src/side-menu/nav-group/nav-group.test.tsx +32 -0
- package/src/side-menu/nav-group/nav-group.ts +10 -0
- package/src/side-menu/side-menu.component.tsx +6 -0
- package/src/side-menu/side-menu.test.tsx +17 -0
- package/src/transition-queue-entry/transition-queue-entry-dialog.component.tsx +174 -0
- package/src/transition-queue-entry/transition-queue-entry-dialog.scss +12 -0
- package/src/transition-queue-entry/transition-queue-entry-dialog.test.tsx +95 -0
- package/src/transition-queue-entry/transition-queue-entry.resource.ts +16 -0
- package/src/types/index.ts +434 -0
- package/src/visits-missing-inqueue/visits-missing-inqueue.component.tsx +298 -0
- package/src/visits-missing-inqueue/visits-missing-inqueue.resource.ts +93 -0
- package/src/visits-missing-inqueue/visits-missing-inqueue.scss +108 -0
- package/translations/am.json +258 -0
- package/translations/en.json +258 -0
- package/translations/es.json +258 -0
- package/translations/fr.json +258 -0
- package/translations/he.json +262 -0
- package/translations/km.json +258 -0
- package/tsconfig.json +5 -0
- package/webpack.config.js +1 -0
|
@@ -0,0 +1,434 @@
|
|
|
1
|
+
import { OpenmrsResource } from '@openmrs/esm-framework';
|
|
2
|
+
|
|
3
|
+
export enum SearchTypes {
|
|
4
|
+
BASIC = 'basic',
|
|
5
|
+
ADVANCED = 'advanced',
|
|
6
|
+
SEARCH_RESULTS = 'search_results',
|
|
7
|
+
SCHEDULED_VISITS = 'scheduled-visits',
|
|
8
|
+
VISIT_FORM = 'visit_form',
|
|
9
|
+
QUEUE_SERVICE_FORM = 'queue_service_form',
|
|
10
|
+
QUEUE_ROOM_FORM = 'queue_room_form',
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface Patient {
|
|
14
|
+
uuid: string;
|
|
15
|
+
display: string;
|
|
16
|
+
identifiers: Array<any>;
|
|
17
|
+
person: Person;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface Attribute {
|
|
21
|
+
attributeType: OpenmrsResource;
|
|
22
|
+
display: string;
|
|
23
|
+
uuid: string;
|
|
24
|
+
value: string | number;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface Person {
|
|
28
|
+
age: number;
|
|
29
|
+
attributes: Array<Attribute>;
|
|
30
|
+
birthDate: string;
|
|
31
|
+
gender: string;
|
|
32
|
+
display: string;
|
|
33
|
+
preferredAddress: OpenmrsResource;
|
|
34
|
+
uuid: string;
|
|
35
|
+
}
|
|
36
|
+
export interface AppointmentsFetchResponse {
|
|
37
|
+
data: Array<Appointment>;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface Appointment {
|
|
41
|
+
appointmentKind: string;
|
|
42
|
+
appointmentNumber: string;
|
|
43
|
+
comments: string;
|
|
44
|
+
endDateTime: Date | number;
|
|
45
|
+
location: OpenmrsResource;
|
|
46
|
+
patient: {
|
|
47
|
+
uuid: string;
|
|
48
|
+
name: string;
|
|
49
|
+
identifier: string;
|
|
50
|
+
gender: string;
|
|
51
|
+
age: string;
|
|
52
|
+
phoneNumber: string;
|
|
53
|
+
};
|
|
54
|
+
provider: OpenmrsResource;
|
|
55
|
+
providers: Array<OpenmrsResource>;
|
|
56
|
+
// recurring: boolean;
|
|
57
|
+
service: AppointmentService;
|
|
58
|
+
startDateTime: number | any;
|
|
59
|
+
status: string;
|
|
60
|
+
uuid: string;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface ServiceTypes {
|
|
64
|
+
duration: number;
|
|
65
|
+
name: string;
|
|
66
|
+
uuid: string;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface AppointmentService {
|
|
70
|
+
appointmentServiceId: number;
|
|
71
|
+
color: string;
|
|
72
|
+
creatorName: string;
|
|
73
|
+
description: string;
|
|
74
|
+
durationMins: string;
|
|
75
|
+
endTime: string;
|
|
76
|
+
initialAppointmentStatus: string;
|
|
77
|
+
location: OpenmrsResource;
|
|
78
|
+
maxAppointmentsLimit: number | null;
|
|
79
|
+
name: string;
|
|
80
|
+
speciality: OpenmrsResource;
|
|
81
|
+
startTime: string;
|
|
82
|
+
uuid: string;
|
|
83
|
+
serviceTypes: Array<ServiceTypes>;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface Note {
|
|
87
|
+
concept: OpenmrsResource;
|
|
88
|
+
note: string;
|
|
89
|
+
provider: {
|
|
90
|
+
name: string;
|
|
91
|
+
role: string;
|
|
92
|
+
};
|
|
93
|
+
time: string;
|
|
94
|
+
}
|
|
95
|
+
export interface Order {
|
|
96
|
+
uuid: string;
|
|
97
|
+
dateActivated: string;
|
|
98
|
+
dateStopped?: Date | null;
|
|
99
|
+
dose: number;
|
|
100
|
+
dosingInstructions: string | null;
|
|
101
|
+
dosingType?: 'org.openmrs.FreeTextDosingInstructions' | 'org.openmrs.SimpleDosingInstructions';
|
|
102
|
+
doseUnits: {
|
|
103
|
+
uuid: string;
|
|
104
|
+
display: string;
|
|
105
|
+
};
|
|
106
|
+
drug: {
|
|
107
|
+
uuid: string;
|
|
108
|
+
name: string;
|
|
109
|
+
strength: string;
|
|
110
|
+
};
|
|
111
|
+
duration: number;
|
|
112
|
+
durationUnits: {
|
|
113
|
+
uuid: string;
|
|
114
|
+
display: string;
|
|
115
|
+
};
|
|
116
|
+
frequency: {
|
|
117
|
+
uuid: string;
|
|
118
|
+
display: string;
|
|
119
|
+
};
|
|
120
|
+
numRefills: number;
|
|
121
|
+
orderNumber: string;
|
|
122
|
+
orderReason: string | null;
|
|
123
|
+
orderReasonNonCoded: string | null;
|
|
124
|
+
orderer: {
|
|
125
|
+
uuid: string;
|
|
126
|
+
person: {
|
|
127
|
+
uuid: string;
|
|
128
|
+
display: string;
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
orderType: {
|
|
132
|
+
uuid: string;
|
|
133
|
+
display: string;
|
|
134
|
+
};
|
|
135
|
+
route: {
|
|
136
|
+
uuid: string;
|
|
137
|
+
display: string;
|
|
138
|
+
};
|
|
139
|
+
quantity: number;
|
|
140
|
+
quantityUnits: OpenmrsResource;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export interface OrderItem {
|
|
144
|
+
order: Order;
|
|
145
|
+
provider: {
|
|
146
|
+
name: string;
|
|
147
|
+
role: string;
|
|
148
|
+
};
|
|
149
|
+
time: string;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export interface DiagnosisItem {
|
|
153
|
+
diagnosis: string;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export interface Encounter {
|
|
157
|
+
uuid: string;
|
|
158
|
+
encounterDatetime: string;
|
|
159
|
+
encounterProviders: Array<{
|
|
160
|
+
uuid: string;
|
|
161
|
+
display: string;
|
|
162
|
+
encounterRole: {
|
|
163
|
+
uuid: string;
|
|
164
|
+
display: string;
|
|
165
|
+
};
|
|
166
|
+
provider: {
|
|
167
|
+
uuid: string;
|
|
168
|
+
person: {
|
|
169
|
+
uuid: string;
|
|
170
|
+
display: string;
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
}>;
|
|
174
|
+
encounterType: {
|
|
175
|
+
uuid: string;
|
|
176
|
+
display: string;
|
|
177
|
+
};
|
|
178
|
+
obs: Array<Observation>;
|
|
179
|
+
form: OpenmrsResource;
|
|
180
|
+
patient: OpenmrsResource;
|
|
181
|
+
orders: Array<Order>;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export interface Observation {
|
|
185
|
+
uuid: string;
|
|
186
|
+
concept: {
|
|
187
|
+
uuid: string;
|
|
188
|
+
display: string;
|
|
189
|
+
conceptClass: {
|
|
190
|
+
uuid: string;
|
|
191
|
+
display: string;
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
display: string;
|
|
195
|
+
groupMembers: null | Array<{
|
|
196
|
+
uuid: string;
|
|
197
|
+
concept: {
|
|
198
|
+
uuid: string;
|
|
199
|
+
display: string;
|
|
200
|
+
};
|
|
201
|
+
value: {
|
|
202
|
+
uuid: string;
|
|
203
|
+
display: string;
|
|
204
|
+
};
|
|
205
|
+
}>;
|
|
206
|
+
value: any;
|
|
207
|
+
obsDatetime: string;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export interface PatientVitals {
|
|
211
|
+
systolic?: number;
|
|
212
|
+
diastolic?: number;
|
|
213
|
+
pulse?: number;
|
|
214
|
+
temperature?: number;
|
|
215
|
+
oxygenSaturation?: number;
|
|
216
|
+
height?: number;
|
|
217
|
+
weight?: number;
|
|
218
|
+
bmi?: number | null;
|
|
219
|
+
respiratoryRate?: number;
|
|
220
|
+
muac?: number;
|
|
221
|
+
provider?: {
|
|
222
|
+
name: string;
|
|
223
|
+
role: string;
|
|
224
|
+
};
|
|
225
|
+
time?: string;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
export interface MappedEncounter {
|
|
229
|
+
id: string;
|
|
230
|
+
datetime: string;
|
|
231
|
+
encounterType: string;
|
|
232
|
+
form: OpenmrsResource;
|
|
233
|
+
obs: Array<Observation>;
|
|
234
|
+
provider: string;
|
|
235
|
+
visitUuid?: string;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
export interface FormattedEncounter {
|
|
239
|
+
id: string;
|
|
240
|
+
datetime: string;
|
|
241
|
+
encounterType: string;
|
|
242
|
+
form: OpenmrsResource;
|
|
243
|
+
obs: Array<Observation>;
|
|
244
|
+
provider: string;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
export interface ObsMetaInfo {
|
|
248
|
+
[_: string]: any;
|
|
249
|
+
assessValue?: (value: number) => OBSERVATION_INTERPRETATION;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export type OBSERVATION_INTERPRETATION =
|
|
253
|
+
| 'NORMAL'
|
|
254
|
+
| 'HIGH'
|
|
255
|
+
| 'CRITICALLY_HIGH'
|
|
256
|
+
| 'OFF_SCALE_HIGH'
|
|
257
|
+
| 'LOW'
|
|
258
|
+
| 'CRITICALLY_LOW'
|
|
259
|
+
| 'OFF_SCALE_LOW'
|
|
260
|
+
| '--';
|
|
261
|
+
export interface PatientProgram {
|
|
262
|
+
uuid: string;
|
|
263
|
+
display: string;
|
|
264
|
+
patient: OpenmrsResource;
|
|
265
|
+
program: OpenmrsResource;
|
|
266
|
+
dateEnrolled: string;
|
|
267
|
+
dateCompleted: string;
|
|
268
|
+
location: OpenmrsResource;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
export interface AppointmentCountMap {
|
|
272
|
+
allAppointmentsCount: number;
|
|
273
|
+
missedAppointmentsCount;
|
|
274
|
+
appointmentDate: number;
|
|
275
|
+
appointmentServiceUuid: string;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
export interface AppointmentSummary {
|
|
279
|
+
appointmentService: { name: string };
|
|
280
|
+
appointmentCountMap: Record<string, AppointmentCountMap>;
|
|
281
|
+
}
|
|
282
|
+
export interface QueueEntryPayload {
|
|
283
|
+
visit: { uuid: string };
|
|
284
|
+
queueEntry: {
|
|
285
|
+
status: { uuid: string };
|
|
286
|
+
priority: { uuid: string };
|
|
287
|
+
queue: { uuid: string };
|
|
288
|
+
patient: { uuid: string };
|
|
289
|
+
startedAt: Date;
|
|
290
|
+
sortWeight: number;
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
export interface QueueServiceInfo {
|
|
295
|
+
uuid: string;
|
|
296
|
+
display: string;
|
|
297
|
+
name: string;
|
|
298
|
+
description: string;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
export interface MappedServiceQueueEntry {
|
|
302
|
+
id: string;
|
|
303
|
+
name: string;
|
|
304
|
+
age: string;
|
|
305
|
+
gender: string;
|
|
306
|
+
phoneNumber: string;
|
|
307
|
+
visitType: string;
|
|
308
|
+
returnDate: string;
|
|
309
|
+
patientUuid: string;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
export enum FilterTypes {
|
|
313
|
+
SHOW,
|
|
314
|
+
HIDE,
|
|
315
|
+
}
|
|
316
|
+
export interface Provider {
|
|
317
|
+
uuid: string;
|
|
318
|
+
display: string;
|
|
319
|
+
comments: string;
|
|
320
|
+
response?: string;
|
|
321
|
+
person: OpenmrsResource;
|
|
322
|
+
location: string;
|
|
323
|
+
serviceType: string;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
export interface MappedQueueEntry {
|
|
327
|
+
id: string;
|
|
328
|
+
name: string;
|
|
329
|
+
patientAge: string;
|
|
330
|
+
patientSex: string;
|
|
331
|
+
patientDob: string;
|
|
332
|
+
patientUuid: string;
|
|
333
|
+
priority: string;
|
|
334
|
+
priorityComment: string;
|
|
335
|
+
priorityUuid: string;
|
|
336
|
+
service: string;
|
|
337
|
+
status: string;
|
|
338
|
+
statusUuid: string;
|
|
339
|
+
visitStartDateTime: string;
|
|
340
|
+
visitType: string;
|
|
341
|
+
visitUuid: string;
|
|
342
|
+
waitTime: string;
|
|
343
|
+
queueUuid: string;
|
|
344
|
+
queueEntryUuid: string;
|
|
345
|
+
queueLocation: string;
|
|
346
|
+
sortWeight: string;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
export interface EndVisitPayload {
|
|
350
|
+
location: string;
|
|
351
|
+
startDatetime: Date;
|
|
352
|
+
visitType: string;
|
|
353
|
+
stopDatetime: Date;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
export interface LocationResponse {
|
|
357
|
+
type: string;
|
|
358
|
+
total: number;
|
|
359
|
+
resourceType: string;
|
|
360
|
+
meta: {
|
|
361
|
+
lastUpdated: string;
|
|
362
|
+
};
|
|
363
|
+
link: Array<{
|
|
364
|
+
relation: string;
|
|
365
|
+
url: string;
|
|
366
|
+
}>;
|
|
367
|
+
id: string;
|
|
368
|
+
entry: Array<LocationEntry>;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
export interface LocationEntry {
|
|
372
|
+
resource: Resource;
|
|
373
|
+
}
|
|
374
|
+
export interface Resource {
|
|
375
|
+
id: string;
|
|
376
|
+
name: string;
|
|
377
|
+
resourceType: string;
|
|
378
|
+
status: 'active' | 'inactive';
|
|
379
|
+
meta?: {
|
|
380
|
+
tag?: Array<{
|
|
381
|
+
code: string;
|
|
382
|
+
display: string;
|
|
383
|
+
system: string;
|
|
384
|
+
}>;
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
export interface Identifer {
|
|
389
|
+
identifier: string;
|
|
390
|
+
display: string;
|
|
391
|
+
uuid: string;
|
|
392
|
+
identifierType: {
|
|
393
|
+
uuid: string;
|
|
394
|
+
display: string;
|
|
395
|
+
};
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
export interface NewVisitPayload {
|
|
399
|
+
uuid?: string;
|
|
400
|
+
location: string;
|
|
401
|
+
patient?: string;
|
|
402
|
+
startDatetime: Date;
|
|
403
|
+
visitType: string;
|
|
404
|
+
stopDatetime?: Date;
|
|
405
|
+
attributes?: Array<{
|
|
406
|
+
attributeType: string;
|
|
407
|
+
value: string;
|
|
408
|
+
}>;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
export interface QueueRoom {
|
|
412
|
+
uuid: string;
|
|
413
|
+
display: string;
|
|
414
|
+
name: string;
|
|
415
|
+
description: string;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
export interface ProvidersQueueRoom {
|
|
419
|
+
uuid: string;
|
|
420
|
+
provider: {
|
|
421
|
+
uuid: string;
|
|
422
|
+
display: string;
|
|
423
|
+
};
|
|
424
|
+
queueRoom: {
|
|
425
|
+
uuid: string;
|
|
426
|
+
name: string;
|
|
427
|
+
display: string;
|
|
428
|
+
};
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
export interface WaitTime {
|
|
432
|
+
metric: string;
|
|
433
|
+
averageWaitTime: string;
|
|
434
|
+
}
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
import React, { useMemo, useEffect, useState, useCallback, MouseEvent, AnchorHTMLAttributes } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
DataTable,
|
|
4
|
+
DataTableSkeleton,
|
|
5
|
+
InlineLoading,
|
|
6
|
+
Layer,
|
|
7
|
+
Pagination,
|
|
8
|
+
Search,
|
|
9
|
+
Table,
|
|
10
|
+
TableContainer,
|
|
11
|
+
TableHead,
|
|
12
|
+
TableRow,
|
|
13
|
+
TableHeader,
|
|
14
|
+
TableBody,
|
|
15
|
+
TableCell,
|
|
16
|
+
TableToolbar,
|
|
17
|
+
TableToolbarContent,
|
|
18
|
+
TableExpandRow,
|
|
19
|
+
TableExpandHeader,
|
|
20
|
+
TableExpandedRow,
|
|
21
|
+
Tile,
|
|
22
|
+
Button,
|
|
23
|
+
} from '@carbon/react';
|
|
24
|
+
import {
|
|
25
|
+
useLayoutType,
|
|
26
|
+
isDesktop,
|
|
27
|
+
useConfig,
|
|
28
|
+
usePagination,
|
|
29
|
+
ExtensionSlot,
|
|
30
|
+
formatDatetime,
|
|
31
|
+
parseDate,
|
|
32
|
+
interpolateUrl,
|
|
33
|
+
navigate,
|
|
34
|
+
showModal,
|
|
35
|
+
} from '@openmrs/esm-framework';
|
|
36
|
+
import { useTranslation } from 'react-i18next';
|
|
37
|
+
import styles from './visits-missing-inqueue.scss';
|
|
38
|
+
import { getOriginFromPathName } from '../active-visits/active-visits-table.resource';
|
|
39
|
+
import { ActiveVisit, useMissingQueueEntries } from './visits-missing-inqueue.resource';
|
|
40
|
+
import { Add } from '@carbon/react/icons';
|
|
41
|
+
|
|
42
|
+
interface PaginationData {
|
|
43
|
+
goTo: (page: number) => void;
|
|
44
|
+
results: Array<ActiveVisit>;
|
|
45
|
+
currentPage: number;
|
|
46
|
+
}
|
|
47
|
+
interface NameLinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
48
|
+
to: string;
|
|
49
|
+
from: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const PatientNameLink: React.FC<NameLinkProps> = ({ from, to, children }) => {
|
|
53
|
+
const handleNameClick = (event: MouseEvent, to: string) => {
|
|
54
|
+
event.preventDefault();
|
|
55
|
+
navigate({ to });
|
|
56
|
+
localStorage.setItem('fromPage', from);
|
|
57
|
+
};
|
|
58
|
+
return (
|
|
59
|
+
<a onClick={(e) => handleNameClick(e, to)} href={interpolateUrl(to)}>
|
|
60
|
+
{children}
|
|
61
|
+
</a>
|
|
62
|
+
);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
function AddMenu({ visitDetails }: { visitDetails: ActiveVisit }) {
|
|
66
|
+
const { t } = useTranslation();
|
|
67
|
+
const launchAddVisitToQueueModal = useCallback(() => {
|
|
68
|
+
const dispose = showModal('add-visit-to-queue-modal', {
|
|
69
|
+
closeModal: () => dispose(),
|
|
70
|
+
visitDetails,
|
|
71
|
+
});
|
|
72
|
+
}, [visitDetails]);
|
|
73
|
+
|
|
74
|
+
return (
|
|
75
|
+
<Button
|
|
76
|
+
kind="ghost"
|
|
77
|
+
onClick={launchAddVisitToQueueModal}
|
|
78
|
+
iconDescription={t('addisitToQueueTooltip', 'Add to queue')}
|
|
79
|
+
renderIcon={(props) => <Add size={16} {...props} />}>
|
|
80
|
+
{t('addToQueue', 'Add to queue')}
|
|
81
|
+
</Button>
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const MissingQueueEntries = () => {
|
|
86
|
+
const { t } = useTranslation();
|
|
87
|
+
const config = useConfig();
|
|
88
|
+
const layout = useLayoutType();
|
|
89
|
+
const { activeVisits, isLoading, visitsIsValidating } = useMissingQueueEntries();
|
|
90
|
+
const pageSizes = config?.activeVisits?.pageSizes ?? [10, 20, 30, 40, 50];
|
|
91
|
+
const [currentPageSize, setPageSize] = useState(config?.activeVisits?.pageSize ?? 10);
|
|
92
|
+
const [searchString, setSearchString] = useState('');
|
|
93
|
+
|
|
94
|
+
const currentPathName = window.location.pathname;
|
|
95
|
+
const fromPage = getOriginFromPathName(currentPathName);
|
|
96
|
+
|
|
97
|
+
const headerData = useMemo(
|
|
98
|
+
() => [
|
|
99
|
+
{
|
|
100
|
+
id: 0,
|
|
101
|
+
header: t('visitStartTime', 'Visit Time'),
|
|
102
|
+
key: 'visitStartTime',
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
id: 1,
|
|
106
|
+
header: t('idNumber', 'ID Number'),
|
|
107
|
+
key: 'idNumber',
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
id: 2,
|
|
111
|
+
header: t('name', 'Name'),
|
|
112
|
+
key: 'name',
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
id: 3,
|
|
116
|
+
header: t('gender', 'Gender'),
|
|
117
|
+
key: 'gender',
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
id: 4,
|
|
121
|
+
header: t('age', 'Age'),
|
|
122
|
+
key: 'age',
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
id: 5,
|
|
126
|
+
header: t('visitType', 'Visit Type'),
|
|
127
|
+
key: 'visitType',
|
|
128
|
+
},
|
|
129
|
+
],
|
|
130
|
+
[t],
|
|
131
|
+
);
|
|
132
|
+
|
|
133
|
+
const rowData = activeVisits.map((visit) => ({
|
|
134
|
+
...visit,
|
|
135
|
+
visitStartTime: formatDatetime(parseDate(visit.visitStartTime)),
|
|
136
|
+
}));
|
|
137
|
+
|
|
138
|
+
const searchResults = useMemo(() => {
|
|
139
|
+
if (searchString && searchString.trim() !== '') {
|
|
140
|
+
const search = searchString.toLowerCase();
|
|
141
|
+
return rowData.filter((activeVisitRow) =>
|
|
142
|
+
Object.keys(activeVisitRow).some((header) => {
|
|
143
|
+
if (header === 'patientUuid') {
|
|
144
|
+
return false;
|
|
145
|
+
}
|
|
146
|
+
return `${activeVisitRow[header]}`.toLowerCase().includes(search);
|
|
147
|
+
}),
|
|
148
|
+
);
|
|
149
|
+
} else {
|
|
150
|
+
return rowData;
|
|
151
|
+
}
|
|
152
|
+
}, [searchString, rowData]);
|
|
153
|
+
|
|
154
|
+
const {
|
|
155
|
+
goTo,
|
|
156
|
+
results: paginatedActiveVisits,
|
|
157
|
+
currentPage,
|
|
158
|
+
}: PaginationData = usePagination(searchResults, currentPageSize);
|
|
159
|
+
|
|
160
|
+
const handleSearch = useCallback((e) => setSearchString(e.target.value), []);
|
|
161
|
+
|
|
162
|
+
useEffect(() => {
|
|
163
|
+
if (currentPage !== 1) {
|
|
164
|
+
goTo(1);
|
|
165
|
+
}
|
|
166
|
+
}, [searchString, currentPage, goTo]);
|
|
167
|
+
|
|
168
|
+
if (isLoading) {
|
|
169
|
+
return <DataTableSkeleton role="progressbar" />;
|
|
170
|
+
}
|
|
171
|
+
if (activeVisits?.length) {
|
|
172
|
+
return (
|
|
173
|
+
<div className={styles.activeVisitsContainer}>
|
|
174
|
+
<div className={styles.activeVisitsDetailHeaderContainer}>
|
|
175
|
+
<div className={!isDesktop(layout) ? styles.tabletHeading : styles.desktopHeading}>
|
|
176
|
+
<h4>{t('activeVisitsNotInQueue', 'Active visits not in queue')}</h4>
|
|
177
|
+
</div>
|
|
178
|
+
<div className={styles.backgroundDataFetchingIndicator}>
|
|
179
|
+
<span>{visitsIsValidating ? <InlineLoading /> : null}</span>
|
|
180
|
+
</div>
|
|
181
|
+
</div>
|
|
182
|
+
<DataTable
|
|
183
|
+
rows={paginatedActiveVisits}
|
|
184
|
+
headers={headerData}
|
|
185
|
+
size={isDesktop(layout) ? 'xs' : 'md'}
|
|
186
|
+
useZebraStyles={activeVisits?.length > 1 ? true : false}>
|
|
187
|
+
{({ rows, headers, getHeaderProps, getTableProps, getBatchActionProps, getRowProps }) => (
|
|
188
|
+
<TableContainer className={styles.tableContainer}>
|
|
189
|
+
<TableToolbar>
|
|
190
|
+
<TableToolbarContent>
|
|
191
|
+
<Search
|
|
192
|
+
tabIndex={getBatchActionProps().shouldShowBatchActions ? -1 : 0}
|
|
193
|
+
labelText=""
|
|
194
|
+
placeholder={t('filterTable', 'Filter table')}
|
|
195
|
+
onChange={handleSearch}
|
|
196
|
+
/>
|
|
197
|
+
</TableToolbarContent>
|
|
198
|
+
</TableToolbar>
|
|
199
|
+
<Table className={styles.activeVisitsTable} {...getTableProps()}>
|
|
200
|
+
<TableHead>
|
|
201
|
+
<TableRow>
|
|
202
|
+
<TableExpandHeader />
|
|
203
|
+
{headers.map((header) => (
|
|
204
|
+
<TableHeader {...getHeaderProps({ header })}>{header.header}</TableHeader>
|
|
205
|
+
))}
|
|
206
|
+
</TableRow>
|
|
207
|
+
</TableHead>
|
|
208
|
+
<TableBody>
|
|
209
|
+
{rows.map((row, index) => (
|
|
210
|
+
<React.Fragment key={index}>
|
|
211
|
+
<TableExpandRow {...getRowProps({ row })}>
|
|
212
|
+
{row.cells.map((cell) => (
|
|
213
|
+
<TableCell key={cell.id}>
|
|
214
|
+
{cell.info.header === 'name' ? (
|
|
215
|
+
<PatientNameLink
|
|
216
|
+
from={fromPage}
|
|
217
|
+
to={`\${openmrsSpaBase}/patient/${paginatedActiveVisits?.[index]?.patientUuid}/chart/`}>
|
|
218
|
+
{cell.value}
|
|
219
|
+
</PatientNameLink>
|
|
220
|
+
) : (
|
|
221
|
+
cell.value
|
|
222
|
+
)}
|
|
223
|
+
</TableCell>
|
|
224
|
+
))}
|
|
225
|
+
<TableCell className="cds--table-column-menu">
|
|
226
|
+
<AddMenu visitDetails={paginatedActiveVisits?.[index]} />
|
|
227
|
+
</TableCell>
|
|
228
|
+
</TableExpandRow>
|
|
229
|
+
{row.isExpanded ? (
|
|
230
|
+
<TableRow className={styles.expandedActiveVisitRow}>
|
|
231
|
+
<th colSpan={headers.length + 2}>
|
|
232
|
+
<ExtensionSlot
|
|
233
|
+
className={styles.visitSummaryContainer}
|
|
234
|
+
name="visit-summary-slot"
|
|
235
|
+
state={{
|
|
236
|
+
visitUuid: paginatedActiveVisits[index]?.visitUuid,
|
|
237
|
+
patientUuid: paginatedActiveVisits[index]?.patientUuid,
|
|
238
|
+
}}
|
|
239
|
+
/>
|
|
240
|
+
</th>
|
|
241
|
+
</TableRow>
|
|
242
|
+
) : (
|
|
243
|
+
<TableExpandedRow className={styles.hiddenRow} colSpan={headers.length + 2} />
|
|
244
|
+
)}
|
|
245
|
+
</React.Fragment>
|
|
246
|
+
))}
|
|
247
|
+
</TableBody>
|
|
248
|
+
</Table>
|
|
249
|
+
{rows.length === 0 && (
|
|
250
|
+
<p
|
|
251
|
+
style={{
|
|
252
|
+
height: isDesktop(layout) ? '2rem' : '3rem',
|
|
253
|
+
margin: '1rem 1.5rem',
|
|
254
|
+
}}
|
|
255
|
+
className={`${styles.emptyRow} ${styles.bodyLong01}`}>
|
|
256
|
+
{t('noVisitsNotInQueueFound', 'No visits currently not in queue found')}
|
|
257
|
+
</p>
|
|
258
|
+
)}
|
|
259
|
+
<Pagination
|
|
260
|
+
forwardText="Next page"
|
|
261
|
+
backwardText="Previous page"
|
|
262
|
+
page={currentPage}
|
|
263
|
+
pageSize={currentPageSize}
|
|
264
|
+
pageSizes={pageSizes}
|
|
265
|
+
totalItems={searchResults.length}
|
|
266
|
+
className={styles.pagination}
|
|
267
|
+
onChange={({ pageSize, page }) => {
|
|
268
|
+
if (pageSize !== currentPageSize) {
|
|
269
|
+
setPageSize(pageSize);
|
|
270
|
+
}
|
|
271
|
+
if (page !== currentPage) {
|
|
272
|
+
goTo(page);
|
|
273
|
+
}
|
|
274
|
+
}}
|
|
275
|
+
/>
|
|
276
|
+
</TableContainer>
|
|
277
|
+
)}
|
|
278
|
+
</DataTable>
|
|
279
|
+
</div>
|
|
280
|
+
);
|
|
281
|
+
}
|
|
282
|
+
return (
|
|
283
|
+
<div className={styles.activeVisitsContainer}>
|
|
284
|
+
<Layer>
|
|
285
|
+
<Tile className={styles.tile}>
|
|
286
|
+
<div className={!isDesktop(layout) ? styles.tabletHeading : styles.desktopHeading}>
|
|
287
|
+
<h4>{t('activeVisits', 'Active Visits')}</h4>
|
|
288
|
+
</div>
|
|
289
|
+
<p className={styles.content}>
|
|
290
|
+
{t('noActiveVisitsForLocation', 'There are no active visits to display for this location.')}
|
|
291
|
+
</p>
|
|
292
|
+
</Tile>
|
|
293
|
+
</Layer>
|
|
294
|
+
</div>
|
|
295
|
+
);
|
|
296
|
+
};
|
|
297
|
+
|
|
298
|
+
export default MissingQueueEntries;
|