@kenyaemr/esm-active-visits-app 8.1.1-pre.129 → 8.1.2-pre.152
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 +17 -17
- package/dist/130.js +1 -1
- package/dist/130.js.map +1 -1
- package/dist/136.js +2 -0
- package/dist/136.js.map +1 -0
- package/dist/236.js +1 -0
- package/dist/240.js +1 -0
- package/dist/261.js +1 -0
- package/dist/271.js +1 -1
- package/dist/272.js +1 -0
- package/dist/319.js +1 -1
- package/dist/336.js +1 -0
- package/dist/378.js +1 -0
- package/dist/460.js +1 -1
- package/dist/539.js +1 -0
- package/dist/566.js +1 -0
- package/dist/6.js +1 -1
- package/dist/6.js.map +1 -1
- package/dist/652.js +1 -0
- package/dist/673.js +1 -0
- package/dist/705.js +1 -0
- package/dist/711.js +1 -0
- package/dist/725.js +1 -1
- package/dist/727.js +1 -0
- package/dist/737.js +1 -0
- package/dist/744.js +1 -0
- package/dist/899.js +1 -0
- package/dist/967.js +1 -1
- package/dist/kenyaemr-esm-active-visits-app.js +1 -1
- package/dist/kenyaemr-esm-active-visits-app.js.buildmanifest.json +389 -37
- package/dist/kenyaemr-esm-active-visits-app.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package-lock.json +2028 -1668
- package/package.json +5 -5
- package/src/active-visits-widget/active-visits.component.tsx +156 -187
- package/src/active-visits-widget/active-visits.resource.tsx +202 -28
- package/src/active-visits-widget/active-visits.scss +18 -0
- package/src/active-visits-widget/active-visits.test.tsx +120 -83
- package/src/config-schema.ts +11 -1
- package/src/types/index.ts +156 -1
- package/src/visits-summary/visit-detail.component.tsx +3 -2
- package/src/visits-summary/visit-detail.test.tsx +27 -14
- package/src/visits-summary/visit.resource.ts +1 -135
- package/src/visits-summary/visits-components/encounter-list.component.tsx +9 -9
- package/src/visits-summary/visits-components/encounter-observations.component.tsx +1 -1
- package/src/visits-summary/visits-components/encounter-observations.test.tsx +1 -1
- package/src/visits-summary/visits-components/medications-summary.component.tsx +1 -1
- package/src/visits-summary/visits-components/notes-summary.component.tsx +1 -1
- package/src/visits-summary/visits-components/tests-summary.component.tsx +1 -1
- package/src/visits-summary/visits-components/visit-summary.component.tsx +4 -4
- package/translations/ar.json +6 -6
- package/translations/de.json +37 -0
- package/translations/es.json +11 -11
- package/translations/hi.json +37 -0
- package/translations/hi_IN.json +37 -0
- package/translations/id.json +37 -0
- package/translations/it.json +37 -0
- package/translations/ne.json +37 -0
- package/translations/pt.json +37 -0
- package/translations/pt_BR.json +37 -0
- package/translations/qu.json +37 -0
- package/translations/si.json +37 -0
- package/translations/sw.json +37 -0
- package/translations/sw_KE.json +37 -0
- package/translations/tr.json +37 -0
- package/translations/tr_TR.json +37 -0
- package/translations/uk.json +37 -0
- package/translations/vi.json +37 -0
- package/translations/zh.json +1 -1
- package/dist/586.js +0 -2
- package/dist/586.js.map +0 -1
- /package/dist/{586.js.LICENSE.txt → 136.js.LICENSE.txt} +0 -0
package/src/types/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type OpenmrsResource } from '@openmrs/esm-framework';
|
|
1
|
+
import { type OpenmrsResource, type Visit } from '@openmrs/esm-framework';
|
|
2
2
|
|
|
3
3
|
export interface SearchedPatient {
|
|
4
4
|
patientId: number;
|
|
@@ -28,3 +28,158 @@ export interface Identifier {
|
|
|
28
28
|
preferred: boolean;
|
|
29
29
|
voided: boolean;
|
|
30
30
|
}
|
|
31
|
+
|
|
32
|
+
export interface Encounter {
|
|
33
|
+
uuid: string;
|
|
34
|
+
encounterDateTime: string;
|
|
35
|
+
encounterProviders: Array<{
|
|
36
|
+
uuid: string;
|
|
37
|
+
display: string;
|
|
38
|
+
encounterRole: {
|
|
39
|
+
uuid: string;
|
|
40
|
+
display: string;
|
|
41
|
+
};
|
|
42
|
+
provider: {
|
|
43
|
+
uuid: string;
|
|
44
|
+
person: {
|
|
45
|
+
uuid: string;
|
|
46
|
+
display: string;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
}>;
|
|
50
|
+
encounterType: {
|
|
51
|
+
uuid: string;
|
|
52
|
+
display: string;
|
|
53
|
+
};
|
|
54
|
+
obs: Array<Observation>;
|
|
55
|
+
orders: Array<Order>;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface EncounterProvider {
|
|
59
|
+
uuid: string;
|
|
60
|
+
display: string;
|
|
61
|
+
encounterRole: {
|
|
62
|
+
uuid: string;
|
|
63
|
+
display: string;
|
|
64
|
+
};
|
|
65
|
+
provider: {
|
|
66
|
+
uuid: string;
|
|
67
|
+
person: {
|
|
68
|
+
uuid: string;
|
|
69
|
+
display: string;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export interface Observation {
|
|
75
|
+
uuid: string;
|
|
76
|
+
concept: {
|
|
77
|
+
uuid: string;
|
|
78
|
+
display: string;
|
|
79
|
+
conceptClass: {
|
|
80
|
+
uuid: string;
|
|
81
|
+
display: string;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
display: string;
|
|
85
|
+
groupMembers: null | Array<{
|
|
86
|
+
uuid: string;
|
|
87
|
+
concept: {
|
|
88
|
+
uuid: string;
|
|
89
|
+
display: string;
|
|
90
|
+
};
|
|
91
|
+
value: {
|
|
92
|
+
uuid: string;
|
|
93
|
+
display: string;
|
|
94
|
+
};
|
|
95
|
+
}>;
|
|
96
|
+
value: any;
|
|
97
|
+
obsDatetime: string;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export interface Order {
|
|
101
|
+
uuid: string;
|
|
102
|
+
dateActivated: string;
|
|
103
|
+
dateStopped?: Date | null;
|
|
104
|
+
dose: number;
|
|
105
|
+
dosingInstructions: string | null;
|
|
106
|
+
dosingType?: 'org.openmrs.FreeTextDosingInstructions' | 'org.openmrs.SimpleDosingInstructions';
|
|
107
|
+
doseUnits: {
|
|
108
|
+
uuid: string;
|
|
109
|
+
display: string;
|
|
110
|
+
};
|
|
111
|
+
drug: {
|
|
112
|
+
uuid: string;
|
|
113
|
+
name: string;
|
|
114
|
+
strength: string;
|
|
115
|
+
display: string;
|
|
116
|
+
};
|
|
117
|
+
duration: number;
|
|
118
|
+
durationUnits: {
|
|
119
|
+
uuid: string;
|
|
120
|
+
display: string;
|
|
121
|
+
};
|
|
122
|
+
frequency: {
|
|
123
|
+
uuid: string;
|
|
124
|
+
display: string;
|
|
125
|
+
};
|
|
126
|
+
numRefills: number;
|
|
127
|
+
orderNumber: string;
|
|
128
|
+
orderReason: string | null;
|
|
129
|
+
orderReasonNonCoded: string | null;
|
|
130
|
+
orderer: {
|
|
131
|
+
uuid: string;
|
|
132
|
+
person: {
|
|
133
|
+
uuid: string;
|
|
134
|
+
display: string;
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
orderType: {
|
|
138
|
+
uuid: string;
|
|
139
|
+
display: string;
|
|
140
|
+
};
|
|
141
|
+
route: {
|
|
142
|
+
uuid: string;
|
|
143
|
+
display: string;
|
|
144
|
+
};
|
|
145
|
+
quantity: number;
|
|
146
|
+
quantityUnits: OpenmrsResource;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export interface Note {
|
|
150
|
+
note: string;
|
|
151
|
+
provider: {
|
|
152
|
+
name: string;
|
|
153
|
+
role: string;
|
|
154
|
+
};
|
|
155
|
+
time: string;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export interface OrderItem {
|
|
159
|
+
order: Order;
|
|
160
|
+
provider: {
|
|
161
|
+
name: string;
|
|
162
|
+
role: string;
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export interface ActiveVisit {
|
|
167
|
+
age: string;
|
|
168
|
+
id: string;
|
|
169
|
+
idNumber: string;
|
|
170
|
+
gender: string;
|
|
171
|
+
location: string;
|
|
172
|
+
name: string;
|
|
173
|
+
patientUuid: string;
|
|
174
|
+
visitStartTime: string;
|
|
175
|
+
visitType: string;
|
|
176
|
+
visitUuid: string;
|
|
177
|
+
observations?: Record<string, Observation[]>;
|
|
178
|
+
[identifier: string]: string | Record<string, Observation[]>;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export interface VisitResponse {
|
|
182
|
+
results: Array<Visit>;
|
|
183
|
+
links: Array<{ rel: 'prev' | 'next' }>;
|
|
184
|
+
totalCount: number;
|
|
185
|
+
}
|
|
@@ -2,8 +2,9 @@ import React, { useMemo, useState } from 'react';
|
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import { ContentSwitcher, DataTableSkeleton, Switch } from '@carbon/react';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { useVisit } from './visit.resource';
|
|
6
|
+
import { type Encounter } from '../types';
|
|
7
|
+
import { formatDatetime, formatTime, parseDate } from '@openmrs/esm-framework';
|
|
7
8
|
import EncounterList from './visits-components/encounter-list.component';
|
|
8
9
|
import VisitSummary from './visits-components/visit-summary.component';
|
|
9
10
|
import styles from './visit-detail-overview.scss';
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import userEvent from '@testing-library/user-event';
|
|
3
3
|
import { render, screen } from '@testing-library/react';
|
|
4
|
-
import { formatDate } from '@openmrs/esm-framework';
|
|
5
4
|
import { useVisit } from './visit.resource';
|
|
6
5
|
import VisitDetailComponent from './visit-detail.component';
|
|
7
6
|
|
|
7
|
+
const mockUseVisit = jest.mocked(useVisit);
|
|
8
8
|
const defaultProps = {
|
|
9
9
|
patientUuid: '691eed12-c0f1-11e2-94be-8c13b969e334',
|
|
10
10
|
visitUuid: '497b8b17-54ec-4726-87ec-3c4da8cdcaeb',
|
|
11
11
|
};
|
|
12
|
-
const mockUseVisit = jest.mocked(useVisit);
|
|
13
12
|
|
|
14
|
-
jest.mock('./visit.resource')
|
|
13
|
+
jest.mock('./visit.resource', () => ({
|
|
14
|
+
...jest.requireActual('./visit.resource'),
|
|
15
|
+
useVisit: jest.fn(),
|
|
16
|
+
}));
|
|
15
17
|
|
|
16
18
|
describe('VisitDetail', () => {
|
|
17
19
|
it('renders a loading spinner when data is loading', () => {
|
|
18
|
-
mockUseVisit.
|
|
20
|
+
mockUseVisit.mockReturnValue({
|
|
19
21
|
visit: null,
|
|
20
22
|
error: undefined,
|
|
21
23
|
isLoading: true,
|
|
@@ -29,7 +31,8 @@ describe('VisitDetail', () => {
|
|
|
29
31
|
|
|
30
32
|
it('renders a visit detail overview when data is available', () => {
|
|
31
33
|
const mockVisitDate = new Date();
|
|
32
|
-
|
|
34
|
+
|
|
35
|
+
mockUseVisit.mockReturnValue({
|
|
33
36
|
visit: {
|
|
34
37
|
encounters: [],
|
|
35
38
|
startDatetime: mockVisitDate.toISOString(),
|
|
@@ -43,13 +46,14 @@ describe('VisitDetail', () => {
|
|
|
43
46
|
|
|
44
47
|
render(<VisitDetailComponent {...defaultProps} />);
|
|
45
48
|
|
|
46
|
-
expect(screen.
|
|
47
|
-
expect(screen.
|
|
48
|
-
expect(screen.getByText(
|
|
49
|
-
expect(screen.
|
|
49
|
+
expect(screen.getByRole('heading', { name: /some visit type/i })).toBeInTheDocument();
|
|
50
|
+
expect(screen.getByRole('heading', { name: /no encounters found/i })).toBeInTheDocument();
|
|
51
|
+
expect(screen.getByText(/there is no information to display here/i)).toBeInTheDocument();
|
|
52
|
+
expect(screen.getByRole('tab', { name: /all encounters/i })).toBeInTheDocument();
|
|
53
|
+
expect(screen.getByRole('tab', { name: /visit summary/i })).toBeInTheDocument();
|
|
50
54
|
});
|
|
51
55
|
|
|
52
|
-
it('
|
|
56
|
+
it('renders the Encounter Lists view when the "All Encounters" tab is clicked', async () => {
|
|
53
57
|
const user = userEvent.setup();
|
|
54
58
|
|
|
55
59
|
mockUseVisit.mockReturnValue({
|
|
@@ -74,8 +78,12 @@ describe('VisitDetail', () => {
|
|
|
74
78
|
|
|
75
79
|
render(<VisitDetailComponent {...defaultProps} />);
|
|
76
80
|
|
|
77
|
-
await user.click(screen.
|
|
78
|
-
expect(screen.
|
|
81
|
+
await user.click(screen.getByRole('tab', { name: /all encounters/i }));
|
|
82
|
+
expect(screen.getByRole('table')).toBeInTheDocument();
|
|
83
|
+
expect(screen.getByRole('columnheader', { name: /time/i })).toBeInTheDocument();
|
|
84
|
+
expect(screen.getByRole('columnheader', { name: /encounter type/i })).toBeInTheDocument();
|
|
85
|
+
expect(screen.getByRole('columnheader', { name: /provider/i })).toBeInTheDocument();
|
|
86
|
+
expect(screen.getByRole('row', { name: /12:34 pm encounter type/i })).toBeInTheDocument();
|
|
79
87
|
});
|
|
80
88
|
|
|
81
89
|
it('renders the Visit Summaries view when the "Visit Summary" tab is clicked', async () => {
|
|
@@ -112,7 +120,12 @@ describe('VisitDetail', () => {
|
|
|
112
120
|
|
|
113
121
|
render(<VisitDetailComponent {...defaultProps} />);
|
|
114
122
|
|
|
115
|
-
await user.click(screen.
|
|
116
|
-
expect(screen.getByRole('tablist', { name:
|
|
123
|
+
await user.click(screen.getByRole('tab', { name: /visit summary/i }));
|
|
124
|
+
expect(screen.getByRole('tablist', { name: /visit summary tabs/i })).toBeInTheDocument();
|
|
125
|
+
expect(screen.getByRole('tab', { name: /notes/i })).toBeInTheDocument();
|
|
126
|
+
expect(screen.getByRole('tab', { name: /tests/i })).toBeInTheDocument();
|
|
127
|
+
expect(screen.getByRole('tab', { name: /medications/i })).toBeInTheDocument();
|
|
128
|
+
expect(screen.getByText(/no diagnoses found/i)).toBeInTheDocument();
|
|
129
|
+
expect(screen.getByText(/there are no notes to display for this patient/i)).toBeInTheDocument();
|
|
117
130
|
});
|
|
118
131
|
});
|
|
@@ -1,139 +1,5 @@
|
|
|
1
1
|
import useSWR from 'swr';
|
|
2
|
-
import { openmrsFetch, restBaseUrl, type
|
|
3
|
-
|
|
4
|
-
export interface Encounter {
|
|
5
|
-
uuid: string;
|
|
6
|
-
encounterDateTime: string;
|
|
7
|
-
encounterProviders: Array<{
|
|
8
|
-
uuid: string;
|
|
9
|
-
display: string;
|
|
10
|
-
encounterRole: {
|
|
11
|
-
uuid: string;
|
|
12
|
-
display: string;
|
|
13
|
-
};
|
|
14
|
-
provider: {
|
|
15
|
-
uuid: string;
|
|
16
|
-
person: {
|
|
17
|
-
uuid: string;
|
|
18
|
-
display: string;
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
}>;
|
|
22
|
-
encounterType: {
|
|
23
|
-
uuid: string;
|
|
24
|
-
display: string;
|
|
25
|
-
};
|
|
26
|
-
obs: Array<Observation>;
|
|
27
|
-
orders: Array<Order>;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export interface EncounterProvider {
|
|
31
|
-
uuid: string;
|
|
32
|
-
display: string;
|
|
33
|
-
encounterRole: {
|
|
34
|
-
uuid: string;
|
|
35
|
-
display: string;
|
|
36
|
-
};
|
|
37
|
-
provider: {
|
|
38
|
-
uuid: string;
|
|
39
|
-
person: {
|
|
40
|
-
uuid: string;
|
|
41
|
-
display: string;
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export interface Observation {
|
|
47
|
-
uuid: string;
|
|
48
|
-
concept: {
|
|
49
|
-
uuid: string;
|
|
50
|
-
display: string;
|
|
51
|
-
conceptClass: {
|
|
52
|
-
uuid: string;
|
|
53
|
-
display: string;
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
display: string;
|
|
57
|
-
groupMembers: null | Array<{
|
|
58
|
-
uuid: string;
|
|
59
|
-
concept: {
|
|
60
|
-
uuid: string;
|
|
61
|
-
display: string;
|
|
62
|
-
};
|
|
63
|
-
value: {
|
|
64
|
-
uuid: string;
|
|
65
|
-
display: string;
|
|
66
|
-
};
|
|
67
|
-
}>;
|
|
68
|
-
value: any;
|
|
69
|
-
obsDatetime: string;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export interface Order {
|
|
73
|
-
uuid: string;
|
|
74
|
-
dateActivated: string;
|
|
75
|
-
dateStopped?: Date | null;
|
|
76
|
-
dose: number;
|
|
77
|
-
dosingInstructions: string | null;
|
|
78
|
-
dosingType?: 'org.openmrs.FreeTextDosingInstructions' | 'org.openmrs.SimpleDosingInstructions';
|
|
79
|
-
doseUnits: {
|
|
80
|
-
uuid: string;
|
|
81
|
-
display: string;
|
|
82
|
-
};
|
|
83
|
-
drug: {
|
|
84
|
-
uuid: string;
|
|
85
|
-
name: string;
|
|
86
|
-
strength: string;
|
|
87
|
-
display: string;
|
|
88
|
-
};
|
|
89
|
-
duration: number;
|
|
90
|
-
durationUnits: {
|
|
91
|
-
uuid: string;
|
|
92
|
-
display: string;
|
|
93
|
-
};
|
|
94
|
-
frequency: {
|
|
95
|
-
uuid: string;
|
|
96
|
-
display: string;
|
|
97
|
-
};
|
|
98
|
-
numRefills: number;
|
|
99
|
-
orderNumber: string;
|
|
100
|
-
orderReason: string | null;
|
|
101
|
-
orderReasonNonCoded: string | null;
|
|
102
|
-
orderer: {
|
|
103
|
-
uuid: string;
|
|
104
|
-
person: {
|
|
105
|
-
uuid: string;
|
|
106
|
-
display: string;
|
|
107
|
-
};
|
|
108
|
-
};
|
|
109
|
-
orderType: {
|
|
110
|
-
uuid: string;
|
|
111
|
-
display: string;
|
|
112
|
-
};
|
|
113
|
-
route: {
|
|
114
|
-
uuid: string;
|
|
115
|
-
display: string;
|
|
116
|
-
};
|
|
117
|
-
quantity: number;
|
|
118
|
-
quantityUnits: OpenmrsResource;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
export interface Note {
|
|
122
|
-
note: string;
|
|
123
|
-
provider: {
|
|
124
|
-
name: string;
|
|
125
|
-
role: string;
|
|
126
|
-
};
|
|
127
|
-
time: string;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
export interface OrderItem {
|
|
131
|
-
order: Order;
|
|
132
|
-
provider: {
|
|
133
|
-
name: string;
|
|
134
|
-
role: string;
|
|
135
|
-
};
|
|
136
|
-
}
|
|
2
|
+
import { openmrsFetch, restBaseUrl, type Visit } from '@openmrs/esm-framework';
|
|
137
3
|
|
|
138
4
|
export function useVisit(visitUuid: string) {
|
|
139
5
|
const customRepresentation =
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import React, { useEffect,
|
|
1
|
+
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import {
|
|
5
5
|
DataTable,
|
|
6
|
-
TableContainer,
|
|
7
6
|
Table,
|
|
8
|
-
TableHead,
|
|
9
|
-
TableExpandHeader,
|
|
10
|
-
TableRow,
|
|
11
|
-
TableHeader,
|
|
12
7
|
TableBody,
|
|
13
|
-
TableExpandRow,
|
|
14
8
|
TableCell,
|
|
9
|
+
TableContainer,
|
|
15
10
|
TableExpandedRow,
|
|
11
|
+
TableExpandHeader,
|
|
12
|
+
TableExpandRow,
|
|
13
|
+
TableHead,
|
|
14
|
+
TableHeader,
|
|
15
|
+
TableRow,
|
|
16
16
|
} from '@carbon/react';
|
|
17
|
-
import {
|
|
18
|
-
import { type Observation } from '
|
|
17
|
+
import { isDesktop, useLayoutType } from '@openmrs/esm-framework';
|
|
18
|
+
import { type Observation } from '../../types';
|
|
19
19
|
import EncounterObservations from './encounter-observations.component';
|
|
20
20
|
import styles from '../visit-detail-overview.scss';
|
|
21
21
|
|
|
@@ -2,7 +2,7 @@ import React, { useMemo } from 'react';
|
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import { SkeletonText } from '@carbon/react';
|
|
5
|
-
import { type Observation } from '
|
|
5
|
+
import { type Observation } from '../../types';
|
|
6
6
|
import styles from '../visit-detail-overview.scss';
|
|
7
7
|
|
|
8
8
|
interface EncounterObservationsProps {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { render, screen } from '@testing-library/react';
|
|
3
|
-
import { type Observation } from '
|
|
3
|
+
import { type Observation } from '../../types';
|
|
4
4
|
import EncounterObservations from './encounter-observations.component';
|
|
5
5
|
|
|
6
6
|
describe('EncounterObservations', () => {
|
|
@@ -3,7 +3,7 @@ import classNames from 'classnames';
|
|
|
3
3
|
import capitalize from 'lodash-es/capitalize';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
5
|
import { formatDate, formatTime, parseDate } from '@openmrs/esm-framework';
|
|
6
|
-
import { type OrderItem
|
|
6
|
+
import { type OrderItem } from '../../types';
|
|
7
7
|
import styles from '../visit-detail-overview.scss';
|
|
8
8
|
|
|
9
9
|
interface MedicationSummaryProps {
|
|
@@ -3,7 +3,7 @@ import classNames from 'classnames';
|
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import { Layer, Tile } from '@carbon/react';
|
|
5
5
|
import { isDesktop, useLayoutType } from '@openmrs/esm-framework';
|
|
6
|
-
import type { Note } from '
|
|
6
|
+
import type { Note } from '../../types';
|
|
7
7
|
import { EmptyDataIllustration } from '../../active-visits-widget/empty-data-illustration.component';
|
|
8
8
|
import styles from '../visit-detail-overview.scss';
|
|
9
9
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
import { ExtensionSlot } from '@openmrs/esm-framework';
|
|
3
|
-
import { type Encounter } from '
|
|
3
|
+
import { type Encounter } from '../../types';
|
|
4
4
|
import styles from '../visit-detail-overview.scss';
|
|
5
5
|
|
|
6
6
|
const TestsSummary = ({ patientUuid, encounters }: { patientUuid: string; encounters: Array<Encounter> }) => {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useMemo, useState } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import { Tab,
|
|
5
|
-
import { type OpenmrsResource,
|
|
4
|
+
import { Tab, TabList, TabPanel, TabPanels, Tabs, Tag } from '@carbon/react';
|
|
5
|
+
import { formatTime, type OpenmrsResource, parseDate } from '@openmrs/esm-framework';
|
|
6
6
|
import NotesSummary from './notes-summary.component';
|
|
7
7
|
import MedicationSummary from './medications-summary.component';
|
|
8
8
|
import TestsSummary from './tests-summary.component';
|
|
9
|
-
import
|
|
9
|
+
import type { Encounter, Note, Observation, Order, OrderItem } from '../../types';
|
|
10
10
|
import styles from '../visit-detail-overview.scss';
|
|
11
11
|
|
|
12
12
|
interface DiagnosisItem {
|
package/translations/ar.json
CHANGED
|
@@ -6,31 +6,31 @@
|
|
|
6
6
|
"diagnoses": "التشخيصات",
|
|
7
7
|
"dose": "الجرعة",
|
|
8
8
|
"encounterType": "نوع اللقاء",
|
|
9
|
-
"endDate": "
|
|
9
|
+
"endDate": "تاريخ النهاية",
|
|
10
10
|
"filterTable": "فلتر الجدول",
|
|
11
11
|
"gender": "الجنس",
|
|
12
12
|
"idNumber": "رقم الهوية",
|
|
13
|
-
"indication": "
|
|
13
|
+
"indication": "اشارة",
|
|
14
14
|
"medications": "الأدوية",
|
|
15
15
|
"name": "الاسم",
|
|
16
16
|
"noActiveVisitsForLocation": "لا توجد زيارات نشطة لعرضها لهذا الموقع.",
|
|
17
17
|
"noDiagnosesFound": "لم يتم العثور على تشخيصات",
|
|
18
18
|
"noEncountersFound": "لم يتم العثور على لقاءات",
|
|
19
19
|
"noMedicationsFound": "لم يتم العثور على أدوية",
|
|
20
|
-
"noNotesToShowForPatient": "
|
|
20
|
+
"noNotesToShowForPatient": "لايوجد ملاحظات لعرضها لهذا المريض",
|
|
21
21
|
"noObservationsFound": "لم يتم العثور على ملاحظات",
|
|
22
22
|
"notes": "الملاحظات",
|
|
23
23
|
"noVisitsToDisplay": "لا زيارات للعرض",
|
|
24
24
|
"orderDurationAndUnit": "لمدة {{duration}} {{durationUnit}}",
|
|
25
25
|
"orderIndefiniteDuration": "مدة غير محددة",
|
|
26
|
-
"patients": "
|
|
26
|
+
"patients": "مرضى",
|
|
27
27
|
"provider": "مقدم الخدمة",
|
|
28
|
-
"quantity": "
|
|
28
|
+
"quantity": "الكمية",
|
|
29
29
|
"refills": "إعادة التعبئة",
|
|
30
30
|
"tests": "الاختبارات",
|
|
31
31
|
"thereIsNoInformationToDisplayHere": "لا توجد معلومات لعرضها هنا",
|
|
32
32
|
"time": "الوقت",
|
|
33
|
-
"totalVisits": "
|
|
33
|
+
"totalVisits": "عدد الزيارات اليوم",
|
|
34
34
|
"visitStartTime": "وقت الزيارة",
|
|
35
35
|
"visitSummary": "ملخص الزيارة",
|
|
36
36
|
"visitType": "نوع الزيارة"
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"activeVisits": "Active Visits",
|
|
3
|
+
"age": "Age",
|
|
4
|
+
"allEncounters": "All Encounters",
|
|
5
|
+
"checkFilters": "Check the filters above",
|
|
6
|
+
"diagnoses": "Diagnoses",
|
|
7
|
+
"dose": "Dose",
|
|
8
|
+
"encounterType": "Encounter Type",
|
|
9
|
+
"endDate": "End date",
|
|
10
|
+
"filterTable": "Filter table",
|
|
11
|
+
"gender": "Gender",
|
|
12
|
+
"idNumber": "ID Number",
|
|
13
|
+
"indication": "Indication",
|
|
14
|
+
"medications": "Medications",
|
|
15
|
+
"name": "Name",
|
|
16
|
+
"noActiveVisitsForLocation": "There are no active visits to display for this location.",
|
|
17
|
+
"noDiagnosesFound": "No diagnoses found",
|
|
18
|
+
"noEncountersFound": "No encounters found",
|
|
19
|
+
"noMedicationsFound": "No medications found",
|
|
20
|
+
"noNotesToShowForPatient": "There are no notes to display for this patient",
|
|
21
|
+
"noObservationsFound": "No observations found",
|
|
22
|
+
"notes": "Notes",
|
|
23
|
+
"noVisitsToDisplay": "No visits to display",
|
|
24
|
+
"orderDurationAndUnit": "for {{duration}} {{durationUnit}}",
|
|
25
|
+
"orderIndefiniteDuration": "Indefinite duration",
|
|
26
|
+
"patients": "Patients",
|
|
27
|
+
"provider": "Provider",
|
|
28
|
+
"quantity": "Quantity",
|
|
29
|
+
"refills": "Refills",
|
|
30
|
+
"tests": "Tests",
|
|
31
|
+
"thereIsNoInformationToDisplayHere": "There is no information to display here",
|
|
32
|
+
"time": "Time",
|
|
33
|
+
"totalVisits": "Total Visits Today",
|
|
34
|
+
"visitStartTime": "Visit Time",
|
|
35
|
+
"visitSummary": "Visit Summary",
|
|
36
|
+
"visitType": "Visit Type"
|
|
37
|
+
}
|
package/translations/es.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"activeVisits": "
|
|
2
|
+
"activeVisits": "Consultas Activas",
|
|
3
3
|
"age": "Edad",
|
|
4
4
|
"allEncounters": "Todos Los Encuentros",
|
|
5
5
|
"checkFilters": "Compruebe los filtros anteriores",
|
|
@@ -9,29 +9,29 @@
|
|
|
9
9
|
"endDate": "Fecha de finalización",
|
|
10
10
|
"filterTable": "Filtrar la tabla",
|
|
11
11
|
"gender": "Género",
|
|
12
|
-
"idNumber": "Número ID",
|
|
12
|
+
"idNumber": "Número de ID",
|
|
13
13
|
"indication": "Indicación",
|
|
14
|
-
"medications": "
|
|
14
|
+
"medications": "Medicamentos",
|
|
15
15
|
"name": "Nombre",
|
|
16
|
-
"noActiveVisitsForLocation": "No hay visitas activas para esta ubicación.",
|
|
16
|
+
"noActiveVisitsForLocation": "No hay visitas activas para mostrar para esta ubicación.",
|
|
17
17
|
"noDiagnosesFound": "No se encontraron diagnósticos",
|
|
18
18
|
"noEncountersFound": "No se encontraron encuentros",
|
|
19
19
|
"noMedicationsFound": "No se encontraron medicamentos",
|
|
20
20
|
"noNotesToShowForPatient": "No hay notas para mostrar para este paciente",
|
|
21
21
|
"noObservationsFound": "No se encontraron observaciones",
|
|
22
22
|
"notes": "Notas",
|
|
23
|
-
"noVisitsToDisplay": "No hay
|
|
23
|
+
"noVisitsToDisplay": "No hay consultas para mostrar",
|
|
24
24
|
"orderDurationAndUnit": "por {{duration}} {{durationUnit}}",
|
|
25
25
|
"orderIndefiniteDuration": "Duración indefinida",
|
|
26
26
|
"patients": "Pacientes",
|
|
27
|
-
"provider": "
|
|
27
|
+
"provider": "Personal de la Salud",
|
|
28
28
|
"quantity": "Cantidad",
|
|
29
|
-
"refills": "
|
|
29
|
+
"refills": "Reabastecimientos",
|
|
30
30
|
"tests": "Pruebas",
|
|
31
31
|
"thereIsNoInformationToDisplayHere": "No hay información para mostrar aquí",
|
|
32
32
|
"time": "Hora",
|
|
33
|
-
"totalVisits": "Total de
|
|
34
|
-
"visitStartTime": "Tiempo de
|
|
35
|
-
"visitSummary": "Resumen de
|
|
36
|
-
"visitType": "Tipo de
|
|
33
|
+
"totalVisits": "Total de Consultas Hoy",
|
|
34
|
+
"visitStartTime": "Tiempo de la Consulta",
|
|
35
|
+
"visitSummary": "Resumen de la Consulta",
|
|
36
|
+
"visitType": "Tipo de Consulta"
|
|
37
37
|
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"activeVisits": "Active Visits",
|
|
3
|
+
"age": "Age",
|
|
4
|
+
"allEncounters": "All Encounters",
|
|
5
|
+
"checkFilters": "Check the filters above",
|
|
6
|
+
"diagnoses": "Diagnoses",
|
|
7
|
+
"dose": "Dose",
|
|
8
|
+
"encounterType": "Encounter Type",
|
|
9
|
+
"endDate": "End date",
|
|
10
|
+
"filterTable": "Filter table",
|
|
11
|
+
"gender": "Gender",
|
|
12
|
+
"idNumber": "ID Number",
|
|
13
|
+
"indication": "Indication",
|
|
14
|
+
"medications": "Medications",
|
|
15
|
+
"name": "Name",
|
|
16
|
+
"noActiveVisitsForLocation": "There are no active visits to display for this location.",
|
|
17
|
+
"noDiagnosesFound": "No diagnoses found",
|
|
18
|
+
"noEncountersFound": "No encounters found",
|
|
19
|
+
"noMedicationsFound": "No medications found",
|
|
20
|
+
"noNotesToShowForPatient": "There are no notes to display for this patient",
|
|
21
|
+
"noObservationsFound": "No observations found",
|
|
22
|
+
"notes": "Notes",
|
|
23
|
+
"noVisitsToDisplay": "No visits to display",
|
|
24
|
+
"orderDurationAndUnit": "for {{duration}} {{durationUnit}}",
|
|
25
|
+
"orderIndefiniteDuration": "Indefinite duration",
|
|
26
|
+
"patients": "Patients",
|
|
27
|
+
"provider": "Provider",
|
|
28
|
+
"quantity": "Quantity",
|
|
29
|
+
"refills": "Refills",
|
|
30
|
+
"tests": "Tests",
|
|
31
|
+
"thereIsNoInformationToDisplayHere": "There is no information to display here",
|
|
32
|
+
"time": "Time",
|
|
33
|
+
"totalVisits": "Total Visits Today",
|
|
34
|
+
"visitStartTime": "Visit Time",
|
|
35
|
+
"visitSummary": "Visit Summary",
|
|
36
|
+
"visitType": "Visit Type"
|
|
37
|
+
}
|