@openmrs/esm-patient-chart-app 11.3.1-pre.9452 → 11.3.1-pre.9455

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.
Files changed (86) hide show
  1. package/.turbo/turbo-build.log +11 -11
  2. package/dist/2540.js +1 -1
  3. package/dist/2540.js.map +1 -1
  4. package/dist/2761.js.map +1 -1
  5. package/dist/3697.js +1 -0
  6. package/dist/3697.js.map +1 -0
  7. package/dist/4300.js +1 -1
  8. package/dist/506.js +1 -1
  9. package/dist/506.js.map +1 -1
  10. package/dist/5827.js +1 -0
  11. package/dist/5827.js.map +1 -0
  12. package/dist/6411.js +1 -1
  13. package/dist/6411.js.map +1 -1
  14. package/dist/6568.js +1 -1
  15. package/dist/6568.js.map +1 -1
  16. package/dist/6924.js +1 -1
  17. package/dist/6924.js.map +1 -1
  18. package/dist/7818.js +1 -0
  19. package/dist/7818.js.map +1 -0
  20. package/dist/7822.js +1 -1
  21. package/dist/7822.js.map +1 -1
  22. package/dist/8260.js +1 -1
  23. package/dist/8260.js.map +1 -1
  24. package/dist/{3119.js → 8278.js} +1 -1
  25. package/dist/{3119.js.map → 8278.js.map} +1 -1
  26. package/dist/8454.js +1 -1
  27. package/dist/8454.js.map +1 -1
  28. package/dist/8709.js +1 -1
  29. package/dist/8709.js.map +1 -1
  30. package/dist/{6997.js → 9294.js} +1 -1
  31. package/dist/9294.js.map +1 -0
  32. package/dist/main.js +1 -1
  33. package/dist/main.js.map +1 -1
  34. package/dist/openmrs-esm-patient-chart-app.js +1 -1
  35. package/dist/openmrs-esm-patient-chart-app.js.buildmanifest.json +134 -158
  36. package/dist/openmrs-esm-patient-chart-app.js.map +1 -1
  37. package/dist/routes.json +1 -1
  38. package/package.json +2 -2
  39. package/src/actions-buttons/mark-patient-deceased.component.tsx +2 -2
  40. package/src/actions-buttons/start-visit.component.tsx +10 -5
  41. package/src/actions-buttons/start-visit.test.tsx +9 -5
  42. package/src/clinical-views/encounter-list/encounter-list-tabs.extension.tsx +1 -1
  43. package/src/clinical-views/utils/helpers.ts +2 -2
  44. package/src/index.ts +12 -18
  45. package/src/mark-patient-deceased/mark-patient-deceased-form.test.tsx +15 -9
  46. package/src/mark-patient-deceased/mark-patient-deceased-form.workspace.tsx +147 -138
  47. package/src/patient-chart/chart-review/dashboard-view.component.tsx +2 -2
  48. package/src/patient-chart/patient-chart.component.tsx +45 -42
  49. package/src/patient-chart/patient-chart.resources.ts +52 -10
  50. package/src/patient-chart/patient-chart.scss +0 -4
  51. package/src/routes.json +17 -6
  52. package/src/visit/hooks/useDeleteVisit.tsx +1 -1
  53. package/src/visit/start-visit-button.component.tsx +2 -2
  54. package/src/visit/start-visit-button.test.tsx +2 -2
  55. package/src/visit/visit-action-items/edit-visit-details.component.tsx +29 -8
  56. package/src/visit/visit-form/exported-visit-form.workspace.tsx +2 -10
  57. package/src/visit/visit-form/visit-form.test.tsx +27 -18
  58. package/src/visit/visit-form/visit-form.workspace.tsx +38 -675
  59. package/src/visit/visit-history-table/visit-actions-cell.component.tsx +3 -2
  60. package/src/visit/visit-history-table/visit-date-cell.component.tsx +1 -0
  61. package/src/visit/visit-history-table/visit-diagnoses-cell.component.tsx +1 -0
  62. package/src/visit/visit-history-table/visit-history-table.component.tsx +3 -2
  63. package/src/visit/visit-history-table/visit-type-cell.component.tsx +1 -0
  64. package/src/visit/visit-prompt/delete-visit-dialog.test.tsx +1 -1
  65. package/src/visit/visit-prompt/{end-visit-dialog.component.tsx → end-visit-dialog.modal.tsx} +1 -1
  66. package/src/visit/visit-prompt/end-visit-dialog.test.tsx +1 -1
  67. package/src/visit/visit-prompt/{start-visit-dialog.component.tsx → start-visit-dialog.modal.tsx} +10 -4
  68. package/src/visit/visit-prompt/start-visit-dialog.test.tsx +3 -3
  69. package/src/visit/visits-widget/current-visit-summary.extension.tsx +3 -3
  70. package/src/visit/visits-widget/past-visits-components/encounters-table/encounters-table.component.tsx +12 -35
  71. package/src/visit/visits-widget/visit-context/retrospective-data-date-time-picker/retrospective-date-time-picker.component.tsx +1 -0
  72. package/src/visit/visits-widget/visit-context/visit-context-switcher.modal.tsx +2 -2
  73. package/src/visit/visits-widget/visit-context/visit-context-switcher.test.tsx +22 -20
  74. package/src/visit/visits-widget/visit-detail-overview.component.tsx +3 -2
  75. package/src/visit/visits-widget/visit-detail-overview.test.tsx +4 -4
  76. package/translations/en.json +1 -1
  77. package/dist/276.js +0 -1
  78. package/dist/276.js.map +0 -1
  79. package/dist/3905.js +0 -1
  80. package/dist/3905.js.map +0 -1
  81. package/dist/5048.js +0 -1
  82. package/dist/5048.js.map +0 -1
  83. package/dist/6997.js.map +0 -1
  84. package/dist/7810.js +0 -1
  85. package/dist/7810.js.map +0 -1
  86. /package/src/visit/visit-prompt/{delete-visit-dialog.component.tsx → delete-visit-dialog.modal.tsx} +0 -0
@@ -4,14 +4,15 @@ import styles from './visit-actions-cell.scss';
4
4
 
5
5
  interface Props {
6
6
  visit: Visit;
7
+ patient: fhir.Patient;
7
8
  }
8
9
 
9
- const VisitActionsCell: React.FC<Props> = ({ visit }) => {
10
+ const VisitActionsCell: React.FC<Props> = ({ visit, patient }) => {
10
11
  return (
11
12
  <ExtensionSlot
12
13
  name="visit-detail-overview-actions"
13
14
  className={styles.visitActions}
14
- state={{ patientUuid: visit.patient.uuid, visit, compact: true }}
15
+ state={{ patientUuid: visit.patient.uuid, patient, visit, compact: true }}
15
16
  />
16
17
  );
17
18
  };
@@ -4,6 +4,7 @@ import { useTranslation } from 'react-i18next';
4
4
 
5
5
  interface Props {
6
6
  visit: Visit;
7
+ patient: fhir.Patient;
7
8
  }
8
9
 
9
10
  const VisitDateCell: React.FC<Props> = ({ visit }) => {
@@ -3,6 +3,7 @@ import React from 'react';
3
3
 
4
4
  interface Props {
5
5
  visit: Visit;
6
+ patient: fhir.Patient;
6
7
  }
7
8
 
8
9
  const VisitDiagnosisCell: React.FC<Props> = ({ visit }) => {
@@ -27,12 +27,13 @@ import styles from './visit-history-table.scss';
27
27
 
28
28
  interface VisitHistoryTableProps {
29
29
  patientUuid: string;
30
+ patient: fhir.Patient;
30
31
  }
31
32
 
32
33
  /**
33
34
  * This show a list of visit histories in the visit tab in patient chart
34
35
  */
35
- const VisitHistoryTable: React.FC<VisitHistoryTableProps> = ({ patientUuid }) => {
36
+ const VisitHistoryTable: React.FC<VisitHistoryTableProps> = ({ patientUuid, patient }) => {
36
37
  const defaultPageSize = 10;
37
38
  const [pageSize, setPageSize] = useState(defaultPageSize);
38
39
  const pageSizes = [10, 20, 30, 40, 50];
@@ -54,7 +55,7 @@ const VisitHistoryTable: React.FC<VisitHistoryTableProps> = ({ patientUuid }) =>
54
55
  const rowData = visits?.map((visit) => {
55
56
  const row: Record<string, JSX.Element | string> = { id: visit.uuid };
56
57
  for (const { key, CellComponent } of columns) {
57
- row[key] = <CellComponent key={key} visit={visit} />;
58
+ row[key] = <CellComponent key={key} visit={visit} patient={patient} />;
58
59
  }
59
60
  return row;
60
61
  });
@@ -3,6 +3,7 @@ import React from 'react';
3
3
 
4
4
  interface Props {
5
5
  visit: Visit;
6
+ patient: fhir.Patient;
6
7
  }
7
8
 
8
9
  const VisitTypeCell: React.FC<Props> = ({ visit }) => {
@@ -4,7 +4,7 @@ import userEvent from '@testing-library/user-event';
4
4
  import { mockCurrentVisit } from '__mocks__';
5
5
  import React from 'react';
6
6
  import { mockPatient } from 'tools';
7
- import DeleteVisitDialog from './delete-visit-dialog.component';
7
+ import DeleteVisitDialog from './delete-visit-dialog.modal';
8
8
 
9
9
  const mockCloseModal = jest.fn();
10
10
  const mockOpenmrsFetch = jest.mocked(openmrsFetch);
@@ -35,7 +35,7 @@ const EndVisitDialog: React.FC<EndVisitDialogProps> = ({ patientUuid, closeModal
35
35
  mutate();
36
36
  window.dispatchEvent(new CustomEvent('queue-entry-updated'));
37
37
  closeModal();
38
- if (visitContext?.uuid === activeVisit.uuid) {
38
+ if (visitContext?.uuid == activeVisit.uuid) {
39
39
  setVisitContext(null, null);
40
40
  }
41
41
  showSnackbar({
@@ -3,7 +3,7 @@ import userEvent from '@testing-library/user-event';
3
3
  import { screen, render } from '@testing-library/react';
4
4
  import { showSnackbar, updateVisit, useVisit, type Visit, type FetchResponse } from '@openmrs/esm-framework';
5
5
  import { mockCurrentVisit } from '__mocks__';
6
- import EndVisitDialog from './end-visit-dialog.component';
6
+ import EndVisitDialog from './end-visit-dialog.modal';
7
7
  import { usePatientChartStore } from '@openmrs/esm-patient-common-lib';
8
8
 
9
9
  const endVisitPayload = {
@@ -1,7 +1,7 @@
1
1
  import React, { useCallback } from 'react';
2
2
  import { useTranslation } from 'react-i18next';
3
3
  import { Button, ModalBody, ModalFooter, ModalHeader } from '@carbon/react';
4
- import { launchWorkspace } from '@openmrs/esm-framework';
4
+ import { launchWorkspace2 } from '@openmrs/esm-framework';
5
5
  import { launchPatientChartWithWorkspaceOpen } from '@openmrs/esm-patient-common-lib';
6
6
  import styles from './start-visit-dialog.scss';
7
7
 
@@ -9,9 +9,15 @@ interface StartVisitDialogProps {
9
9
  patientUuid: string;
10
10
  closeModal: () => void;
11
11
  launchPatientChart?: boolean;
12
+ onVisitStarted?: () => void;
12
13
  }
13
14
 
14
- const StartVisitDialog: React.FC<StartVisitDialogProps> = ({ patientUuid, closeModal, launchPatientChart }) => {
15
+ const StartVisitDialog: React.FC<StartVisitDialogProps> = ({
16
+ patientUuid,
17
+ closeModal,
18
+ launchPatientChart,
19
+ onVisitStarted,
20
+ }) => {
15
21
  const { t } = useTranslation();
16
22
 
17
23
  const handleStartNewVisit = useCallback(() => {
@@ -22,11 +28,11 @@ const StartVisitDialog: React.FC<StartVisitDialogProps> = ({ patientUuid, closeM
22
28
  additionalProps: { openedFrom: 'patient-chart-start-visit' },
23
29
  });
24
30
  } else {
25
- launchWorkspace('start-visit-workspace-form', { openedFrom: 'patient-chart-start-visit' });
31
+ launchWorkspace2('start-visit-workspace-form', { openedFrom: 'patient-chart-start-visit', onVisitStarted });
26
32
  }
27
33
 
28
34
  closeModal();
29
- }, [closeModal, patientUuid, launchPatientChart]);
35
+ }, [closeModal, patientUuid, launchPatientChart, onVisitStarted]);
30
36
 
31
37
  const modalHeaderText = t('noActiveVisit', 'No active visit');
32
38
 
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import { render, screen } from '@testing-library/react';
3
3
  import userEvent from '@testing-library/user-event';
4
- import { launchWorkspace } from '@openmrs/esm-framework';
5
- import StartVisitDialog from './start-visit-dialog.component';
4
+ import { launchWorkspace2 } from '@openmrs/esm-framework';
5
+ import StartVisitDialog from './start-visit-dialog.modal';
6
6
 
7
7
  const defaultProps = {
8
8
  patientUuid: 'some-uuid',
@@ -10,7 +10,7 @@ const defaultProps = {
10
10
  visitType: null,
11
11
  };
12
12
 
13
- const mockLaunchWorkspace = jest.mocked(launchWorkspace);
13
+ const mockLaunchWorkspace = jest.mocked(launchWorkspace2);
14
14
 
15
15
  describe('StartVisit', () => {
16
16
  test('should launch start visit form', async () => {
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { useTranslation } from 'react-i18next';
3
- import { launchWorkspace } from '@openmrs/esm-framework';
3
+ import { launchWorkspace2 } from '@openmrs/esm-framework';
4
4
  import { CardHeader, EmptyState, usePatientChartStore } from '@openmrs/esm-patient-common-lib';
5
5
  import VisitSummary from './past-visits-components/visit-summary.component';
6
6
  import styles from './current-visit-summary.scss';
@@ -25,9 +25,9 @@ const CurrentVisitSummary: React.FC<CurrentVisitSummaryProps> = ({ patientUuid }
25
25
  return (
26
26
  <EmptyState
27
27
  headerTitle={t('currentVisit', 'Current visit')}
28
- displayText={t('activeVisits__lower', 'active visits')}
28
+ displayText={t('noActiveVisitMessage', 'active visits')}
29
29
  launchForm={() =>
30
- launchWorkspace('start-visit-workspace-form', { openedFrom: 'patient-chart-current-visit-summary' })
30
+ launchWorkspace2('start-visit-workspace-form', { openedFrom: 'patient-chart-current-visit-summary' })
31
31
  }
32
32
  />
33
33
  );
@@ -27,7 +27,7 @@ import {
27
27
  import {
28
28
  EditIcon,
29
29
  isDesktop,
30
- launchWorkspace,
30
+ launchWorkspace2,
31
31
  showModal,
32
32
  showSnackbar,
33
33
  TrashCanIcon,
@@ -35,17 +35,11 @@ import {
35
35
  useLayoutType,
36
36
  userHasAccess,
37
37
  useSession,
38
- useVisit,
39
38
  type EncounterType,
40
39
  ExtensionSlot,
41
40
  useFeatureFlag,
42
41
  } from '@openmrs/esm-framework';
43
- import {
44
- type HtmlFormEntryForm,
45
- launchFormEntryOrHtmlForms,
46
- invalidateVisitAndEncounterData,
47
- usePatientChartStore,
48
- } from '@openmrs/esm-patient-common-lib';
42
+ import { invalidateVisitAndEncounterData, usePatientChartStore } from '@openmrs/esm-patient-common-lib';
49
43
  import { jsonSchemaResourceName } from '../../../../constants';
50
44
  import {
51
45
  deleteEncounter,
@@ -86,12 +80,7 @@ const EncountersTable: React.FC<EncountersTableProps> = ({
86
80
  const responsiveSize = desktopLayout ? 'sm' : 'lg';
87
81
  const { data: encounterTypes, isLoading: isLoadingEncounterTypes } = useEncounterTypes();
88
82
  const enableEmbeddedFormView = useFeatureFlag('enable-embedded-form-view');
89
-
90
83
  const { encounterEditableDuration, encounterEditableDurationOverridePrivileges } = useConfig<ChartConfig>();
91
- const formsConfig: { htmlFormEntryForms: HtmlFormEntryForm[] } = useConfig({
92
- externalModuleName: '@openmrs/esm-patient-forms-app',
93
- });
94
- const { htmlFormEntryForms } = formsConfig;
95
84
  const paginatedMappedEncounters = useMemo(
96
85
  () => (paginatedEncounters ?? []).map(mapEncounter).filter(Boolean),
97
86
  [paginatedEncounters],
@@ -270,22 +259,16 @@ const EncountersTable: React.FC<EncountersTableProps> = ({
270
259
  itemText={t('editThisEncounter', 'Edit this encounter')}
271
260
  onClick={() => {
272
261
  if (isVisitNoteEncounter(encounter)) {
273
- launchWorkspace('visit-notes-form-workspace', {
262
+ launchWorkspace2('visit-notes-form-workspace', {
274
263
  encounter,
275
264
  formContext: 'editing',
276
265
  patientUuid,
277
266
  });
278
267
  } else {
279
- launchFormEntryOrHtmlForms(
280
- htmlFormEntryForms,
281
- patientUuid,
282
- encounter.form,
283
- encounter.visitUuid,
284
- encounter.id,
285
- encounter.visitTypeUuid,
286
- encounter.visitStartDatetime,
287
- encounter.visitStopDatetime,
288
- );
268
+ launchWorkspace2('patient-form-entry-workspace', {
269
+ form: encounter.form,
270
+ encounterUuid: encounter.id,
271
+ });
289
272
  }
290
273
  }}
291
274
  />
@@ -327,22 +310,16 @@ const EncountersTable: React.FC<EncountersTableProps> = ({
327
310
  kind="ghost"
328
311
  onClick={() => {
329
312
  if (isVisitNoteEncounter(encounter)) {
330
- launchWorkspace('visit-notes-form-workspace', {
313
+ launchWorkspace2('visit-notes-form-workspace', {
331
314
  encounter,
332
315
  formContext: 'editing',
333
316
  patientUuid,
334
317
  });
335
318
  } else {
336
- launchFormEntryOrHtmlForms(
337
- htmlFormEntryForms,
338
- patientUuid,
339
- encounter.form,
340
- encounter.visitUuid,
341
- encounter.id,
342
- encounter.visitTypeUuid,
343
- encounter.visitStartDatetime,
344
- encounter.visitStopDatetime,
345
- );
319
+ launchWorkspace2('patient-form-entry-workspace', {
320
+ form: encounter.form,
321
+ encounterUuid: encounter.id,
322
+ });
346
323
  }
347
324
  }}
348
325
  renderIcon={(props: ComponentProps<typeof EditIcon>) => (
@@ -12,6 +12,7 @@ type FormValues = {
12
12
  };
13
13
 
14
14
  type RetrospectiveDateTimePickerProps = {
15
+ patientUuid: string;
15
16
  visitContext: Visit;
16
17
  control?: Control<FormValues>;
17
18
  onChange?: (data: FormValues) => void;
@@ -5,7 +5,7 @@ import { Button, ModalBody, ModalFooter, ModalHeader, RadioButton, InlineLoading
5
5
  import { useTranslation } from 'react-i18next';
6
6
  import {
7
7
  ErrorState,
8
- launchWorkspace,
8
+ launchWorkspace2,
9
9
  OpenmrsDatePicker,
10
10
  useDebounce,
11
11
  useOnVisible,
@@ -51,7 +51,7 @@ const VisitContextSwitcherModal: React.FC<VisitContextSwitcherProps> = ({
51
51
 
52
52
  const openStartVisitWorkspace = () => {
53
53
  closeModal();
54
- launchWorkspace('start-visit-workspace-form', {
54
+ launchWorkspace2('start-visit-workspace-form', {
55
55
  openedFrom: 'visit-context-switcher',
56
56
  });
57
57
  };
@@ -6,18 +6,35 @@ import { mockCurrentVisit, mockVisit2, mockVisit3 } from '__mocks__';
6
6
  import { useInfiniteVisits } from '../visit.resource';
7
7
  import VisitContextSwitcherModal from './visit-context-switcher.modal';
8
8
 
9
- const mockUseInfiniteVisits = jest.fn(useInfiniteVisits);
9
+ const mockUseSystemVisitSetting = jest.fn(useSystemVisitSetting).mockReturnValue({
10
+ errorFetchingSystemVisitSetting: null,
11
+ isLoadingSystemVisitSetting: false,
12
+ systemVisitEnabled: true,
13
+ });
14
+
15
+ const mockUseInfiniteVisits = jest.fn(useInfiniteVisits).mockReturnValue({
16
+ visits: [mockCurrentVisit, mockVisit2, mockVisit3],
17
+ error: null,
18
+ mutate: jest.fn(),
19
+ isValidating: false,
20
+ isLoading: false,
21
+ totalCount: 3,
22
+ hasMore: false,
23
+ loadMore: jest.fn(),
24
+ nextUri: '',
25
+ });
26
+
27
+ jest.mock('@openmrs/esm-patient-common-lib/src/useSystemVisitSetting', () => ({
28
+ useSystemVisitSetting: () => mockUseSystemVisitSetting(),
29
+ }));
10
30
 
11
31
  jest.mock('../visit.resource', () => ({
12
32
  useInfiniteVisits: () => mockUseInfiniteVisits('some-uuid'),
13
33
  }));
14
34
 
15
35
  const mockSetVisitContext = jest.fn();
16
- const mockUseSystemVisitSetting = jest.fn(useSystemVisitSetting);
17
-
18
36
  jest.mock('@openmrs/esm-patient-common-lib', () => ({
19
37
  ...jest.requireActual('@openmrs/esm-patient-common-lib'),
20
- useSystemVisitSetting: jest.fn(),
21
38
  usePatientChartStore: jest.fn(() => ({
22
39
  visitContext: null,
23
40
  setVisitContext: mockSetVisitContext,
@@ -26,22 +43,7 @@ jest.mock('@openmrs/esm-patient-common-lib', () => ({
26
43
 
27
44
  describe('VisitContextSwitcherModal', () => {
28
45
  beforeEach(() => {
29
- mockUseInfiniteVisits.mockReturnValue({
30
- visits: [mockCurrentVisit, mockVisit2, mockVisit3],
31
- error: null,
32
- mutate: jest.fn(),
33
- isValidating: false,
34
- isLoading: false,
35
- totalCount: 3,
36
- hasMore: false,
37
- loadMore: jest.fn(),
38
- nextUri: '',
39
- });
40
- mockUseSystemVisitSetting.mockReturnValue({
41
- errorFetchingSystemVisitSetting: null,
42
- isLoadingSystemVisitSetting: false,
43
- systemVisitEnabled: true,
44
- });
46
+ jest.clearAllMocks();
45
47
  });
46
48
 
47
49
  it('should display a list of past visits', () => {
@@ -9,9 +9,10 @@ import styles from './visit-detail-overview.scss';
9
9
 
10
10
  interface VisitOverviewComponentProps {
11
11
  patientUuid: string;
12
+ patient: fhir.Patient;
12
13
  }
13
14
 
14
- function VisitDetailOverviewComponent({ patientUuid }: VisitOverviewComponentProps) {
15
+ function VisitDetailOverviewComponent({ patientUuid, patient }: VisitOverviewComponentProps) {
15
16
  const { t } = useTranslation();
16
17
  const [tabIndex, setTabIndex] = useState(0);
17
18
  const { showAllEncountersTab } = useConfig<ChartConfig>();
@@ -33,7 +34,7 @@ function VisitDetailOverviewComponent({ patientUuid }: VisitOverviewComponentPro
33
34
  </TabList>
34
35
  <TabPanels>
35
36
  <TabPanel>
36
- <VisitHistoryTable patientUuid={patientUuid} />
37
+ <VisitHistoryTable patientUuid={patientUuid} patient={patient} />
37
38
  </TabPanel>
38
39
  {showAllEncountersTab && (
39
40
  <TabPanel>
@@ -82,7 +82,7 @@ describe('VisitDetailOverview', () => {
82
82
  });
83
83
  mockGetConfig.mockResolvedValue({ htmlFormEntryForms: [] });
84
84
 
85
- renderWithSwr(<VisitDetailOverview patientUuid={mockPatient.id} />);
85
+ renderWithSwr(<VisitDetailOverview patientUuid={mockPatient.id} patient={mockPatient} />);
86
86
 
87
87
  await waitForLoadingToFinish();
88
88
 
@@ -106,7 +106,7 @@ describe('VisitDetailOverview', () => {
106
106
  error,
107
107
  });
108
108
 
109
- renderWithSwr(<VisitDetailOverview patientUuid={mockPatient.id} />);
109
+ renderWithSwr(<VisitDetailOverview patientUuid={mockPatient.id} patient={mockPatient} />);
110
110
 
111
111
  await waitForLoadingToFinish();
112
112
 
@@ -125,7 +125,7 @@ describe('VisitDetailOverview', () => {
125
125
  });
126
126
  mockUsePaginatedVisits.mockReturnValue(mockPaginatedVisitsData);
127
127
 
128
- renderWithSwr(<VisitDetailOverview patientUuid={mockPatient.id} />);
128
+ renderWithSwr(<VisitDetailOverview patientUuid={mockPatient.id} patient={mockPatient} />);
129
129
 
130
130
  await waitForLoadingToFinish();
131
131
 
@@ -161,7 +161,7 @@ describe('VisitDetailOverview', () => {
161
161
  });
162
162
  mockUsePaginatedVisits.mockReturnValue(mockPaginatedVisitsData);
163
163
 
164
- renderWithSwr(<VisitDetailOverview patientUuid={mockPatient.id} />);
164
+ renderWithSwr(<VisitDetailOverview patientUuid={mockPatient.id} patient={mockPatient} />);
165
165
 
166
166
  await waitForLoadingToFinish();
167
167
 
@@ -1,6 +1,5 @@
1
1
  {
2
2
  "actions": "Actions",
3
- "activeVisits__lower": "active visits",
4
3
  "addingToVisit": "Adding to:",
5
4
  "additionalVisitInformationUpdatedSuccessfully": "Additional visit information updated successfully",
6
5
  "addVisit": "Add visit",
@@ -99,6 +98,7 @@
99
98
  "nextPage": "Next page",
100
99
  "no": "No",
101
100
  "noActiveVisit": "No Active Visit",
101
+ "noActiveVisitMessage": "active visit",
102
102
  "noActiveVisitNoRDEText": "You can't add data to the patient chart without an active visit. Would you like to start a new visit?",
103
103
  "noDiagnosesFound": "No diagnoses found",
104
104
  "noEncountersToDisplay": "No encounters to display",
package/dist/276.js DELETED
@@ -1 +0,0 @@
1
- "use strict";(globalThis.webpackChunk_openmrs_esm_patient_chart_app=globalThis.webpackChunk_openmrs_esm_patient_chart_app||[]).push([[276],{10276:(n,e,t)=>{t.r(e),t.d(e,{default:()=>z});var a=t(1343),i=t.n(a),o=t(72339),s=t(75198),l=t(54440),p=t(63276),r=t(72591),c=t.n(r),d=t(1740),u=t.n(d),f=t(88128),h=t.n(f),g=t(30855),y=t.n(g),b=t(93051),$=t.n(b),m=t(73656),v=t.n(m),w=t(29533),k={};k.styleTagTransform=v(),k.setAttributes=y(),k.insert=h().bind(null,"head"),k.domAPI=u(),k.insertStyleElement=$(),c()(w.A,k);const x=w.A&&w.A.locals?w.A.locals:void 0,z=function(n){var e=n.patientUuid,t=n.closeModal,a=(0,o.useTranslation)().t,r=(0,l.useVisit)(e),c=r.activeVisit,d=r.mutate,u=(0,p.usePatientChartStore)(e),f=u.visitContext,h=u.setVisitContext;return i().createElement("div",null,i().createElement(s.ModalHeader,{closeModal:t,title:a("endActiveVisitConfirmation","Are you sure you want to end this active visit?")}),i().createElement(s.ModalBody,null,i().createElement("p",{className:x.bodyShort02},a("youCanAddAdditionalEncounters","You can add additional encounters to this visit in the visit summary."))),i().createElement(s.ModalFooter,null,i().createElement(s.Button,{kind:"secondary",onClick:t},a("cancel","Cancel")),i().createElement(s.Button,{kind:"danger",onClick:function(){if(c){var n={stopDatetime:new Date},e=new AbortController;(0,l.updateVisit)(c.uuid,n,e).then((function(n){var e,i;d(),window.dispatchEvent(new CustomEvent("queue-entry-updated")),t(),(null==f?void 0:f.uuid)===c.uuid&&h(null,null),(0,l.showSnackbar)({isLowContrast:!0,kind:"success",subtitle:a("visitEndSuccessfully","".concat(null==n||null===(i=n.data)||void 0===i||null===(e=i.visitType)||void 0===e?void 0:e.display," ended successfully")),title:a("visitEnded","Visit ended")})})).catch((function(n){(0,l.showSnackbar)({title:a("errorEndingVisit","Error ending visit"),kind:"error",isLowContrast:!1,subtitle:null==n?void 0:n.message})}))}}},a("endVisit_title","End Visit"))))}},29533:(n,e,t)=>{t.d(e,{A:()=>l});var a=t(30977),i=t.n(a),o=t(95924),s=t.n(o)()(i());s.push([n.id,":root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79;--bottom-nav-height: 4rem;--workspace-header-height: 3rem;--tablet-workspace-window-height: calc(100vh - var(--omrs-navbar-height) - var(--bottom-nav-height));--desktop-workspace-window-height: calc(100vh - var(--omrs-navbar-height) - var(--workspace-header-height))}.-esm-patient-chart__end-visit-dialog__bodyShort02___XB3Mu{font-size:var(--cds-body-compact-02-font-size, 1rem);font-weight:var(--cds-body-compact-02-font-weight, 400);line-height:var(--cds-body-compact-02-line-height, 1.375);letter-spacing:var(--cds-body-compact-02-letter-spacing, 0);color:#161616}","",{version:3,sources:["webpack://./../../node_modules/@openmrs/esm-styleguide/src/_vars.scss","webpack://./src/visit/visit-prompt/end-visit-dialog.scss","webpack://./../../node_modules/@carbon/type/scss/_styles.scss"],names:[],mappings:"AAsDA,MACE,mBAAA,CACA,mBAAA,CACA,mBAAA,CACA,yBAAA,CACA,+BAAA,CACA,oGAAA,CACA,2GAAA,CC1DF,2DC+1BI,oDAAA,CAAA,uDAAA,CAAA,yDAAA,CAAA,2DAAA,CD71BF,aDCM",sourcesContent:["@use '@carbon/layout';\n\n$ui-01: #f4f4f4;\n$ui-02: #ffffff;\n$ui-03: #e0e0e0;\n$ui-04: #8d8d8d;\n$ui-05: #161616;\n$text-02: #525252;\n$text-03: #a8a8a8;\n$ui-background: #ffffff;\n$color-gray-30: #c6c6c6;\n$color-gray-70: #525252;\n$color-gray-100: #161616;\n$color-blue-60-2: #0f62fe;\n$color-blue-10: #edf5ff;\n$color-yellow-50: #feecae;\n$carbon--red-50: #fa4d56;\n$inverse-link: #78a9ff;\n$support-02: #24a148;\n$inverse-support-03: #f1c21b;\n$warning-background: #fff8e1;\n$openmrs-background-grey: #f4f4f4;\n$danger: #da1e28;\n$interactive-01: #0f62fe;\n$field-01: #f4f4f4;\n$grey-2: #e0e0e0;\n$labeldropdown: #c6c6c6;\n\n$brand-primary-10: #d9fbfb;\n$brand-primary-20: #9ef0f0;\n$brand-primary-30: #3ddbd9;\n$brand-primary-40: #08bdba;\n$brand-primary-50: #009d9a;\n\n/* 60,70 and 80 are already declared as brand-01, 02 and 03 respectively */\n\n$brand-primary-90: #022b30;\n$brand-primary-100: #081a1c;\n\n@mixin brand-01($property) {\n #{$property}: #005d5d;\n #{$property}: var(--brand-01);\n}\n\n@mixin brand-02($property) {\n #{$property}: #004144;\n #{$property}: var(--brand-02);\n}\n\n@mixin brand-03($property) {\n #{$property}: #007d79;\n #{$property}: var(--brand-03);\n}\n\n:root {\n --brand-01: #005d5d;\n --brand-02: #004144;\n --brand-03: #007d79;\n --bottom-nav-height: #{layout.$spacing-10};\n --workspace-header-height: #{layout.$spacing-09};\n --tablet-workspace-window-height: calc(100vh - var(--omrs-navbar-height) - var(--bottom-nav-height));\n --desktop-workspace-window-height: calc(100vh - var(--omrs-navbar-height) - var(--workspace-header-height));\n}\n\n$breakpoint-phone-min: 0px;\n$breakpoint-phone-max: 600px;\n$breakpoint-tablet-min: 601px;\n$breakpoint-tablet-max: 1023px;\n$breakpoint-small-desktop-min: 1024px;\n$breakpoint-small-desktop-max: 1439px;\n$breakpoint-large-desktop-min: 1440px;\n$breakpoint-large-desktop-max: 99999999px;\n\n/* These color variables will be removed in a future release */\n$brand-teal-01: #007d79;\n$brand-01: #005d5d;\n$brand-02: #004144;\n","@use '@carbon/type';\n@use '@openmrs/esm-styleguide/src/vars' as *;\n\n.bodyShort02 {\n @include type.type-style('body-compact-02');\n color: $ui-05;\n}\n","//\n// Copyright IBM Corp. 2018, 2023\n//\n// This source code is licensed under the Apache-2.0 license found in the\n// LICENSE file in the root directory of this source tree.\n//\n\n// stylelint-disable number-max-precision\n\n@use 'sass:map';\n@use 'sass:math';\n@use '@carbon/grid/scss/config' as gridconfig;\n@use '@carbon/grid/scss/breakpoint' as grid;\n@use 'prefix' as *;\n@use 'font-family';\n@use 'scale';\n\n/// @type Map\n/// @access public\n/// @deprecated\n/// @group @carbon/type\n$caption-01: (\n font-size: scale.type-scale(1),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.33333,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @deprecated\n/// @group @carbon/type\n$caption-02: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$label-01: (\n font-size: scale.type-scale(1),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.33333,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$label-02: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$legal-01: (\n font-size: scale.type-scale(1),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.33333,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$legal-02: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @deprecated\n/// @group @carbon/type\n$helper-text-01: (\n font-size: scale.type-scale(1),\n line-height: 1.33333,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @deprecated\n/// @group @carbon/type\n$helper-text-02: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-short-01: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-compact-01: $body-short-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-long-01: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.42857,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-01: $body-long-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-short-02: (\n font-size: scale.type-scale(3),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.375,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-compact-02: $body-short-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-long-02: (\n font-size: scale.type-scale(3),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.5,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-02: $body-long-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$code-01: (\n font-family: font-family.font-family('mono'),\n font-size: scale.type-scale(1),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.33333,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$code-02: (\n font-family: font-family.font-family('mono'),\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.42857,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-01: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.42857,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-01: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.28572,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-compact-01: $productive-heading-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-02: (\n font-size: scale.type-scale(3),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.5,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-02: (\n font-size: scale.type-scale(3),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.375,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-compact-02: $productive-heading-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-03: (\n font-size: scale.type-scale(5),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.4,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-03: $productive-heading-03 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-04: (\n font-size: scale.type-scale(7),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-04: $productive-heading-04 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-05: (\n font-size: scale.type-scale(8),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.25,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-05: $productive-heading-05 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-06: (\n font-size: scale.type-scale(10),\n font-weight: font-family.font-weight('light'),\n // Extra digit needed for precision in Chrome\n line-height: 1.199,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-06: $productive-heading-06 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-07: (\n font-size: scale.type-scale(12),\n font-weight: font-family.font-weight('light'),\n line-height: 1.19,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-07: $productive-heading-07 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-01: $heading-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-02: $heading-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-03: (\n font-size: scale.type-scale(5),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.4,\n letter-spacing: 0,\n breakpoints: (\n xlg: (\n font-size: scale.type-scale(5),\n line-height: 1.4,\n ),\n max: (\n font-size: scale.type-scale(6),\n line-height: 1.334,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-heading-03: $expressive-heading-03 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-04: (\n font-size: scale.type-scale(7),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0,\n breakpoints: (\n xlg: (\n font-size: scale.type-scale(8),\n line-height: 1.25,\n font-weight: font-family.font-weight('regular'),\n ),\n max: (\n font-size: scale.type-scale(8),\n font-weight: font-family.font-weight('regular'),\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-heading-04: $expressive-heading-04 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-05: (\n font-size: scale.type-scale(8),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.25,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(9),\n font-weight: font-family.font-weight('light'),\n line-height: 1.22,\n ),\n lg: (\n font-size: scale.type-scale(10),\n line-height: 1.19,\n ),\n xlg: (\n font-size: scale.type-scale(11),\n line-height: 1.17,\n ),\n max: (\n font-size: scale.type-scale(13),\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-heading-05: $expressive-heading-05 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-06: (\n font-size: scale.type-scale(8),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.25,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(9),\n line-height: 1.22,\n ),\n lg: (\n font-size: scale.type-scale(10),\n line-height: 1.19,\n ),\n xlg: (\n font-size: scale.type-scale(11),\n line-height: 1.17,\n ),\n max: (\n font-size: scale.type-scale(13),\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-heading-06: $expressive-heading-06 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-paragraph-01: (\n font-size: scale.type-scale(6),\n font-weight: font-family.font-weight('light'),\n line-height: 1.334,\n letter-spacing: 0,\n breakpoints: (\n lg: (\n font-size: scale.type-scale(7),\n line-height: 1.28572,\n ),\n max: (\n font-size: scale.type-scale(8),\n line-height: 1.25,\n ),\n ),\n);\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-paragraph-01: $expressive-paragraph-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$quotation-01: (\n font-family: font-family.font-family('serif'),\n font-size: scale.type-scale(5),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.3,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(5),\n ),\n lg: (\n font-size: scale.type-scale(6),\n line-height: 1.334,\n ),\n xlg: (\n font-size: scale.type-scale(7),\n line-height: 1.28572,\n ),\n max: (\n font-size: scale.type-scale(8),\n line-height: 1.25,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-quotation-01: $quotation-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$quotation-02: (\n font-family: font-family.font-family('serif'),\n font-size: scale.type-scale(8),\n font-weight: font-family.font-weight('light'),\n line-height: 1.25,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(9),\n line-height: 1.22,\n ),\n lg: (\n font-size: scale.type-scale(10),\n line-height: 1.19,\n ),\n xlg: (\n font-size: scale.type-scale(11),\n line-height: 1.17,\n ),\n max: (\n font-size: scale.type-scale(13),\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-quotation-02: $quotation-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$display-01: (\n font-size: scale.type-scale(10),\n font-weight: font-family.font-weight('light'),\n line-height: 1.19,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(10),\n ),\n lg: (\n font-size: scale.type-scale(12),\n ),\n xlg: (\n font-size: scale.type-scale(13),\n line-height: 1.17,\n ),\n max: (\n font-size: scale.type-scale(15),\n line-height: 1.13,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-display-01: $display-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$display-02: (\n font-size: scale.type-scale(10),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.19,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(10),\n ),\n lg: (\n font-size: scale.type-scale(12),\n ),\n xlg: (\n font-size: scale.type-scale(13),\n line-height: 1.16,\n ),\n max: (\n font-size: scale.type-scale(15),\n line-height: 1.13,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-display-02: $display-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$display-03: (\n font-size: scale.type-scale(10),\n font-weight: font-family.font-weight('light'),\n line-height: 1.19,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(12),\n line-height: 1.18,\n ),\n lg: (\n font-size: scale.type-scale(13),\n line-height: 1.16,\n letter-spacing: -0.64px,\n ),\n xlg: (\n font-size: scale.type-scale(15),\n line-height: 1.13,\n letter-spacing: -0.64px,\n ),\n max: (\n font-size: scale.type-scale(16),\n line-height: 1.11,\n letter-spacing: -0.96px,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-display-03: $display-03 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$display-04: (\n font-size: scale.type-scale(10),\n font-weight: font-family.font-weight('light'),\n line-height: 1.19,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(14),\n line-height: 1.15,\n ),\n lg: (\n font-size: scale.type-scale(17),\n line-height: 1.11,\n letter-spacing: -0.64px,\n ),\n xlg: (\n font-size: scale.type-scale(20),\n line-height: 1.07,\n letter-spacing: -0.64px,\n ),\n max: (\n font-size: scale.type-scale(23),\n line-height: 1.05,\n letter-spacing: -0.96px,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-display-04: $display-04 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$tokens: (\n caption-01: $caption-01,\n caption-02: $caption-02,\n label-01: $label-01,\n label-02: $label-02,\n helper-text-01: $helper-text-01,\n helper-text-02: $helper-text-02,\n body-short-01: $body-short-01,\n body-short-02: $body-short-02,\n body-long-01: $body-long-01,\n body-long-02: $body-long-02,\n code-01: $code-01,\n code-02: $code-02,\n heading-01: $heading-01,\n heading-02: $heading-02,\n productive-heading-01: $productive-heading-01,\n productive-heading-02: $productive-heading-02,\n productive-heading-03: $productive-heading-03,\n productive-heading-04: $productive-heading-04,\n productive-heading-05: $productive-heading-05,\n productive-heading-06: $productive-heading-06,\n productive-heading-07: $productive-heading-07,\n expressive-paragraph-01: $expressive-paragraph-01,\n expressive-heading-01: $expressive-heading-01,\n expressive-heading-02: $expressive-heading-02,\n expressive-heading-03: $expressive-heading-03,\n expressive-heading-04: $expressive-heading-04,\n expressive-heading-05: $expressive-heading-05,\n expressive-heading-06: $expressive-heading-06,\n quotation-01: $quotation-01,\n quotation-02: $quotation-02,\n display-01: $display-01,\n display-02: $display-02,\n display-03: $display-03,\n display-04: $display-04,\n // V11 Tokens\n legal-01: $legal-01,\n legal-02: $legal-02,\n body-compact-01: $body-compact-01,\n body-compact-02: $body-compact-02,\n heading-compact-01: $heading-compact-01,\n heading-compact-02: $heading-compact-02,\n body-01: $body-01,\n body-02: $body-02,\n heading-03: $heading-03,\n heading-04: $heading-04,\n heading-05: $heading-05,\n heading-06: $heading-06,\n heading-07: $heading-07,\n fluid-heading-03: $fluid-heading-03,\n fluid-heading-04: $fluid-heading-04,\n fluid-heading-05: $fluid-heading-05,\n fluid-heading-06: $fluid-heading-06,\n fluid-paragraph-01: $fluid-paragraph-01,\n fluid-quotation-01: $fluid-quotation-01,\n fluid-quotation-02: $fluid-quotation-02,\n fluid-display-01: $fluid-display-01,\n fluid-display-02: $fluid-display-02,\n fluid-display-03: $fluid-display-03,\n fluid-display-04: $fluid-display-04,\n) !default;\n\n/// @param {Map} $map\n/// @access public\n/// @group @carbon/type\n@mixin properties($map) {\n @each $name, $value in $map {\n #{$name}: $value;\n }\n}\n\n/// @param {Number} $value - Number with units\n/// @return {Number} Without units\n/// @access public\n/// @group @carbon/type\n@function strip-unit($value) {\n @return math.div($value, $value * 0 + 1);\n}\n\n/// This helper includes fluid type styles for the given token value. Fluid type\n/// means that the `font-size` is computed using `calc()` in order to be\n/// determined by the screen size instead of a breakpoint. As a result, fluid\n/// styles should be used with caution in fixed width contexts.\n///\n/// In addition, we make use of %-based line-heights so that the line-height of\n/// each type style is computed correctly due to the dynamic nature of the\n/// `font-size`.\n///\n/// Most of the logic for this work comes from CSS Tricks:\n/// https://css-tricks.com/snippets/css/fluid-typography/\n///\n/// @param {Map} $type-styles - The value of a given type token\n/// @param {Map} $breakpoints [$grid-breakpoints] - Custom breakpoints to use\n/// @access public\n/// @group @carbon/type\n@mixin fluid-type($type-styles, $breakpoints: gridconfig.$grid-breakpoints) {\n // Include the initial styles for the given token by default without any\n // media query guard. This includes `font-size` as a fallback in the case\n // that a browser does not support `calc()`\n @include properties(map.remove($type-styles, breakpoints));\n // We also need to include the `sm` styles by default since they don't\n // appear in the fluid styles for tokens\n @include fluid-type-size($type-styles, sm, $breakpoints);\n\n // Finally, we need to go through all the breakpoints defined in the type\n // token and apply the properties and fluid type size for that given\n // breakpoint\n @each $name, $values in map.get($type-styles, breakpoints) {\n @include grid.breakpoint($name) {\n @include properties($values);\n @include fluid-type-size($type-styles, $name, $breakpoints);\n }\n }\n}\n\n/// Computes the fluid `font-size` for a given type style and breakpoint\n/// @param {Map} $type-styles - The styles for a given token\n/// @param {String} $name - The name of the breakpoint to which we apply the fluid\n/// @param {Map} $breakpoints [$grid-breakpoints] - The breakpoints for the grid system\n/// @access public\n/// @group @carbon/type\n@mixin fluid-type-size(\n $type-styles,\n $name,\n $breakpoints: gridconfig.$grid-breakpoints\n) {\n // Get the information about the breakpoint we're currently working in. Useful\n // for getting initial width information\n $breakpoint: map.get($breakpoints, $name);\n\n // Our fluid styles are captured under the 'breakpoints' property in our type\n // styles map. These define what values to treat as `max-` variables below\n $fluid-sizes: map.get($type-styles, breakpoints);\n $fluid-breakpoint: ();\n // Special case for `sm` because the styles for small are on the type style\n // directly\n @if $name == sm {\n $fluid-breakpoint: map.remove($type-styles, breakpoints);\n } @else {\n $fluid-breakpoint: map.get($fluid-sizes, $name);\n }\n\n // Initialize our font-sizes to the default size for the type style\n $max-font-size: map.get($type-styles, font-size);\n $min-font-size: map.get($type-styles, font-size);\n @if map.has-key($fluid-breakpoint, font-size) {\n $min-font-size: map.get($fluid-breakpoint, font-size);\n }\n\n // Initialize our min and max width to the width of the current breakpoint\n $max-vw: map.get($breakpoint, width);\n $min-vw: map.get($breakpoint, width);\n\n // We can use `breakpoint-next` to see if there is another breakpoint we can\n // use to update `max-font-size` and `max-vw` with larger values\n $next-breakpoint-available: grid.breakpoint-next($name, $breakpoints);\n $next-fluid-breakpoint-name: null;\n\n // We need to figure out what the next available fluid breakpoint is for our\n // given $type-styles. In this loop we try and iterate through breakpoints\n // until we either manually set $next-breakpoint-available to null or\n // `breakpoint-next` returns null.\n @while $next-breakpoint-available {\n @if map.has-key($fluid-sizes, $next-breakpoint-available) {\n $next-fluid-breakpoint-name: $next-breakpoint-available;\n $next-breakpoint-available: null;\n } @else {\n $next-breakpoint-available: grid.breakpoint-next(\n $next-breakpoint-available,\n $breakpoints\n );\n }\n }\n\n // If we have found the next available fluid breakpoint name, then we know\n // that we have values that we can use to set max-font-size and max-vw as both\n // values derive from the next breakpoint\n @if $next-fluid-breakpoint-name {\n $next-fluid-breakpoint: map.get($breakpoints, $next-fluid-breakpoint-name);\n $max-font-size: map.get(\n map.get($fluid-sizes, $next-fluid-breakpoint-name),\n font-size\n );\n $max-vw: map.get($next-fluid-breakpoint, width);\n\n // prettier-ignore\n font-size: calc(#{$min-font-size} +\n #{strip-unit($max-font-size - $min-font-size)} *\n ((100vw - #{$min-vw}) / #{strip-unit($max-vw - $min-vw)})\n );\n } @else {\n // Otherwise, just default to setting the font size found from the type\n // style or the given fluid breakpoint in the type style\n font-size: $min-font-size;\n }\n}\n\n// TODO move following variable and `custom-property` mixin into shared file for\n// both `@carbon/type` and `@carbon/themes`\n\n/// @access private\n/// @group @carbon/type\n@mixin custom-properties($name, $value) {\n @each $property, $value in $value {\n #{$property}: var(\n --#{$custom-property-prefix}-#{$name}-#{$property},\n #{$value}\n );\n }\n}\n\n/// Helper mixin to include the styles for a given token in any selector in your\n/// project. Also includes an optional fluid option that will enable fluid\n/// styles for the token if they are defined. Fluid styles will cause the\n/// token's font-size to be computed based on the viewport size. As a result, use\n/// with caution in fixed contexts.\n/// @param {String} $name - The name of the token to get the styles for\n/// @param {Boolean} $fluid [false] - Specify whether to include fluid styles for the\n/// @param {Map} $breakpoints [$grid-breakpoints] - Provide a custom breakpoint map to use\n/// @access public\n/// @group @carbon/type\n@mixin type-style(\n $name,\n $fluid: false,\n $breakpoints: gridconfig.$grid-breakpoints\n) {\n @if not map.has-key($tokens, $name) {\n @error 'Unable to find a token with the name: `#{$name}`';\n }\n\n $token: map.get($tokens, $name);\n\n // If $fluid is set to true and the token has breakpoints defined for fluid\n // styles, delegate to the fluid-type helper for the given token\n @if $fluid == true and map.has-key($token, 'breakpoints') {\n @include fluid-type($token, $breakpoints);\n } @else {\n @include custom-properties($name, $token);\n }\n}\n"],sourceRoot:""}]),s.locals={bodyShort02:"-esm-patient-chart__end-visit-dialog__bodyShort02___XB3Mu"};const l=s}}]);
package/dist/276.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"276.js","mappings":"+XAWIA,EAAU,CAAC,EAEfA,EAAQC,kBAAoB,IAC5BD,EAAQE,cAAgB,IAElBF,EAAQG,OAAS,SAAc,KAAM,QAE3CH,EAAQI,OAAS,IACjBJ,EAAQK,mBAAqB,IAEhB,IAAI,IAASL,GAKnB,QAAe,KAAW,IAAQM,OAAS,IAAQA,YAASC,ECuDnE,EA9DsD,Y,IAAGC,EAAAA,EAAAA,YAAaC,EAAAA,EAAAA,WAC9D,GAAQC,EAAAA,EAAAA,kBAANC,EACwBC,GAAAA,EAAAA,EAAAA,UAASJ,GAAjCK,EAAwBD,EAAxBC,YAAaC,EAAWF,EAAXE,OACqBC,GAAAA,EAAAA,EAAAA,sBAAqBP,GAAvDQ,EAAkCD,EAAlCC,aAAcC,EAAoBF,EAApBE,gBAoCtB,OACE,kBAACC,MAAAA,KACC,kBAACC,EAAAA,YAAWA,CACVV,WAAYA,EACZW,MAAOT,EAAE,6BAA8B,qDAEzC,kBAACU,EAAAA,UAASA,KACR,kBAACC,IAAAA,CAAEC,UAAWC,EAAOC,aAClBd,EAAE,gCAAiC,2EAGxC,kBAACe,EAAAA,YAAWA,KACV,kBAACC,EAAAA,OAAMA,CAACC,KAAK,YAAYC,QAASpB,GAC/BE,EAAE,SAAU,WAEf,kBAACgB,EAAAA,OAAMA,CAACC,KAAK,SAASC,QAjDL,WACrB,GAAIhB,EAAa,CACf,IAAMiB,EAAkB,CACtBC,aAAc,IAAIC,MAGdC,EAAkB,IAAIC,iBAE5BC,EAAAA,EAAAA,aAAYtB,EAAYuB,KAAMN,EAAiBG,GAC5CI,MAAK,SAACC,G,IAUoCA,EAAAA,EATzCxB,IACAyB,OAAOC,cAAc,IAAIC,YAAY,wBACrChC,KACIO,aAAAA,EAAAA,EAAcoB,QAASvB,EAAYuB,MACrCnB,EAAgB,KAAM,OAExByB,EAAAA,EAAAA,cAAa,CACXC,eAAe,EACff,KAAM,UACNgB,SAAUjC,EAAE,uBAAwB,GAAsC,OAAnC2B,SAAc,QAAdA,EAAAA,EAAUO,YAAVP,IAAAA,GAAyB,QAAzBA,EAAAA,EAAgBQ,iBAAhBR,IAAAA,OAAAA,EAAAA,EAA2BS,QAAQ,wBAC1E3B,MAAOT,EAAE,aAAc,gBAE3B,IACCqC,OAAM,SAACC,IACNP,EAAAA,EAAAA,cAAa,CACXtB,MAAOT,EAAE,mBAAoB,sBAC7BiB,KAAM,QACNe,eAAe,EACfC,SAAUK,aAAAA,EAAAA,EAAOC,SAErB,GACJ,CACF,GAkBSvC,EAAE,iBAAkB,eAK/B,C,sEC5EIwC,E,MAA0B,GAA4B,KAE1DA,EAAwBC,KAAK,CAACC,EAAOC,GAAI,4nBAA6nB,GAAG,CAAC,QAAU,EAAE,QAAU,CAAC,wEAAwE,2DAA2D,iEAAiE,MAAQ,GAAG,SAAW,sJAAsJ,eAAiB,CAAC,g/DAAg/D,+JAA+J,w8uBAAw8uB,WAAa,MAEvq1BH,EAAwB7C,OAAS,CAChC,YAAe,6DAEhB,S","sources":["webpack://@openmrs/esm-patient-chart-app/./src/visit/visit-prompt/end-visit-dialog.scss?0b7a","webpack://@openmrs/esm-patient-chart-app/./src/visit/visit-prompt/end-visit-dialog.component.tsx","webpack://@openmrs/esm-patient-chart-app/./src/visit/visit-prompt/end-visit-dialog.scss"],"names":["options","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","locals","undefined","patientUuid","closeModal","useTranslation","t","useVisit","activeVisit","mutate","usePatientChartStore","visitContext","setVisitContext","div","ModalHeader","title","ModalBody","p","className","styles","bodyShort02","ModalFooter","Button","kind","onClick","endVisitPayload","stopDatetime","Date","abortController","AbortController","updateVisit","uuid","then","response","window","dispatchEvent","CustomEvent","showSnackbar","isLowContrast","subtitle","data","visitType","display","catch","error","message","___CSS_LOADER_EXPORT___","push","module","id"],"sourceRoot":""}
package/dist/3905.js DELETED
@@ -1 +0,0 @@
1
- "use strict";(globalThis.webpackChunk_openmrs_esm_patient_chart_app=globalThis.webpackChunk_openmrs_esm_patient_chart_app||[]).push([[3905],{93905:(t,e,a)=>{a.r(e),a.d(e,{default:()=>p});var n=a(1343),i=a.n(n),o=a(72339),r=a(75198),s=a(54440),c=a(63276),l=a(8112);const p=function(t){var e=t.patientUuid,a=t.closeModal,p=t.launchPatientChart,d=(0,o.useTranslation)().t,u=(0,n.useCallback)((function(){p?(0,c.launchPatientChartWithWorkspaceOpen)({patientUuid:e,workspaceName:"start-visit-workspace-form",additionalProps:{openedFrom:"patient-chart-start-visit"}}):(0,s.launchWorkspace)("start-visit-workspace-form",{openedFrom:"patient-chart-start-visit"}),a()}),[a,e,p]),m=d("noActiveVisit","No active visit"),h=d("noActiveVisitNoRDEText","You can't add data to the patient chart without an active visit. Would you like to start a new visit?");return i().createElement("div",null,i().createElement(r.ModalHeader,{closeModal:a},i().createElement("span",{className:l.A.header},m)),i().createElement(r.ModalBody,null,i().createElement("p",{className:l.A.body},h)),i().createElement(r.ModalFooter,null,i().createElement(r.Button,{kind:"secondary",onClick:a},d("cancel","Cancel")),i().createElement(r.Button,{kind:"primary",onClick:u},d("startNewVisit","Start new visit"))))}}}]);
package/dist/3905.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"3905.js","mappings":"wQAyDA,QA5C0D,Y,IAAGA,EAAAA,EAAAA,YAAaC,EAAAA,EAAAA,WAAYC,EAAAA,EAAAA,mBAC9E,GAAQC,EAAAA,EAAAA,kBAANC,EAEFC,GAAsBC,EAAAA,EAAAA,cAAY,WAClCJ,GACFK,EAAAA,EAAAA,qCAAoC,CAClCP,YAAAA,EACAQ,cAAe,6BACfC,gBAAiB,CAAEC,WAAY,gCAGjCC,EAAAA,EAAAA,iBAAgB,6BAA8B,CAAED,WAAY,8BAG9DT,GACF,GAAG,CAACA,EAAYD,EAAaE,IAEvBU,EAAkBR,EAAE,gBAAiB,mBAErCS,EAAgBT,EACpB,yBACA,yGAGF,OACE,kBAACU,MAAAA,KACC,kBAACC,EAAAA,YAAWA,CAACd,WAAYA,GACvB,kBAACe,OAAAA,CAAKC,UAAWC,EAAAA,EAAOC,QAASP,IAEnC,kBAACQ,EAAAA,UAASA,KACR,kBAACC,IAAAA,CAAEJ,UAAWC,EAAAA,EAAOI,MAAOT,IAE9B,kBAACU,EAAAA,YAAWA,KACV,kBAACC,EAAAA,OAAMA,CAACC,KAAK,YAAYC,QAASzB,GAC/BG,EAAE,SAAU,WAEf,kBAACoB,EAAAA,OAAMA,CAACC,KAAK,UAAUC,QAASrB,GAC7BD,EAAE,gBAAiB,qBAK9B,C","sources":["webpack://@openmrs/esm-patient-chart-app/./src/visit/visit-prompt/start-visit-dialog.component.tsx"],"names":["patientUuid","closeModal","launchPatientChart","useTranslation","t","handleStartNewVisit","useCallback","launchPatientChartWithWorkspaceOpen","workspaceName","additionalProps","openedFrom","launchWorkspace","modalHeaderText","modalBodyText","div","ModalHeader","span","className","styles","header","ModalBody","p","body","ModalFooter","Button","kind","onClick"],"sourceRoot":""}