@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.
Files changed (157) hide show
  1. package/.editorconfig +12 -0
  2. package/.eslintignore +2 -0
  3. package/.eslintrc +32 -0
  4. package/.husky/pre-commit +4 -0
  5. package/.husky/pre-push +6 -0
  6. package/.prettierignore +14 -0
  7. package/.turbo/turbo-build.log +30 -0
  8. package/.turbo/turbo-lint.log +12 -0
  9. package/.turbo/turbo-typescript.log +0 -0
  10. package/.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs +541 -0
  11. package/.yarn/plugins/@yarnpkg/plugin-outdated.cjs +35 -0
  12. package/.yarn/plugins/@yarnpkg/plugin-version.cjs +550 -0
  13. package/.yarn/versions/3d4697b8.yml +0 -0
  14. package/README.md +39 -0
  15. package/__mocks__/react-i18next.js +50 -0
  16. package/assets/logo/logo.png +0 -0
  17. package/assets/logo/moh_logo_without_word.png +0 -0
  18. package/assets/screenshots/labs_enter_results.png +0 -0
  19. package/assets/screenshots/labs_general_dashboard.png +0 -0
  20. package/dist/142.js +1 -0
  21. package/dist/142.js.map +1 -0
  22. package/dist/319.js +1 -0
  23. package/dist/36.js +1 -0
  24. package/dist/36.js.map +1 -0
  25. package/dist/395.js +1 -0
  26. package/dist/395.js.map +1 -0
  27. package/dist/453.js +1 -0
  28. package/dist/453.js.map +1 -0
  29. package/dist/533.js +1 -0
  30. package/dist/533.js.map +1 -0
  31. package/dist/56.js +2 -0
  32. package/dist/56.js.LICENSE.txt +32 -0
  33. package/dist/56.js.map +1 -0
  34. package/dist/572.js +1 -0
  35. package/dist/572.js.map +1 -0
  36. package/dist/574.js +1 -0
  37. package/dist/581.js +1 -0
  38. package/dist/581.js.map +1 -0
  39. package/dist/66.js +1 -0
  40. package/dist/66.js.map +1 -0
  41. package/dist/757.js +1 -0
  42. package/dist/769.js +1 -0
  43. package/dist/769.js.map +1 -0
  44. package/dist/770.js +1 -0
  45. package/dist/770.js.map +1 -0
  46. package/dist/800.js +2 -0
  47. package/dist/800.js.LICENSE.txt +3 -0
  48. package/dist/800.js.map +1 -0
  49. package/dist/809.js +1 -0
  50. package/dist/809.js.map +1 -0
  51. package/dist/889.js +1 -0
  52. package/dist/889.js.map +1 -0
  53. package/dist/894.js +2 -0
  54. package/dist/894.js.LICENSE.txt +48 -0
  55. package/dist/894.js.map +1 -0
  56. package/dist/924.js +1 -0
  57. package/dist/924.js.map +1 -0
  58. package/dist/928.js +1 -0
  59. package/dist/928.js.map +1 -0
  60. package/dist/967b98e46b0984c4.png +0 -0
  61. package/dist/97.js +1 -0
  62. package/dist/97.js.map +1 -0
  63. package/dist/983.js +1 -0
  64. package/dist/983.js.map +1 -0
  65. package/dist/main.js +2 -0
  66. package/dist/main.js.LICENSE.txt +48 -0
  67. package/dist/main.js.map +1 -0
  68. package/dist/openmrs-esm-laboratory-app.js +1 -0
  69. package/dist/openmrs-esm-laboratory-app.js.buildmanifest.json +628 -0
  70. package/dist/openmrs-esm-laboratory-app.js.map +1 -0
  71. package/dist/routes.json +1 -0
  72. package/i18next-parser.config.js +89 -0
  73. package/jest.config.js +16 -0
  74. package/package.json +121 -0
  75. package/src/completed-list/completed-list.component.tsx +242 -0
  76. package/src/completed-list/completed-list.resource.ts +0 -0
  77. package/src/completed-list/completed-list.scss +232 -0
  78. package/src/components/create-dashboard-link.component.tsx +44 -0
  79. package/src/components/overlay/hook.ts +47 -0
  80. package/src/components/overlay/overlay.component.tsx +52 -0
  81. package/src/components/overlay/overlay.scss +93 -0
  82. package/src/config-schema.ts +36 -0
  83. package/src/constants.ts +5 -0
  84. package/src/declarations.d.ts +6 -0
  85. package/src/header/laboratory-header.component.tsx +35 -0
  86. package/src/header/laboratory-header.scss +68 -0
  87. package/src/header/laboratory-illustration.component.tsx +13 -0
  88. package/src/index.ts +92 -0
  89. package/src/laboratory.component.tsx +18 -0
  90. package/src/patient-chart/laboratory-item/view-laboratory-item.component.tsx +39 -0
  91. package/src/patient-chart/laboratory-item/view-laboratory-item.resource.ts +290 -0
  92. package/src/patient-chart/laboratory-item/view-laboratory-item.scss +0 -0
  93. package/src/patient-chart/laboratory-order.component.tsx +453 -0
  94. package/src/patient-chart/laboratory-order.resource.ts +437 -0
  95. package/src/patient-chart/laboratory-order.scss +66 -0
  96. package/src/patient-chart/results-summary/print-results-summary.component.tsx +240 -0
  97. package/src/patient-chart/results-summary/print-results-summary.scss +105 -0
  98. package/src/patient-chart/results-summary/print-results-table.component.tsx +163 -0
  99. package/src/patient-chart/results-summary/results/results.component.tsx +25 -0
  100. package/src/patient-chart/results-summary/results/results.resource.ts +50 -0
  101. package/src/patient-chart/results-summary/results/results.scss +0 -0
  102. package/src/patient-chart/results-summary/results-dialog/edit-results-dialog.component.tsx +46 -0
  103. package/src/patient-chart/results-summary/results-summary.component.tsx +98 -0
  104. package/src/patient-chart/results-summary/results-summary.resource.tsx +185 -0
  105. package/src/patient-chart/results-summary/results-summary.scss +154 -0
  106. package/src/patient-chart/results-summary/send-email-dialog.component.tsx +111 -0
  107. package/src/patient-chart/results-summary/test-children-results.component.tsx +221 -0
  108. package/src/patient-chart/results-summary/test-print-results-table.component.tsx +148 -0
  109. package/src/patient-chart/results-summary/test-results-delete-action-menu.component.tsx +27 -0
  110. package/src/patient-chart/results-summary/test-results-rescend-action-menu.component.tsx +26 -0
  111. package/src/patient-chart/results-summary/test-results-table.component.tsx +153 -0
  112. package/src/patient-chart/results-summary/tests-children-detail.component.tsx +54 -0
  113. package/src/patient-chart/results-summary/views/email.handlebars +13 -0
  114. package/src/queue-list/lab-dialogs/add-to-worklist-dialog.component.tsx +323 -0
  115. package/src/queue-list/lab-dialogs/add-to-worklist-dialog.resource.ts +155 -0
  116. package/src/queue-list/lab-dialogs/add-to-worklist-dialog.scss +20 -0
  117. package/src/queue-list/lab-tests/lab-tests.component.tsx +116 -0
  118. package/src/queue-list/lab-tests/lab-tests.resource.ts +17 -0
  119. package/src/queue-list/lab-tests/lab-tests.scss +12 -0
  120. package/src/queue-list/laboratory-patient-list.component.tsx +277 -0
  121. package/src/queue-list/laboratory-patient-list.resource.ts +86 -0
  122. package/src/queue-list/laboratory-queue.component.tsx +120 -0
  123. package/src/queue-list/laboratory-queue.scss +213 -0
  124. package/src/queue-list/laboratory-tabs.component.tsx +81 -0
  125. package/src/queue-list/pick-lab-request-menu.component.tsx +38 -0
  126. package/src/reject-order/reject-order-dialog.component.tsx +114 -0
  127. package/src/reject-order/reject-order-dialog.resource.ts +14 -0
  128. package/src/reject-order/reject-order-dialog.scss +14 -0
  129. package/src/results/result-form.component.tsx +223 -0
  130. package/src/results/result-form.resource.ts +328 -0
  131. package/src/results/result-form.scss +19 -0
  132. package/src/review-list/dialog/review-item.component.tsx +283 -0
  133. package/src/review-list/dialog/review-item.resource.ts +14 -0
  134. package/src/review-list/dialog/review-item.scss +0 -0
  135. package/src/review-list/review-list.component.tsx +277 -0
  136. package/src/review-list/review-list.resource.ts +0 -0
  137. package/src/review-list/review-list.scss +189 -0
  138. package/src/root.component.tsx +15 -0
  139. package/src/root.scss +50 -0
  140. package/src/routes.json +72 -0
  141. package/src/setup-tests.ts +1 -0
  142. package/src/summary-tiles/laboratory-summary-tiles.component.tsx +53 -0
  143. package/src/summary-tiles/laboratory-summary-tiles.scss +12 -0
  144. package/src/summary-tiles/laboratory-summary.resource.tsx +50 -0
  145. package/src/summary-tiles/summary-tile.component.tsx +48 -0
  146. package/src/summary-tiles/summary-tile.scss +43 -0
  147. package/src/types/index.ts +412 -0
  148. package/src/types/patient-queues.ts +189 -0
  149. package/src/utils/functions.ts +246 -0
  150. package/src/work-list/work-list.component.tsx +310 -0
  151. package/src/work-list/work-list.resource.ts +136 -0
  152. package/src/work-list/work-list.scss +215 -0
  153. package/translations/en.json +16 -0
  154. package/translations/es.json +3 -0
  155. package/translations/fr.json +3 -0
  156. package/tsconfig.json +23 -0
  157. package/webpack.config.js +29 -0
@@ -0,0 +1,290 @@
1
+ import { openmrsFetch } from "@openmrs/esm-framework";
2
+ import useSWR from "swr";
3
+
4
+ export interface EncounterResponse {
5
+ uuid: string;
6
+ display: string;
7
+ encounterDatetime: string;
8
+ patient: Patient;
9
+ location: Location;
10
+ form: Form;
11
+ encounterType: EncounterType2;
12
+ obs: Ob[];
13
+ orders: Order[];
14
+ voided: boolean;
15
+ auditInfo: AuditInfo;
16
+ visit: Visit;
17
+ encounterProviders: any[];
18
+ diagnoses: any[];
19
+ links: Link[];
20
+ resourceVersion: string;
21
+ }
22
+
23
+ export interface Patient {
24
+ uuid: string;
25
+ display: string;
26
+ links: Link[];
27
+ }
28
+
29
+ export interface Link {
30
+ rel: string;
31
+ uri: string;
32
+ resourceAlias: string;
33
+ }
34
+
35
+ export interface Location {
36
+ uuid: string;
37
+ display: string;
38
+ name: string;
39
+ description: any;
40
+ address1: any;
41
+ address2: any;
42
+ cityVillage: any;
43
+ stateProvince: any;
44
+ country: string;
45
+ postalCode: any;
46
+ latitude: any;
47
+ longitude: any;
48
+ countyDistrict: any;
49
+ address3: any;
50
+ address4: any;
51
+ address5: any;
52
+ address6: any;
53
+ tags: Tag[];
54
+ parentLocation: ParentLocation;
55
+ childLocations: ChildLocation[];
56
+ retired: boolean;
57
+ attributes: any[];
58
+ address7: any;
59
+ address8: any;
60
+ address9: any;
61
+ address10: any;
62
+ address11: any;
63
+ address12: any;
64
+ address13: any;
65
+ address14: any;
66
+ address15: any;
67
+ links: Link[];
68
+ resourceVersion: string;
69
+ }
70
+
71
+ export interface Tag {
72
+ uuid: string;
73
+ display: string;
74
+ links: Link[];
75
+ }
76
+
77
+ export interface ParentLocation {
78
+ uuid: string;
79
+ display: string;
80
+ links: Link[];
81
+ }
82
+
83
+ export interface ChildLocation {
84
+ uuid: string;
85
+ display: string;
86
+ links: Link[];
87
+ }
88
+
89
+ export interface Form {
90
+ uuid: string;
91
+ display: string;
92
+ name: string;
93
+ description: string;
94
+ encounterType: EncounterType;
95
+ version: string;
96
+ build: any;
97
+ published: boolean;
98
+ formFields: any[];
99
+ retired: boolean;
100
+ resources: Resource[];
101
+ links: Link[];
102
+ resourceVersion: string;
103
+ }
104
+
105
+ export interface EncounterType {
106
+ uuid: string;
107
+ display: string;
108
+ links: Link[];
109
+ }
110
+
111
+ export interface Resource {
112
+ uuid: string;
113
+ display: string;
114
+ links: Link[];
115
+ }
116
+
117
+ export interface EncounterType2 {
118
+ uuid: string;
119
+ display: string;
120
+ name: string;
121
+ description: string;
122
+ retired: boolean;
123
+ links: Link[];
124
+ resourceVersion: string;
125
+ }
126
+
127
+ export interface Ob {
128
+ uuid: string;
129
+ display: string;
130
+ concept: Concept;
131
+ person: Person;
132
+ obsDatetime: string;
133
+ accessionNumber: any;
134
+ obsGroup: any;
135
+ valueCodedName: any;
136
+ groupMembers: any;
137
+ comment: any;
138
+ location: Location2;
139
+ order: Order;
140
+ encounter: Encounter;
141
+ voided: boolean;
142
+ value: any;
143
+ valueModifier: any;
144
+ formFieldPath: string;
145
+ formFieldNamespace: string;
146
+ links: Link[];
147
+ resourceVersion: string;
148
+ }
149
+
150
+ export interface Concept {
151
+ uuid: string;
152
+ display: string;
153
+ links: Link[];
154
+ }
155
+
156
+ export interface Person {
157
+ uuid: string;
158
+ display: string;
159
+ links: Link[];
160
+ }
161
+
162
+ export interface Location2 {
163
+ uuid: string;
164
+ display: string;
165
+ links: Link[];
166
+ }
167
+
168
+ export interface Encounter {
169
+ uuid: string;
170
+ display: string;
171
+ links: Link[];
172
+ }
173
+
174
+ export interface Order {
175
+ uuid: string;
176
+ orderNumber: string;
177
+ accessionNumber: any;
178
+ patient: Patient;
179
+ concept: Concept;
180
+ action: string;
181
+ careSetting: CareSetting;
182
+ previousOrder: any;
183
+ dateActivated: string;
184
+ scheduledDate: any;
185
+ dateStopped: any;
186
+ autoExpireDate: any;
187
+ encounter: Encounter;
188
+ orderer: Orderer;
189
+ orderReason: any;
190
+ orderReasonNonCoded: any;
191
+ orderType: OrderType;
192
+ urgency: string;
193
+ instructions: any;
194
+ commentToFulfiller: any;
195
+ display: string;
196
+ specimenSource: any;
197
+ laterality: any;
198
+ clinicalHistory: any;
199
+ frequency: any;
200
+ numberOfRepeats: any;
201
+ links: Link[];
202
+ type: string;
203
+ resourceVersion: string;
204
+ }
205
+
206
+ export interface CareSetting {
207
+ uuid: string;
208
+ display: string;
209
+ links: Link[];
210
+ }
211
+
212
+ export interface Encounter {
213
+ uuid: string;
214
+ display: string;
215
+ links: Link[];
216
+ }
217
+
218
+ export interface Orderer {
219
+ uuid: string;
220
+ display: string;
221
+ links: Link[];
222
+ }
223
+
224
+ export interface OrderType {
225
+ uuid: string;
226
+ display: string;
227
+ name: string;
228
+ javaClassName: string;
229
+ retired: boolean;
230
+ description: string;
231
+ conceptClasses: any[];
232
+ parent: any;
233
+ links: Link[];
234
+ resourceVersion: string;
235
+ }
236
+
237
+ export interface AuditInfo {
238
+ creator: Creator;
239
+ dateCreated: string;
240
+ changedBy: any;
241
+ dateChanged: any;
242
+ }
243
+
244
+ export interface Creator {
245
+ uuid: string;
246
+ display: string;
247
+ links: Link[];
248
+ }
249
+
250
+ export interface Visit {
251
+ uuid: string;
252
+ display: string;
253
+ patient: Patient;
254
+ visitType: VisitType;
255
+ indication: any;
256
+ location: Location;
257
+ startDatetime: string;
258
+ stopDatetime: any;
259
+ encounters: Encounter[];
260
+ attributes: any[];
261
+ voided: boolean;
262
+ links: Link[];
263
+ resourceVersion: string;
264
+ }
265
+
266
+ export interface VisitType {
267
+ uuid: string;
268
+ display: string;
269
+ links: Link[];
270
+ }
271
+
272
+ export interface Encounter {
273
+ uuid: string;
274
+ display: string;
275
+ links: Link[];
276
+ }
277
+
278
+ export function useGetEncounterById(encounterUuid: string) {
279
+ const apiUrl = `/ws/rest/v1/encounter/${encounterUuid}?v=full`;
280
+ const { data, error, isLoading } = useSWR<{ data: EncounterResponse }, Error>(
281
+ apiUrl,
282
+ openmrsFetch
283
+ );
284
+
285
+ return {
286
+ encounter: data?.data,
287
+ isLoading,
288
+ isError: error,
289
+ };
290
+ }