@openmrs/esm-laboratory-app 1.0.1-pre.106
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/.editorconfig +12 -0
- package/.eslintignore +2 -0
- package/.eslintrc +32 -0
- package/.husky/pre-commit +4 -0
- package/.husky/pre-push +6 -0
- package/.prettierignore +14 -0
- package/.turbo/turbo-build.log +30 -0
- package/.turbo/turbo-lint.log +12 -0
- package/.turbo/turbo-typescript.log +0 -0
- package/.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs +541 -0
- package/.yarn/plugins/@yarnpkg/plugin-outdated.cjs +35 -0
- package/.yarn/plugins/@yarnpkg/plugin-version.cjs +550 -0
- package/.yarn/versions/3d4697b8.yml +0 -0
- package/README.md +39 -0
- package/__mocks__/react-i18next.js +50 -0
- package/assets/logo/logo.png +0 -0
- package/assets/logo/moh_logo_without_word.png +0 -0
- package/assets/screenshots/labs_enter_results.png +0 -0
- package/assets/screenshots/labs_general_dashboard.png +0 -0
- package/dist/142.js +1 -0
- package/dist/142.js.map +1 -0
- package/dist/319.js +1 -0
- package/dist/36.js +1 -0
- package/dist/36.js.map +1 -0
- package/dist/395.js +1 -0
- package/dist/395.js.map +1 -0
- package/dist/453.js +1 -0
- package/dist/453.js.map +1 -0
- package/dist/533.js +1 -0
- package/dist/533.js.map +1 -0
- package/dist/56.js +2 -0
- package/dist/56.js.LICENSE.txt +32 -0
- package/dist/56.js.map +1 -0
- package/dist/572.js +1 -0
- package/dist/572.js.map +1 -0
- package/dist/574.js +1 -0
- package/dist/581.js +1 -0
- package/dist/581.js.map +1 -0
- package/dist/66.js +1 -0
- package/dist/66.js.map +1 -0
- package/dist/757.js +1 -0
- package/dist/769.js +1 -0
- package/dist/769.js.map +1 -0
- package/dist/770.js +1 -0
- package/dist/770.js.map +1 -0
- package/dist/800.js +2 -0
- package/dist/800.js.LICENSE.txt +3 -0
- package/dist/800.js.map +1 -0
- package/dist/809.js +1 -0
- package/dist/809.js.map +1 -0
- package/dist/889.js +1 -0
- package/dist/889.js.map +1 -0
- package/dist/894.js +2 -0
- package/dist/894.js.LICENSE.txt +48 -0
- package/dist/894.js.map +1 -0
- package/dist/924.js +1 -0
- package/dist/924.js.map +1 -0
- package/dist/928.js +1 -0
- package/dist/928.js.map +1 -0
- package/dist/967b98e46b0984c4.png +0 -0
- package/dist/97.js +1 -0
- package/dist/97.js.map +1 -0
- package/dist/983.js +1 -0
- package/dist/983.js.map +1 -0
- package/dist/main.js +2 -0
- package/dist/main.js.LICENSE.txt +48 -0
- package/dist/main.js.map +1 -0
- package/dist/openmrs-esm-laboratory-app.js +1 -0
- package/dist/openmrs-esm-laboratory-app.js.buildmanifest.json +628 -0
- package/dist/openmrs-esm-laboratory-app.js.map +1 -0
- package/dist/routes.json +1 -0
- package/i18next-parser.config.js +89 -0
- package/jest.config.js +16 -0
- package/package.json +121 -0
- package/src/completed-list/completed-list.component.tsx +242 -0
- package/src/completed-list/completed-list.resource.ts +0 -0
- package/src/completed-list/completed-list.scss +232 -0
- package/src/components/create-dashboard-link.component.tsx +44 -0
- package/src/components/overlay/hook.ts +47 -0
- package/src/components/overlay/overlay.component.tsx +52 -0
- package/src/components/overlay/overlay.scss +93 -0
- package/src/config-schema.ts +36 -0
- package/src/constants.ts +5 -0
- package/src/declarations.d.ts +6 -0
- package/src/header/laboratory-header.component.tsx +35 -0
- package/src/header/laboratory-header.scss +68 -0
- package/src/header/laboratory-illustration.component.tsx +13 -0
- package/src/index.ts +92 -0
- package/src/laboratory.component.tsx +18 -0
- package/src/patient-chart/laboratory-item/view-laboratory-item.component.tsx +39 -0
- package/src/patient-chart/laboratory-item/view-laboratory-item.resource.ts +290 -0
- package/src/patient-chart/laboratory-item/view-laboratory-item.scss +0 -0
- package/src/patient-chart/laboratory-order.component.tsx +453 -0
- package/src/patient-chart/laboratory-order.resource.ts +437 -0
- package/src/patient-chart/laboratory-order.scss +66 -0
- package/src/patient-chart/results-summary/print-results-summary.component.tsx +240 -0
- package/src/patient-chart/results-summary/print-results-summary.scss +105 -0
- package/src/patient-chart/results-summary/print-results-table.component.tsx +163 -0
- package/src/patient-chart/results-summary/results/results.component.tsx +25 -0
- package/src/patient-chart/results-summary/results/results.resource.ts +50 -0
- package/src/patient-chart/results-summary/results/results.scss +0 -0
- package/src/patient-chart/results-summary/results-dialog/edit-results-dialog.component.tsx +46 -0
- package/src/patient-chart/results-summary/results-summary.component.tsx +98 -0
- package/src/patient-chart/results-summary/results-summary.resource.tsx +185 -0
- package/src/patient-chart/results-summary/results-summary.scss +154 -0
- package/src/patient-chart/results-summary/send-email-dialog.component.tsx +111 -0
- package/src/patient-chart/results-summary/test-children-results.component.tsx +221 -0
- package/src/patient-chart/results-summary/test-print-results-table.component.tsx +148 -0
- package/src/patient-chart/results-summary/test-results-delete-action-menu.component.tsx +27 -0
- package/src/patient-chart/results-summary/test-results-rescend-action-menu.component.tsx +26 -0
- package/src/patient-chart/results-summary/test-results-table.component.tsx +153 -0
- package/src/patient-chart/results-summary/tests-children-detail.component.tsx +54 -0
- package/src/patient-chart/results-summary/views/email.handlebars +13 -0
- package/src/queue-list/lab-dialogs/add-to-worklist-dialog.component.tsx +323 -0
- package/src/queue-list/lab-dialogs/add-to-worklist-dialog.resource.ts +155 -0
- package/src/queue-list/lab-dialogs/add-to-worklist-dialog.scss +20 -0
- package/src/queue-list/lab-tests/lab-tests.component.tsx +116 -0
- package/src/queue-list/lab-tests/lab-tests.resource.ts +17 -0
- package/src/queue-list/lab-tests/lab-tests.scss +12 -0
- package/src/queue-list/laboratory-patient-list.component.tsx +277 -0
- package/src/queue-list/laboratory-patient-list.resource.ts +86 -0
- package/src/queue-list/laboratory-queue.component.tsx +120 -0
- package/src/queue-list/laboratory-queue.scss +213 -0
- package/src/queue-list/laboratory-tabs.component.tsx +81 -0
- package/src/queue-list/pick-lab-request-menu.component.tsx +38 -0
- package/src/reject-order/reject-order-dialog.component.tsx +114 -0
- package/src/reject-order/reject-order-dialog.resource.ts +14 -0
- package/src/reject-order/reject-order-dialog.scss +14 -0
- package/src/results/result-form.component.tsx +223 -0
- package/src/results/result-form.resource.ts +328 -0
- package/src/results/result-form.scss +19 -0
- package/src/review-list/dialog/review-item.component.tsx +283 -0
- package/src/review-list/dialog/review-item.resource.ts +14 -0
- package/src/review-list/dialog/review-item.scss +0 -0
- package/src/review-list/review-list.component.tsx +277 -0
- package/src/review-list/review-list.resource.ts +0 -0
- package/src/review-list/review-list.scss +189 -0
- package/src/root.component.tsx +15 -0
- package/src/root.scss +50 -0
- package/src/routes.json +72 -0
- package/src/setup-tests.ts +1 -0
- package/src/summary-tiles/laboratory-summary-tiles.component.tsx +53 -0
- package/src/summary-tiles/laboratory-summary-tiles.scss +12 -0
- package/src/summary-tiles/laboratory-summary.resource.tsx +50 -0
- package/src/summary-tiles/summary-tile.component.tsx +48 -0
- package/src/summary-tiles/summary-tile.scss +43 -0
- package/src/types/index.ts +412 -0
- package/src/types/patient-queues.ts +189 -0
- package/src/utils/functions.ts +246 -0
- package/src/work-list/work-list.component.tsx +310 -0
- package/src/work-list/work-list.resource.ts +136 -0
- package/src/work-list/work-list.scss +215 -0
- package/translations/en.json +16 -0
- package/translations/es.json +3 -0
- package/translations/fr.json +3 -0
- package/tsconfig.json +23 -0
- package/webpack.config.js +29 -0
|
@@ -0,0 +1,437 @@
|
|
|
1
|
+
import { formatDate, openmrsFetch, useConfig } from "@openmrs/esm-framework";
|
|
2
|
+
import useSWR from "swr";
|
|
3
|
+
|
|
4
|
+
export interface LaboratoryResponse {
|
|
5
|
+
results: Result[];
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface Result {
|
|
9
|
+
uuid: string;
|
|
10
|
+
display: string;
|
|
11
|
+
encounterDatetime: string;
|
|
12
|
+
patient: Patient;
|
|
13
|
+
location: Location;
|
|
14
|
+
form: Form;
|
|
15
|
+
encounterType: EncounterType;
|
|
16
|
+
obs: Ob[];
|
|
17
|
+
orders: Order[];
|
|
18
|
+
voided: boolean;
|
|
19
|
+
auditInfo: AuditInfo;
|
|
20
|
+
visit: Visit;
|
|
21
|
+
encounterProviders: EncounterProvider[];
|
|
22
|
+
diagnoses: any[];
|
|
23
|
+
links: Link[];
|
|
24
|
+
resourceVersion: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface Patient {
|
|
28
|
+
uuid: string;
|
|
29
|
+
display: string;
|
|
30
|
+
links: Link[];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface Link {
|
|
34
|
+
rel: string;
|
|
35
|
+
uri: string;
|
|
36
|
+
resourceAlias: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface Location {
|
|
40
|
+
uuid: string;
|
|
41
|
+
display: string;
|
|
42
|
+
name: string;
|
|
43
|
+
description: any;
|
|
44
|
+
address1: any;
|
|
45
|
+
address2: any;
|
|
46
|
+
cityVillage: any;
|
|
47
|
+
stateProvince: any;
|
|
48
|
+
country: string;
|
|
49
|
+
postalCode: any;
|
|
50
|
+
latitude: any;
|
|
51
|
+
longitude: any;
|
|
52
|
+
countyDistrict: any;
|
|
53
|
+
address3: any;
|
|
54
|
+
address4: any;
|
|
55
|
+
address5: any;
|
|
56
|
+
address6: any;
|
|
57
|
+
tags: Tag[];
|
|
58
|
+
parentLocation: ParentLocation;
|
|
59
|
+
childLocations: ChildLocation[];
|
|
60
|
+
retired: boolean;
|
|
61
|
+
attributes: any[];
|
|
62
|
+
address7: any;
|
|
63
|
+
address8: any;
|
|
64
|
+
address9: any;
|
|
65
|
+
address10: any;
|
|
66
|
+
address11: any;
|
|
67
|
+
address12: any;
|
|
68
|
+
address13: any;
|
|
69
|
+
address14: any;
|
|
70
|
+
address15: any;
|
|
71
|
+
links: Link[];
|
|
72
|
+
resourceVersion: string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface Tag {
|
|
76
|
+
uuid: string;
|
|
77
|
+
display: string;
|
|
78
|
+
links: Link[];
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export interface ParentLocation {
|
|
82
|
+
uuid: string;
|
|
83
|
+
display: string;
|
|
84
|
+
links: Link[];
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export interface ChildLocation {
|
|
88
|
+
uuid: string;
|
|
89
|
+
display: string;
|
|
90
|
+
links: Link[];
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export interface Form {
|
|
94
|
+
uuid: string;
|
|
95
|
+
display: string;
|
|
96
|
+
name: string;
|
|
97
|
+
description: string;
|
|
98
|
+
encounterType: EncounterType;
|
|
99
|
+
version: string;
|
|
100
|
+
build: any;
|
|
101
|
+
published: boolean;
|
|
102
|
+
formFields: any[];
|
|
103
|
+
retired: boolean;
|
|
104
|
+
resources: Resource[];
|
|
105
|
+
links: Link[];
|
|
106
|
+
resourceVersion: string;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export interface Resource {
|
|
110
|
+
uuid: string;
|
|
111
|
+
display: string;
|
|
112
|
+
links: Link[];
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export interface EncounterType {
|
|
116
|
+
uuid: string;
|
|
117
|
+
display: string;
|
|
118
|
+
name: string;
|
|
119
|
+
description: string;
|
|
120
|
+
retired: boolean;
|
|
121
|
+
links: Link[];
|
|
122
|
+
resourceVersion: string;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export interface Ob {
|
|
126
|
+
uuid: string;
|
|
127
|
+
display: string;
|
|
128
|
+
concept: Concept;
|
|
129
|
+
person: Person;
|
|
130
|
+
obsDatetime: string;
|
|
131
|
+
accessionNumber: any;
|
|
132
|
+
obsGroup: any;
|
|
133
|
+
valueCodedName: any;
|
|
134
|
+
groupMembers: GroupMember[];
|
|
135
|
+
comment: any;
|
|
136
|
+
location: Location;
|
|
137
|
+
order: any;
|
|
138
|
+
encounter: Encounter;
|
|
139
|
+
voided: boolean;
|
|
140
|
+
value: any;
|
|
141
|
+
valueModifier: any;
|
|
142
|
+
formFieldPath: string;
|
|
143
|
+
formFieldNamespace: string;
|
|
144
|
+
links: Link[];
|
|
145
|
+
resourceVersion: string;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export interface GroupMember {
|
|
149
|
+
uuid: string;
|
|
150
|
+
display: string;
|
|
151
|
+
concept: Concept;
|
|
152
|
+
person: Person;
|
|
153
|
+
obsDatetime: string;
|
|
154
|
+
accessionNumber: any;
|
|
155
|
+
obsGroup: ObsGroup;
|
|
156
|
+
valueCodedName: any;
|
|
157
|
+
groupMembers: any;
|
|
158
|
+
comment: any;
|
|
159
|
+
location: Location;
|
|
160
|
+
order: Order;
|
|
161
|
+
encounter: Encounter;
|
|
162
|
+
voided: boolean;
|
|
163
|
+
value: number | Value;
|
|
164
|
+
valueModifier: any;
|
|
165
|
+
formFieldPath: any;
|
|
166
|
+
formFieldNamespace: any;
|
|
167
|
+
links: Link[];
|
|
168
|
+
resourceVersion: string;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export interface Value {
|
|
172
|
+
uuid: string;
|
|
173
|
+
display: string;
|
|
174
|
+
name: Name;
|
|
175
|
+
datatype: Datatype;
|
|
176
|
+
conceptClass: ConceptClass;
|
|
177
|
+
set: boolean;
|
|
178
|
+
version: any;
|
|
179
|
+
retired: boolean;
|
|
180
|
+
names: Name2[];
|
|
181
|
+
descriptions: Description[];
|
|
182
|
+
mappings: Mapping[];
|
|
183
|
+
answers: any[];
|
|
184
|
+
setMembers: any[];
|
|
185
|
+
attributes: any[];
|
|
186
|
+
links: Link[];
|
|
187
|
+
resourceVersion: string;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export interface Name {
|
|
191
|
+
display: string;
|
|
192
|
+
uuid: string;
|
|
193
|
+
name: string;
|
|
194
|
+
locale: string;
|
|
195
|
+
localePreferred: boolean;
|
|
196
|
+
conceptNameType: string;
|
|
197
|
+
links: Link[];
|
|
198
|
+
resourceVersion: string;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export interface Link {
|
|
202
|
+
rel: string;
|
|
203
|
+
uri: string;
|
|
204
|
+
resourceAlias: string;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export interface Datatype {
|
|
208
|
+
uuid: string;
|
|
209
|
+
display: string;
|
|
210
|
+
links: Link[];
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export interface ConceptClass {
|
|
214
|
+
uuid: string;
|
|
215
|
+
display: string;
|
|
216
|
+
links: Link[];
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
export interface Name2 {
|
|
220
|
+
uuid: string;
|
|
221
|
+
display: string;
|
|
222
|
+
links: Link[];
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export interface Description {
|
|
226
|
+
uuid: string;
|
|
227
|
+
display: string;
|
|
228
|
+
links: Link[];
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export interface Mapping {
|
|
232
|
+
uuid: string;
|
|
233
|
+
display: string;
|
|
234
|
+
links: Link[];
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
export interface ObsGroup {
|
|
238
|
+
uuid: string;
|
|
239
|
+
display: string;
|
|
240
|
+
links: Link[];
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export interface Concept {
|
|
244
|
+
uuid: string;
|
|
245
|
+
display: string;
|
|
246
|
+
links: Link[];
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
export interface Person {
|
|
250
|
+
uuid: string;
|
|
251
|
+
display: string;
|
|
252
|
+
links: Link[];
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
export interface Encounter {
|
|
256
|
+
uuid: string;
|
|
257
|
+
display: string;
|
|
258
|
+
links: Link[];
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
export interface AuditInfo {
|
|
262
|
+
creator: Creator;
|
|
263
|
+
dateCreated: string;
|
|
264
|
+
changedBy: any;
|
|
265
|
+
dateChanged: any;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
export interface Creator {
|
|
269
|
+
uuid: string;
|
|
270
|
+
display: string;
|
|
271
|
+
links: Link[];
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
export interface Visit {
|
|
275
|
+
uuid: string;
|
|
276
|
+
display: string;
|
|
277
|
+
patient: Patient;
|
|
278
|
+
visitType: VisitType;
|
|
279
|
+
indication: any;
|
|
280
|
+
location: Location;
|
|
281
|
+
startDatetime: string;
|
|
282
|
+
stopDatetime: any;
|
|
283
|
+
encounters: Encounter[];
|
|
284
|
+
attributes: any[];
|
|
285
|
+
voided: boolean;
|
|
286
|
+
links: Link[];
|
|
287
|
+
resourceVersion: string;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
export interface VisitType {
|
|
291
|
+
uuid: string;
|
|
292
|
+
display: string;
|
|
293
|
+
links: Link[];
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
export interface EncounterRole {
|
|
297
|
+
uuid: string;
|
|
298
|
+
display: string;
|
|
299
|
+
links: Link[];
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
export interface EncounterProvider {
|
|
303
|
+
uuid: string;
|
|
304
|
+
provider: Provider;
|
|
305
|
+
encounterRole: EncounterRole;
|
|
306
|
+
voided: boolean;
|
|
307
|
+
links: Link[];
|
|
308
|
+
resourceVersion: string;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
export interface Provider {
|
|
312
|
+
uuid: string;
|
|
313
|
+
display: string;
|
|
314
|
+
links: Link[];
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
// order
|
|
318
|
+
export interface Order {
|
|
319
|
+
uuid: string;
|
|
320
|
+
orderNumber: string;
|
|
321
|
+
accessionNumber: any;
|
|
322
|
+
patient: Patient;
|
|
323
|
+
concept: Concept;
|
|
324
|
+
action: string;
|
|
325
|
+
careSetting: CareSetting;
|
|
326
|
+
previousOrder: any;
|
|
327
|
+
dateActivated: string;
|
|
328
|
+
scheduledDate: any;
|
|
329
|
+
dateStopped: string;
|
|
330
|
+
autoExpireDate: any;
|
|
331
|
+
encounter: Encounter;
|
|
332
|
+
orderer: Orderer;
|
|
333
|
+
orderReason: any;
|
|
334
|
+
orderReasonNonCoded: any;
|
|
335
|
+
orderType: OrderType;
|
|
336
|
+
urgency: string;
|
|
337
|
+
instructions: any;
|
|
338
|
+
commentToFulfiller: any;
|
|
339
|
+
display: string;
|
|
340
|
+
specimenSource: any;
|
|
341
|
+
laterality: any;
|
|
342
|
+
clinicalHistory: any;
|
|
343
|
+
frequency: any;
|
|
344
|
+
numberOfRepeats: any;
|
|
345
|
+
links: Link[];
|
|
346
|
+
type: string;
|
|
347
|
+
resourceVersion: string;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
export interface Patient {
|
|
351
|
+
uuid: string;
|
|
352
|
+
display: string;
|
|
353
|
+
links: Link[];
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
export interface Link {
|
|
357
|
+
rel: string;
|
|
358
|
+
uri: string;
|
|
359
|
+
resourceAlias: string;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
export interface Concept {
|
|
363
|
+
uuid: string;
|
|
364
|
+
display: string;
|
|
365
|
+
links: Link[];
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
export interface CareSetting {
|
|
369
|
+
uuid: string;
|
|
370
|
+
display: string;
|
|
371
|
+
links: Link[];
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
export interface Encounter {
|
|
375
|
+
uuid: string;
|
|
376
|
+
display: string;
|
|
377
|
+
links: Link[];
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
export interface Orderer {
|
|
381
|
+
uuid: string;
|
|
382
|
+
display: string;
|
|
383
|
+
links: Link[];
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
export interface OrderType {
|
|
387
|
+
uuid: string;
|
|
388
|
+
display: string;
|
|
389
|
+
name: string;
|
|
390
|
+
javaClassName: string;
|
|
391
|
+
retired: boolean;
|
|
392
|
+
description: string;
|
|
393
|
+
conceptClasses: any[];
|
|
394
|
+
parent: any;
|
|
395
|
+
links: Link[];
|
|
396
|
+
resourceVersion: string;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
export const getOrderColor = (activated: string, stopped: string) => {
|
|
400
|
+
const numAct = formatWaitTime(activated);
|
|
401
|
+
let testStopped: Number;
|
|
402
|
+
if (stopped === null) {
|
|
403
|
+
testStopped = 0;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
if (numAct >= 0 && testStopped == 0) {
|
|
407
|
+
return "#6F6F6F"; // #6F6F6F
|
|
408
|
+
} else {
|
|
409
|
+
return "green"; // green
|
|
410
|
+
}
|
|
411
|
+
};
|
|
412
|
+
|
|
413
|
+
export const formatWaitTime = (waitTime: string) => {
|
|
414
|
+
const num = parseInt(waitTime);
|
|
415
|
+
const hours = num / 60;
|
|
416
|
+
const rhours = Math.floor(hours);
|
|
417
|
+
const minutes = (hours - rhours) * 60;
|
|
418
|
+
const rminutes = Math.round(minutes);
|
|
419
|
+
return rminutes;
|
|
420
|
+
};
|
|
421
|
+
|
|
422
|
+
export function useLabOrders(patientUuid: string) {
|
|
423
|
+
const config = useConfig();
|
|
424
|
+
const { laboratoryEncounterTypeUuid } = config;
|
|
425
|
+
|
|
426
|
+
const apiUrl = `/ws/rest/v1/encounter?patient=${patientUuid}&encounterType=${laboratoryEncounterTypeUuid}&v=full`;
|
|
427
|
+
const { data, error, isLoading } = useSWR<
|
|
428
|
+
{ data: LaboratoryResponse },
|
|
429
|
+
Error
|
|
430
|
+
>(apiUrl, openmrsFetch, { refreshInterval: 3000 });
|
|
431
|
+
|
|
432
|
+
return {
|
|
433
|
+
labRequests: data?.data ? data?.data?.results : [],
|
|
434
|
+
isLoading,
|
|
435
|
+
isError: error,
|
|
436
|
+
};
|
|
437
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
@use '@carbon/styles/scss/spacing';
|
|
2
|
+
@use '@carbon/styles/scss/type';
|
|
3
|
+
@import "~@openmrs/esm-styleguide/src/vars";
|
|
4
|
+
@import '../root.scss';
|
|
5
|
+
.headerBtnContainer {
|
|
6
|
+
background-color: $ui-background;
|
|
7
|
+
padding: spacing.$spacing-05;
|
|
8
|
+
text-align: right;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.tileContainer {
|
|
12
|
+
background-color: $ui-02;
|
|
13
|
+
border-top: 1px solid $ui-03;
|
|
14
|
+
padding: 5rem 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.tile {
|
|
18
|
+
margin: auto;
|
|
19
|
+
width: fit-content;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.tileContent {
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
align-items: center;
|
|
26
|
+
}
|
|
27
|
+
.content {
|
|
28
|
+
@include type.type-style('heading-compact-02');
|
|
29
|
+
color: $text-02;
|
|
30
|
+
margin-bottom: 0.5rem;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.helper {
|
|
34
|
+
@include type.type-style('body-compact-01');
|
|
35
|
+
color: $text-02;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.separator {
|
|
39
|
+
@include type.type-style('body-compact-02');
|
|
40
|
+
color: $text-02;
|
|
41
|
+
width: 80%;
|
|
42
|
+
margin: 1.5rem auto;
|
|
43
|
+
overflow: hidden;
|
|
44
|
+
text-align: center;
|
|
45
|
+
|
|
46
|
+
&::before,
|
|
47
|
+
&::after {
|
|
48
|
+
background-color: $text-03;
|
|
49
|
+
content: '';
|
|
50
|
+
display: inline-block;
|
|
51
|
+
height: 1px;
|
|
52
|
+
position: relative;
|
|
53
|
+
vertical-align: middle;
|
|
54
|
+
width: 50%;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&::before {
|
|
58
|
+
right: 0.5rem;
|
|
59
|
+
margin-left: -50%;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
&::after {
|
|
63
|
+
left: 0.5rem;
|
|
64
|
+
margin-right: -50%;
|
|
65
|
+
}
|
|
66
|
+
}
|