@openmrs/esm-react-utils 5.6.1-pre.1905 → 5.6.1-pre.1908

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-react-utils",
3
- "version": "5.6.1-pre.1905",
3
+ "version": "5.6.1-pre.1908",
4
4
  "license": "MPL-2.0",
5
5
  "description": "React utilities for OpenMRS.",
6
6
  "browser": "dist/openmrs-esm-react-utils.js",
@@ -61,15 +61,15 @@
61
61
  "swr": "2.x"
62
62
  },
63
63
  "devDependencies": {
64
- "@openmrs/esm-api": "5.6.1-pre.1905",
65
- "@openmrs/esm-config": "5.6.1-pre.1905",
66
- "@openmrs/esm-context": "5.6.1-pre.1905",
67
- "@openmrs/esm-error-handling": "5.6.1-pre.1905",
68
- "@openmrs/esm-extensions": "5.6.1-pre.1905",
69
- "@openmrs/esm-feature-flags": "5.6.1-pre.1905",
70
- "@openmrs/esm-globals": "5.6.1-pre.1905",
71
- "@openmrs/esm-navigation": "5.6.1-pre.1905",
72
- "@openmrs/esm-utils": "5.6.1-pre.1905",
64
+ "@openmrs/esm-api": "5.6.1-pre.1908",
65
+ "@openmrs/esm-config": "5.6.1-pre.1908",
66
+ "@openmrs/esm-context": "5.6.1-pre.1908",
67
+ "@openmrs/esm-error-handling": "5.6.1-pre.1908",
68
+ "@openmrs/esm-extensions": "5.6.1-pre.1908",
69
+ "@openmrs/esm-feature-flags": "5.6.1-pre.1908",
70
+ "@openmrs/esm-globals": "5.6.1-pre.1908",
71
+ "@openmrs/esm-navigation": "5.6.1-pre.1908",
72
+ "@openmrs/esm-utils": "5.6.1-pre.1908",
73
73
  "dayjs": "^1.10.8",
74
74
  "i18next": "^21.10.0",
75
75
  "react": "^18.1.0",
package/src/useVisit.ts CHANGED
@@ -37,13 +37,14 @@ export interface VisitReturnType {
37
37
  * API call is in progress. `mutate` refreshes the data from both API calls.
38
38
  *
39
39
  * @param patientUuid Unique patient identifier `string`
40
+ * @param representation The custom representation of the visit
40
41
  */
41
- export function useVisit(patientUuid: string): VisitReturnType {
42
+ export function useVisit(patientUuid: string, representation = defaultVisitCustomRepresentation): VisitReturnType {
42
43
  const { patientUuid: visitStorePatientUuid, manuallySetVisitUuid } = useStore(getVisitStore());
43
44
  // Ignore the visit store data if it is not for this patient
44
45
  const retrospectiveVisitUuid = patientUuid && visitStorePatientUuid == patientUuid ? manuallySetVisitUuid : null;
45
- const activeVisitUrlSuffix = `?patient=${patientUuid}&v=${defaultVisitCustomRepresentation}&includeInactive=false`;
46
- const retrospectiveVisitUrlSuffix = `/${retrospectiveVisitUuid}`;
46
+ const activeVisitUrlSuffix = `?patient=${patientUuid}&v=${representation}&includeInactive=false`;
47
+ const retrospectiveVisitUrlSuffix = `/${retrospectiveVisitUuid}?v=${representation}`;
47
48
 
48
49
  const {
49
50
  data: activeData,