@kenyaemr/esm-service-queues-app 7.0.2-pre.65
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 +40 -0
- package/README.md +20 -0
- package/dist/130.js +2 -0
- package/dist/130.js.LICENSE.txt +3 -0
- package/dist/130.js.map +1 -0
- package/dist/152.js +1 -0
- package/dist/152.js.map +1 -0
- package/dist/169.js +1 -0
- package/dist/169.js.map +1 -0
- package/dist/185.js +1 -0
- package/dist/185.js.map +1 -0
- package/dist/233.js +1 -0
- package/dist/233.js.map +1 -0
- package/dist/237.js +1 -0
- package/dist/237.js.map +1 -0
- package/dist/255.js +2 -0
- package/dist/255.js.LICENSE.txt +9 -0
- package/dist/255.js.map +1 -0
- package/dist/271.js +1 -0
- package/dist/276.js +1 -0
- package/dist/276.js.map +1 -0
- package/dist/303.js +1 -0
- package/dist/303.js.map +1 -0
- package/dist/319.js +1 -0
- package/dist/401.js +1 -0
- package/dist/401.js.map +1 -0
- package/dist/430.js +2 -0
- package/dist/430.js.LICENSE.txt +50 -0
- package/dist/430.js.map +1 -0
- package/dist/460.js +1 -0
- package/dist/501.js +1 -0
- package/dist/501.js.map +1 -0
- package/dist/574.js +1 -0
- package/dist/591.js +2 -0
- package/dist/591.js.LICENSE.txt +32 -0
- package/dist/591.js.map +1 -0
- package/dist/644.js +1 -0
- package/dist/647.js +1 -0
- package/dist/647.js.map +1 -0
- package/dist/650.js +1 -0
- package/dist/650.js.map +1 -0
- package/dist/669.js +1 -0
- package/dist/669.js.map +1 -0
- package/dist/696.js +1 -0
- package/dist/696.js.map +1 -0
- package/dist/703.js +1 -0
- package/dist/703.js.map +1 -0
- package/dist/729.js +1 -0
- package/dist/729.js.map +1 -0
- package/dist/738.js +1 -0
- package/dist/738.js.map +1 -0
- package/dist/757.js +1 -0
- package/dist/764.js +1 -0
- package/dist/764.js.map +1 -0
- package/dist/784.js +2 -0
- package/dist/784.js.LICENSE.txt +9 -0
- package/dist/784.js.map +1 -0
- package/dist/788.js +1 -0
- package/dist/806.js +1 -0
- package/dist/806.js.map +1 -0
- package/dist/807.js +1 -0
- package/dist/833.js +1 -0
- package/dist/877.js +1 -0
- package/dist/877.js.map +1 -0
- package/dist/917.js +1 -0
- package/dist/917.js.map +1 -0
- package/dist/940.js +1 -0
- package/dist/940.js.map +1 -0
- package/dist/981.js +1 -0
- package/dist/981.js.map +1 -0
- package/dist/kenyaemr-esm-service-queues-app.js +1 -0
- package/dist/kenyaemr-esm-service-queues-app.js.buildmanifest.json +965 -0
- package/dist/kenyaemr-esm-service-queues-app.js.map +1 -0
- package/dist/main.js +2 -0
- package/dist/main.js.LICENSE.txt +60 -0
- package/dist/main.js.map +1 -0
- package/dist/routes.json +1 -0
- package/jest.config.js +3 -0
- package/package.json +54 -0
- package/src/active-visits/active-visits-row-actions.component.tsx +25 -0
- package/src/active-visits/active-visits-row-actions.scss +4 -0
- package/src/active-visits/active-visits-table.resource.ts +273 -0
- package/src/active-visits/change-status-dialog.component.tsx +272 -0
- package/src/active-visits/change-status-dialog.scss +47 -0
- package/src/active-visits/change-status-dialog.test.tsx +154 -0
- package/src/add-patient-toqueue/add-patient-toqueue-dialog.component.tsx +228 -0
- package/src/add-patient-toqueue/add-patient-toqueue-dialog.scss +32 -0
- package/src/add-provider-queue-room/add-provider-queue-room.component.tsx +238 -0
- package/src/add-provider-queue-room/add-provider-queue-room.resource.ts +76 -0
- package/src/add-provider-queue-room/add-provider-queue-room.scss +17 -0
- package/src/add-provider-queue-room/add-provider-queue-room.test.tsx +105 -0
- package/src/clear-queue-entries-dialog/clear-queue-entries-dialog.component.tsx +76 -0
- package/src/clear-queue-entries-dialog/clear-queue-entries-dialog.resource.ts +7 -0
- package/src/clear-queue-entries-dialog/clear-queue-entries-dialog.scss +8 -0
- package/src/clear-queue-entries-dialog/clear-queue-entries-dialog.test.tsx +43 -0
- package/src/clear-queue-entries-dialog/clear-queue-entries.component.tsx +43 -0
- package/src/config-schema.ts +465 -0
- package/src/constants.ts +10 -0
- package/src/createDashboardLink.component.tsx +39 -0
- package/src/current-visit/current-visit-summary.component.tsx +38 -0
- package/src/current-visit/current-visit-summary.test.tsx +43 -0
- package/src/current-visit/current-visit.resource.ts +84 -0
- package/src/current-visit/current-visit.scss +34 -0
- package/src/current-visit/hooks/useVitalsConceptMetadata.tsx +101 -0
- package/src/current-visit/visit-details/biometrics-config-schema.ts +14 -0
- package/src/current-visit/visit-details/current-visit-details.component.tsx +96 -0
- package/src/current-visit/visit-details/triage-note.component.tsx +53 -0
- package/src/current-visit/visit-details/triage-note.scss +89 -0
- package/src/current-visit/visit-details/vitals-config-schema.ts +17 -0
- package/src/current-visit/visit-details/vitals.component.tsx +165 -0
- package/src/dashboard.meta.ts +5 -0
- package/src/declarations.d.ts +4 -0
- package/src/helpers/functions.ts +28 -0
- package/src/helpers/helpers.ts +177 -0
- package/src/helpers/time-helpers.ts +15 -0
- package/src/home.component.tsx +16 -0
- package/src/home.test.tsx +48 -0
- package/src/hooks/useConcept.ts +13 -0
- package/src/hooks/useQueue.ts +10 -0
- package/src/hooks/useQueueEntries.ts +187 -0
- package/src/hooks/useQueues.ts +22 -0
- package/src/hooks/useSystemSetting.ts +18 -0
- package/src/index.ts +172 -0
- package/src/past-visit/past-visit-details/encounter-list.component.tsx +54 -0
- package/src/past-visit/past-visit-details/medications-list.component.tsx +98 -0
- package/src/past-visit/past-visit-details/notes-list.component.tsx +41 -0
- package/src/past-visit/past-visit-details/past-visit-summary.component.tsx +181 -0
- package/src/past-visit/past-visit-details/past-visit-summary.scss +58 -0
- package/src/past-visit/past-visit.component.tsx +37 -0
- package/src/past-visit/past-visit.resource.ts +83 -0
- package/src/past-visit/past-visit.scss +126 -0
- package/src/past-visit/past-visit.test.tsx +41 -0
- package/src/patient-info/appointment-details.component.tsx +98 -0
- package/src/patient-info/appointment-details.scss +34 -0
- package/src/patient-info/appointment-details.test.tsx +36 -0
- package/src/patient-info/appointments.resource.ts +43 -0
- package/src/patient-info/hooks/usePatientAttributes.tsx +42 -0
- package/src/patient-info/patient-info.component.tsx +82 -0
- package/src/patient-info/patient-info.scss +60 -0
- package/src/patient-info/patient-info.test.tsx +43 -0
- package/src/patient-queue-header/patient-queue-header.component.tsx +99 -0
- package/src/patient-queue-header/patient-queue-header.scss +90 -0
- package/src/patient-queue-header/patient-queue-illustration.component.tsx +22 -0
- package/src/patient-queue-metrics/clinic-metrics.component.tsx +98 -0
- package/src/patient-queue-metrics/clinic-metrics.resource.ts +58 -0
- package/src/patient-queue-metrics/clinic-metrics.scss +11 -0
- package/src/patient-queue-metrics/clinic-metrics.test.tsx +76 -0
- package/src/patient-queue-metrics/metrics-card.component.tsx +68 -0
- package/src/patient-queue-metrics/metrics-card.scss +80 -0
- package/src/patient-queue-metrics/metrics-header.component.tsx +61 -0
- package/src/patient-queue-metrics/metrics-header.scss +26 -0
- package/src/patient-queue-metrics/queue-metrics.resource.ts +42 -0
- package/src/patient-search/advanced-search.component.tsx +191 -0
- package/src/patient-search/advanced-search.scss +154 -0
- package/src/patient-search/advanced-search.test.tsx +29 -0
- package/src/patient-search/basic-search.component.tsx +112 -0
- package/src/patient-search/basic-search.scss +139 -0
- package/src/patient-search/basic-search.test.tsx +23 -0
- package/src/patient-search/empty-data-illustration.component.tsx +41 -0
- package/src/patient-search/hooks/useActivePatientEnrollment.tsx +29 -0
- package/src/patient-search/hooks/useDefaultLocation.ts +14 -0
- package/src/patient-search/hooks/usePatients.tsx +25 -0
- package/src/patient-search/hooks/useQueueLocations.tsx +23 -0
- package/src/patient-search/hooks/useRecommendedVisitTypes.tsx +35 -0
- package/src/patient-search/hooks/useScheduledVisits.ts +52 -0
- package/src/patient-search/patient-scheduled-visits.component.tsx +324 -0
- package/src/patient-search/patient-scheduled-visits.scss +131 -0
- package/src/patient-search/patient-scheduled-visits.test.tsx +44 -0
- package/src/patient-search/patient-search.scss +43 -0
- package/src/patient-search/patient-search.workspace.tsx +135 -0
- package/src/patient-search/search-illustration.component.tsx +27 -0
- package/src/patient-search/search-results.component.tsx +75 -0
- package/src/patient-search/search-results.scss +80 -0
- package/src/patient-search/search-results.test.tsx +77 -0
- package/src/patient-search/search.resource.ts +10 -0
- package/src/patient-search/visit-form/existing-visit-form.component.tsx +112 -0
- package/src/patient-search/visit-form/queue.resource.ts +64 -0
- package/src/patient-search/visit-form/visit-form.component.tsx +344 -0
- package/src/patient-search/visit-form/visit-form.scss +73 -0
- package/src/patient-search/visit-form/visit-type-selector.component.tsx +155 -0
- package/src/patient-search/visit-form/visit-type-selector.scss +100 -0
- package/src/patient-search/visit-form/visit-type-selector.test.tsx +83 -0
- package/src/patient-search/visit-form-queue-fields/visit-form-queue-fields.component.tsx +178 -0
- package/src/patient-search/visit-form-queue-fields/visit-form-queue-fields.scss +19 -0
- package/src/patient-search/visit-form-queue-fields/visit-form-queue-fields.test.tsx +63 -0
- package/src/queue-entry-table-components/edit-entry.scss +14 -0
- package/src/queue-entry-table-components/queue-duration.component.tsx +41 -0
- package/src/queue-entry-table-components/queue-priority.component.tsx +38 -0
- package/src/queue-entry-table-components/queue-priority.scss +12 -0
- package/src/queue-entry-table-components/queue-status.component.tsx +39 -0
- package/src/queue-entry-table-components/transition-entry.component.tsx +55 -0
- package/src/queue-entry-table-components/transition-entry.scss +22 -0
- package/src/queue-patient-linelists/queue-linelist-base-table.component.tsx +241 -0
- package/src/queue-patient-linelists/queue-linelist-base-table.scss +110 -0
- package/src/queue-patient-linelists/queue-linelist-base-table.test.tsx +93 -0
- package/src/queue-patient-linelists/queue-linelist-filter.scss +63 -0
- package/src/queue-patient-linelists/queue-linelist-filter.test.tsx +94 -0
- package/src/queue-patient-linelists/queue-linelist-filter.workspace.tsx +185 -0
- package/src/queue-patient-linelists/queue-linelist.resource.ts +84 -0
- package/src/queue-patient-linelists/queue-services-table.component.tsx +63 -0
- package/src/queue-patient-linelists/scheduled-appointments-table.component.tsx +305 -0
- package/src/queue-patient-linelists/scheduled-appointments-table.test.tsx +41 -0
- package/src/queue-rooms/queue-room-form.scss +56 -0
- package/src/queue-rooms/queue-room-form.test.tsx +80 -0
- package/src/queue-rooms/queue-room-form.workspace.tsx +169 -0
- package/src/queue-rooms/queue-room.resource.ts +20 -0
- package/src/queue-screen/queue-screen.component.tsx +47 -0
- package/src/queue-screen/queue-screen.scss +39 -0
- package/src/queue-screen/queue-screen.test.tsx +51 -0
- package/src/queue-screen/useActiveTickets.tsx +13 -0
- package/src/queue-services/queue-service-form.scss +61 -0
- package/src/queue-services/queue-service-form.test.tsx +60 -0
- package/src/queue-services/queue-service-form.workspace.tsx +179 -0
- package/src/queue-services/queue-service.resource.ts +33 -0
- package/src/queue-table/cells/columns.resource.ts +135 -0
- package/src/queue-table/cells/queue-table-action-cell.component.tsx +88 -0
- package/src/queue-table/cells/queue-table-action-cell.scss +7 -0
- package/src/queue-table/cells/queue-table-coming-from-cell.component.tsx +13 -0
- package/src/queue-table/cells/queue-table-extension-cell.component.tsx +16 -0
- package/src/queue-table/cells/queue-table-name-cell.component.tsx +20 -0
- package/src/queue-table/cells/queue-table-patient-age-cell.component.tsx +18 -0
- package/src/queue-table/cells/queue-table-patient-identifier-cell.component.tsx +25 -0
- package/src/queue-table/cells/queue-table-priority-cell.component.tsx +23 -0
- package/src/queue-table/cells/queue-table-queue-name-cell.component.tsx +14 -0
- package/src/queue-table/cells/queue-table-status-cell.component.tsx +18 -0
- package/src/queue-table/cells/queue-table-visit-attribute-queue-number-cell.component.tsx +37 -0
- package/src/queue-table/cells/queue-table-visit-start-time-cell.component.tsx +20 -0
- package/src/queue-table/cells/queue-table-wait-time-cell.component.tsx +17 -0
- package/src/queue-table/default-queue-table.component.tsx +174 -0
- package/src/queue-table/default-queue-table.test.tsx +131 -0
- package/src/queue-table/queue-entry-actions/edit-queue-entry-modal.component.tsx +52 -0
- package/src/queue-table/queue-entry-actions/end-queue-entry-modal.component.tsx +39 -0
- package/src/queue-table/queue-entry-actions/queue-entry-actions-modal.component.tsx +362 -0
- package/src/queue-table/queue-entry-actions/queue-entry-actions-modal.test.tsx +152 -0
- package/src/queue-table/queue-entry-actions/queue-entry-actions.resource.ts +83 -0
- package/src/queue-table/queue-entry-actions/queue-entry-actons-modal.scss +36 -0
- package/src/queue-table/queue-entry-actions/queue-entry-confirm-action-modal.component.tsx +97 -0
- package/src/queue-table/queue-entry-actions/queue-entry-confirm-action-modal.test.tsx +106 -0
- package/src/queue-table/queue-entry-actions/queue-entry-undo-actions-modal.test.tsx +76 -0
- package/src/queue-table/queue-entry-actions/transition-queue-entry-modal.component.tsx +51 -0
- package/src/queue-table/queue-entry-actions/undo-transition-queue-entry-modal.component.tsx +58 -0
- package/src/queue-table/queue-entry-actions/void-queue-entry-modal.component.tsx +34 -0
- package/src/queue-table/queue-table-by-status-menu.component.tsx +42 -0
- package/src/queue-table/queue-table-by-status-menu.scss +11 -0
- package/src/queue-table/queue-table-by-status-skeleton.component.tsx +32 -0
- package/src/queue-table/queue-table-by-status.component.tsx +96 -0
- package/src/queue-table/queue-table-expanded-row.component.tsx +29 -0
- package/src/queue-table/queue-table-metrics-card.component.tsx +50 -0
- package/src/queue-table/queue-table-metrics-card.scss +48 -0
- package/src/queue-table/queue-table-metrics.component.tsx +30 -0
- package/src/queue-table/queue-table-metrics.scss +11 -0
- package/src/queue-table/queue-table.component.tsx +179 -0
- package/src/queue-table/queue-table.scss +192 -0
- package/src/queue-table/queue-table.test.tsx +210 -0
- package/src/remove-queue-entry-dialog/remove-queue-entry.component.tsx +87 -0
- package/src/remove-queue-entry-dialog/remove-queue-entry.resource.ts +93 -0
- package/src/remove-queue-entry-dialog/remove-queue-entry.scss +7 -0
- package/src/remove-queue-entry-dialog/remove-queue-entry.test.tsx +45 -0
- package/src/root.component.tsx +28 -0
- package/src/root.scss +15 -0
- package/src/root.test.tsx +24 -0
- package/src/routes.json +133 -0
- package/src/side-menu/nav-group/createNavGroup.tsx +17 -0
- package/src/side-menu/nav-group/nav-group.component.tsx +24 -0
- package/src/side-menu/nav-group/nav-group.test.tsx +32 -0
- package/src/side-menu/nav-group/nav-group.ts +10 -0
- package/src/side-menu/side-menu.component.tsx +6 -0
- package/src/side-menu/side-menu.test.tsx +17 -0
- package/src/transition-queue-entry/transition-queue-entry-dialog.component.tsx +134 -0
- package/src/transition-queue-entry/transition-queue-entry-dialog.scss +12 -0
- package/src/transition-queue-entry/transition-queue-entry-dialog.test.tsx +102 -0
- package/src/transition-queue-entry/transition-queue-entry.resource.ts +16 -0
- package/src/types/index.ts +494 -0
- package/src/views/queue-table-by-status-view.component.tsx +25 -0
- package/src/views/queue-tables-for-all-statuses.component.tsx +150 -0
- package/src/visits-missing-inqueue/visits-missing-inqueue.component.tsx +277 -0
- package/src/visits-missing-inqueue/visits-missing-inqueue.resource.ts +93 -0
- package/src/visits-missing-inqueue/visits-missing-inqueue.scss +108 -0
- package/translations/am.json +295 -0
- package/translations/ar.json +295 -0
- package/translations/en.json +305 -0
- package/translations/es.json +295 -0
- package/translations/fr.json +295 -0
- package/translations/he.json +295 -0
- package/translations/km.json +295 -0
- package/translations/zh.json +295 -0
- package/translations/zh_CN.json +295 -0
- package/tsconfig.json +5 -0
- package/webpack.config.js +1 -0
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
import React, { useEffect, useState, useMemo, useCallback, useRef } from 'react';
|
|
2
|
+
import dayjs from 'dayjs';
|
|
3
|
+
import { first } from 'rxjs/operators';
|
|
4
|
+
import {
|
|
5
|
+
Button,
|
|
6
|
+
ButtonSet,
|
|
7
|
+
ContentSwitcher,
|
|
8
|
+
DatePicker,
|
|
9
|
+
DatePickerInput,
|
|
10
|
+
Form,
|
|
11
|
+
FormGroup,
|
|
12
|
+
InlineNotification,
|
|
13
|
+
RadioButton,
|
|
14
|
+
RadioButtonGroup,
|
|
15
|
+
Row,
|
|
16
|
+
Select,
|
|
17
|
+
SelectItem,
|
|
18
|
+
Stack,
|
|
19
|
+
Switch,
|
|
20
|
+
TimePicker,
|
|
21
|
+
TimePickerSelect,
|
|
22
|
+
} from '@carbon/react';
|
|
23
|
+
import { useTranslation } from 'react-i18next';
|
|
24
|
+
import {
|
|
25
|
+
ExtensionSlot,
|
|
26
|
+
ResponsiveWrapper,
|
|
27
|
+
saveVisit,
|
|
28
|
+
showSnackbar,
|
|
29
|
+
toDateObjectStrict,
|
|
30
|
+
toOmrsIsoString,
|
|
31
|
+
useConfig,
|
|
32
|
+
useLayoutType,
|
|
33
|
+
useLocations,
|
|
34
|
+
useSession,
|
|
35
|
+
} from '@openmrs/esm-framework';
|
|
36
|
+
import { RecommendedVisitTypeSelector, VisitTypeSelector } from './visit-type-selector.component';
|
|
37
|
+
import { postQueueEntry } from '../../active-visits/active-visits-table.resource';
|
|
38
|
+
import { type amPm, convertTime12to24 } from '../../helpers/time-helpers';
|
|
39
|
+
import { useActivePatientEnrollment } from '../hooks/useActivePatientEnrollment';
|
|
40
|
+
import { type NewVisitPayload, type PatientProgram } from '../../types';
|
|
41
|
+
import styles from './visit-form.scss';
|
|
42
|
+
import { useDefaultLoginLocation } from '../hooks/useDefaultLocation';
|
|
43
|
+
import isEmpty from 'lodash-es/isEmpty';
|
|
44
|
+
import { useMutateQueueEntries } from '../../hooks/useQueueEntries';
|
|
45
|
+
import { type ConfigObject } from '../../config-schema';
|
|
46
|
+
import { datePickerFormat, datePickerPlaceHolder } from '../../constants';
|
|
47
|
+
import VisitFormQueueFields from '../visit-form-queue-fields/visit-form-queue-fields.component';
|
|
48
|
+
|
|
49
|
+
interface VisitFormProps {
|
|
50
|
+
patientUuid: string;
|
|
51
|
+
closeWorkspace: () => void;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const VisitForm: React.FC<VisitFormProps> = ({ patientUuid, closeWorkspace }) => {
|
|
55
|
+
const { t } = useTranslation();
|
|
56
|
+
const isTablet = useLayoutType() === 'tablet';
|
|
57
|
+
const locations = useLocations();
|
|
58
|
+
const sessionUser = useSession();
|
|
59
|
+
const { defaultFacility, isLoading: loadingDefaultFacility } = useDefaultLoginLocation();
|
|
60
|
+
|
|
61
|
+
const config = useConfig<ConfigObject>();
|
|
62
|
+
const [contentSwitcherIndex, setContentSwitcherIndex] = useState(config.showRecommendedVisitTypeTab ? 0 : 1);
|
|
63
|
+
const [isMissingVisitType, setIsMissingVisitType] = useState(false);
|
|
64
|
+
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
65
|
+
const [timeFormat, setTimeFormat] = useState<amPm>(new Date().getHours() >= 12 ? 'PM' : 'AM');
|
|
66
|
+
const [visitDate, setVisitDate] = useState(new Date());
|
|
67
|
+
const [visitTime, setVisitTime] = useState(dayjs(new Date()).format('hh:mm'));
|
|
68
|
+
const state = useMemo(() => ({ patientUuid }), [patientUuid]);
|
|
69
|
+
const [ignoreChanges, setIgnoreChanges] = useState(true);
|
|
70
|
+
const { activePatientEnrollment, isLoading } = useActivePatientEnrollment(patientUuid);
|
|
71
|
+
const [enrollment, setEnrollment] = useState<PatientProgram>(activePatientEnrollment[0]);
|
|
72
|
+
const { mutateQueueEntries } = useMutateQueueEntries();
|
|
73
|
+
const visitQueueNumberAttributeUuid = config.visitQueueNumberAttributeUuid;
|
|
74
|
+
const [selectedLocation, setSelectedLocation] = useState('');
|
|
75
|
+
const [visitType, setVisitType] = useState('');
|
|
76
|
+
const [{ service, priority, status, sortWeight, queueLocation }, setVisitFormFields] = useState({
|
|
77
|
+
service: null,
|
|
78
|
+
priority: null,
|
|
79
|
+
status: null,
|
|
80
|
+
sortWeight: null,
|
|
81
|
+
queueLocation: null,
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
useEffect(() => {
|
|
85
|
+
if (locations?.length && sessionUser) {
|
|
86
|
+
setSelectedLocation(sessionUser?.sessionLocation?.uuid);
|
|
87
|
+
} else if (!loadingDefaultFacility && defaultFacility) {
|
|
88
|
+
setSelectedLocation(defaultFacility?.uuid);
|
|
89
|
+
}
|
|
90
|
+
}, [locations, sessionUser, loadingDefaultFacility]);
|
|
91
|
+
|
|
92
|
+
const handleSubmit = useCallback(
|
|
93
|
+
(event) => {
|
|
94
|
+
event.preventDefault();
|
|
95
|
+
|
|
96
|
+
if (!visitType) {
|
|
97
|
+
setIsMissingVisitType(true);
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
setIsSubmitting(true);
|
|
102
|
+
|
|
103
|
+
const [hours, minutes] = convertTime12to24(visitTime, timeFormat);
|
|
104
|
+
|
|
105
|
+
const payload: NewVisitPayload = {
|
|
106
|
+
patient: patientUuid,
|
|
107
|
+
startDatetime: toDateObjectStrict(
|
|
108
|
+
toOmrsIsoString(
|
|
109
|
+
new Date(dayjs(visitDate).year(), dayjs(visitDate).month(), dayjs(visitDate).date(), hours, minutes),
|
|
110
|
+
),
|
|
111
|
+
),
|
|
112
|
+
visitType: visitType,
|
|
113
|
+
location: selectedLocation,
|
|
114
|
+
attributes: [],
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
const abortController = new AbortController();
|
|
118
|
+
|
|
119
|
+
saveVisit(payload, abortController)
|
|
120
|
+
.pipe(first())
|
|
121
|
+
.subscribe(
|
|
122
|
+
(response) => {
|
|
123
|
+
if (response.status === 201) {
|
|
124
|
+
// add new queue entry if visit created successfully
|
|
125
|
+
postQueueEntry(
|
|
126
|
+
response.data.uuid,
|
|
127
|
+
service,
|
|
128
|
+
patientUuid,
|
|
129
|
+
priority,
|
|
130
|
+
status,
|
|
131
|
+
sortWeight,
|
|
132
|
+
queueLocation,
|
|
133
|
+
visitQueueNumberAttributeUuid,
|
|
134
|
+
).then(
|
|
135
|
+
({ status }) => {
|
|
136
|
+
if (status === 201) {
|
|
137
|
+
showSnackbar({
|
|
138
|
+
kind: 'success',
|
|
139
|
+
isLowContrast: true,
|
|
140
|
+
title: t('startAVisit', 'Start a visit'),
|
|
141
|
+
subtitle: t(
|
|
142
|
+
'startVisitQueueSuccessfully',
|
|
143
|
+
'Patient has been added to active visits list and queue.',
|
|
144
|
+
`${hours} : ${minutes}`,
|
|
145
|
+
),
|
|
146
|
+
});
|
|
147
|
+
closeWorkspace();
|
|
148
|
+
mutateQueueEntries();
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
(error) => {
|
|
152
|
+
showSnackbar({
|
|
153
|
+
title: t('queueEntryError', 'Error adding patient to the queue'),
|
|
154
|
+
kind: 'error',
|
|
155
|
+
subtitle: error?.message,
|
|
156
|
+
});
|
|
157
|
+
},
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
(error) => {
|
|
162
|
+
showSnackbar({
|
|
163
|
+
title: t('startVisitError', 'Error starting visit'),
|
|
164
|
+
kind: 'error',
|
|
165
|
+
subtitle: error?.message,
|
|
166
|
+
});
|
|
167
|
+
},
|
|
168
|
+
);
|
|
169
|
+
},
|
|
170
|
+
[
|
|
171
|
+
closeWorkspace,
|
|
172
|
+
mutateQueueEntries,
|
|
173
|
+
patientUuid,
|
|
174
|
+
selectedLocation,
|
|
175
|
+
t,
|
|
176
|
+
timeFormat,
|
|
177
|
+
visitDate,
|
|
178
|
+
visitQueueNumberAttributeUuid,
|
|
179
|
+
visitTime,
|
|
180
|
+
visitType,
|
|
181
|
+
],
|
|
182
|
+
);
|
|
183
|
+
|
|
184
|
+
const handleOnChange = () => {
|
|
185
|
+
setIgnoreChanges((prevState) => !prevState);
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
return (
|
|
189
|
+
<Form className={styles.form} onChange={handleOnChange} onSubmit={handleSubmit}>
|
|
190
|
+
<div>
|
|
191
|
+
{isTablet && (
|
|
192
|
+
<Row className={styles.headerGridRow}>
|
|
193
|
+
<ExtensionSlot name="visit-form-header-slot" className={styles.dataGridRow} state={state} />
|
|
194
|
+
</Row>
|
|
195
|
+
)}
|
|
196
|
+
<Stack gap={8} className={styles.container}>
|
|
197
|
+
<section className={styles.section}>
|
|
198
|
+
<div className={styles.sectionTitle}>{t('dateAndTimeOfVisit', 'Date and time of visit')}</div>
|
|
199
|
+
<div className={styles.dateTimeSection}>
|
|
200
|
+
<DatePicker
|
|
201
|
+
dateFormat={datePickerFormat}
|
|
202
|
+
datePickerType="single"
|
|
203
|
+
id="visitDate"
|
|
204
|
+
style={{ paddingBottom: '1rem' }}
|
|
205
|
+
maxDate={new Date().toISOString()}
|
|
206
|
+
onChange={([date]) => setVisitDate(date)}
|
|
207
|
+
value={visitDate}>
|
|
208
|
+
<DatePickerInput
|
|
209
|
+
id="visitStartDateInput"
|
|
210
|
+
labelText={t('date', 'Date')}
|
|
211
|
+
placeholder={datePickerPlaceHolder}
|
|
212
|
+
style={{ width: '100%' }}
|
|
213
|
+
/>
|
|
214
|
+
</DatePicker>
|
|
215
|
+
<ResponsiveWrapper>
|
|
216
|
+
<TimePicker
|
|
217
|
+
id="visitStartTime"
|
|
218
|
+
labelText={t('time', 'Time')}
|
|
219
|
+
onChange={(event) => setVisitTime(event.target.value as amPm)}
|
|
220
|
+
pattern="^(1[0-2]|0?[1-9]):([0-5]?[0-9])$"
|
|
221
|
+
style={{ marginLeft: '0.125rem', flex: 'none' }}
|
|
222
|
+
value={visitTime}>
|
|
223
|
+
<TimePickerSelect
|
|
224
|
+
id="visitStartTimeSelect"
|
|
225
|
+
onChange={(event) => setTimeFormat(event.target.value as amPm)}
|
|
226
|
+
value={timeFormat}
|
|
227
|
+
labelText={t('time', 'Time')}
|
|
228
|
+
aria-label={t('time', 'Time')}>
|
|
229
|
+
<SelectItem value="AM" text="AM" />
|
|
230
|
+
<SelectItem value="PM" text="PM" />
|
|
231
|
+
</TimePickerSelect>
|
|
232
|
+
</TimePicker>
|
|
233
|
+
</ResponsiveWrapper>
|
|
234
|
+
</div>
|
|
235
|
+
</section>
|
|
236
|
+
|
|
237
|
+
<section className={styles.section}>
|
|
238
|
+
<div className={styles.sectionTitle}>{t('facility', 'Facility')}</div>
|
|
239
|
+
<Select
|
|
240
|
+
labelText={t('selectFacility', 'Select a facility')}
|
|
241
|
+
id="location"
|
|
242
|
+
invalidText="Required"
|
|
243
|
+
value={selectedLocation}
|
|
244
|
+
defaultSelected={selectedLocation}
|
|
245
|
+
onChange={(event) => setSelectedLocation(event.target.value)}>
|
|
246
|
+
{!selectedLocation ? <SelectItem text={t('selectOption', 'Select an option')} value="" /> : null}
|
|
247
|
+
{!isEmpty(defaultFacility) ? (
|
|
248
|
+
<SelectItem key={defaultFacility?.uuid} text={defaultFacility?.display} value={defaultFacility?.uuid}>
|
|
249
|
+
{defaultFacility?.display}
|
|
250
|
+
</SelectItem>
|
|
251
|
+
) : locations?.length > 0 ? (
|
|
252
|
+
locations.map((location) => (
|
|
253
|
+
<SelectItem key={location.uuid} text={location.display} value={location.uuid}>
|
|
254
|
+
{location.display}
|
|
255
|
+
</SelectItem>
|
|
256
|
+
))
|
|
257
|
+
) : null}
|
|
258
|
+
</Select>
|
|
259
|
+
</section>
|
|
260
|
+
|
|
261
|
+
{config.showRecommendedVisitTypeTab && (
|
|
262
|
+
<section>
|
|
263
|
+
<div className={styles.sectionTitle}>{t('program', 'Program')}</div>
|
|
264
|
+
<FormGroup legendText={t('selectProgramType', 'Select program type')}>
|
|
265
|
+
<RadioButtonGroup
|
|
266
|
+
defaultSelected={enrollment?.program?.uuid}
|
|
267
|
+
orientation="vertical"
|
|
268
|
+
onChange={(uuid) =>
|
|
269
|
+
setEnrollment(activePatientEnrollment.find(({ program }) => program.uuid === uuid))
|
|
270
|
+
}
|
|
271
|
+
name="program-type-radio-group"
|
|
272
|
+
valueSelected="default-selected">
|
|
273
|
+
{activePatientEnrollment.map(({ uuid, display, program }) => (
|
|
274
|
+
<RadioButton
|
|
275
|
+
key={uuid}
|
|
276
|
+
className={styles.radioButton}
|
|
277
|
+
id={uuid}
|
|
278
|
+
labelText={display}
|
|
279
|
+
value={program.uuid}
|
|
280
|
+
/>
|
|
281
|
+
))}
|
|
282
|
+
</RadioButtonGroup>
|
|
283
|
+
</FormGroup>
|
|
284
|
+
</section>
|
|
285
|
+
)}
|
|
286
|
+
<section>
|
|
287
|
+
<div className={styles.sectionTitle}>{t('visitType', 'Visit Type')}</div>
|
|
288
|
+
{config.showRecommendedVisitTypeTab && (
|
|
289
|
+
<ContentSwitcher
|
|
290
|
+
selectedIndex={contentSwitcherIndex}
|
|
291
|
+
className={styles.contentSwitcher}
|
|
292
|
+
onChange={({ index }) => setContentSwitcherIndex(index)}>
|
|
293
|
+
<Switch name="recommended" text={t('recommended', 'Recommended')} />
|
|
294
|
+
<Switch name="all" text={t('all', 'All')} />
|
|
295
|
+
</ContentSwitcher>
|
|
296
|
+
)}
|
|
297
|
+
{config.showRecommendedVisitTypeTab && contentSwitcherIndex === 0 && (
|
|
298
|
+
<RecommendedVisitTypeSelector
|
|
299
|
+
onChange={(visitType) => {
|
|
300
|
+
setVisitType(visitType);
|
|
301
|
+
setIsMissingVisitType(false);
|
|
302
|
+
}}
|
|
303
|
+
patientUuid={patientUuid}
|
|
304
|
+
patientProgram={enrollment}
|
|
305
|
+
locationUuid={selectedLocation}
|
|
306
|
+
/>
|
|
307
|
+
)}
|
|
308
|
+
{(!config.showRecommendedVisitTypeTab || contentSwitcherIndex === 1) && (
|
|
309
|
+
<VisitTypeSelector
|
|
310
|
+
onChange={(visitType) => {
|
|
311
|
+
setVisitType(visitType);
|
|
312
|
+
setIsMissingVisitType(false);
|
|
313
|
+
}}
|
|
314
|
+
/>
|
|
315
|
+
)}
|
|
316
|
+
</section>
|
|
317
|
+
{isMissingVisitType && (
|
|
318
|
+
<section>
|
|
319
|
+
<InlineNotification
|
|
320
|
+
style={{ margin: '0', minWidth: '100%' }}
|
|
321
|
+
kind="error"
|
|
322
|
+
lowContrast={true}
|
|
323
|
+
title={t('missingVisitType', 'Missing visit type')}
|
|
324
|
+
subtitle={t('selectVisitType', 'Please select a Visit Type')}
|
|
325
|
+
/>
|
|
326
|
+
</section>
|
|
327
|
+
)}
|
|
328
|
+
|
|
329
|
+
<VisitFormQueueFields setFormFields={setVisitFormFields} />
|
|
330
|
+
<ButtonSet className={isTablet ? styles.tablet : styles.desktop}>
|
|
331
|
+
<Button className={styles.button} kind="secondary" onClick={closeWorkspace}>
|
|
332
|
+
{t('discard', 'Discard')}
|
|
333
|
+
</Button>
|
|
334
|
+
<Button className={styles.button} disabled={isSubmitting} kind="primary" type="submit">
|
|
335
|
+
{t('startVisit', 'Start visit')}
|
|
336
|
+
</Button>
|
|
337
|
+
</ButtonSet>
|
|
338
|
+
</Stack>
|
|
339
|
+
</div>
|
|
340
|
+
</Form>
|
|
341
|
+
);
|
|
342
|
+
};
|
|
343
|
+
|
|
344
|
+
export default VisitForm;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
@use '@carbon/styles/scss/spacing';
|
|
2
|
+
@use '@carbon/styles/scss/type';
|
|
3
|
+
@use '@carbon/layout';
|
|
4
|
+
@import '~@openmrs/esm-styleguide/src/vars';
|
|
5
|
+
|
|
6
|
+
.container {
|
|
7
|
+
flex: 1;
|
|
8
|
+
|
|
9
|
+
& section {
|
|
10
|
+
margin: spacing.$spacing-05 spacing.$spacing-05 spacing.$spacing-05;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.heading {
|
|
15
|
+
@include type.type-style('heading-03');
|
|
16
|
+
margin: spacing.$spacing-05;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.sectionTitle {
|
|
20
|
+
@include type.type-style('heading-compact-02');
|
|
21
|
+
color: $text-02;
|
|
22
|
+
margin-bottom: spacing.$spacing-05;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.dateTimeSection {
|
|
26
|
+
display: flex;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.radioButton {
|
|
30
|
+
margin: spacing.$spacing-05 0;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.headerGridRow {
|
|
34
|
+
border-bottom: 0.0625rem solid $grey-2;
|
|
35
|
+
margin: 0;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.dataGridRow {
|
|
39
|
+
display: grid;
|
|
40
|
+
grid-template-columns: 50% 10% 1fr;
|
|
41
|
+
margin: spacing.$spacing-03 spacing.$spacing-05;
|
|
42
|
+
width: 100%;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.form {
|
|
46
|
+
display: flex;
|
|
47
|
+
flex-direction: column;
|
|
48
|
+
justify-content: space-between;
|
|
49
|
+
height: calc(var(--desktop-workspace-window-height) - 7rem - 2px); // 7rem patient banner, plus border
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.button {
|
|
53
|
+
height: 4rem;
|
|
54
|
+
display: flex;
|
|
55
|
+
align-content: flex-start;
|
|
56
|
+
align-items: baseline;
|
|
57
|
+
min-width: 50%;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.tablet {
|
|
61
|
+
padding: spacing.$spacing-06 spacing.$spacing-05;
|
|
62
|
+
background-color: $ui-02;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.desktop {
|
|
66
|
+
padding: 0rem;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
@media screen and (max-width: 600px) {
|
|
70
|
+
.dateTimeSection {
|
|
71
|
+
flex-direction: column;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import React, { useState, useMemo, useEffect } from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import debounce from 'lodash-es/debounce';
|
|
4
|
+
import isEmpty from 'lodash-es/isEmpty';
|
|
5
|
+
import { useTranslation } from 'react-i18next';
|
|
6
|
+
import { Layer, Search, RadioButtonGroup, RadioButton, StructuredListSkeleton, Tile } from '@carbon/react';
|
|
7
|
+
import {
|
|
8
|
+
ResponsiveWrapper,
|
|
9
|
+
reportError,
|
|
10
|
+
useDebounce,
|
|
11
|
+
useLayoutType,
|
|
12
|
+
usePagination,
|
|
13
|
+
useVisitTypes,
|
|
14
|
+
type VisitType,
|
|
15
|
+
} from '@openmrs/esm-framework';
|
|
16
|
+
import EmptyDataIllustration from '../empty-data-illustration.component';
|
|
17
|
+
import styles from './visit-type-selector.scss';
|
|
18
|
+
import { useRecommendedVisitTypes } from '../hooks/useRecommendedVisitTypes';
|
|
19
|
+
import { type PatientProgram } from '../../types';
|
|
20
|
+
import { InlineNotification } from '@carbon/react';
|
|
21
|
+
|
|
22
|
+
export interface VisitTypeSelectorProps {
|
|
23
|
+
onChange: (event) => void;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const VisitTypeSelector: React.FC<VisitTypeSelectorProps> = ({ onChange }) => {
|
|
27
|
+
const allVisitTypes = useVisitTypes();
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<div>
|
|
31
|
+
{allVisitTypes.length == 0 ? (
|
|
32
|
+
<StructuredListSkeleton />
|
|
33
|
+
) : (
|
|
34
|
+
<VisitTypeSelectorPresentation visitTypes={allVisitTypes} onChange={onChange} />
|
|
35
|
+
)}
|
|
36
|
+
</div>
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export interface RecommendedVisitTypeSelectorProps {
|
|
41
|
+
onChange: (event) => void;
|
|
42
|
+
patientUuid: string;
|
|
43
|
+
patientProgram: PatientProgram;
|
|
44
|
+
locationUuid: string;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** Recommended visits are specfic to a patient, patient program, and location. */
|
|
48
|
+
export const RecommendedVisitTypeSelector: React.FC<RecommendedVisitTypeSelectorProps> = ({
|
|
49
|
+
onChange,
|
|
50
|
+
patientUuid,
|
|
51
|
+
patientProgram,
|
|
52
|
+
locationUuid,
|
|
53
|
+
}) => {
|
|
54
|
+
const { t } = useTranslation();
|
|
55
|
+
const { recommendedVisitTypes, error, isLoading } = useRecommendedVisitTypes(
|
|
56
|
+
patientUuid,
|
|
57
|
+
patientProgram?.uuid,
|
|
58
|
+
patientProgram?.program?.uuid,
|
|
59
|
+
locationUuid,
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
return (
|
|
63
|
+
<div style={{ marginTop: '0.625rem' }}>
|
|
64
|
+
{isLoading ? (
|
|
65
|
+
<StructuredListSkeleton />
|
|
66
|
+
) : (
|
|
67
|
+
<VisitTypeSelectorPresentation onChange={onChange} visitTypes={recommendedVisitTypes} />
|
|
68
|
+
)}
|
|
69
|
+
{error && (
|
|
70
|
+
<InlineNotification
|
|
71
|
+
kind="error"
|
|
72
|
+
title={t('failedToLoadRecommendedVisitTypes', 'Failed to load recommended visit types')}></InlineNotification>
|
|
73
|
+
)}
|
|
74
|
+
</div>
|
|
75
|
+
);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
interface VisitTypeSelectorPresentationProps {
|
|
79
|
+
onChange: (event) => void;
|
|
80
|
+
visitTypes: VisitType[];
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const MAX_RESULTS = 5;
|
|
84
|
+
|
|
85
|
+
const VisitTypeSelectorPresentation: React.FC<VisitTypeSelectorPresentationProps> = ({ visitTypes, onChange }) => {
|
|
86
|
+
const { t } = useTranslation();
|
|
87
|
+
const isTablet = useLayoutType() === 'tablet';
|
|
88
|
+
const [searchTerm, setSearchTerm] = useState<string>('');
|
|
89
|
+
const debouncedSearchTerm = useDebounce(searchTerm);
|
|
90
|
+
const [selectedVisitType, setSelectedVisitType] = useState<string>();
|
|
91
|
+
|
|
92
|
+
const results = useMemo(() => {
|
|
93
|
+
if (!isEmpty(debouncedSearchTerm)) {
|
|
94
|
+
return visitTypes.filter(
|
|
95
|
+
(visitType) => visitType.display.toLowerCase().search(debouncedSearchTerm.toLowerCase()) !== -1,
|
|
96
|
+
);
|
|
97
|
+
} else {
|
|
98
|
+
return visitTypes;
|
|
99
|
+
}
|
|
100
|
+
}, [debouncedSearchTerm, visitTypes]);
|
|
101
|
+
|
|
102
|
+
const truncatedResults = results.slice(0, MAX_RESULTS);
|
|
103
|
+
|
|
104
|
+
useEffect(() => {
|
|
105
|
+
if (results.length > 0) {
|
|
106
|
+
onChange(results[0].uuid);
|
|
107
|
+
setSelectedVisitType(results[0].uuid);
|
|
108
|
+
}
|
|
109
|
+
}, [results]);
|
|
110
|
+
|
|
111
|
+
return (
|
|
112
|
+
<div
|
|
113
|
+
className={classNames(styles.visitTypeOverviewWrapper, {
|
|
114
|
+
[styles.tablet]: isTablet,
|
|
115
|
+
[styles.desktop]: !isTablet,
|
|
116
|
+
})}>
|
|
117
|
+
{truncatedResults.length < visitTypes.length ? (
|
|
118
|
+
<ResponsiveWrapper>
|
|
119
|
+
<Search
|
|
120
|
+
onChange={(event) => setSearchTerm(event.target.value)}
|
|
121
|
+
placeholder={t('searchForAVisitType', 'Search for a visit type')}
|
|
122
|
+
labelText=""
|
|
123
|
+
/>
|
|
124
|
+
</ResponsiveWrapper>
|
|
125
|
+
) : null}
|
|
126
|
+
{truncatedResults.length ? (
|
|
127
|
+
<RadioButtonGroup
|
|
128
|
+
className={styles.radioButtonGroup}
|
|
129
|
+
defaultSelected={results[0].uuid}
|
|
130
|
+
orientation="vertical"
|
|
131
|
+
onChange={(visitType) => {
|
|
132
|
+
setSelectedVisitType(visitType);
|
|
133
|
+
onChange(visitType);
|
|
134
|
+
}}
|
|
135
|
+
name="radio-button-group"
|
|
136
|
+
valueSelected={selectedVisitType}>
|
|
137
|
+
{truncatedResults.map(({ uuid, display, name }) => (
|
|
138
|
+
<RadioButton key={uuid} className={styles.radioButton} id={name} labelText={display} value={uuid} />
|
|
139
|
+
))}
|
|
140
|
+
{/* TODO: This is supposed to paginate. Right now it just shows the user a truncated list
|
|
141
|
+
with no indication that the list is truncated. */}
|
|
142
|
+
</RadioButtonGroup>
|
|
143
|
+
) : (
|
|
144
|
+
<Layer>
|
|
145
|
+
<Tile className={styles.tile}>
|
|
146
|
+
<EmptyDataIllustration />
|
|
147
|
+
<p className={styles.content}>
|
|
148
|
+
{t('noVisitTypesMatchingSearch', 'There are no visit types matching this search text')}
|
|
149
|
+
</p>
|
|
150
|
+
</Tile>
|
|
151
|
+
</Layer>
|
|
152
|
+
)}
|
|
153
|
+
</div>
|
|
154
|
+
);
|
|
155
|
+
};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
@use '@carbon/styles/scss/spacing';
|
|
2
|
+
@use '@carbon/styles/scss/type';
|
|
3
|
+
@import '~@openmrs/esm-styleguide/src/vars';
|
|
4
|
+
|
|
5
|
+
.visitTypeOverviewWrapper {
|
|
6
|
+
margin: spacing.$spacing-05 0rem;
|
|
7
|
+
border: 0.0625rem solid $grey-2;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.tablet {
|
|
11
|
+
background-color: $ui-02;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.desktop {
|
|
15
|
+
background-color: $ui-01;
|
|
16
|
+
|
|
17
|
+
.paginationContainer div {
|
|
18
|
+
background-color: $ui-01;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.visitTypeOverviewWrapper div:nth-child(3) > div:nth-child(2) {
|
|
23
|
+
position: relative;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.visitTypeOverviewWrapper div:nth-child(3) span * {
|
|
27
|
+
display: none;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.radioButtonGroup {
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
align-items: flex-start;
|
|
34
|
+
margin-top: spacing.$spacing-03;
|
|
35
|
+
min-height: spacing.$spacing-10;
|
|
36
|
+
width: 100%;
|
|
37
|
+
@include type.type-style('body-compact-01');
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.radioButton {
|
|
41
|
+
padding: spacing.$spacing-02 spacing.$spacing-05;
|
|
42
|
+
margin: spacing.$spacing-03 0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.content {
|
|
46
|
+
@include type.type-style('heading-compact-01');
|
|
47
|
+
color: $text-02;
|
|
48
|
+
margin-top: spacing.$spacing-05;
|
|
49
|
+
margin-bottom: spacing.$spacing-03;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.desktopHeading {
|
|
53
|
+
h4 {
|
|
54
|
+
@include type.type-style('heading-compact-02');
|
|
55
|
+
color: $text-02;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.tabletHeading {
|
|
60
|
+
h4 {
|
|
61
|
+
@include type.type-style('heading-03');
|
|
62
|
+
color: $text-02;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.desktopHeading,
|
|
67
|
+
.tabletHeading {
|
|
68
|
+
text-align: left;
|
|
69
|
+
text-transform: capitalize;
|
|
70
|
+
margin-bottom: spacing.$spacing-05;
|
|
71
|
+
|
|
72
|
+
h4:after {
|
|
73
|
+
content: '';
|
|
74
|
+
display: block;
|
|
75
|
+
width: 2rem;
|
|
76
|
+
padding-top: 0.188rem;
|
|
77
|
+
border-bottom: 0.375rem solid var(--brand-03);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.heading:after {
|
|
82
|
+
content: '';
|
|
83
|
+
display: block;
|
|
84
|
+
width: 2rem;
|
|
85
|
+
padding-top: 0.188rem;
|
|
86
|
+
border-bottom: 0.375rem solid var(--brand-03);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.tile {
|
|
90
|
+
text-align: center;
|
|
91
|
+
border: 1px solid $ui-03;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// Overriding styles for RTL support
|
|
95
|
+
html[dir='rtl'] {
|
|
96
|
+
.desktopHeading,
|
|
97
|
+
.tabletHeading {
|
|
98
|
+
text-align: right;
|
|
99
|
+
}
|
|
100
|
+
}
|