@palladium-ethiopia/esm-clinical-workflow-app 5.4.2-pre.20 → 5.4.2-pre.26
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 +5 -5
- package/dist/152.js +1 -1
- package/dist/152.js.map +1 -1
- package/dist/164.js +1 -0
- package/dist/164.js.map +1 -0
- package/dist/208.js +1 -1
- package/dist/208.js.map +1 -1
- package/dist/209.js +1 -1
- package/dist/209.js.map +1 -1
- package/dist/363.js +1 -1
- package/dist/363.js.map +1 -1
- package/dist/534.js +1 -0
- package/dist/534.js.map +1 -0
- package/dist/677.js +1 -1
- package/dist/677.js.map +1 -1
- package/dist/689.js +1 -1
- package/dist/689.js.map +1 -1
- package/dist/712.js +1 -1
- package/dist/712.js.map +1 -1
- package/dist/771.js +1 -1
- package/dist/771.js.map +1 -1
- package/dist/825.js +1 -0
- package/dist/825.js.map +1 -0
- package/dist/914.js +37 -0
- package/dist/914.js.map +1 -0
- package/dist/926.js +17 -0
- package/dist/926.js.map +1 -0
- package/dist/ethiopia-esm-clinical-workflow-app.js +5 -5
- package/dist/ethiopia-esm-clinical-workflow-app.js.buildmanifest.json +144 -144
- package/dist/ethiopia-esm-clinical-workflow-app.js.map +1 -1
- package/dist/main.js +34 -8
- package/dist/main.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/config-schema.ts +98 -0
- package/src/index.ts +32 -1
- package/src/patient-chart/clinical-views/hooks/useEncountersByVisit.ts +13 -0
- package/src/patient-chart/constants.ts +11 -0
- package/src/patient-chart/visit/visit-history-table/diagnosis-tags.component.tsx +43 -0
- package/src/patient-chart/visit/visit-history-table/diagnosis-tags.module.scss +57 -0
- package/src/patient-chart/visit/visit-history-table/visit-actions-cell.component.tsx +20 -0
- package/src/patient-chart/visit/visit-history-table/visit-actions-cell.scss +4 -0
- package/src/patient-chart/visit/visit-history-table/visit-date-cell.component.tsx +19 -0
- package/src/patient-chart/visit/visit-history-table/visit-diagnoses-cell-with-certainty.component.tsx +31 -0
- package/src/patient-chart/visit/visit-history-table/visit-diagnoses-cell-with-certainty.module.scss +16 -0
- package/src/patient-chart/visit/visit-history-table/visit-history-table.component.tsx +144 -0
- package/src/patient-chart/visit/visit-history-table/visit-history-table.scss +25 -0
- package/src/patient-chart/visit/visit-history-table/visit-type-cell.component.tsx +15 -0
- package/src/patient-chart/visit/visits-widget/encounter-observations/encounter-observations.component.tsx +67 -0
- package/src/patient-chart/visit/visits-widget/encounter-observations/index.ts +3 -0
- package/src/patient-chart/visit/visits-widget/encounter-observations/styles.scss +22 -0
- package/src/patient-chart/visit/visits-widget/past-visits-components/encounters-table/all-encounters-table.component.tsx +44 -0
- package/src/patient-chart/visit/visits-widget/past-visits-components/encounters-table/encounters-table.component.tsx +388 -0
- package/src/patient-chart/visit/visits-widget/past-visits-components/encounters-table/encounters-table.resource.ts +97 -0
- package/src/patient-chart/visit/visits-widget/past-visits-components/encounters-table/encounters-table.scss +113 -0
- package/src/patient-chart/visit/visits-widget/past-visits-components/encounters-table/visit-encounters-table.component.tsx +42 -0
- package/src/patient-chart/visit/visits-widget/past-visits-components/medications-summary.component.tsx +157 -0
- package/src/patient-chart/visit/visits-widget/past-visits-components/notes-summary.component.tsx +34 -0
- package/src/patient-chart/visit/visits-widget/past-visits-components/tests-summary.component.tsx +16 -0
- package/src/patient-chart/visit/visits-widget/past-visits-components/visit-actions-cell.scss +4 -0
- package/src/patient-chart/visit/visits-widget/past-visits-components/visit-summary.component.tsx +176 -0
- package/src/patient-chart/visit/visits-widget/past-visits-components/visit-summary.scss +72 -0
- package/src/patient-chart/visit/visits-widget/single-visit-details/visit-timeline/visit-timeline.component.tsx +94 -0
- package/src/patient-chart/visit/visits-widget/single-visit-details/visit-timeline/visit-timeline.scss +60 -0
- package/src/patient-chart/visit/visits-widget/visit-detail-overview.component.tsx +50 -0
- package/src/patient-chart/visit/visits-widget/visit-detail-overview.scss +262 -0
- package/src/patient-chart/visit/visits-widget/visit.resource.tsx +144 -0
- package/src/patient-notes/types/index.ts +194 -0
- package/src/patient-notes/visit-note-action-button.extension.tsx +28 -0
- package/src/patient-notes/visit-note-config-schema.ts +38 -0
- package/src/patient-notes/visit-notes-form-shadow.workspace.tsx +963 -0
- package/src/patient-notes/visit-notes-form.scss +453 -0
- package/src/patient-notes/visit-notes.resource.ts +113 -0
- package/src/routes.json +23 -0
- package/translations/am.json +168 -0
- package/translations/en.json +168 -0
- package/dist/410.js +0 -1
- package/dist/410.js.map +0 -1
- package/dist/484.js +0 -11
- package/dist/484.js.map +0 -1
- package/dist/540.js +0 -1
- package/dist/540.js.map +0 -1
- package/dist/545.js +0 -43
- package/dist/545.js.map +0 -1
|
@@ -0,0 +1,453 @@
|
|
|
1
|
+
@use '@carbon/colors';
|
|
2
|
+
@use '@carbon/layout';
|
|
3
|
+
@use '@carbon/type';
|
|
4
|
+
|
|
5
|
+
.heading {
|
|
6
|
+
@include type.type-style('heading-03');
|
|
7
|
+
margin-bottom: layout.$spacing-03;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.columnLabel {
|
|
11
|
+
@include type.type-style('heading-compact-02');
|
|
12
|
+
color: colors.$gray-70;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.diagnosis {
|
|
16
|
+
padding: layout.$spacing-04;
|
|
17
|
+
border-top: 1px solid colors.$gray-20;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.diagnosis:first-of-type {
|
|
21
|
+
border-top: none;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.diagnosis:last-of-type {
|
|
25
|
+
border-bottom: none;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.diagnosisList {
|
|
29
|
+
background-color: colors.$white;
|
|
30
|
+
max-height: layout.rem(320px);
|
|
31
|
+
overflow-y: auto;
|
|
32
|
+
border: 1px solid colors.$gray-20;
|
|
33
|
+
display: flex;
|
|
34
|
+
flex-direction: column;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.diagnosisList li:hover {
|
|
38
|
+
background-color: colors.$gray-20;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.diagnosesText {
|
|
42
|
+
@include type.type-style('body-compact-01');
|
|
43
|
+
color: colors.$gray-70;
|
|
44
|
+
margin-bottom: layout.$spacing-05;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.emptyResults {
|
|
48
|
+
@include type.type-style('body-compact-01');
|
|
49
|
+
color: colors.$gray-70;
|
|
50
|
+
min-height: layout.$spacing-05;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.imgUploadHelperText {
|
|
54
|
+
@include type.type-style('body-compact-01');
|
|
55
|
+
color: colors.$gray-70;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.imgThumbnailContainer {
|
|
59
|
+
height: layout.$spacing-12;
|
|
60
|
+
width: layout.$spacing-12;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.imgThumbnail {
|
|
64
|
+
width: 100%;
|
|
65
|
+
height: 100%;
|
|
66
|
+
object-fit: cover;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.imgThumbnailGrid {
|
|
70
|
+
display: grid;
|
|
71
|
+
grid-template-columns: repeat(auto-fill, layout.$spacing-12);
|
|
72
|
+
gap: layout.$spacing-05;
|
|
73
|
+
margin-top: layout.$spacing-05;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.imgThumbnailItem {
|
|
77
|
+
display: flex;
|
|
78
|
+
flex-direction: column;
|
|
79
|
+
align-items: center;
|
|
80
|
+
position: relative;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.removeButton {
|
|
84
|
+
position: absolute;
|
|
85
|
+
top: layout.$spacing-02;
|
|
86
|
+
right: layout.$spacing-02;
|
|
87
|
+
background-color: transparent;
|
|
88
|
+
border: none;
|
|
89
|
+
padding: 0;
|
|
90
|
+
cursor: pointer;
|
|
91
|
+
--cds-layout-size-height-local: 0;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.closeIcon {
|
|
95
|
+
fill: colors.$white !important;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.button {
|
|
99
|
+
height: layout.$spacing-10;
|
|
100
|
+
display: flex;
|
|
101
|
+
align-content: flex-start;
|
|
102
|
+
align-items: baseline;
|
|
103
|
+
min-width: 50%;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.spinner {
|
|
107
|
+
min-height: layout.$spacing-05;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.tablet {
|
|
111
|
+
padding: layout.$spacing-06 layout.$spacing-05;
|
|
112
|
+
background-color: colors.$white;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.desktop {
|
|
116
|
+
padding: 0;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.headerGridRow {
|
|
120
|
+
border-bottom: 1px solid colors.$gray-20;
|
|
121
|
+
margin: 0;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.dataGridRow {
|
|
125
|
+
display: grid;
|
|
126
|
+
grid-template-columns: 50% 10% 1fr;
|
|
127
|
+
margin: layout.$spacing-03 layout.$spacing-05;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.formContainer {
|
|
131
|
+
margin: layout.$spacing-05;
|
|
132
|
+
flex: 1;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.form {
|
|
136
|
+
display: flex;
|
|
137
|
+
flex-direction: column;
|
|
138
|
+
justify-content: space-between;
|
|
139
|
+
height: 100%;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.grid {
|
|
143
|
+
margin: 0;
|
|
144
|
+
padding: 0;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.row {
|
|
148
|
+
margin: layout.$spacing-03 0 layout.$spacing-08;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.skeleton {
|
|
152
|
+
margin-top: layout.$spacing-02;
|
|
153
|
+
height: layout.$spacing-07;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.errorMessage {
|
|
157
|
+
@include type.type-style('label-02');
|
|
158
|
+
color: colors.$red-60;
|
|
159
|
+
margin-top: layout.$spacing-03;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.diagnoserrorOutline {
|
|
163
|
+
max-width: layout.rem(320px);
|
|
164
|
+
|
|
165
|
+
:global(.cds--search-input):focus {
|
|
166
|
+
outline: 2px solid colors.$red-60;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
:global(.cds--search-magnifier) {
|
|
170
|
+
svg {
|
|
171
|
+
fill: colors.$red-60;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
:global(.omrs-breakpoint-lt-desktop) {
|
|
177
|
+
.form {
|
|
178
|
+
height: 100%;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.row {
|
|
182
|
+
display: flex;
|
|
183
|
+
gap: layout.$spacing-10;
|
|
184
|
+
|
|
185
|
+
:global(.cds--col-sm-1) {
|
|
186
|
+
flex-basis: 30%;
|
|
187
|
+
min-width: layout.$spacing-11;
|
|
188
|
+
text-align: left;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
:global(.cds--col-sm-3) {
|
|
192
|
+
flex-basis: 70%;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.diagnosis {
|
|
197
|
+
padding: layout.$spacing-05 layout.$spacing-04;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.skeleton {
|
|
201
|
+
height: layout.$spacing-08;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.errorNotification {
|
|
206
|
+
margin-top: layout.$spacing-02;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.tag {
|
|
210
|
+
max-width: layout.rem(320px);
|
|
211
|
+
margin-right: layout.$spacing-03;
|
|
212
|
+
margin-left: 0;
|
|
213
|
+
|
|
214
|
+
:global(.cds--tag__label) {
|
|
215
|
+
display: flex;
|
|
216
|
+
align-items: center;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.tagContent {
|
|
221
|
+
display: flex;
|
|
222
|
+
align-items: center;
|
|
223
|
+
gap: layout.$spacing-01;
|
|
224
|
+
overflow: hidden;
|
|
225
|
+
text-overflow: ellipsis;
|
|
226
|
+
white-space: nowrap;
|
|
227
|
+
flex: 1;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.tagIcon {
|
|
231
|
+
flex-shrink: 0;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.confirmedIcon {
|
|
235
|
+
color: colors.$green-60;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.presumedIcon {
|
|
239
|
+
color: colors.$orange-60;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
:global(.omrs-breakpoint-lt-desktop) {
|
|
243
|
+
.tag {
|
|
244
|
+
max-width: layout.$spacing-10;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.uploadButton {
|
|
249
|
+
margin-top: layout.$spacing-05;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.diagnosisListItem {
|
|
253
|
+
position: relative;
|
|
254
|
+
margin-bottom: layout.$spacing-02;
|
|
255
|
+
height: auto;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.diagnosisRow {
|
|
259
|
+
display: flex;
|
|
260
|
+
align-items: center;
|
|
261
|
+
justify-content: space-between;
|
|
262
|
+
padding: layout.$spacing-03;
|
|
263
|
+
background-color: colors.$white;
|
|
264
|
+
border: 1px solid colors.$gray-20;
|
|
265
|
+
border-radius: 2px;
|
|
266
|
+
transition: all 0.1s ease;
|
|
267
|
+
cursor: pointer;
|
|
268
|
+
min-height: layout.$spacing-08;
|
|
269
|
+
|
|
270
|
+
&:hover {
|
|
271
|
+
background-color: colors.$gray-10;
|
|
272
|
+
border-color: colors.$gray-30;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.diagnosisInfo {
|
|
277
|
+
flex: 1;
|
|
278
|
+
margin-right: layout.$spacing-03;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.diagnosisName {
|
|
282
|
+
@include type.type-style('body-compact-01');
|
|
283
|
+
color: colors.$gray-100;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
.addButton {
|
|
287
|
+
min-width: layout.$spacing-07;
|
|
288
|
+
flex-shrink: 0;
|
|
289
|
+
padding: layout.$spacing-02 layout.$spacing-03;
|
|
290
|
+
height: layout.$spacing-07;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.certaintyDropdown {
|
|
294
|
+
position: relative;
|
|
295
|
+
z-index: 10;
|
|
296
|
+
margin-top: layout.$spacing-02;
|
|
297
|
+
background: colors.$white;
|
|
298
|
+
border: 1px solid colors.$gray-20;
|
|
299
|
+
border-radius: 2px;
|
|
300
|
+
box-shadow: none;
|
|
301
|
+
overflow: hidden;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
.dropdownHeader {
|
|
305
|
+
padding: layout.$spacing-03;
|
|
306
|
+
border-bottom: 1px solid colors.$gray-20;
|
|
307
|
+
background: colors.$gray-10;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
.dropdownTitle {
|
|
311
|
+
@include type.type-style('body-compact-01');
|
|
312
|
+
color: colors.$gray-100;
|
|
313
|
+
margin-bottom: layout.$spacing-01;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
.diagnosisPreview {
|
|
317
|
+
color: colors.$blue-60;
|
|
318
|
+
font-weight: 600;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
.dropdownSubtitle {
|
|
322
|
+
@include type.type-style('label-01');
|
|
323
|
+
color: colors.$gray-70;
|
|
324
|
+
margin: 0;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.certaintyOptions {
|
|
328
|
+
padding: layout.$spacing-02;
|
|
329
|
+
display: flex;
|
|
330
|
+
gap: layout.$spacing-01;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
.certaintyOption {
|
|
334
|
+
flex: 1;
|
|
335
|
+
padding: layout.$spacing-02;
|
|
336
|
+
text-align: center;
|
|
337
|
+
background: colors.$white;
|
|
338
|
+
border: 1px solid colors.$gray-20;
|
|
339
|
+
border-radius: 2px;
|
|
340
|
+
cursor: pointer;
|
|
341
|
+
transition: all 0.1s ease;
|
|
342
|
+
outline: none;
|
|
343
|
+
min-height: layout.$spacing-07;
|
|
344
|
+
display: flex;
|
|
345
|
+
align-items: center;
|
|
346
|
+
justify-content: center;
|
|
347
|
+
margin-bottom: 0;
|
|
348
|
+
|
|
349
|
+
&:hover {
|
|
350
|
+
border-color: colors.$blue-60;
|
|
351
|
+
background: colors.$gray-10;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
&:focus {
|
|
355
|
+
outline: 2px solid colors.$blue-60;
|
|
356
|
+
outline-offset: -2px;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
.optionContent {
|
|
361
|
+
display: flex;
|
|
362
|
+
align-items: center;
|
|
363
|
+
gap: layout.$spacing-01;
|
|
364
|
+
justify-content: center;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
.optionIcon {
|
|
368
|
+
width: layout.$spacing-04;
|
|
369
|
+
height: layout.$spacing-04;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
.optionText {
|
|
373
|
+
text-align: center;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
.optionTitle {
|
|
377
|
+
@include type.type-style('label-01');
|
|
378
|
+
color: colors.$gray-100;
|
|
379
|
+
font-weight: 600;
|
|
380
|
+
white-space: nowrap;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
.confirmedOption {
|
|
384
|
+
border-color: colors.$green-30;
|
|
385
|
+
background: colors.$green-10;
|
|
386
|
+
|
|
387
|
+
&:hover {
|
|
388
|
+
border-color: colors.$green-60;
|
|
389
|
+
background: colors.$green-20;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
.optionIcon {
|
|
393
|
+
color: colors.$green-60;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
.optionTitle {
|
|
397
|
+
color: colors.$green-70;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
.presumedOption {
|
|
402
|
+
border-color: colors.$yellow-20;
|
|
403
|
+
background: colors.$yellow-10;
|
|
404
|
+
|
|
405
|
+
&:hover {
|
|
406
|
+
border-color: colors.$yellow-30;
|
|
407
|
+
background: colors.$yellow-20;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
.optionIcon {
|
|
411
|
+
color: colors.$yellow-40;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
.optionTitle {
|
|
415
|
+
color: colors.$yellow-70;
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
.optionDescription {
|
|
420
|
+
display: none;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
.dropdownFooter {
|
|
424
|
+
padding: layout.$spacing-02 layout.$spacing-03;
|
|
425
|
+
border-top: 1px solid colors.$gray-20;
|
|
426
|
+
text-align: right;
|
|
427
|
+
background: colors.$gray-10;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
// Responsive styles
|
|
431
|
+
:global(.omrs-breakpoint-lt-desktop) {
|
|
432
|
+
.certaintyDropdown {
|
|
433
|
+
position: fixed;
|
|
434
|
+
top: 50%;
|
|
435
|
+
left: 50%;
|
|
436
|
+
transform: translate(-50%, -50%);
|
|
437
|
+
width: 90%;
|
|
438
|
+
max-width: layout.rem(320px);
|
|
439
|
+
max-height: 70vh;
|
|
440
|
+
overflow-y: auto;
|
|
441
|
+
margin-top: 0;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
.diagnosisRow {
|
|
445
|
+
padding: layout.$spacing-03;
|
|
446
|
+
min-height: layout.$spacing-09;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
.certaintyOption {
|
|
450
|
+
padding: layout.$spacing-03;
|
|
451
|
+
min-height: layout.$spacing-09;
|
|
452
|
+
}
|
|
453
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import useSWR from 'swr';
|
|
2
|
+
import useSWRInfinite from 'swr/infinite';
|
|
3
|
+
import { openmrsFetch, restBaseUrl, useConfig } from '@openmrs/esm-framework';
|
|
4
|
+
import { type VisitNoteConfig } from '../config-schema';
|
|
5
|
+
import type {
|
|
6
|
+
Concept,
|
|
7
|
+
DiagnosisPayload,
|
|
8
|
+
EncountersFetchResponse,
|
|
9
|
+
PatientNote,
|
|
10
|
+
RESTPatientNote,
|
|
11
|
+
VisitNotePayload,
|
|
12
|
+
} from './types';
|
|
13
|
+
|
|
14
|
+
interface UseVisitNotes {
|
|
15
|
+
visitNotes: Array<PatientNote> | null;
|
|
16
|
+
error: Error;
|
|
17
|
+
isLoading: boolean;
|
|
18
|
+
isValidating?: boolean;
|
|
19
|
+
mutateVisitNotes: () => void;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function useVisitNotes(patientUuid: string): UseVisitNotes {
|
|
23
|
+
const {
|
|
24
|
+
visitNoteConfig: { encounterNoteTextConceptUuid, visitDiagnosesConceptUuid },
|
|
25
|
+
} = useConfig<VisitNoteConfig>();
|
|
26
|
+
|
|
27
|
+
const customRepresentation =
|
|
28
|
+
'custom:(uuid,display,encounterDatetime,patient,obs,' +
|
|
29
|
+
'encounterProviders:(uuid,display,' +
|
|
30
|
+
'encounterRole:(uuid,display),' +
|
|
31
|
+
'provider:(uuid,person:(uuid,display))),' +
|
|
32
|
+
'diagnoses';
|
|
33
|
+
const encountersApiUrl = `${restBaseUrl}/encounter?patient=${patientUuid}&obs=${visitDiagnosesConceptUuid}&v=${customRepresentation}`;
|
|
34
|
+
|
|
35
|
+
const { data, error, isLoading, isValidating, mutate } = useSWR<{ data: EncountersFetchResponse }, Error>(
|
|
36
|
+
encountersApiUrl,
|
|
37
|
+
openmrsFetch,
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
const mapNoteProperties = (note: RESTPatientNote, index: number): PatientNote => ({
|
|
41
|
+
id: `${index}`,
|
|
42
|
+
diagnoses: note.diagnoses
|
|
43
|
+
.filter((diagnosis) => !diagnosis.voided)
|
|
44
|
+
.map((diagnosisData) => diagnosisData.display)
|
|
45
|
+
.filter((val) => val)
|
|
46
|
+
.join(', '),
|
|
47
|
+
encounterDate: note.encounterDatetime,
|
|
48
|
+
encounterNote: note.obs.find((observation) => observation.concept.uuid === encounterNoteTextConceptUuid)?.value,
|
|
49
|
+
encounterNoteRecordedAt: note.obs.find((observation) => observation.concept.uuid === encounterNoteTextConceptUuid)
|
|
50
|
+
?.obsDatetime,
|
|
51
|
+
encounterProvider: note?.encounterProviders[0]?.provider?.person?.display,
|
|
52
|
+
encounterProviderRole: note?.encounterProviders[0]?.encounterRole?.display,
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
const formattedVisitNotes = data?.data?.results
|
|
56
|
+
?.map(mapNoteProperties)
|
|
57
|
+
?.sort((noteA, noteB) => new Date(noteB.encounterDate).getTime() - new Date(noteA.encounterDate).getTime());
|
|
58
|
+
|
|
59
|
+
return {
|
|
60
|
+
visitNotes: data ? formattedVisitNotes : null,
|
|
61
|
+
error,
|
|
62
|
+
isLoading,
|
|
63
|
+
isValidating,
|
|
64
|
+
mutateVisitNotes: mutate,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function fetchDiagnosisConceptsByName(searchTerm: string, diagnosisConceptClass: string) {
|
|
69
|
+
const customRepresentation = 'custom:(uuid,display)';
|
|
70
|
+
const url = `${restBaseUrl}/concept?name=${searchTerm}&searchType=fuzzy&class=${diagnosisConceptClass}&v=${customRepresentation}`;
|
|
71
|
+
|
|
72
|
+
return openmrsFetch<Array<Concept>>(url).then(({ data }) => Promise.resolve(data['results']));
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function saveVisitNote(abortController: AbortController, payload: VisitNotePayload) {
|
|
76
|
+
return openmrsFetch(`${restBaseUrl}/encounter`, {
|
|
77
|
+
headers: {
|
|
78
|
+
'Content-Type': 'application/json',
|
|
79
|
+
},
|
|
80
|
+
method: 'POST',
|
|
81
|
+
body: payload,
|
|
82
|
+
signal: abortController.signal,
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export function updateVisitNote(abortController: AbortController, encounterUuid: string, payload: VisitNotePayload) {
|
|
87
|
+
return openmrsFetch(`${restBaseUrl}/encounter/${encounterUuid}`, {
|
|
88
|
+
headers: {
|
|
89
|
+
'Content-Type': 'application/json',
|
|
90
|
+
},
|
|
91
|
+
method: 'POST',
|
|
92
|
+
body: payload,
|
|
93
|
+
signal: abortController.signal,
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export function savePatientDiagnosis(abortController: AbortController, payload: DiagnosisPayload) {
|
|
98
|
+
return openmrsFetch(`${restBaseUrl}/patientdiagnoses`, {
|
|
99
|
+
headers: {
|
|
100
|
+
'Content-Type': 'application/json',
|
|
101
|
+
},
|
|
102
|
+
method: 'POST',
|
|
103
|
+
body: payload,
|
|
104
|
+
signal: abortController.signal,
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export function deletePatientDiagnosis(abortController: AbortController, diagnosisUuid: string) {
|
|
109
|
+
return openmrsFetch(`${restBaseUrl}/patientdiagnoses/${diagnosisUuid}`, {
|
|
110
|
+
method: 'DELETE',
|
|
111
|
+
signal: abortController.signal,
|
|
112
|
+
});
|
|
113
|
+
}
|
package/src/routes.json
CHANGED
|
@@ -59,6 +59,18 @@
|
|
|
59
59
|
"slot": "patient-scoreboard-slot",
|
|
60
60
|
"online": true,
|
|
61
61
|
"offline": false
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"name": "past-visits-detail-overview-shadow",
|
|
65
|
+
"slot": "patient-chart-encounters-dashboard-slot",
|
|
66
|
+
"component": "pastVisitsDetailOverviewShadow",
|
|
67
|
+
"order": 0,
|
|
68
|
+
"meta": {
|
|
69
|
+
"title": "Visits",
|
|
70
|
+
"view": "visits"
|
|
71
|
+
},
|
|
72
|
+
"online": true,
|
|
73
|
+
"offline": true
|
|
62
74
|
}
|
|
63
75
|
],
|
|
64
76
|
"workspaces": [
|
|
@@ -88,6 +100,11 @@
|
|
|
88
100
|
"name": "clinical-workflow-patient-form-entry-workspace",
|
|
89
101
|
"component": "@openmrs/esm-patient-forms-app#exportedPatientFormEntryWorkspace",
|
|
90
102
|
"window": "clinical-workflow-window"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"name": "visit-notes-form-shadow-workspace",
|
|
106
|
+
"component": "visitNotesFormWorkspace",
|
|
107
|
+
"window": "visit-note-shadow"
|
|
91
108
|
}
|
|
92
109
|
],
|
|
93
110
|
"workspaceWindows2": [
|
|
@@ -96,6 +113,12 @@
|
|
|
96
113
|
"group": "clinical-workflow-group",
|
|
97
114
|
"width": "wider",
|
|
98
115
|
"canMaximize": true
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"name": "visit-note-shadow",
|
|
119
|
+
"group": "patient-chart",
|
|
120
|
+
"icon": "visitNoteActionButton",
|
|
121
|
+
"order": 3
|
|
99
122
|
}
|
|
100
123
|
],
|
|
101
124
|
"workspaceGroups2": [
|