@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,50 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Tab, TabList, TabPanel, TabPanels, Tabs } from '@carbon/react';
|
|
3
|
+
import { useConfig } from '@openmrs/esm-framework';
|
|
4
|
+
import { useTranslation } from 'react-i18next';
|
|
5
|
+
import type { ChartConfig } from '../../../config-schema';
|
|
6
|
+
import VisitHistoryTable from '../visit-history-table/visit-history-table.component';
|
|
7
|
+
import AllEncountersTable from './past-visits-components/encounters-table/all-encounters-table.component';
|
|
8
|
+
import styles from './visit-detail-overview.scss';
|
|
9
|
+
|
|
10
|
+
interface VisitOverviewComponentProps {
|
|
11
|
+
patientUuid: string;
|
|
12
|
+
patient: fhir.Patient;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function VisitDetailOverviewComponent({ patientUuid, patient }: VisitOverviewComponentProps) {
|
|
16
|
+
const { t } = useTranslation();
|
|
17
|
+
const [tabIndex, setTabIndex] = useState(0);
|
|
18
|
+
const { showAllEncountersTab } = useConfig<ChartConfig>();
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<div className={styles.tabs}>
|
|
22
|
+
<Tabs onChange={({ selectedIndex }) => setTabIndex(selectedIndex)} selectedIndex={tabIndex}>
|
|
23
|
+
<TabList aria-label="Visit detail tabs" className={styles.tabList}>
|
|
24
|
+
<Tab className={styles.tab} id="visit-summaries-tab">
|
|
25
|
+
{t('Visits', 'Visits')}
|
|
26
|
+
</Tab>
|
|
27
|
+
{showAllEncountersTab ? (
|
|
28
|
+
<Tab className={styles.tab} id="all-encounters-tab">
|
|
29
|
+
{t('allEncounters', 'All encounters')}
|
|
30
|
+
</Tab>
|
|
31
|
+
) : (
|
|
32
|
+
<></>
|
|
33
|
+
)}
|
|
34
|
+
</TabList>
|
|
35
|
+
<TabPanels>
|
|
36
|
+
<TabPanel>
|
|
37
|
+
<VisitHistoryTable patientUuid={patientUuid} patient={patient} />
|
|
38
|
+
</TabPanel>
|
|
39
|
+
{showAllEncountersTab && (
|
|
40
|
+
<TabPanel>
|
|
41
|
+
<AllEncountersTable patientUuid={patientUuid} />
|
|
42
|
+
</TabPanel>
|
|
43
|
+
)}
|
|
44
|
+
</TabPanels>
|
|
45
|
+
</Tabs>
|
|
46
|
+
</div>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export default VisitDetailOverviewComponent;
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
@use '@carbon/colors';
|
|
2
|
+
@use '@carbon/layout';
|
|
3
|
+
@use '@carbon/type';
|
|
4
|
+
@use '@openmrs/esm-styleguide/src/vars' as *;
|
|
5
|
+
|
|
6
|
+
.visitType {
|
|
7
|
+
@include type.type-style('heading-compact-02');
|
|
8
|
+
color: $text-02;
|
|
9
|
+
margin-bottom: 5px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.date {
|
|
13
|
+
@include type.type-style('body-compact-01');
|
|
14
|
+
color: $text-02;
|
|
15
|
+
padding-right: 0.625rem;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.dateLabel {
|
|
19
|
+
padding-right: 0.313rem;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.displayFlex {
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
justify-content: left;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.container {
|
|
29
|
+
background-color: $ui-background;
|
|
30
|
+
border: 1px solid $grey-2;
|
|
31
|
+
padding: layout.$spacing-05;
|
|
32
|
+
margin: layout.$spacing-05 0 layout.$spacing-05;
|
|
33
|
+
width: 100%;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.tabs > :global(.cds--tab-content) {
|
|
37
|
+
padding: 0 0 !important;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.tabList {
|
|
41
|
+
position: sticky;
|
|
42
|
+
top: 3rem;
|
|
43
|
+
z-index: 10;
|
|
44
|
+
background-color: $ui-01;
|
|
45
|
+
border-bottom: 2px solid $ui-03;
|
|
46
|
+
|
|
47
|
+
& :global(.cds--tabs__nav-link) {
|
|
48
|
+
border-bottom: none !important;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.tab {
|
|
53
|
+
height: 2.5rem;
|
|
54
|
+
|
|
55
|
+
&:active,
|
|
56
|
+
&:focus {
|
|
57
|
+
outline: none !important;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&[aria-selected='true'] {
|
|
61
|
+
border-bottom: 3px solid var(--brand-03) !important;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.header {
|
|
66
|
+
.visitInfo {
|
|
67
|
+
display: flex;
|
|
68
|
+
align-items: center;
|
|
69
|
+
justify-content: space-between;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.header::after {
|
|
74
|
+
content: '';
|
|
75
|
+
display: block;
|
|
76
|
+
width: layout.$spacing-07;
|
|
77
|
+
padding-top: 0.188rem;
|
|
78
|
+
border-bottom: 0.375rem solid var(--brand-03);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.toggleButtons {
|
|
82
|
+
margin: 0 layout.$spacing-05;
|
|
83
|
+
height: layout.$spacing-08;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.toggle {
|
|
87
|
+
border: 1px solid colors.$blue-30;
|
|
88
|
+
|
|
89
|
+
&:hover {
|
|
90
|
+
background-color: $color-blue-10;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
&:active,
|
|
94
|
+
&:focus {
|
|
95
|
+
box-shadow: none;
|
|
96
|
+
background-color: $color-blue-10;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
&:first-of-type {
|
|
100
|
+
border-radius: layout.$spacing-02 0 0 layout.$spacing-02;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
&:last-of-type {
|
|
104
|
+
border-radius: 0 layout.$spacing-02 layout.$spacing-02 0;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.emptyStateContainer {
|
|
109
|
+
text-align: center;
|
|
110
|
+
margin: layout.$spacing-05 0;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.observation {
|
|
114
|
+
display: grid;
|
|
115
|
+
grid-template-columns: 1fr 1fr;
|
|
116
|
+
grid-gap: layout.$spacing-03;
|
|
117
|
+
margin: layout.$spacing-05 layout.$spacing-05 0 0;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.observation > span {
|
|
121
|
+
align-self: center;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.flexSections {
|
|
125
|
+
display: flex;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.desktopTabs {
|
|
129
|
+
button {
|
|
130
|
+
height: layout.$spacing-07;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.tabletTabs {
|
|
135
|
+
button {
|
|
136
|
+
height: layout.$spacing-09;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.tabContent {
|
|
141
|
+
border-top: 1px solid $ui-03;
|
|
142
|
+
padding: layout.$spacing-05 0;
|
|
143
|
+
width: 70%;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.medicationRecord {
|
|
147
|
+
display: flex;
|
|
148
|
+
flex-direction: column;
|
|
149
|
+
justify-content: space-between;
|
|
150
|
+
|
|
151
|
+
.bodyLong01 {
|
|
152
|
+
gap: layout.$spacing-02;
|
|
153
|
+
margin: layout.$spacing-02 0;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.medicationContainer {
|
|
158
|
+
background-color: $ui-01;
|
|
159
|
+
padding: layout.$spacing-05;
|
|
160
|
+
width: 100% !important;
|
|
161
|
+
display: flex;
|
|
162
|
+
flex-direction: column;
|
|
163
|
+
align-items: flex-start;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.medicationContainer > div {
|
|
167
|
+
display: flex;
|
|
168
|
+
flex-direction: column;
|
|
169
|
+
align-items: flex-start;
|
|
170
|
+
width: 100%;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.medicationContainer p {
|
|
174
|
+
margin: layout.$spacing-02 0;
|
|
175
|
+
display: flex;
|
|
176
|
+
align-items: center;
|
|
177
|
+
flex-wrap: wrap;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.dosage {
|
|
181
|
+
@include type.type-style('heading-compact-01');
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.toggleSwitch {
|
|
185
|
+
display: flex;
|
|
186
|
+
flex-direction: row;
|
|
187
|
+
justify-content: flex-end;
|
|
188
|
+
margin-bottom: layout.$spacing-02;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.toggleSwitch div {
|
|
192
|
+
width: 30%;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.noteText {
|
|
196
|
+
background-color: $ui-01;
|
|
197
|
+
padding: layout.$spacing-05;
|
|
198
|
+
width: 100% !important;
|
|
199
|
+
white-space: pre-wrap;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.metadata {
|
|
203
|
+
@include type.type-style('label-01');
|
|
204
|
+
color: $text-02;
|
|
205
|
+
margin: layout.$spacing-03 0 layout.$spacing-05;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.observationsEmptyState {
|
|
209
|
+
margin-top: layout.$spacing-06;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.loader {
|
|
213
|
+
margin: 0 auto;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.notesContainer {
|
|
217
|
+
margin-bottom: layout.$spacing-07;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.visitDetailOverviewActions {
|
|
221
|
+
display: flex;
|
|
222
|
+
justify-content: flex-end;
|
|
223
|
+
align-items: center;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.loadMoreButton {
|
|
227
|
+
:global(.cds--inline-loading) {
|
|
228
|
+
min-height: layout.$spacing-05 !important;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
:global(.cds--inline-loading__text) {
|
|
232
|
+
font-size: unset !important;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.label01 {
|
|
237
|
+
@include type.type-style('label-01');
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.tag {
|
|
241
|
+
margin: 0 layout.$spacing-02 0 !important;
|
|
242
|
+
text-transform: uppercase;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.text02 {
|
|
246
|
+
color: colors.$gray-70;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.bodyLong01 {
|
|
250
|
+
@include type.type-style('body-01');
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// Overriding styles for RTL support
|
|
254
|
+
html[dir='rtl'] {
|
|
255
|
+
.header {
|
|
256
|
+
.visitInfo {
|
|
257
|
+
display: flex;
|
|
258
|
+
align-items: center;
|
|
259
|
+
justify-content: space-between;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import {
|
|
2
|
+
openmrsFetch,
|
|
3
|
+
restBaseUrl,
|
|
4
|
+
type OpenmrsResource,
|
|
5
|
+
type Visit,
|
|
6
|
+
useOpenmrsInfinite,
|
|
7
|
+
useOpenmrsPagination,
|
|
8
|
+
} from '@openmrs/esm-framework';
|
|
9
|
+
|
|
10
|
+
const customRepresentation =
|
|
11
|
+
'custom:(uuid,location,encounters:(uuid,diagnoses:(uuid,display,rank,diagnosis,certainty,voided),form:(uuid,display,name,description,encounterType,version,resources:(uuid,display,name,valueReference)),encounterDatetime,orders:full,obs:(uuid,concept:(uuid,display,conceptClass:(uuid,display)),display,groupMembers:(uuid,concept:(uuid,display),value:(uuid,display),display),value,obsDatetime),encounterType:(uuid,display,viewPrivilege,editPrivilege),encounterProviders:(uuid,display,encounterRole:(uuid,display),provider:(uuid,person:(uuid,display)))),visitType:(uuid,name,display),startDatetime,stopDatetime,patient,attributes:(attributeType:ref,display,uuid,value)';
|
|
12
|
+
|
|
13
|
+
export function useInfiniteVisits(
|
|
14
|
+
patientUuid: string,
|
|
15
|
+
params: Record<string, number | string> = {},
|
|
16
|
+
rep: string = customRepresentation,
|
|
17
|
+
) {
|
|
18
|
+
const url = new URL(
|
|
19
|
+
`${window.openmrsBase}/${restBaseUrl}/visit?patient=${patientUuid}&v=${rep}`,
|
|
20
|
+
window.location.toString(),
|
|
21
|
+
);
|
|
22
|
+
for (const key in params) {
|
|
23
|
+
url.searchParams.set(key, '' + params[key]);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const { data, mutate, ...rest } = useOpenmrsInfinite<Visit>(patientUuid ? url : null);
|
|
27
|
+
|
|
28
|
+
return { visits: data, mutate, ...rest };
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function usePaginatedVisits(
|
|
32
|
+
patientUuid: string,
|
|
33
|
+
pageSize: number,
|
|
34
|
+
params: Record<string, number | string> = {},
|
|
35
|
+
) {
|
|
36
|
+
const url = new URL(
|
|
37
|
+
`${window.openmrsBase}/${restBaseUrl}/visit?patient=${patientUuid}&v=${customRepresentation}`,
|
|
38
|
+
window.location.toString(),
|
|
39
|
+
);
|
|
40
|
+
for (const key in params) {
|
|
41
|
+
url.searchParams.set(key, '' + params[key]);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const ret = useOpenmrsPagination<Visit>(url, pageSize);
|
|
45
|
+
|
|
46
|
+
return ret;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function deleteVisit(visitUuid: string) {
|
|
50
|
+
return openmrsFetch(`${restBaseUrl}/visit/${visitUuid}`, {
|
|
51
|
+
method: 'DELETE',
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function restoreVisit(visitUuid: string) {
|
|
56
|
+
return openmrsFetch<Visit>(`${restBaseUrl}/visit/${visitUuid}`, {
|
|
57
|
+
headers: {
|
|
58
|
+
'content-type': 'application/json',
|
|
59
|
+
},
|
|
60
|
+
method: 'POST',
|
|
61
|
+
body: { voided: false },
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface Order {
|
|
66
|
+
uuid: string;
|
|
67
|
+
action?: string | null;
|
|
68
|
+
autoExpireDate?: Date | null;
|
|
69
|
+
dateActivated: string;
|
|
70
|
+
dateStopped?: Date | null;
|
|
71
|
+
fulfillerStatus?: string | null;
|
|
72
|
+
dose: number;
|
|
73
|
+
dosingInstructions: string | null;
|
|
74
|
+
dosingType?: 'org.openmrs.FreeTextDosingInstructions' | 'org.openmrs.SimpleDosingInstructions';
|
|
75
|
+
doseUnits: {
|
|
76
|
+
uuid: string;
|
|
77
|
+
display: string;
|
|
78
|
+
};
|
|
79
|
+
drug: {
|
|
80
|
+
uuid: string;
|
|
81
|
+
name: string;
|
|
82
|
+
strength: string;
|
|
83
|
+
display: string;
|
|
84
|
+
};
|
|
85
|
+
duration: number;
|
|
86
|
+
durationUnits: {
|
|
87
|
+
uuid: string;
|
|
88
|
+
display: string;
|
|
89
|
+
};
|
|
90
|
+
frequency: {
|
|
91
|
+
uuid: string;
|
|
92
|
+
display: string;
|
|
93
|
+
};
|
|
94
|
+
numRefills: number;
|
|
95
|
+
orderNumber: string;
|
|
96
|
+
orderReason: string | null;
|
|
97
|
+
orderReasonNonCoded: string | null;
|
|
98
|
+
orderer: OpenmrsResource;
|
|
99
|
+
orderType: {
|
|
100
|
+
uuid: string;
|
|
101
|
+
display: string;
|
|
102
|
+
};
|
|
103
|
+
route: {
|
|
104
|
+
uuid: string;
|
|
105
|
+
display: string;
|
|
106
|
+
};
|
|
107
|
+
quantity: number;
|
|
108
|
+
quantityUnits: OpenmrsResource;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export interface Note {
|
|
112
|
+
concept: OpenmrsResource;
|
|
113
|
+
note: string;
|
|
114
|
+
provider: {
|
|
115
|
+
name: string;
|
|
116
|
+
role: string;
|
|
117
|
+
};
|
|
118
|
+
time: string;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export interface OrderItem {
|
|
122
|
+
order: Order;
|
|
123
|
+
provider: {
|
|
124
|
+
name: string;
|
|
125
|
+
role: string;
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export interface Diagnosis {
|
|
130
|
+
certainty: string;
|
|
131
|
+
display: string;
|
|
132
|
+
encounter: OpenmrsResource;
|
|
133
|
+
links: Array<any>;
|
|
134
|
+
patient: OpenmrsResource;
|
|
135
|
+
rank: number;
|
|
136
|
+
resourceVersion: string;
|
|
137
|
+
uuid: string;
|
|
138
|
+
voided: boolean;
|
|
139
|
+
diagnosis: {
|
|
140
|
+
coded: {
|
|
141
|
+
display: string;
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
export interface EncountersFetchResponse {
|
|
2
|
+
results: Array<RESTPatientNote>;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export interface RESTPatientNote {
|
|
6
|
+
uuid: string;
|
|
7
|
+
display: string;
|
|
8
|
+
encounterDatetime: string;
|
|
9
|
+
encounterType: { name: string; uuid: string };
|
|
10
|
+
encounterProviders: [{ encounterRole: { uuid: string; display: string }; provider: { person: { display: string } } }];
|
|
11
|
+
location: { uuid: string; display: string; name: string };
|
|
12
|
+
auditInfo: {
|
|
13
|
+
creator: any;
|
|
14
|
+
uuid: string;
|
|
15
|
+
display: string;
|
|
16
|
+
links: any;
|
|
17
|
+
dateCreated: Date;
|
|
18
|
+
changedBy?: any;
|
|
19
|
+
dateChanged?: Date;
|
|
20
|
+
};
|
|
21
|
+
obs: Array<ObsData>;
|
|
22
|
+
diagnoses: Array<DiagnosisData>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface PatientNote {
|
|
26
|
+
id: string;
|
|
27
|
+
diagnoses: string;
|
|
28
|
+
encounterDate: string;
|
|
29
|
+
encounterNote: string;
|
|
30
|
+
encounterNoteRecordedAt: string;
|
|
31
|
+
encounterProvider: string;
|
|
32
|
+
encounterProviderRole: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface Concept {
|
|
36
|
+
display: string;
|
|
37
|
+
uuid: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface DiagnosisData {
|
|
41
|
+
uuid: string;
|
|
42
|
+
display: string;
|
|
43
|
+
conceptClass: {
|
|
44
|
+
uuid: string;
|
|
45
|
+
name: string;
|
|
46
|
+
description: string;
|
|
47
|
+
};
|
|
48
|
+
names: Array<ConceptNames>;
|
|
49
|
+
mappings: Array<ConceptMapping>;
|
|
50
|
+
voided: boolean;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface ConceptNames {
|
|
54
|
+
uuid: string;
|
|
55
|
+
name: string;
|
|
56
|
+
conceptNameType: string;
|
|
57
|
+
}
|
|
58
|
+
export interface ConceptMapping {
|
|
59
|
+
conceptMapType: {
|
|
60
|
+
uuid: string;
|
|
61
|
+
display: string;
|
|
62
|
+
};
|
|
63
|
+
conceptReferenceTerm: {
|
|
64
|
+
display: string;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface DisplayMetadata {
|
|
69
|
+
display?: string;
|
|
70
|
+
links?: Links;
|
|
71
|
+
uuid?: string;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export interface SessionData {
|
|
75
|
+
authenticated: boolean;
|
|
76
|
+
locale: string;
|
|
77
|
+
currentProvider: {
|
|
78
|
+
uuid: string;
|
|
79
|
+
display: string;
|
|
80
|
+
person: DisplayMetadata;
|
|
81
|
+
identifier: string;
|
|
82
|
+
attributes: Array<{}>;
|
|
83
|
+
retired: boolean;
|
|
84
|
+
links: Links;
|
|
85
|
+
resourceVersion: string;
|
|
86
|
+
};
|
|
87
|
+
sessionLocation: {
|
|
88
|
+
uuid: string;
|
|
89
|
+
display: string;
|
|
90
|
+
name: string;
|
|
91
|
+
description?: string;
|
|
92
|
+
};
|
|
93
|
+
user: {
|
|
94
|
+
uuid: string;
|
|
95
|
+
display: string;
|
|
96
|
+
username: string;
|
|
97
|
+
};
|
|
98
|
+
privileges: Array<DisplayMetadata>;
|
|
99
|
+
roles: Array<DisplayMetadata>;
|
|
100
|
+
retired: false;
|
|
101
|
+
links: Links;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export type Links = Array<{
|
|
105
|
+
rel: string;
|
|
106
|
+
uri: string;
|
|
107
|
+
}>;
|
|
108
|
+
|
|
109
|
+
export interface Provider {
|
|
110
|
+
uuid: string;
|
|
111
|
+
display: string;
|
|
112
|
+
person: {
|
|
113
|
+
uuid: string;
|
|
114
|
+
display: string;
|
|
115
|
+
links: Links;
|
|
116
|
+
};
|
|
117
|
+
identifier: string;
|
|
118
|
+
attributes: Array<any>;
|
|
119
|
+
retired: boolean;
|
|
120
|
+
links: Links;
|
|
121
|
+
resourceVersion: string;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export interface Location {
|
|
125
|
+
uuid: string;
|
|
126
|
+
display: string;
|
|
127
|
+
name: string;
|
|
128
|
+
description?: string;
|
|
129
|
+
address1?: string;
|
|
130
|
+
address2?: string;
|
|
131
|
+
cityVillage?: string;
|
|
132
|
+
stateProvince?: string;
|
|
133
|
+
country?: string;
|
|
134
|
+
postalCode?: string;
|
|
135
|
+
latitude?: string;
|
|
136
|
+
longitude?: string;
|
|
137
|
+
countryDistrict?: string;
|
|
138
|
+
address3?: string;
|
|
139
|
+
address4?: string;
|
|
140
|
+
address5?: string;
|
|
141
|
+
address6?: string;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export interface ObsData {
|
|
145
|
+
concept: Concept;
|
|
146
|
+
value?: string | any;
|
|
147
|
+
groupMembers?: Array<{
|
|
148
|
+
concept: Concept;
|
|
149
|
+
value?: string | any;
|
|
150
|
+
}>;
|
|
151
|
+
obsDatetime: string;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export interface Diagnosis {
|
|
155
|
+
patient: string;
|
|
156
|
+
diagnosis: {
|
|
157
|
+
coded: string;
|
|
158
|
+
};
|
|
159
|
+
certainty: string;
|
|
160
|
+
rank: number;
|
|
161
|
+
display: string;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export interface DiagnosisPayload {
|
|
165
|
+
encounter: string;
|
|
166
|
+
patient: string;
|
|
167
|
+
condition: null;
|
|
168
|
+
diagnosis: {
|
|
169
|
+
coded: string;
|
|
170
|
+
};
|
|
171
|
+
certainty: string;
|
|
172
|
+
rank: number;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export interface VisitNotePayload {
|
|
176
|
+
encounterDatetime: string; // date and time the encounter was created (ISO8601 Long) (REQUIRED)
|
|
177
|
+
encounterType: string; // uuid of the encounter type - initial visit, return visit etc. (REQUIRED)
|
|
178
|
+
patient: string; // the patient to whom the encounter applies
|
|
179
|
+
location: string; // the location at which the encounter occurred (REQUIRED)
|
|
180
|
+
encounterProviders: Array<{ encounterRole: string; provider: string }>; // array of providers and their role within the encounter. At least 1 provider is required
|
|
181
|
+
obs: Array<ObsPayload>; // array of observations and values for the encounter
|
|
182
|
+
form: string; // target form uuid to be filled for the encounter
|
|
183
|
+
orders?: Array<any>; // list of orders created during the encounter
|
|
184
|
+
visit?: string; // when creating an encounter for a specific visit, this specifies the visit
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export interface ObsPayload {
|
|
188
|
+
concept: Concept;
|
|
189
|
+
value?: string;
|
|
190
|
+
groupMembers?: Array<{
|
|
191
|
+
concept: Concept;
|
|
192
|
+
value: string;
|
|
193
|
+
}>;
|
|
194
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React, { type ComponentProps } from 'react';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
3
|
+
import { ActionMenuButton2, PenIcon } from '@openmrs/esm-framework';
|
|
4
|
+
import { useStartVisitIfNeeded, type PatientChartWorkspaceActionButtonProps } from '@openmrs/esm-patient-common-lib';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* This button uses the patient chart store and MUST only be used
|
|
8
|
+
* within the patient chart
|
|
9
|
+
*/
|
|
10
|
+
const VisitNoteActionButton: React.FC<PatientChartWorkspaceActionButtonProps> = ({ groupProps: { patientUuid } }) => {
|
|
11
|
+
const { t } = useTranslation();
|
|
12
|
+
|
|
13
|
+
const startVisitIfNeeded = useStartVisitIfNeeded(patientUuid);
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<ActionMenuButton2
|
|
17
|
+
icon={(props: ComponentProps<typeof PenIcon>) => <PenIcon {...props} />}
|
|
18
|
+
label={t('visitNote', 'Visit note')}
|
|
19
|
+
workspaceToLaunch={{
|
|
20
|
+
workspaceName: 'visit-notes-form-shadow-workspace',
|
|
21
|
+
workspaceProps: {},
|
|
22
|
+
}}
|
|
23
|
+
onBeforeWorkspaceLaunch={startVisitIfNeeded}
|
|
24
|
+
/>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default VisitNoteActionButton;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Type } from '@openmrs/esm-framework';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
clinicianEncounterRole: {
|
|
5
|
+
_type: Type.UUID,
|
|
6
|
+
_default: '240b26f9-dd88-4172-823d-4a8bfeb7841f',
|
|
7
|
+
_description: 'Doctor or Nurse who is the primary provider for an encounter, and will sign the note',
|
|
8
|
+
},
|
|
9
|
+
visitDiagnosesConceptUuid: {
|
|
10
|
+
_type: Type.ConceptUuid,
|
|
11
|
+
_default: '159947AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
|
|
12
|
+
_description: 'The set of diagnoses that were either addressed or diagnosed during the current visit',
|
|
13
|
+
},
|
|
14
|
+
encounterNoteTextConceptUuid: {
|
|
15
|
+
_type: Type.ConceptUuid,
|
|
16
|
+
_default: '162169AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
|
|
17
|
+
_description: 'Free text note field intended to capture unstructured description of the patient encounter',
|
|
18
|
+
},
|
|
19
|
+
encounterTypeUuid: {
|
|
20
|
+
_type: Type.UUID,
|
|
21
|
+
_default: 'd7151f82-c1f3-4152-a605-2f9ea7414a79',
|
|
22
|
+
_description:
|
|
23
|
+
'Encounter where a full or abbreviated examination is done, usually leading to a presumptive or confirmed diagnosis, recorded by the examining clinician.',
|
|
24
|
+
},
|
|
25
|
+
formConceptUuid: {
|
|
26
|
+
_type: Type.UUID,
|
|
27
|
+
_default: 'c75f120a-04ec-11e3-8780-2b40bef9a44b',
|
|
28
|
+
_description: 'The UUID of the Visit Note form to be associated with visit note encounters',
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export interface VisitNoteConfigObject {
|
|
33
|
+
clinicianEncounterRole: string;
|
|
34
|
+
encounterNoteTextConceptUuid: string;
|
|
35
|
+
encounterTypeUuid: string;
|
|
36
|
+
formConceptUuid: string;
|
|
37
|
+
visitDiagnosesConceptUuid: string;
|
|
38
|
+
}
|