@kenyaemr/esm-service-queues-app 7.0.3-pre.88 → 7.0.3-pre.94
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 +18 -17
- package/dist/130.js +1 -1
- package/dist/130.js.map +1 -1
- package/dist/199.js +1 -1
- package/dist/236.js +1 -0
- package/dist/236.js.map +1 -0
- package/dist/265.js +1 -0
- package/dist/265.js.map +1 -0
- package/dist/271.js +1 -1
- package/dist/282.js +1 -0
- package/dist/282.js.map +1 -0
- package/dist/319.js +1 -1
- package/dist/366.js +1 -0
- package/dist/366.js.map +1 -0
- package/dist/392.js +1 -0
- package/dist/392.js.map +1 -0
- package/dist/460.js +1 -1
- package/dist/484.js +2 -0
- package/dist/484.js.map +1 -0
- package/dist/574.js +1 -1
- package/dist/6.js +1 -1
- package/dist/604.js +1 -0
- package/dist/604.js.map +1 -0
- package/dist/644.js +1 -1
- package/dist/670.js +1 -0
- package/dist/670.js.map +1 -0
- package/dist/727.js +1 -0
- package/dist/727.js.map +1 -0
- package/dist/752.js +1 -1
- package/dist/757.js +1 -1
- package/dist/760.js +1 -0
- package/dist/760.js.map +1 -0
- package/dist/788.js +1 -1
- package/dist/800.js +1 -1
- package/dist/807.js +1 -1
- package/dist/818.js +1 -0
- package/dist/818.js.map +1 -0
- package/dist/828.js +1 -1
- package/dist/833.js +1 -1
- package/dist/911.js +1 -0
- package/dist/911.js.map +1 -0
- package/dist/kenyaemr-esm-service-queues-app.js +1 -1
- package/dist/kenyaemr-esm-service-queues-app.js.buildmanifest.json +160 -160
- package/dist/kenyaemr-esm-service-queues-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.json +1 -1
- package/src/active-visits/active-visits-table.resource.ts +1 -1
- package/src/active-visits/change-status-dialog.scss +11 -11
- package/src/active-visits/change-status-dialog.test.tsx +36 -31
- package/src/add-patient-toqueue/add-patient-toqueue-dialog.scss +10 -10
- package/src/add-provider-queue-room/add-provider-queue-room.component.tsx +4 -4
- package/src/add-provider-queue-room/add-provider-queue-room.resource.ts +2 -2
- package/src/add-provider-queue-room/add-provider-queue-room.scss +6 -6
- package/src/add-provider-queue-room/add-provider-queue-room.test.tsx +44 -38
- package/src/clear-queue-entries-dialog/clear-queue-entries-dialog.component.tsx +1 -1
- package/src/clear-queue-entries-dialog/clear-queue-entries-dialog.scss +2 -3
- package/src/clear-queue-entries-dialog/clear-queue-entries-dialog.test.tsx +15 -15
- package/src/config-schema.ts +84 -84
- package/src/current-visit/current-visit-summary.component.tsx +1 -1
- package/src/current-visit/current-visit-summary.test.tsx +12 -11
- package/src/current-visit/current-visit.resource.ts +1 -1
- package/src/current-visit/current-visit.scss +4 -4
- package/src/current-visit/hooks/useVitalsConceptMetadata.tsx +1 -1
- package/src/current-visit/visit-details/triage-note.scss +11 -11
- package/src/helpers/helpers.test.ts +24 -0
- package/src/helpers/helpers.ts +41 -14
- package/src/home.test.tsx +10 -12
- package/src/hooks/useQueueService.ts +16 -10
- package/src/past-visit/past-visit-details/past-visit-summary.scss +8 -8
- package/src/past-visit/past-visit.component.tsx +1 -1
- package/src/past-visit/past-visit.resource.ts +1 -1
- package/src/past-visit/past-visit.scss +17 -17
- package/src/past-visit/past-visit.test.tsx +8 -13
- package/src/patient-info/appointment-details.scss +7 -7
- package/src/patient-info/appointment-details.test.tsx +11 -6
- package/src/patient-info/appointments.resource.ts +1 -1
- package/src/patient-info/patient-info.scss +9 -9
- package/src/patient-info/patient-info.test.tsx +3 -14
- package/src/patient-queue-header/patient-queue-header.component.tsx +4 -1
- package/src/patient-queue-header/patient-queue-header.scss +11 -11
- package/src/patient-queue-metrics/clinic-metrics.component.tsx +1 -1
- package/src/patient-queue-metrics/clinic-metrics.resource.ts +2 -2
- package/src/patient-queue-metrics/clinic-metrics.scss +4 -4
- package/src/patient-queue-metrics/clinic-metrics.test.tsx +40 -45
- package/src/patient-queue-metrics/metrics-card.scss +11 -11
- package/src/patient-queue-metrics/metrics-header.scss +2 -2
- package/src/patient-search/advanced-search.scss +27 -27
- package/src/patient-search/advanced-search.test.tsx +6 -9
- package/src/patient-search/basic-search.scss +14 -14
- package/src/patient-search/basic-search.test.tsx +2 -7
- package/src/patient-search/hooks/useDefaultLocation.ts +1 -1
- package/src/patient-search/hooks/useQueueLocations.tsx +1 -0
- package/src/patient-search/hooks/useScheduledVisits.ts +1 -1
- package/src/patient-search/patient-scheduled-visits.component.tsx +4 -4
- package/src/patient-search/patient-scheduled-visits.scss +17 -17
- package/src/patient-search/patient-scheduled-visits.test.tsx +18 -23
- package/src/patient-search/patient-search.scss +7 -7
- package/src/patient-search/patient-search.workspace.tsx +4 -4
- package/src/patient-search/search-results.scss +11 -11
- package/src/patient-search/search-results.test.tsx +2 -10
- package/src/patient-search/visit-form/visit-form.scss +12 -13
- package/src/patient-search/visit-form/visit-type-selector.component.tsx +9 -11
- package/src/patient-search/visit-form/visit-type-selector.scss +13 -13
- package/src/patient-search/visit-form/visit-type-selector.test.tsx +4 -3
- package/src/patient-search/visit-form-queue-fields/visit-form-queue-fields.scss +1 -3
- package/src/patient-search/visit-form-queue-fields/visit-form-queue-fields.test.tsx +15 -9
- package/src/queue-entry-table-components/edit-entry.scss +1 -1
- package/src/queue-entry-table-components/queue-priority.scss +3 -4
- package/src/queue-entry-table-components/transition-entry.scss +1 -1
- package/src/queue-patient-linelists/queue-linelist-base-table.scss +16 -17
- package/src/queue-patient-linelists/queue-linelist-base-table.test.tsx +7 -8
- package/src/queue-patient-linelists/queue-linelist-filter.scss +13 -13
- package/src/queue-patient-linelists/queue-linelist-filter.test.tsx +9 -6
- package/src/queue-patient-linelists/queue-linelist.resource.ts +4 -4
- package/src/queue-patient-linelists/scheduled-appointments-table.test.tsx +10 -7
- package/src/queue-rooms/queue-room-form.scss +13 -13
- package/src/queue-rooms/queue-room-form.test.tsx +10 -8
- package/src/queue-screen/queue-screen.scss +6 -4
- package/src/queue-screen/queue-screen.test.tsx +6 -6
- package/src/queue-services/queue-service-form.scss +13 -13
- package/src/queue-services/queue-service-form.test.tsx +15 -8
- package/src/queue-table/cells/queue-table-action-cell.component.tsx +2 -2
- package/src/queue-table/cells/queue-table-coming-from-cell.component.tsx +1 -1
- package/src/queue-table/default-queue-table.component.tsx +63 -61
- package/src/queue-table/default-queue-table.test.tsx +61 -61
- package/src/queue-table/queue-entry-actions/queue-entry-actions-modal.scss +36 -0
- package/src/queue-table/queue-entry-actions/queue-entry-actions.modal.tsx +30 -10
- package/src/queue-table/queue-entry-actions/queue-entry-actions.test.tsx +34 -103
- package/src/queue-table/queue-entry-actions/queue-entry-confirm-action.test.tsx +42 -25
- package/src/queue-table/queue-entry-actions/queue-entry-undo-actions.test.tsx +19 -14
- package/src/queue-table/queue-table-by-status-skeleton.component.tsx +1 -5
- package/src/queue-table/queue-table-expanded-row.component.tsx +1 -2
- package/src/queue-table/queue-table-metrics-card.scss +7 -7
- package/src/queue-table/queue-table-metrics.scss +3 -3
- package/src/queue-table/queue-table.component.tsx +8 -11
- package/src/queue-table/queue-table.scss +32 -26
- package/src/queue-table/queue-table.test.tsx +46 -21
- package/src/remove-queue-entry-dialog/remove-queue-entry.resource.ts +1 -1
- package/src/remove-queue-entry-dialog/remove-queue-entry.scss +2 -2
- package/src/remove-queue-entry-dialog/remove-queue-entry.test.tsx +13 -12
- package/src/side-menu/side-menu.test.tsx +0 -1
- package/src/transition-queue-entry/transition-queue-entry-dialog.component.tsx +1 -1
- package/src/transition-queue-entry/transition-queue-entry-dialog.scss +5 -5
- package/src/transition-queue-entry/transition-queue-entry-dialog.test.tsx +33 -44
- package/src/views/queue-tables-for-all-statuses.component.tsx +14 -14
- package/src/visits-missing-inqueue/visits-missing-inqueue.component.tsx +1 -1
- package/src/visits-missing-inqueue/visits-missing-inqueue.resource.ts +1 -1
- package/src/visits-missing-inqueue/visits-missing-inqueue.scss +17 -14
- package/translations/am.json +4 -2
- package/translations/ar.json +4 -2
- package/translations/en.json +1 -0
- package/translations/es.json +4 -2
- package/translations/fr.json +39 -37
- package/translations/he.json +4 -2
- package/translations/km.json +4 -2
- package/translations/zh.json +4 -2
- package/translations/zh_CN.json +4 -2
- package/dist/276.js +0 -1
- package/dist/276.js.map +0 -1
- package/dist/384.js +0 -2
- package/dist/384.js.map +0 -1
- package/dist/401.js +0 -1
- package/dist/401.js.map +0 -1
- package/dist/430.js +0 -1
- package/dist/430.js.map +0 -1
- package/dist/60.js +0 -1
- package/dist/60.js.map +0 -1
- package/dist/600.js +0 -1
- package/dist/600.js.map +0 -1
- package/dist/647.js +0 -1
- package/dist/647.js.map +0 -1
- package/dist/650.js +0 -1
- package/dist/650.js.map +0 -1
- package/dist/669.js +0 -1
- package/dist/669.js.map +0 -1
- package/dist/764.js +0 -1
- package/dist/764.js.map +0 -1
- package/dist/877.js +0 -1
- package/dist/877.js.map +0 -1
- package/dist/917.js +0 -1
- package/dist/917.js.map +0 -1
- package/src/queue-table/queue-entry-actions/queue-entry-actons-modal.scss +0 -36
- package/src/root.scss +0 -15
- /package/dist/{384.js.LICENSE.txt → 484.js.LICENSE.txt} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
@use '@carbon/
|
|
2
|
-
@use '@carbon/
|
|
3
|
-
@
|
|
1
|
+
@use '@carbon/layout';
|
|
2
|
+
@use '@carbon/type';
|
|
3
|
+
@use '@openmrs/esm-styleguide/src/vars' as *;
|
|
4
4
|
|
|
5
5
|
.medicationContainer {
|
|
6
|
-
margin-bottom:
|
|
6
|
+
margin-bottom: layout.$spacing-06;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
.medicationRecord {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
|
|
29
29
|
.dosage {
|
|
30
30
|
@include type.type-style('heading-compact-01');
|
|
31
|
-
margin-left:
|
|
31
|
+
margin-left: layout.$spacing-03;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
.date {
|
|
@@ -39,13 +39,13 @@
|
|
|
39
39
|
.metadata {
|
|
40
40
|
@include type.type-style('label-01');
|
|
41
41
|
color: $text-02;
|
|
42
|
-
margin:
|
|
42
|
+
margin: layout.$spacing-02 0;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
.label01 {
|
|
46
46
|
@include type.type-style('label-01');
|
|
47
47
|
color: $text-02;
|
|
48
|
-
margin:
|
|
48
|
+
margin: layout.$spacing-02 0;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
.notesSubHeading {
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
.notesContainer {
|
|
57
|
-
margin:
|
|
57
|
+
margin: layout.$spacing-05 0 layout.$spacing-05;
|
|
58
58
|
}
|
|
@@ -12,7 +12,7 @@ interface PastVisitProps {
|
|
|
12
12
|
|
|
13
13
|
const PastVisit: React.FC<PastVisitProps> = ({ patientUuid }) => {
|
|
14
14
|
const { t } = useTranslation();
|
|
15
|
-
const { visits,
|
|
15
|
+
const { visits, isLoading } = usePastVisits(patientUuid);
|
|
16
16
|
|
|
17
17
|
if (isLoading) {
|
|
18
18
|
return <StructuredListSkeleton role="progressbar" />;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
@use '@carbon/
|
|
2
|
-
@use '@carbon/
|
|
3
|
-
@
|
|
1
|
+
@use '@carbon/layout';
|
|
2
|
+
@use '@carbon/type';
|
|
3
|
+
@use '@openmrs/esm-styleguide/src/vars' as *;
|
|
4
4
|
|
|
5
5
|
.wrapper {
|
|
6
|
-
margin-top:
|
|
6
|
+
margin-top: layout.$spacing-03;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
.bodyShort02 {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
.date {
|
|
18
18
|
@include type.type-style('label-01');
|
|
19
19
|
color: $text-02;
|
|
20
|
-
margin:
|
|
20
|
+
margin: layout.$spacing-03 0 layout.$spacing-03;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
.visitType {
|
|
@@ -26,19 +26,19 @@
|
|
|
26
26
|
|
|
27
27
|
.container {
|
|
28
28
|
background-color: $ui-background;
|
|
29
|
-
padding:
|
|
30
|
-
margin:
|
|
29
|
+
padding: layout.$spacing-03;
|
|
30
|
+
margin: layout.$spacing-03 0 layout.$spacing-03;
|
|
31
31
|
width: 100%;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
.tabs > :global(.cds--tab-content) {
|
|
35
|
-
padding:
|
|
35
|
+
padding: layout.$spacing-05 0 !important;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
.header::after {
|
|
39
39
|
content: '';
|
|
40
40
|
display: block;
|
|
41
|
-
width:
|
|
41
|
+
width: layout.$spacing-07;
|
|
42
42
|
padding-top: 0.188rem;
|
|
43
43
|
border-bottom: 0.375rem solid var(--brand-03);
|
|
44
44
|
}
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
background-color: $ui-background;
|
|
48
48
|
display: grid;
|
|
49
49
|
grid-template-columns: max-content auto;
|
|
50
|
-
min-height:
|
|
50
|
+
min-height: layout.$spacing-13;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
.flexSections {
|
|
@@ -55,10 +55,10 @@
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
.verticalTabs {
|
|
58
|
-
margin:
|
|
58
|
+
margin: layout.$spacing-04 0;
|
|
59
59
|
|
|
60
60
|
&:global(.cds--tabs--scrollable .cds--tabs--scrollable__nav-item + .cds--tabs--scrollable__nav-item) {
|
|
61
|
-
margin-left:
|
|
61
|
+
margin-left: 0;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
> ul {
|
|
@@ -76,13 +76,13 @@
|
|
|
76
76
|
|
|
77
77
|
.desktopTabs {
|
|
78
78
|
button {
|
|
79
|
-
height:
|
|
79
|
+
height: layout.$spacing-07;
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
.tabletTabs {
|
|
84
84
|
button {
|
|
85
|
-
height:
|
|
85
|
+
height: layout.$spacing-09;
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
|
|
@@ -99,13 +99,13 @@
|
|
|
99
99
|
border-left: 3px solid var(--brand-03);
|
|
100
100
|
border-bottom: none;
|
|
101
101
|
font-weight: 600;
|
|
102
|
-
margin-left:
|
|
102
|
+
margin-left: 0 !important;
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
&[aria-selected='false'] {
|
|
106
106
|
border-bottom: none;
|
|
107
107
|
border-left: 2px solid $ui-03;
|
|
108
|
-
margin-left:
|
|
108
|
+
margin-left: 0 !important;
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
|
|
118
118
|
.tabContent {
|
|
119
119
|
border-top: 1px solid $ui-03;
|
|
120
|
-
padding:
|
|
120
|
+
padding: layout.$spacing-05 0;
|
|
121
121
|
width: 70%;
|
|
122
122
|
}
|
|
123
123
|
|
|
@@ -1,41 +1,36 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { screen } from '@testing-library/react';
|
|
3
|
-
import PastVisitSummary from './past-visit-details/past-visit-summary.component';
|
|
4
3
|
import userEvent from '@testing-library/user-event';
|
|
5
4
|
import { mockPastVisit } from '__mocks__';
|
|
6
5
|
import { mockPatient, renderWithSwr } from 'tools';
|
|
7
6
|
import { usePastVisits } from './past-visit.resource';
|
|
7
|
+
import PastVisitSummary from './past-visit-details/past-visit-summary.component';
|
|
8
8
|
|
|
9
|
-
const mockUsePastVisits =
|
|
9
|
+
const mockUsePastVisits = jest.mocked(usePastVisits);
|
|
10
10
|
|
|
11
11
|
jest.mock('./past-visit.resource', () => ({
|
|
12
12
|
usePastVisits: jest.fn(),
|
|
13
13
|
}));
|
|
14
14
|
|
|
15
|
-
describe('PastVisit
|
|
15
|
+
describe('PastVisit', () => {
|
|
16
16
|
it('renders an empty state when notes, encounters, medications, and vitals data is not available', async () => {
|
|
17
17
|
const user = userEvent.setup();
|
|
18
18
|
|
|
19
19
|
mockUsePastVisits.mockReturnValueOnce({
|
|
20
|
-
|
|
20
|
+
visits: mockPastVisit.data.results[0],
|
|
21
|
+
error: null,
|
|
22
|
+
isLoading: false,
|
|
23
|
+
isValidating: false,
|
|
21
24
|
});
|
|
22
25
|
|
|
23
|
-
|
|
26
|
+
renderWithSwr(<PastVisitSummary patientUuid={mockPatient.id} encounters={[]} />);
|
|
24
27
|
|
|
25
28
|
expect(screen.queryAllByText(/vitals/i));
|
|
26
29
|
const vitalsTab = screen.getByRole('tab', { name: /vitals/i });
|
|
27
|
-
|
|
28
30
|
expect(vitalsTab).toBeInTheDocument();
|
|
29
|
-
|
|
30
31
|
expect(screen.getByRole('tab', { name: /notes/i })).toBeInTheDocument();
|
|
31
32
|
expect(screen.getByRole('tab', { name: /medications/i })).toBeInTheDocument();
|
|
32
|
-
|
|
33
33
|
await user.click(vitalsTab);
|
|
34
|
-
|
|
35
34
|
expect(vitalsTab).toHaveAttribute('aria-selected', 'true');
|
|
36
35
|
});
|
|
37
36
|
});
|
|
38
|
-
|
|
39
|
-
function renderPastVisitTabs() {
|
|
40
|
-
renderWithSwr(<PastVisitSummary patientUuid={mockPatient.id} encounters={[]} />);
|
|
41
|
-
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
@use '@carbon/
|
|
2
|
-
@use '@carbon/
|
|
3
|
-
@use '@carbon/
|
|
4
|
-
@
|
|
1
|
+
@use '@carbon/colors';
|
|
2
|
+
@use '@carbon/layout';
|
|
3
|
+
@use '@carbon/type';
|
|
4
|
+
@use '@openmrs/esm-styleguide/src/vars' as *;
|
|
5
5
|
|
|
6
6
|
.widgetCard {
|
|
7
7
|
border: 1px solid colors.$blue-20;
|
|
8
8
|
border-left: none;
|
|
9
9
|
border-right: none;
|
|
10
10
|
background-color: colors.$blue-10;
|
|
11
|
-
padding:
|
|
11
|
+
padding: layout.$spacing-05;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
.title {
|
|
15
15
|
@include type.type-style('heading-compact-01');
|
|
16
16
|
color: $text-02;
|
|
17
|
-
margin-bottom:
|
|
17
|
+
margin-bottom: layout.$spacing-02;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
.subtitle {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
.content {
|
|
26
26
|
@include type.type-style('heading-compact-01');
|
|
27
27
|
background-color: colors.$blue-10;
|
|
28
|
-
padding:
|
|
28
|
+
padding: layout.$spacing-05;
|
|
29
29
|
border: 1px solid colors.$blue-20;
|
|
30
30
|
}
|
|
31
31
|
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { screen } from '@testing-library/react';
|
|
3
3
|
import { mockPatient, renderWithSwr } from 'tools';
|
|
4
|
-
import AppointmentDetails from './appointment-details.component';
|
|
5
|
-
import { usePastVisits } from './../past-visit/past-visit.resource';
|
|
6
4
|
import { useAppointments } from './appointments.resource';
|
|
5
|
+
import { usePastVisits } from './../past-visit/past-visit.resource';
|
|
6
|
+
import AppointmentDetails from './appointment-details.component';
|
|
7
7
|
|
|
8
8
|
const testProps = {
|
|
9
9
|
patientUuid: mockPatient.id,
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
-
const mockUseAppointments =
|
|
13
|
-
const mockUsePastVisits =
|
|
12
|
+
const mockUseAppointments = jest.mocked(useAppointments);
|
|
13
|
+
const mockUsePastVisits = jest.mocked(usePastVisits);
|
|
14
14
|
|
|
15
15
|
jest.mock('./../past-visit/past-visit.resource', () => ({
|
|
16
16
|
usePastVisits: jest.fn(),
|
|
@@ -22,8 +22,13 @@ jest.mock('./appointments.resource', () => ({
|
|
|
22
22
|
|
|
23
23
|
describe('RecentandUpcomingAppointments', () => {
|
|
24
24
|
it('renders no data if past and upcoming visit is empty', async () => {
|
|
25
|
-
mockUseAppointments.mockReturnValueOnce({
|
|
26
|
-
|
|
25
|
+
mockUseAppointments.mockReturnValueOnce({
|
|
26
|
+
upcomingAppointment: null,
|
|
27
|
+
error: null,
|
|
28
|
+
isLoading: false,
|
|
29
|
+
isValidating: false,
|
|
30
|
+
});
|
|
31
|
+
mockUsePastVisits.mockReturnValueOnce({ visits: null, error: null, isLoading: false, isValidating: false });
|
|
27
32
|
renderAppointments();
|
|
28
33
|
|
|
29
34
|
expect(screen.getByText(/there is no last encounter to display for this patient/i)).toBeInTheDocument();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
@use '@carbon/
|
|
2
|
-
@use '@carbon/
|
|
3
|
-
@
|
|
1
|
+
@use '@carbon/layout';
|
|
2
|
+
@use '@carbon/type';
|
|
3
|
+
@use '@openmrs/esm-styleguide/src/vars' as *;
|
|
4
4
|
|
|
5
5
|
.container {
|
|
6
6
|
border-bottom: 0.0125rem solid $color-gray-30;
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
.patientInfoContainer {
|
|
12
12
|
background-color: $ui-02;
|
|
13
|
-
padding: 0 0 0
|
|
13
|
+
padding: 0 0 0 layout.$spacing-05;
|
|
14
14
|
display: flex;
|
|
15
15
|
align-items: center;
|
|
16
16
|
min-height: 7rem;
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
.activePatientInfoContainer {
|
|
20
20
|
background-color: $color-blue-10;
|
|
21
|
-
padding: 0 0 0
|
|
21
|
+
padding: 0 0 0 layout.$spacing-05;
|
|
22
22
|
display: flex;
|
|
23
23
|
align-items: center;
|
|
24
24
|
min-height: 7rem;
|
|
@@ -29,14 +29,14 @@
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
.patientInfoContent {
|
|
32
|
-
margin:
|
|
32
|
+
margin: layout.$spacing-05 0 0 layout.$spacing-05;
|
|
33
33
|
width: 100%;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
.demographics {
|
|
37
37
|
@include type.type-style('body-compact-02');
|
|
38
38
|
color: $text-02;
|
|
39
|
-
margin-top:
|
|
39
|
+
margin-top: layout.$spacing-02;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
.identifier {
|
|
@@ -50,11 +50,11 @@
|
|
|
50
50
|
align-items: center;
|
|
51
51
|
|
|
52
52
|
& > button {
|
|
53
|
-
min-height:
|
|
53
|
+
min-height: layout.$spacing-07;
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
.patientEditBtn {
|
|
58
58
|
color: $ui-05;
|
|
59
|
-
margin:
|
|
59
|
+
margin: layout.$spacing-03;
|
|
60
60
|
}
|
|
@@ -1,29 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import userEvent from '@testing-library/user-event';
|
|
3
2
|
import { screen, render } from '@testing-library/react';
|
|
4
3
|
import { age } from '@openmrs/esm-framework';
|
|
5
4
|
import { mockPatient, mockPatientWithLongName, mockPatientWithoutFormattedName } from 'tools';
|
|
6
5
|
import PatientInfo from './patient-info.component';
|
|
7
6
|
|
|
8
|
-
const mockAge =
|
|
7
|
+
const mockAge = jest.mocked(age);
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
const originalModule = jest.requireActual('@openmrs/esm-framework');
|
|
12
|
-
return {
|
|
13
|
-
...originalModule,
|
|
14
|
-
age: jest.fn(),
|
|
15
|
-
};
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
describe('Patient Info', () => {
|
|
9
|
+
describe('Patient info', () => {
|
|
19
10
|
it.each([
|
|
20
11
|
[mockPatient, 'Wilson, John'],
|
|
21
12
|
[mockPatientWithLongName, 'family name, Some very long given name'],
|
|
22
13
|
[mockPatientWithoutFormattedName, 'given middle family name'],
|
|
23
14
|
])(`should render patient info correctly`, async (patient, displayName) => {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
mockAge.mockReturnValue(35);
|
|
15
|
+
mockAge.mockReturnValue('35');
|
|
27
16
|
|
|
28
17
|
renderPatientInfo(patient);
|
|
29
18
|
|
|
@@ -47,7 +47,10 @@ const PatientQueueHeader: React.FC<PatientQueueHeaderProps> = ({ title, showLoca
|
|
|
47
47
|
if (queueLocations.length === 1) {
|
|
48
48
|
handleQueueLocationChange({ selectedItem: queueLocations[0] });
|
|
49
49
|
}
|
|
50
|
-
if (
|
|
50
|
+
if (
|
|
51
|
+
queueLocations.some((location) => location.id === userSession?.sessionLocation?.uuid) &&
|
|
52
|
+
currentQueueLocationUuid
|
|
53
|
+
) {
|
|
51
54
|
handleQueueLocationChange({
|
|
52
55
|
selectedItem: {
|
|
53
56
|
id: userSession?.sessionLocation?.uuid,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
@use '@carbon/
|
|
2
|
-
@use '@carbon/
|
|
3
|
-
@
|
|
1
|
+
@use '@carbon/layout';
|
|
2
|
+
@use '@carbon/type';
|
|
3
|
+
@use '@openmrs/esm-styleguide/src/vars' as *;
|
|
4
4
|
|
|
5
5
|
.header {
|
|
6
6
|
@include type.type-style('body-compact-02');
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
border-left: 0px;
|
|
11
11
|
display: flex;
|
|
12
12
|
justify-content: space-between;
|
|
13
|
-
padding-right:
|
|
13
|
+
padding-right: layout.$spacing-05;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
.left-justified-items {
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
.right-justified-items {
|
|
23
23
|
@include type.type-style('body-compact-02');
|
|
24
24
|
color: $text-02;
|
|
25
|
-
padding-top:
|
|
25
|
+
padding-top: layout.$spacing-05;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
.page-name {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
|
|
32
32
|
.page-labels {
|
|
33
33
|
p:first-of-type {
|
|
34
|
-
margin-bottom:
|
|
34
|
+
margin-bottom: layout.$spacing-02;
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
|
|
@@ -42,11 +42,11 @@
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
.value {
|
|
45
|
-
margin-left:
|
|
45
|
+
margin-left: layout.$spacing-02;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
.middot {
|
|
49
|
-
margin: 0
|
|
49
|
+
margin: 0 layout.$spacing-03;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
.view {
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
display: flex;
|
|
58
58
|
align-items: center;
|
|
59
59
|
justify-content: flex-end;
|
|
60
|
-
margin-top:
|
|
60
|
+
margin-top: layout.$spacing-03;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
.dropdown {
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
:global(.cds--dropdown--inline .cds--list-box__menu) {
|
|
70
|
-
left: -
|
|
70
|
+
left: -(layout.$spacing-10);
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
html[dir='rtl'] {
|
|
76
76
|
.date-and-location {
|
|
77
77
|
margin-right: unset;
|
|
78
|
-
margin-left:
|
|
78
|
+
margin-left: layout.$spacing-05;
|
|
79
79
|
& > svg:first-child {
|
|
80
80
|
order: -1;
|
|
81
81
|
}
|
|
@@ -21,7 +21,7 @@ function ClinicMetrics() {
|
|
|
21
21
|
const layout = useLayoutType();
|
|
22
22
|
const mutate = useMutateQueueEntries();
|
|
23
23
|
const currentQueueLocation = useSelectedQueueLocationUuid();
|
|
24
|
-
const { services } = useQueueServices(
|
|
24
|
+
const { services } = useQueueServices();
|
|
25
25
|
const currentService = useSelectedService();
|
|
26
26
|
const { serviceCount } = useServiceMetricsCount(currentService?.serviceUuid, currentQueueLocation);
|
|
27
27
|
const [initialSelectedItem, setInitialSelectItem] = useState(() => {
|
|
@@ -35,7 +35,7 @@ export function useActiveVisits() {
|
|
|
35
35
|
return {
|
|
36
36
|
activeVisitsCount: uniquePatientUUIDs.size,
|
|
37
37
|
isLoading,
|
|
38
|
-
|
|
38
|
+
error,
|
|
39
39
|
isValidating,
|
|
40
40
|
};
|
|
41
41
|
}
|
|
@@ -51,7 +51,7 @@ export function useAverageWaitTime(serviceUuid: string, statusUuid: string) {
|
|
|
51
51
|
return {
|
|
52
52
|
waitTime: data ? data?.data : null,
|
|
53
53
|
isLoading,
|
|
54
|
-
|
|
54
|
+
error,
|
|
55
55
|
isValidating,
|
|
56
56
|
mutate,
|
|
57
57
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
@use '@carbon/
|
|
2
|
-
@
|
|
1
|
+
@use '@carbon/layout';
|
|
2
|
+
@use '@openmrs/esm-styleguide/src/vars' as *;
|
|
3
3
|
|
|
4
4
|
.cardContainer {
|
|
5
5
|
background-color: $ui-02;
|
|
6
6
|
display: flex;
|
|
7
7
|
justify-content: space-between;
|
|
8
|
-
padding: 0
|
|
8
|
+
padding: 0 layout.$spacing-05 layout.$spacing-07 layout.$spacing-03;
|
|
9
9
|
flex-flow: row wrap;
|
|
10
|
-
margin-top: -(
|
|
10
|
+
margin-top: -(layout.$spacing-03);
|
|
11
11
|
}
|
|
@@ -1,20 +1,26 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { render, screen } from '@testing-library/react';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
type FetchResponse,
|
|
5
|
+
getDefaultsFromConfigSchema,
|
|
6
|
+
openmrsFetch,
|
|
7
|
+
useConfig,
|
|
8
|
+
useLocations,
|
|
9
|
+
useSession,
|
|
10
|
+
} from '@openmrs/esm-framework';
|
|
4
11
|
import { mockMetrics, mockServiceTypes, mockLocations, mockSession } from '__mocks__';
|
|
12
|
+
import { type ConfigObject, configSchema } from '../config-schema';
|
|
5
13
|
import ClinicMetrics from './clinic-metrics.component';
|
|
6
14
|
|
|
7
|
-
const
|
|
8
|
-
const
|
|
15
|
+
const mockOpenmrsFetch = jest.mocked(openmrsFetch);
|
|
16
|
+
const mockUseConfig = jest.mocked(useConfig<ConfigObject>);
|
|
17
|
+
const mockUseLocations = jest.mocked(useLocations);
|
|
18
|
+
const mockUseSession = jest.mocked(useSession);
|
|
9
19
|
|
|
10
|
-
jest.mock('./queue-metrics.resource', () => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
...originalModule,
|
|
15
|
-
useServiceMetricsCount: jest.fn().mockReturnValue(5),
|
|
16
|
-
};
|
|
17
|
-
});
|
|
20
|
+
jest.mock('./queue-metrics.resource', () => ({
|
|
21
|
+
...jest.requireActual('./queue-metrics.resource'),
|
|
22
|
+
useServiceMetricsCount: jest.fn().mockReturnValue(5),
|
|
23
|
+
}));
|
|
18
24
|
|
|
19
25
|
jest.mock('../hooks/useQueues', () => {
|
|
20
26
|
return {
|
|
@@ -22,44 +28,37 @@ jest.mock('../hooks/useQueues', () => {
|
|
|
22
28
|
};
|
|
23
29
|
});
|
|
24
30
|
|
|
25
|
-
jest.mock('./clinic-metrics.resource', () => {
|
|
26
|
-
|
|
31
|
+
jest.mock('./clinic-metrics.resource', () => ({
|
|
32
|
+
...jest.requireActual('./clinic-metrics.resource'),
|
|
33
|
+
useActiveVisits: jest.fn().mockReturnValue({
|
|
34
|
+
activeVisitsCount: mockMetrics.activeVisitsCount,
|
|
35
|
+
}),
|
|
36
|
+
useAverageWaitTime: jest.fn().mockReturnValue({ waitTime: mockMetrics.waitTime }),
|
|
37
|
+
}));
|
|
27
38
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
};
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
jest.mock('@openmrs/esm-framework', () => {
|
|
36
|
-
const originalModule = jest.requireActual('@openmrs/esm-framework');
|
|
37
|
-
|
|
38
|
-
return {
|
|
39
|
-
...originalModule,
|
|
40
|
-
useLocations: jest.fn().mockImplementation(() => mockLocations.data),
|
|
41
|
-
useSession: jest.fn().mockImplementation(() => mockSession.data),
|
|
42
|
-
};
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
jest.mock('../helpers/helpers', () => {
|
|
46
|
-
const originalModule = jest.requireActual('../helpers/helpers');
|
|
47
|
-
|
|
48
|
-
return {
|
|
49
|
-
...originalModule,
|
|
50
|
-
useSelectedServiceName: jest.fn().mockReturnValue('All'),
|
|
51
|
-
};
|
|
52
|
-
});
|
|
39
|
+
jest.mock('../helpers/helpers', () => ({
|
|
40
|
+
...jest.requireActual('../helpers/helpers'),
|
|
41
|
+
useSelectedServiceName: jest.fn().mockReturnValue('All'),
|
|
42
|
+
}));
|
|
53
43
|
|
|
54
44
|
describe('Clinic metrics', () => {
|
|
45
|
+
beforeEach(() => {
|
|
46
|
+
mockUseConfig.mockReturnValue({
|
|
47
|
+
...getDefaultsFromConfigSchema(configSchema),
|
|
48
|
+
});
|
|
49
|
+
mockUseLocations.mockReturnValue(mockLocations.data.results);
|
|
50
|
+
mockUseSession.mockReturnValue(mockSession.data);
|
|
51
|
+
});
|
|
52
|
+
|
|
55
53
|
it('renders a dashboard outlining metrics from the outpatient clinic', async () => {
|
|
56
|
-
|
|
54
|
+
mockUseConfig.mockReturnValue({
|
|
55
|
+
...getDefaultsFromConfigSchema(configSchema),
|
|
57
56
|
visitQueueNumberAttributeUuid: 'c61ce16f-272a-41e7-9924-4c555d0932c5',
|
|
58
57
|
});
|
|
59
58
|
|
|
60
|
-
|
|
59
|
+
mockOpenmrsFetch.mockResolvedValue({ data: mockMetrics } as unknown as FetchResponse);
|
|
61
60
|
|
|
62
|
-
|
|
61
|
+
render(<ClinicMetrics />);
|
|
63
62
|
|
|
64
63
|
await screen.findByText(/Checked in patients/i);
|
|
65
64
|
expect(screen.getByText(/100/i)).toBeInTheDocument();
|
|
@@ -70,7 +69,3 @@ describe('Clinic metrics', () => {
|
|
|
70
69
|
expect(screen.getByText(/69/i)).toBeInTheDocument();
|
|
71
70
|
});
|
|
72
71
|
});
|
|
73
|
-
|
|
74
|
-
function renderClinicMetrics() {
|
|
75
|
-
render(<ClinicMetrics />);
|
|
76
|
-
}
|