@openmrs/esm-patient-chart-app 11.3.1-patch.9310 → 11.3.1-patch.9508

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 (178) hide show
  1. package/.turbo/turbo-build.log +18 -21
  2. package/dist/1119.js +1 -1
  3. package/dist/1197.js +1 -1
  4. package/dist/2146.js +1 -1
  5. package/dist/2540.js +1 -0
  6. package/dist/2540.js.map +1 -0
  7. package/dist/2690.js +1 -1
  8. package/dist/276.js +1 -0
  9. package/dist/276.js.map +1 -0
  10. package/dist/2761.js.map +1 -1
  11. package/dist/3099.js +1 -1
  12. package/dist/{8278.js → 3119.js} +1 -1
  13. package/dist/{8278.js.map → 3119.js.map} +1 -1
  14. package/dist/3584.js +1 -1
  15. package/dist/3905.js +1 -0
  16. package/dist/3905.js.map +1 -0
  17. package/dist/4055.js +1 -1
  18. package/dist/4132.js +1 -1
  19. package/dist/4300.js +1 -1
  20. package/dist/4335.js +1 -1
  21. package/dist/439.js +1 -0
  22. package/dist/4618.js +1 -1
  23. package/dist/4652.js +1 -1
  24. package/dist/4944.js +1 -1
  25. package/dist/5048.js +1 -0
  26. package/dist/5048.js.map +1 -0
  27. package/dist/506.js +2 -0
  28. package/dist/506.js.map +1 -0
  29. package/dist/5173.js +1 -1
  30. package/dist/5241.js +1 -1
  31. package/dist/5442.js +1 -1
  32. package/dist/5661.js +1 -1
  33. package/dist/5670.js +1 -1
  34. package/dist/6022.js +1 -1
  35. package/dist/6411.js +1 -1
  36. package/dist/6411.js.map +1 -1
  37. package/dist/6468.js +1 -1
  38. package/dist/6568.js +1 -1
  39. package/dist/6568.js.map +1 -1
  40. package/dist/6589.js +1 -0
  41. package/dist/6679.js +1 -1
  42. package/dist/6840.js +1 -1
  43. package/dist/6859.js +1 -1
  44. package/dist/6924.js +1 -1
  45. package/dist/6924.js.map +1 -1
  46. package/dist/{9294.js → 6997.js} +1 -1
  47. package/dist/6997.js.map +1 -0
  48. package/dist/7097.js +1 -1
  49. package/dist/7159.js +1 -1
  50. package/dist/723.js +1 -1
  51. package/dist/7617.js +1 -1
  52. package/dist/7810.js +1 -0
  53. package/dist/7810.js.map +1 -0
  54. package/dist/7822.js +1 -1
  55. package/dist/7822.js.map +1 -1
  56. package/dist/795.js +1 -1
  57. package/dist/8163.js +1 -1
  58. package/dist/8260.js +1 -1
  59. package/dist/8260.js.map +1 -1
  60. package/dist/8349.js +1 -1
  61. package/dist/8371.js +1 -0
  62. package/dist/8454.js +1 -1
  63. package/dist/8454.js.map +1 -1
  64. package/dist/8618.js +1 -1
  65. package/dist/8709.js +1 -1
  66. package/dist/8709.js.map +1 -1
  67. package/dist/890.js +1 -1
  68. package/dist/9214.js +1 -1
  69. package/dist/9538.js +1 -1
  70. package/dist/9569.js +1 -1
  71. package/dist/986.js +1 -1
  72. package/dist/9879.js +1 -1
  73. package/dist/9895.js +1 -1
  74. package/dist/9900.js +1 -1
  75. package/dist/9913.js +1 -1
  76. package/dist/main.js +1 -1
  77. package/dist/main.js.map +1 -1
  78. package/dist/openmrs-esm-patient-chart-app.js +1 -1
  79. package/dist/openmrs-esm-patient-chart-app.js.buildmanifest.json +375 -285
  80. package/dist/openmrs-esm-patient-chart-app.js.map +1 -1
  81. package/dist/routes.json +1 -1
  82. package/package.json +2 -2
  83. package/src/actions-buttons/mark-patient-deceased.component.tsx +2 -2
  84. package/src/actions-buttons/start-visit.component.tsx +5 -10
  85. package/src/actions-buttons/start-visit.test.tsx +5 -9
  86. package/src/clinical-views/encounter-list/encounter-list-tabs.extension.tsx +2 -2
  87. package/src/clinical-views/utils/encounter-list-config-builder.ts +19 -6
  88. package/src/clinical-views/utils/helpers.ts +5 -4
  89. package/src/index.ts +18 -12
  90. package/src/mark-patient-deceased/mark-patient-deceased-form.test.tsx +9 -15
  91. package/src/mark-patient-deceased/mark-patient-deceased-form.workspace.tsx +138 -147
  92. package/src/patient-banner-tags/visit-attribute-tags.extension.tsx +21 -13
  93. package/src/patient-banner-tags/visit-attribute-tags.scss +8 -0
  94. package/src/patient-chart/chart-review/dashboard-view.component.tsx +2 -2
  95. package/src/patient-chart/chart-review/dashboard-view.scss +5 -0
  96. package/src/patient-chart/patient-chart.component.tsx +41 -50
  97. package/src/patient-chart/patient-chart.resources.ts +10 -52
  98. package/src/routes.json +7 -18
  99. package/src/visit/hooks/useDeleteVisit.tsx +1 -1
  100. package/src/visit/start-visit-button.component.tsx +2 -2
  101. package/src/visit/start-visit-button.test.tsx +2 -2
  102. package/src/visit/visit-action-items/edit-visit-details.component.tsx +8 -29
  103. package/src/visit/visit-form/base-visit-type.component.tsx +30 -21
  104. package/src/visit/visit-form/exported-visit-form.workspace.tsx +3 -0
  105. package/src/visit/visit-form/visit-form.test.tsx +18 -27
  106. package/src/visit/visit-form/visit-form.workspace.tsx +653 -35
  107. package/src/visit/visit-history-table/visit-actions-cell.component.tsx +2 -3
  108. package/src/visit/visit-history-table/visit-date-cell.component.tsx +0 -1
  109. package/src/visit/visit-history-table/visit-diagnoses-cell.component.tsx +0 -1
  110. package/src/visit/visit-history-table/visit-history-table.component.tsx +2 -3
  111. package/src/visit/visit-history-table/visit-type-cell.component.tsx +0 -1
  112. package/src/visit/visit-prompt/delete-visit-dialog.test.tsx +1 -1
  113. package/src/visit/visit-prompt/{end-visit-dialog.modal.tsx → end-visit-dialog.component.tsx} +1 -1
  114. package/src/visit/visit-prompt/end-visit-dialog.test.tsx +1 -1
  115. package/src/visit/visit-prompt/{start-visit-dialog.modal.tsx → start-visit-dialog.component.tsx} +4 -10
  116. package/src/visit/visit-prompt/start-visit-dialog.test.tsx +3 -3
  117. package/src/visit/visits-widget/current-visit-summary.extension.tsx +3 -3
  118. package/src/visit/visits-widget/past-visits-components/encounters-table/encounters-table.component.tsx +35 -12
  119. package/src/visit/visits-widget/visit-context/retrospective-data-date-time-picker/retrospective-date-time-picker.component.tsx +0 -1
  120. package/src/visit/visits-widget/visit-context/visit-context-switcher.modal.tsx +2 -2
  121. package/src/visit/visits-widget/visit-context/visit-context-switcher.test.tsx +20 -22
  122. package/src/visit/visits-widget/visit-detail-overview.component.tsx +2 -3
  123. package/src/visit/visits-widget/visit-detail-overview.test.tsx +4 -4
  124. package/translations/am.json +1 -2
  125. package/translations/ar.json +2 -3
  126. package/translations/ar_SY.json +1 -2
  127. package/translations/bn.json +1 -2
  128. package/translations/cs.json +196 -0
  129. package/translations/de.json +1 -2
  130. package/translations/en.json +1 -1
  131. package/translations/en_US.json +1 -2
  132. package/translations/es.json +2 -3
  133. package/translations/es_MX.json +1 -2
  134. package/translations/fr.json +7 -8
  135. package/translations/he.json +2 -3
  136. package/translations/hi.json +1 -2
  137. package/translations/hi_IN.json +1 -2
  138. package/translations/id.json +2 -3
  139. package/translations/it.json +2 -3
  140. package/translations/ka.json +2 -3
  141. package/translations/km.json +2 -3
  142. package/translations/ku.json +1 -2
  143. package/translations/ky.json +1 -2
  144. package/translations/lg.json +1 -2
  145. package/translations/ne.json +1 -2
  146. package/translations/pl.json +1 -2
  147. package/translations/pt.json +2 -3
  148. package/translations/pt_BR.json +2 -3
  149. package/translations/qu.json +1 -2
  150. package/translations/ro_RO.json +2 -3
  151. package/translations/ru_RU.json +1 -2
  152. package/translations/si.json +1 -2
  153. package/translations/sq.json +196 -0
  154. package/translations/sw.json +1 -2
  155. package/translations/sw_KE.json +1 -2
  156. package/translations/tr.json +1 -2
  157. package/translations/tr_TR.json +1 -2
  158. package/translations/uk.json +1 -2
  159. package/translations/uz.json +1 -2
  160. package/translations/uz@Latn.json +1 -2
  161. package/translations/uz_UZ.json +1 -2
  162. package/translations/vi.json +2 -3
  163. package/translations/zh.json +2 -3
  164. package/translations/zh_CN.json +2 -3
  165. package/translations/zh_TW.json +196 -0
  166. package/dist/1815.js +0 -2
  167. package/dist/1815.js.map +0 -1
  168. package/dist/3697.js +0 -1
  169. package/dist/3697.js.map +0 -1
  170. package/dist/5827.js +0 -1
  171. package/dist/5827.js.map +0 -1
  172. package/dist/7818.js +0 -1
  173. package/dist/7818.js.map +0 -1
  174. package/dist/9294.js.map +0 -1
  175. package/dist/9329.js +0 -1
  176. package/dist/9329.js.map +0 -1
  177. /package/dist/{1815.js.LICENSE.txt → 506.js.LICENSE.txt} +0 -0
  178. /package/src/visit/visit-prompt/{delete-visit-dialog.modal.tsx → delete-visit-dialog.component.tsx} +0 -0
package/src/routes.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://json.openmrs.org/routes.schema.json",
3
3
  "optionalBackendDependencies": {
4
4
  "emrapi": {
5
- "version": "^2.0.0",
5
+ "version": ">=2.0.0 <4.0.0",
6
6
  "feature": {
7
7
  "flagName": "emrapi-module",
8
8
  "label": "EMR API Module",
@@ -225,29 +225,18 @@
225
225
  "offline": true
226
226
  }
227
227
  ],
228
- "workspaces2": [
228
+ "workspaces": [
229
229
  {
230
230
  "name": "mark-patient-deceased-workspace-form",
231
231
  "component": "markPatientDeceasedForm",
232
- "window": "mark-patient-deceased"
232
+ "title": "Mark patient deceased",
233
+ "type": "form"
233
234
  },
234
235
  {
235
236
  "name": "start-visit-workspace-form",
236
237
  "component": "startVisitWorkspace",
237
- "window": "start-visit"
238
+ "title": "startVisitWorkspaceTitle",
239
+ "type": "start-visit"
238
240
  }
239
- ],
240
- "workspaceWindows2": [
241
- {
242
- "name": "start-visit",
243
- "group": "patient-chart"
244
- },
245
- {
246
- "name": "mark-patient-deceased",
247
- "group": "patient-chart"
248
- }
249
- ],
250
- "workspaceGroups2": [{
251
- "name":"patient-chart"
252
- }]
241
+ ]
253
242
  }
@@ -64,7 +64,7 @@ export function useDeleteVisit(
64
64
  .then(() => {
65
65
  // Update active visit data
66
66
  mutateActiveVisit();
67
- if (activeVisit.uuid == visitContext?.uuid) {
67
+ if (activeVisit.uuid === visitContext?.uuid) {
68
68
  setVisitContext(null, null);
69
69
  }
70
70
 
@@ -1,7 +1,7 @@
1
1
  import React, { useCallback } from 'react';
2
2
  import { useTranslation } from 'react-i18next';
3
3
  import { Button } from '@carbon/react';
4
- import { launchWorkspace2, showSnackbar } from '@openmrs/esm-framework';
4
+ import { launchWorkspace, showSnackbar } from '@openmrs/esm-framework';
5
5
 
6
6
  interface StartVisitButtonProps {
7
7
  patientUuid: string;
@@ -20,7 +20,7 @@ const StartVisitButton = ({ patientUuid, handleReturnToSearchList, hidePatientSe
20
20
  hidePatientSearch?.();
21
21
 
22
22
  try {
23
- launchWorkspace2(startVisitWorkspaceForm, {
23
+ launchWorkspace(startVisitWorkspaceForm, {
24
24
  patientUuid,
25
25
  openedFrom: 'patient-chart-start-visit',
26
26
  handleReturnToSearchList,
@@ -1,11 +1,11 @@
1
1
  import React from 'react';
2
2
  import userEvent from '@testing-library/user-event';
3
3
  import { render, screen } from '@testing-library/react';
4
- import { launchWorkspace2 } from '@openmrs/esm-framework';
4
+ import { launchWorkspace } from '@openmrs/esm-framework';
5
5
  import { mockPatient } from 'tools';
6
6
  import StartVisitButton from './start-visit-button.component';
7
7
 
8
- const mockLaunchWorkspace = jest.mocked(launchWorkspace2);
8
+ const mockLaunchWorkspace = jest.mocked(launchWorkspace);
9
9
 
10
10
  describe('StartVisitButton', () => {
11
11
  it('renders the start visit button', () => {
@@ -6,20 +6,13 @@ import {
6
6
  UserHasAccess,
7
7
  type Visit,
8
8
  getCoreTranslation,
9
- launchWorkspace2,
9
+ launchWorkspace,
10
10
  useLayoutType,
11
11
  } from '@openmrs/esm-framework';
12
- import { type VisitFormProps } from '../visit-form/visit-form.workspace';
13
- import {
14
- invalidateVisitAndEncounterData,
15
- invalidateVisitByUuid,
16
- type PatientWorkspaceGroupProps,
17
- } from '@openmrs/esm-patient-common-lib';
18
- import { useSWRConfig } from 'swr';
19
12
 
20
13
  interface EditVisitDetailsActionItemProps {
14
+ patientUuid: string;
21
15
  visit: Visit;
22
- patient: fhir.Patient;
23
16
 
24
17
  /**
25
18
  * If true, renders as IconButton instead
@@ -27,32 +20,18 @@ interface EditVisitDetailsActionItemProps {
27
20
  compact?: boolean;
28
21
  }
29
22
 
30
- /**
31
- * This component
32
- */
33
- const EditVisitDetailsActionItem: React.FC<EditVisitDetailsActionItemProps> = ({ visit, patient, compact }) => {
23
+ const EditVisitDetailsActionItem: React.FC<EditVisitDetailsActionItemProps> = ({ visit, compact }) => {
34
24
  const { t } = useTranslation();
35
- const { mutate: globalMutate } = useSWRConfig();
36
25
 
37
26
  const isTablet = useLayoutType() === 'tablet';
38
27
  const responsiveSize = isTablet ? 'lg' : 'sm';
39
- const patientUuid = patient.id;
40
28
 
41
29
  const editVisitDetails = () => {
42
- launchWorkspace2<VisitFormProps, {}, PatientWorkspaceGroupProps>(
43
- 'start-visit-workspace-form',
44
- { openedFrom: 'patient-chart-edit-visit' },
45
- {},
46
- {
47
- patient,
48
- patientUuid: patientUuid,
49
- visitContext: visit,
50
- mutateVisitContext: () => {
51
- invalidateVisitByUuid(globalMutate, visit.uuid);
52
- invalidateVisitAndEncounterData(globalMutate, patientUuid);
53
- },
54
- },
55
- );
30
+ launchWorkspace('start-visit-workspace-form', {
31
+ workspaceTitle: t('editVisitDetails', 'Edit visit details'),
32
+ visitToEdit: visit,
33
+ openedFrom: 'patient-chart-edit-visit',
34
+ });
56
35
  };
57
36
 
58
37
  return (
@@ -1,8 +1,8 @@
1
- import React, { useState, useMemo, useCallback, type ChangeEvent } from 'react';
1
+ import React, { useState, useMemo, useCallback, useEffect, useRef, type ChangeEvent } from 'react';
2
2
  import classNames from 'classnames';
3
+ import { Layer, RadioButton, RadioButtonGroup, Search, StructuredListSkeleton, Tile } from '@carbon/react';
3
4
  import { useTranslation } from 'react-i18next';
4
5
  import { useFormContext, Controller } from 'react-hook-form';
5
- import { Layer, RadioButton, RadioButtonGroup, Search, StructuredListSkeleton, Tile } from '@carbon/react';
6
6
  import { PatientChartPagination } from '@openmrs/esm-patient-common-lib';
7
7
  import { useDebounce, useLayoutType, usePagination, type VisitType } from '@openmrs/esm-framework';
8
8
  import { type VisitFormData } from './visit-form.resource';
@@ -14,7 +14,7 @@ interface BaseVisitTypeProps {
14
14
 
15
15
  const BaseVisitType: React.FC<BaseVisitTypeProps> = ({ visitTypes }) => {
16
16
  const { t } = useTranslation();
17
- const { control } = useFormContext<VisitFormData>();
17
+ const { control, setValue } = useFormContext<VisitFormData>();
18
18
  const isTablet = useLayoutType() === 'tablet';
19
19
  const [searchTerm, setSearchTerm] = useState<string>('');
20
20
  const debouncedSearchTerm = useDebounce(searchTerm, 300);
@@ -29,30 +29,40 @@ const BaseVisitType: React.FC<BaseVisitTypeProps> = ({ visitTypes }) => {
29
29
 
30
30
  const { results, currentPage, goTo } = usePagination(searchResults, 5);
31
31
  const hasNoMatchingSearchResults = debouncedSearchTerm.trim() !== '' && searchResults.length === 0;
32
+ const prevSearchTermRef = useRef(debouncedSearchTerm);
32
33
 
33
34
  const handleSearchTermChange = useCallback((e: ChangeEvent<HTMLInputElement>) => {
34
35
  setSearchTerm(e.target.value);
35
36
  }, []);
36
37
 
38
+ useEffect(() => {
39
+ if (searchResults?.length === 1) {
40
+ setValue('visitType', searchResults[0].uuid);
41
+ }
42
+ }, [searchResults, setValue]);
43
+
44
+ // Reset pagination to page 1 when search term changes
45
+ useEffect(() => {
46
+ if (prevSearchTermRef.current !== debouncedSearchTerm && currentPage !== 1) {
47
+ goTo(1);
48
+ }
49
+ prevSearchTermRef.current = debouncedSearchTerm;
50
+ }, [debouncedSearchTerm, currentPage, goTo]);
51
+
52
+ const searchComponent = (
53
+ <Search
54
+ labelText={t('searchForAVisitType', 'Search for a visit type')}
55
+ onChange={handleSearchTermChange}
56
+ placeholder={t('searchForAVisitType', 'Search for a visit type')}
57
+ value={searchTerm}
58
+ />
59
+ );
60
+
37
61
  return (
38
62
  <div className={classNames(styles.visitTypeOverviewWrapper, isTablet ? styles.tablet : styles.desktop)}>
39
63
  {visitTypes.length ? (
40
64
  <>
41
- {isTablet ? (
42
- <Layer>
43
- <Search
44
- labelText={t('searchForAVisitType', 'Search for a visit type')}
45
- onChange={handleSearchTermChange}
46
- placeholder={t('searchForAVisitType', 'Search for a visit type')}
47
- />
48
- </Layer>
49
- ) : (
50
- <Search
51
- labelText={t('searchForAVisitType', 'Search for a visit type')}
52
- onChange={handleSearchTermChange}
53
- placeholder={t('searchForAVisitType', 'Search for a visit type')}
54
- />
55
- )}
65
+ {isTablet ? <Layer>{searchComponent}</Layer> : searchComponent}
56
66
 
57
67
  {hasNoMatchingSearchResults ? (
58
68
  <div className={styles.tileContainer}>
@@ -67,7 +77,6 @@ const BaseVisitType: React.FC<BaseVisitTypeProps> = ({ visitTypes }) => {
67
77
  <Controller
68
78
  name="visitType"
69
79
  control={control}
70
- defaultValue={results?.length === 1 ? results[0].uuid : null}
71
80
  render={({ field: { onChange, value } }) => (
72
81
  <RadioButtonGroup
73
82
  className={styles.radioButtonGroup}
@@ -76,7 +85,7 @@ const BaseVisitType: React.FC<BaseVisitTypeProps> = ({ visitTypes }) => {
76
85
  orientation="vertical"
77
86
  valueSelected={value}
78
87
  >
79
- {results.map(({ uuid, display, name }) => (
88
+ {results.map(({ display, uuid }) => (
80
89
  <RadioButton
81
90
  className={styles.radioButton}
82
91
  id={`visit-type-${uuid}`}
@@ -97,7 +106,7 @@ const BaseVisitType: React.FC<BaseVisitTypeProps> = ({ visitTypes }) => {
97
106
  onPageNumberChange={({ page }) => goTo(page)}
98
107
  pageNumber={currentPage}
99
108
  pageSize={5}
100
- totalItems={visitTypes?.length}
109
+ totalItems={searchResults.length}
101
110
  />
102
111
  </div>
103
112
  )}
@@ -21,6 +21,7 @@ import { zodResolver } from '@hookform/resolvers/zod';
21
21
  import {
22
22
  Extension,
23
23
  ExtensionSlot,
24
+ launchWorkspaceGroup2,
24
25
  OpenmrsFetchError,
25
26
  saveVisit,
26
27
  showSnackbar,
@@ -29,6 +30,7 @@ import {
29
30
  useConnectivity,
30
31
  useEmrConfiguration,
31
32
  useLayoutType,
33
+ useVisit,
32
34
  type Visit,
33
35
  Workspace2,
34
36
  type Workspace2DefinitionProps,
@@ -37,6 +39,7 @@ import {
37
39
  } from '@openmrs/esm-framework';
38
40
  import {
39
41
  createOfflineVisitForPatient,
42
+ invalidateVisitByUuid,
40
43
  invalidateVisitAndEncounterData,
41
44
  useActivePatientEnrollment,
42
45
  } from '@openmrs/esm-patient-common-lib';
@@ -26,8 +26,10 @@ import {
26
26
  useVisitFormCallbacks,
27
27
  useVisitFormSchemaAndDefaultValues,
28
28
  } from './visit-form.resource';
29
- import VisitForm, { type VisitFormProps } from './visit-form.workspace';
30
- import { type PatientWorkspace2DefinitionProps } from '@openmrs/esm-patient-common-lib/src';
29
+ import VisitForm from './visit-form.workspace';
30
+
31
+ // Fixed reference time used in time-dependent tests
32
+ const FIXED_NOW = new Date('2023-01-01T08:00:00.000Z');
31
33
 
32
34
  const visitUuid = 'test_visit_uuid';
33
35
  const visitAttributes = {
@@ -54,23 +56,20 @@ const visitAttributes = {
54
56
  };
55
57
 
56
58
  const mockCloseWorkspace = jest.fn();
59
+ const mockPromptBeforeClosing = jest.fn();
60
+ const mockSetTitle = jest.fn();
57
61
  const mockMutateVisitContext = jest.fn();
58
- const defaultProps: PatientWorkspace2DefinitionProps<VisitFormProps, {}> = {
62
+
63
+ const testProps = {
64
+ openedFrom: 'test',
65
+ patientUuid: mockPatient.id,
66
+ patient: mockPatient,
59
67
  closeWorkspace: mockCloseWorkspace,
60
- workspaceProps: {
61
- openedFrom: 'test',
62
- },
63
- windowProps: {},
64
- groupProps: {
65
- patientUuid: mockPatient.id,
66
- patient: mockPatient,
67
- visitContext: null,
68
- mutateVisitContext: mockMutateVisitContext,
69
- },
70
- workspaceName: '',
71
- launchChildWorkspace: jest.fn(),
72
- windowName: '',
73
- isRootWorkspace: false,
68
+ closeWorkspaceWithSavedChanges: mockCloseWorkspace,
69
+ promptBeforeClosing: mockPromptBeforeClosing,
70
+ setTitle: mockSetTitle,
71
+ visitContext: null,
72
+ mutateVisitContext: mockMutateVisitContext,
74
73
  };
75
74
 
76
75
  const mockSaveVisit = jest.mocked(saveVisit);
@@ -156,10 +155,9 @@ jest.mock('../hooks/useDefaultFacilityLocation', () => {
156
155
 
157
156
  return {
158
157
  ...requireActual,
159
- useDefaultFacilityLocation: jest.fn(() => ({
158
+ useDefaultLoginLocation: jest.fn(() => ({
160
159
  defaultFacility: null,
161
160
  isLoading: false,
162
- error: null,
163
161
  })),
164
162
  };
165
163
  });
@@ -869,12 +867,5 @@ describe('useVisitFormSchemaAndDefaultValues', () => {
869
867
  });
870
868
 
871
869
  function renderVisitForm(visitToEdit?: Visit) {
872
- const props: PatientWorkspace2DefinitionProps<VisitFormProps, {}> = {
873
- ...defaultProps,
874
- groupProps: {
875
- ...defaultProps.groupProps,
876
- visitContext: visitToEdit ?? null,
877
- },
878
- };
879
- return render(<VisitForm {...props} />);
870
+ return render(<VisitForm {...{ ...testProps, visitToEdit }} />);
880
871
  }