@openmrs/esm-framework 9.0.3-pre.4128 → 9.0.3-pre.4166
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 +1 -1
- package/docs/API.md +7 -0
- package/docs/functions/age.md +6 -6
- package/docs/functions/calculateInterpretation.md +2 -2
- package/docs/functions/canAccessStorage.md +4 -4
- package/docs/functions/convertToLocaleCalendar.md +1 -1
- package/docs/functions/createAttachment.md +2 -2
- package/docs/functions/createErrorHandler.md +1 -1
- package/docs/functions/deleteAttachmentPermanently.md +2 -2
- package/docs/functions/dispatchNotificationShown.md +1 -1
- package/docs/functions/dispatchPrecacheStaticDependencies.md +4 -4
- package/docs/functions/displayName.md +1 -1
- package/docs/functions/fetchCurrentPatient.md +1 -1
- package/docs/functions/formatDate.md +1 -1
- package/docs/functions/formatDatetime.md +1 -1
- package/docs/functions/formatDuration.md +1 -1
- package/docs/functions/formatPartialDate.md +4 -4
- package/docs/functions/formatPatientName.md +1 -1
- package/docs/functions/formatTime.md +1 -1
- package/docs/functions/formattedName.md +1 -1
- package/docs/functions/getAttachmentByUuid.md +2 -2
- package/docs/functions/getAttachments.md +2 -2
- package/docs/functions/getCoreTranslation.md +1 -1
- package/docs/functions/getDefaultCalendar.md +1 -1
- package/docs/functions/getDefaultsFromConfigSchema.md +1 -1
- package/docs/functions/getLocale.md +1 -1
- package/docs/functions/getPatientName.md +1 -1
- package/docs/functions/getVisitsForPatient.md +2 -2
- package/docs/functions/isOmrsDateStrict.md +1 -1
- package/docs/functions/isOmrsDateToday.md +1 -1
- package/docs/functions/isOnline.md +1 -1
- package/docs/functions/isVersionSatisfied.md +1 -1
- package/docs/functions/normalizeInterpretation.md +3 -3
- package/docs/functions/parseDate.md +1 -1
- package/docs/functions/registerDefaultCalendar.md +1 -1
- package/docs/functions/reportError.md +1 -1
- package/docs/functions/retry.md +4 -4
- package/docs/functions/saveVisit.md +2 -2
- package/docs/functions/selectPreferredName.md +1 -1
- package/docs/functions/shallowEqual.md +1 -1
- package/docs/functions/subscribeActionableNotificationShown.md +1 -1
- package/docs/functions/subscribeConnectivity.md +1 -1
- package/docs/functions/subscribeConnectivityChanged.md +1 -1
- package/docs/functions/subscribeNotificationShown.md +1 -1
- package/docs/functions/subscribePrecacheStaticDependencies.md +1 -1
- package/docs/functions/subscribeSnackbarShown.md +1 -1
- package/docs/functions/subscribeToastShown.md +1 -1
- package/docs/functions/toDateObjectStrict.md +1 -1
- package/docs/functions/toOmrsIsoString.md +4 -4
- package/docs/functions/updateVisit.md +2 -2
- package/docs/functions/useAssignedExtensions.md +2 -2
- package/docs/functions/useAttachments.md +2 -2
- package/docs/functions/useEmrConfiguration.md +1 -1
- package/docs/functions/useExtensionSlotMeta.md +1 -1
- package/docs/functions/useExtensionSlotStore.md +2 -2
- package/docs/functions/useFhirPagination.md +1 -1
- package/docs/functions/useLeftNav.md +1 -1
- package/docs/functions/useLeftNavStore.md +2 -2
- package/docs/functions/useLocations.md +2 -2
- package/docs/functions/useOpenmrsPagination.md +1 -1
- package/docs/functions/useOpenmrsSWR.md +2 -2
- package/docs/functions/useSession.md +2 -2
- package/docs/functions/useVisitContextStore.md +2 -2
- package/docs/functions/useVisitTypes.md +2 -2
- package/docs/interfaces/AssignedExtension.md +1 -1
- package/docs/interfaces/ConfigurableLinkProps.md +1 -1
- package/docs/interfaces/ConnectedExtension.md +1 -1
- package/docs/interfaces/ConnectivityChangedEvent.md +2 -2
- package/docs/interfaces/Diagnosis.md +20 -16
- package/docs/interfaces/Drug.md +17 -13
- package/docs/interfaces/EmrApiConfigurationResponse.md +51 -51
- package/docs/interfaces/Encounter.md +18 -14
- package/docs/interfaces/EncounterProvider.md +18 -14
- package/docs/interfaces/EncounterRole.md +17 -13
- package/docs/interfaces/EncounterType.md +17 -13
- package/docs/interfaces/ExtensionSlotBaseProps.md +3 -3
- package/docs/interfaces/ExtensionSlotProps.md +11 -11
- package/docs/interfaces/FeatureFlagDefinition.md +4 -4
- package/docs/interfaces/ImportMap.md +2 -2
- package/docs/interfaces/Location.md +19 -15
- package/docs/interfaces/NumericObservationProps.md +1 -1
- package/docs/interfaces/Obs.md +22 -18
- package/docs/interfaces/OpenWorkspace.md +24 -24
- package/docs/interfaces/OpenmrsAppRoutes.md +13 -13
- package/docs/interfaces/OpenmrsResource.md +9 -0
- package/docs/interfaces/Order.md +26 -22
- package/docs/interfaces/Patient.md +8 -8
- package/docs/interfaces/PatientIdentifier.md +7 -7
- package/docs/interfaces/PatientIdentifierType.md +7 -7
- package/docs/interfaces/PrecacheStaticDependenciesEvent.md +1 -1
- package/docs/interfaces/ResourceLoader.md +2 -2
- package/docs/interfaces/RetryOptions.md +4 -4
- package/docs/interfaces/ShowActionableNotificationEvent.md +7 -7
- package/docs/interfaces/ShowNotificationEvent.md +6 -6
- package/docs/interfaces/ShowSnackbarEvent.md +9 -9
- package/docs/interfaces/ShowToastEvent.md +6 -6
- package/docs/interfaces/SpaConfig.md +6 -6
- package/docs/interfaces/UseServerFetchAllOptions.md +2 -2
- package/docs/interfaces/UseServerInfiniteOptions.md +2 -2
- package/docs/interfaces/UseServerPaginationOptions.md +2 -2
- package/docs/interfaces/Visit.md +1 -1
- package/docs/interfaces/VisitReturnType.md +2 -2
- package/docs/interfaces/WorkspaceDefinition2.md +4 -4
- package/docs/interfaces/WorkspaceGroupDefinition.md +3 -3
- package/docs/interfaces/WorkspaceGroupDefinition2.md +6 -6
- package/docs/interfaces/WorkspaceRegistration.md +4 -0
- package/docs/interfaces/WorkspaceWindowDefinition2.md +7 -7
- package/docs/type-aliases/CurrentPatient.md +1 -1
- package/docs/type-aliases/DateInput.md +1 -1
- package/docs/type-aliases/ExtensionDefinition.md +12 -12
- package/docs/type-aliases/FormatDateMode.md +1 -1
- package/docs/type-aliases/FormatDateOptions.md +10 -10
- package/docs/type-aliases/ModalDefinition.md +3 -3
- package/docs/type-aliases/NameUse.md +1 -1
- package/docs/type-aliases/OpenmrsRoutes.md +1 -1
- package/docs/type-aliases/PageDefinition.md +1 -1
- package/docs/type-aliases/SpaEnvironment.md +1 -1
- package/docs/type-aliases/UseOpenmrsSWROptions.md +1 -1
- package/docs/type-aliases/WorkspaceDefinition.md +14 -14
- package/docs/type-aliases/WorkspaceWindowState.md +1 -1
- package/docs/variables/useConnectedExtensions.md +2 -2
- package/docs/variables/useExtensionStore.md +9 -9
- package/package.json +20 -20
package/.turbo/turbo-build.log
CHANGED
package/docs/API.md
CHANGED
|
@@ -71,6 +71,11 @@
|
|
|
71
71
|
- [useAppContext](functions/useAppContext.md)
|
|
72
72
|
- [useDefineAppContext](functions/useDefineAppContext.md)
|
|
73
73
|
|
|
74
|
+
## Error Handling
|
|
75
|
+
|
|
76
|
+
- [reportError](functions/reportError.md)
|
|
77
|
+
- [createErrorHandler](functions/createErrorHandler.md)
|
|
78
|
+
|
|
74
79
|
## Breadcrumb
|
|
75
80
|
|
|
76
81
|
- [registerBreadcrumb](functions/registerBreadcrumb.md)
|
|
@@ -174,6 +179,7 @@
|
|
|
174
179
|
- [useAbortController](functions/useAbortController.md)
|
|
175
180
|
- [useDebounce](functions/useDebounce.md)
|
|
176
181
|
- [useOpenmrsSWR](functions/useOpenmrsSWR.md)
|
|
182
|
+
- [age](functions/age.md)
|
|
177
183
|
- [getPatientName](functions/getPatientName.md)
|
|
178
184
|
- [~~displayName~~](functions/displayName.md)
|
|
179
185
|
- [formatPatientName](functions/formatPatientName.md)
|
|
@@ -182,6 +188,7 @@
|
|
|
182
188
|
- [shallowEqual](functions/shallowEqual.md)
|
|
183
189
|
- [canAccessStorage](functions/canAccessStorage.md)
|
|
184
190
|
- [getDefaultsFromConfigSchema](functions/getDefaultsFromConfigSchema.md)
|
|
191
|
+
- [isVersionSatisfied](functions/isVersionSatisfied.md)
|
|
185
192
|
- [retry](functions/retry.md)
|
|
186
193
|
- [RetryOptions](interfaces/RetryOptions.md)
|
|
187
194
|
|
package/docs/functions/age.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
# Function: age()
|
|
4
4
|
|
|
5
|
-
> **age**(`birthDate`, `currentDate
|
|
5
|
+
> **age**(`birthDate`, `currentDate`): `null` \| `string`
|
|
6
6
|
|
|
7
|
-
Defined in: packages/framework/esm-utils/
|
|
7
|
+
Defined in: [packages/framework/esm-utils/src/age-helpers.ts:22](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-utils/src/age-helpers.ts#L22)
|
|
8
8
|
|
|
9
9
|
Gets a human readable and locale supported representation of a person's age, given their birthDate,
|
|
10
10
|
The representation logic follows the guideline here:
|
|
@@ -15,16 +15,16 @@ https://webarchive.nationalarchives.gov.uk/ukgwa/20160921162509mp_/http://system
|
|
|
15
15
|
|
|
16
16
|
### birthDate
|
|
17
17
|
|
|
18
|
+
`ConfigType`
|
|
19
|
+
|
|
18
20
|
The birthDate. If birthDate is null, returns null.
|
|
19
21
|
|
|
20
|
-
|
|
22
|
+
### currentDate
|
|
21
23
|
|
|
22
|
-
|
|
24
|
+
`ConfigType` = `...`
|
|
23
25
|
|
|
24
26
|
Optional. If provided, calculates the age of the person at the provided currentDate (instead of now).
|
|
25
27
|
|
|
26
|
-
`null` | `string` | `number` | `Date` | `Dayjs`
|
|
27
|
-
|
|
28
28
|
## Returns
|
|
29
29
|
|
|
30
30
|
`null` \| `string`
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Function: calculateInterpretation()
|
|
4
4
|
|
|
5
|
-
> **calculateInterpretation**(`value`, `range?`): `"
|
|
5
|
+
> **calculateInterpretation**(`value`, `range?`): `"normal"` \| `"high"` \| `"low"` \| `"critically_low"` \| `"critically_high"` \| `"off_scale_low"` \| `"off_scale_high"`
|
|
6
6
|
|
|
7
7
|
Defined in: [packages/framework/esm-styleguide/src/numeric-observation/interpretation-utils.ts:68](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/numeric-observation/interpretation-utils.ts#L68)
|
|
8
8
|
|
|
@@ -21,4 +21,4 @@ Returns lowercase ObservationInterpretation format
|
|
|
21
21
|
|
|
22
22
|
## Returns
|
|
23
23
|
|
|
24
|
-
`"
|
|
24
|
+
`"normal"` \| `"high"` \| `"low"` \| `"critically_low"` \| `"critically_high"` \| `"off_scale_low"` \| `"off_scale_high"`
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
# Function: canAccessStorage()
|
|
4
4
|
|
|
5
|
-
> **canAccessStorage**(`storage
|
|
5
|
+
> **canAccessStorage**(`storage`): `boolean`
|
|
6
6
|
|
|
7
|
-
Defined in: packages/framework/esm-utils/
|
|
7
|
+
Defined in: [packages/framework/esm-utils/src/storage.ts:11](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-utils/src/storage.ts#L11)
|
|
8
8
|
|
|
9
9
|
Simple utility function to determine if an object implementing the WebStorage API
|
|
10
10
|
is actually available. Useful for testing the availability of `localStorage` or
|
|
@@ -12,9 +12,9 @@ is actually available. Useful for testing the availability of `localStorage` or
|
|
|
12
12
|
|
|
13
13
|
## Parameters
|
|
14
14
|
|
|
15
|
-
### storage
|
|
15
|
+
### storage
|
|
16
16
|
|
|
17
|
-
`Storage`
|
|
17
|
+
`Storage` = `window.localStorage`
|
|
18
18
|
|
|
19
19
|
The WebStorage API object to check. Defaults to `localStorage`.
|
|
20
20
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **convertToLocaleCalendar**(`date`, `locale`): `CalendarDate` \| `CalendarDateTime` \| `ZonedDateTime`
|
|
6
6
|
|
|
7
|
-
Defined in: packages/framework/esm-utils/
|
|
7
|
+
Defined in: [packages/framework/esm-utils/src/dates/date-util.ts:426](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-utils/src/dates/date-util.ts#L426)
|
|
8
8
|
|
|
9
9
|
Converts a calendar date to the equivalent locale calendar date.
|
|
10
10
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Function: createAttachment()
|
|
4
4
|
|
|
5
|
-
> **createAttachment**(`patientUuid`, `fileToUpload`): `Promise
|
|
5
|
+
> **createAttachment**(`patientUuid`, `fileToUpload`): `Promise`\<[`FetchResponse`](../interfaces/FetchResponse.md)\<`any`\>\>
|
|
6
6
|
|
|
7
7
|
Defined in: [packages/framework/esm-emr-api/src/attachments.ts:73](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-emr-api/src/attachments.ts#L73)
|
|
8
8
|
|
|
@@ -27,7 +27,7 @@ An object containing the file data and metadata to upload.
|
|
|
27
27
|
|
|
28
28
|
## Returns
|
|
29
29
|
|
|
30
|
-
`Promise
|
|
30
|
+
`Promise`\<[`FetchResponse`](../interfaces/FetchResponse.md)\<`any`\>\>
|
|
31
31
|
|
|
32
32
|
A Promise that resolves with the FetchResponse containing the created
|
|
33
33
|
attachment data.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **createErrorHandler**(): (`incomingErr`) => `void`
|
|
6
6
|
|
|
7
|
-
Defined in: packages/framework/esm-error-handling/
|
|
7
|
+
Defined in: [packages/framework/esm-error-handling/src/index.ts:70](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-error-handling/src/index.ts#L70)
|
|
8
8
|
|
|
9
9
|
Creates an error handler function that captures the current stack trace at
|
|
10
10
|
the time of creation. When the returned handler is invoked with an error,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Function: deleteAttachmentPermanently()
|
|
4
4
|
|
|
5
|
-
> **deleteAttachmentPermanently**(`attachmentUuid`, `abortController`): `Promise
|
|
5
|
+
> **deleteAttachmentPermanently**(`attachmentUuid`, `abortController`): `Promise`\<[`FetchResponse`](../interfaces/FetchResponse.md)\<`any`\>\>
|
|
6
6
|
|
|
7
7
|
Defined in: [packages/framework/esm-emr-api/src/attachments.ts:107](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-emr-api/src/attachments.ts#L107)
|
|
8
8
|
|
|
@@ -25,7 +25,7 @@ An AbortController to allow cancellation of the request.
|
|
|
25
25
|
|
|
26
26
|
## Returns
|
|
27
27
|
|
|
28
|
-
`Promise
|
|
28
|
+
`Promise`\<[`FetchResponse`](../interfaces/FetchResponse.md)\<`any`\>\>
|
|
29
29
|
|
|
30
30
|
A Promise that resolves with the FetchResponse confirming deletion.
|
|
31
31
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **dispatchNotificationShown**(`data`): `void`
|
|
6
6
|
|
|
7
|
-
Defined in: packages/framework/esm-globals/
|
|
7
|
+
Defined in: [packages/framework/esm-globals/src/events.ts:89](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-globals/src/events.ts#L89)
|
|
8
8
|
|
|
9
9
|
## Parameters
|
|
10
10
|
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
# Function: dispatchPrecacheStaticDependencies()
|
|
4
4
|
|
|
5
|
-
> **dispatchPrecacheStaticDependencies**(`data
|
|
5
|
+
> **dispatchPrecacheStaticDependencies**(`data`): `void`
|
|
6
6
|
|
|
7
|
-
Defined in: packages/framework/esm-globals/
|
|
7
|
+
Defined in: [packages/framework/esm-globals/src/events.ts:34](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-globals/src/events.ts#L34)
|
|
8
8
|
|
|
9
9
|
## Parameters
|
|
10
10
|
|
|
11
|
-
### data
|
|
11
|
+
### data
|
|
12
12
|
|
|
13
|
-
[`PrecacheStaticDependenciesEvent`](../interfaces/PrecacheStaticDependenciesEvent.md)
|
|
13
|
+
[`PrecacheStaticDependenciesEvent`](../interfaces/PrecacheStaticDependenciesEvent.md) = `{}`
|
|
14
14
|
|
|
15
15
|
## Returns
|
|
16
16
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **displayName**(`patient`): `string`
|
|
6
6
|
|
|
7
|
-
Defined in: packages/framework/esm-utils/
|
|
7
|
+
Defined in: [packages/framework/esm-utils/src/patient-helpers.ts:20](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-utils/src/patient-helpers.ts#L20)
|
|
8
8
|
|
|
9
9
|
## Parameters
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **formatDate**(`date`, `options?`): `string`
|
|
6
6
|
|
|
7
|
-
Defined in: packages/framework/esm-utils/
|
|
7
|
+
Defined in: [packages/framework/esm-utils/src/dates/date-util.ts:308](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-utils/src/dates/date-util.ts#L308)
|
|
8
8
|
|
|
9
9
|
Formats the input date according to the current locale and the
|
|
10
10
|
given options.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **formatDatetime**(`date`, `options?`): `string`
|
|
6
6
|
|
|
7
|
-
Defined in: packages/framework/esm-utils/
|
|
7
|
+
Defined in: [packages/framework/esm-utils/src/dates/date-util.ts:418](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-utils/src/dates/date-util.ts#L418)
|
|
8
8
|
|
|
9
9
|
Formats the input into a string showing the date and time, according
|
|
10
10
|
to the current locale. The `mode` parameter is as described for
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **formatDuration**(`duration`, `options?`): `string`
|
|
6
6
|
|
|
7
|
-
Defined in: packages/framework/esm-utils/
|
|
7
|
+
Defined in: [packages/framework/esm-utils/src/dates/date-util.ts:443](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-utils/src/dates/date-util.ts#L443)
|
|
8
8
|
|
|
9
9
|
Formats the input duration according to the current locale.
|
|
10
10
|
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
# Function: formatPartialDate()
|
|
4
4
|
|
|
5
|
-
> **formatPartialDate**(`dateString`, `options
|
|
5
|
+
> **formatPartialDate**(`dateString`, `options`): `null` \| `string`
|
|
6
6
|
|
|
7
|
-
Defined in: packages/framework/esm-utils/
|
|
7
|
+
Defined in: [packages/framework/esm-utils/src/dates/date-util.ts:243](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-utils/src/dates/date-util.ts#L243)
|
|
8
8
|
|
|
9
9
|
Formats the string representing a date, including partial representations of dates, according to the current
|
|
10
10
|
locale and the given options.
|
|
@@ -32,9 +32,9 @@ locales.
|
|
|
32
32
|
|
|
33
33
|
The date string to parse and format.
|
|
34
34
|
|
|
35
|
-
### options
|
|
35
|
+
### options
|
|
36
36
|
|
|
37
|
-
`Partial`\<[`FormatDateOptions`](../type-aliases/FormatDateOptions.md)\>
|
|
37
|
+
`Partial`\<[`FormatDateOptions`](../type-aliases/FormatDateOptions.md)\> = `{}`
|
|
38
38
|
|
|
39
39
|
Optional formatting options.
|
|
40
40
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **formatPatientName**(`name`): `string`
|
|
6
6
|
|
|
7
|
-
Defined in: packages/framework/esm-utils/
|
|
7
|
+
Defined in: [packages/framework/esm-utils/src/patient-helpers.ts:29](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-utils/src/patient-helpers.ts#L29)
|
|
8
8
|
|
|
9
9
|
Get a formatted display string for an FHIR name.
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **formatTime**(`date`): `string`
|
|
6
6
|
|
|
7
|
-
Defined in: packages/framework/esm-utils/
|
|
7
|
+
Defined in: [packages/framework/esm-utils/src/dates/date-util.ts:398](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-utils/src/dates/date-util.ts#L398)
|
|
8
8
|
|
|
9
9
|
Formats the input as a time, according to the current locale.
|
|
10
10
|
12-hour or 24-hour clock depends on locale.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **formattedName**(`name`): `string`
|
|
6
6
|
|
|
7
|
-
Defined in: packages/framework/esm-utils/
|
|
7
|
+
Defined in: [packages/framework/esm-utils/src/patient-helpers.ts:35](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-utils/src/patient-helpers.ts#L35)
|
|
8
8
|
|
|
9
9
|
## Parameters
|
|
10
10
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Function: getAttachmentByUuid()
|
|
4
4
|
|
|
5
|
-
> **getAttachmentByUuid**(`attachmentUuid`, `abortController`): `Promise
|
|
5
|
+
> **getAttachmentByUuid**(`attachmentUuid`, `abortController`): `Promise`\<[`FetchResponse`](../interfaces/FetchResponse.md)\<`any`\>\>
|
|
6
6
|
|
|
7
7
|
Defined in: [packages/framework/esm-emr-api/src/attachments.ts:23](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-emr-api/src/attachments.ts#L23)
|
|
8
8
|
|
|
@@ -24,7 +24,7 @@ An AbortController to allow cancellation of the request.
|
|
|
24
24
|
|
|
25
25
|
## Returns
|
|
26
26
|
|
|
27
|
-
`Promise
|
|
27
|
+
`Promise`\<[`FetchResponse`](../interfaces/FetchResponse.md)\<`any`\>\>
|
|
28
28
|
|
|
29
29
|
A Promise that resolves with the FetchResponse containing the attachment data.
|
|
30
30
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Function: getAttachments()
|
|
4
4
|
|
|
5
|
-
> **getAttachments**(`patientUuid`, `includeEncounterless`, `abortController`): `Promise
|
|
5
|
+
> **getAttachments**(`patientUuid`, `includeEncounterless`, `abortController`): `Promise`\<[`FetchResponse`](../interfaces/FetchResponse.md)\<`any`\>\>
|
|
6
6
|
|
|
7
7
|
Defined in: [packages/framework/esm-emr-api/src/attachments.ts:46](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-emr-api/src/attachments.ts#L46)
|
|
8
8
|
|
|
@@ -31,7 +31,7 @@ An AbortController to allow cancellation of the request.
|
|
|
31
31
|
|
|
32
32
|
## Returns
|
|
33
33
|
|
|
34
|
-
`Promise
|
|
34
|
+
`Promise`\<[`FetchResponse`](../interfaces/FetchResponse.md)\<`any`\>\>
|
|
35
35
|
|
|
36
36
|
A Promise that resolves with the FetchResponse containing an array of attachments.
|
|
37
37
|
|
|
@@ -19,7 +19,7 @@ invalid key to this function will result in a type error.
|
|
|
19
19
|
|
|
20
20
|
The translation key from the set of core translations.
|
|
21
21
|
|
|
22
|
-
`"
|
|
22
|
+
`"cancel"` | `"change"` | `"close"` | `"error"` | `"unknown"` | `"delete"` | `"Clinic"` | `"abnormalValue"` | `"actions"` | `"actionableNotification"` | `"address"` | `"age"` | `"closesActionableNotification"` | `"closeSnackbar"` | `"confirm"` | `"contactAdministratorIfIssuePersists"` | `"contactDetails"` | `"discardChanges"` | `"edit"` | `"emptyStateText"` | `"errorCopy"` | `"errorLoadingLoginLocations"` | `"female"` | `"leftNavigation"` | `"loading"` | `"male"` | `"noResultsToDisplay"` | `"notAvailable"` | `"other"` | `"paginationItemsCount"` | `"paginationOfPages"` | `"patientAvatarAlt"` | `"patientIdentifierSticker"` | `"patientLists"` | `"patientPhotoAlt"` | `"patientPhotoPlaceholder"` | `"print"` | `"printError"` | `"printErrorExplainer"` | `"printIdentifierSticker"` | `"printing"` | `"recordNewEntry"` | `"relationships"` | `"resetOverrides"` | `"save"` | `"scriptLoadingFailed"` | `"scriptLoadingError"` | `"searchForLocation"` | `"seeAll"` | `"seeMoreLists"` | `"sex"` | `"showLess"` | `"showMore"` | `"snackbarNotification"` | `"toggleDevTools"` | `"yearAbbreviation"` | `"yearsAbbreviation"` | `"closeWorkspaces2PromptTitle"` | `"closeWorkspaces2PromptBody"` | `"closeAllOpenedWorkspaces"` | `"closingAllWorkspacesPromptBody"` | `"closingAllWorkspacesPromptTitle"` | `"discard"` | `"hide"` | `"maximize"` | `"minimize"` | `"openAnyway"` | `"unsavedChangesInOpenedWorkspace"` | `"unsavedChangesInWorkspace"` | `"unsavedChangesTitleText"` | `"workspaceHeader"` | `"address1"` | `"address2"` | `"address3"` | `"address4"` | `"address5"` | `"address6"` | `"city"` | `"cityVillage"` | `"country"` | `"countyDistrict"` | `"district"` | `"postalCode"` | `"state"` | `"stateProvince"`
|
|
23
23
|
|
|
24
24
|
### defaultText?
|
|
25
25
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **getDefaultCalendar**(`locale`): `undefined` \| `CalendarIdentifier`
|
|
6
6
|
|
|
7
|
-
Defined in: packages/framework/esm-utils/
|
|
7
|
+
Defined in: [packages/framework/esm-utils/src/dates/date-util.ts:166](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-utils/src/dates/date-util.ts#L166)
|
|
8
8
|
|
|
9
9
|
Retrieves the default calendar for the specified locale if any.
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **getDefaultsFromConfigSchema**\<`T`\>(`schema`): `T`
|
|
6
6
|
|
|
7
|
-
Defined in: packages/framework/esm-utils/
|
|
7
|
+
Defined in: [packages/framework/esm-utils/src/test-helpers.ts:13](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-utils/src/test-helpers.ts#L13)
|
|
8
8
|
|
|
9
9
|
Given a config schema, this returns an object like is returned by `useConfig`
|
|
10
10
|
with all default values.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **getLocale**(): `string`
|
|
6
6
|
|
|
7
|
-
Defined in: packages/framework/esm-utils/
|
|
7
|
+
Defined in: [packages/framework/esm-utils/src/get-locale.ts:5](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-utils/src/get-locale.ts#L5)
|
|
8
8
|
|
|
9
9
|
Returns the current locale of the application.
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **getPatientName**(`patient`): `string`
|
|
6
6
|
|
|
7
|
-
Defined in: packages/framework/esm-utils/
|
|
7
|
+
Defined in: [packages/framework/esm-utils/src/patient-helpers.ts:14](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-utils/src/patient-helpers.ts#L14)
|
|
8
8
|
|
|
9
9
|
Gets the formatted display name for a patient.
|
|
10
10
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Function: ~~getVisitsForPatient()~~
|
|
4
4
|
|
|
5
|
-
> **getVisitsForPatient**(`patientUuid`, `abortController`, `v?`): `Promise
|
|
5
|
+
> **getVisitsForPatient**(`patientUuid`, `abortController`, `v?`): `Promise`\<[`FetchResponse`](../interfaces/FetchResponse.md)\<\{ `results`: [`Visit`](../interfaces/Visit.md)[]; \}\>\>
|
|
6
6
|
|
|
7
7
|
Defined in: [packages/framework/esm-emr-api/src/visit-utils.ts:180](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-emr-api/src/visit-utils.ts#L180)
|
|
8
8
|
|
|
@@ -22,7 +22,7 @@ Defined in: [packages/framework/esm-emr-api/src/visit-utils.ts:180](https://gith
|
|
|
22
22
|
|
|
23
23
|
## Returns
|
|
24
24
|
|
|
25
|
-
`Promise
|
|
25
|
+
`Promise`\<[`FetchResponse`](../interfaces/FetchResponse.md)\<\{ `results`: [`Visit`](../interfaces/Visit.md)[]; \}\>\>
|
|
26
26
|
|
|
27
27
|
## Deprecated
|
|
28
28
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **isOmrsDateStrict**(`omrsPayloadString`): `boolean`
|
|
6
6
|
|
|
7
|
-
Defined in: packages/framework/esm-utils/
|
|
7
|
+
Defined in: [packages/framework/esm-utils/src/dates/date-util.ts:35](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-utils/src/dates/date-util.ts#L35)
|
|
8
8
|
|
|
9
9
|
This function checks whether a date string is the OpenMRS ISO format.
|
|
10
10
|
The format should be YYYY-MM-DDTHH:mm:ss.SSSZZ
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **isOmrsDateToday**(`date`): `boolean`
|
|
6
6
|
|
|
7
|
-
Defined in: packages/framework/esm-utils/
|
|
7
|
+
Defined in: [packages/framework/esm-utils/src/dates/date-util.ts:66](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-utils/src/dates/date-util.ts#L66)
|
|
8
8
|
|
|
9
9
|
Checks if the provided date is today.
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **isOnline**(`online?`): `boolean`
|
|
6
6
|
|
|
7
|
-
Defined in: packages/framework/esm-utils/
|
|
7
|
+
Defined in: [packages/framework/esm-utils/src/is-online.ts:15](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-utils/src/is-online.ts#L15)
|
|
8
8
|
|
|
9
9
|
Determines if the application should behave as if it is online.
|
|
10
10
|
When offline mode is enabled (`window.offlineEnabled`), this returns the
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **isVersionSatisfied**(`requiredVersion`, `installedVersion`): `boolean`
|
|
6
6
|
|
|
7
|
-
Defined in: packages/framework/esm-utils/
|
|
7
|
+
Defined in: [packages/framework/esm-utils/src/version.ts:31](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-utils/src/version.ts#L31)
|
|
8
8
|
|
|
9
9
|
Checks if an installed version satisfies a required version range using
|
|
10
10
|
semver comparison. Handles prerelease versions and normalizes version strings.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Function: normalizeInterpretation()
|
|
4
4
|
|
|
5
|
-
> **normalizeInterpretation**(`interpretation`): `undefined` \| `"
|
|
5
|
+
> **normalizeInterpretation**(`interpretation`): `undefined` \| `"normal"` \| `"high"` \| `"low"` \| `"critically_low"` \| `"critically_high"` \| `"off_scale_low"` \| `"off_scale_high"`
|
|
6
6
|
|
|
7
7
|
Defined in: [packages/framework/esm-styleguide/src/numeric-observation/interpretation-utils.ts:42](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/numeric-observation/interpretation-utils.ts#L42)
|
|
8
8
|
|
|
@@ -12,8 +12,8 @@ Normalizes interpretation between lowercase (ObservationInterpretation) and uppe
|
|
|
12
12
|
|
|
13
13
|
### interpretation
|
|
14
14
|
|
|
15
|
-
`undefined` | `"
|
|
15
|
+
`undefined` | `"normal"` | `"high"` | `"low"` | `"NORMAL"` | `"HIGH"` | `"CRITICALLY_HIGH"` | `"OFF_SCALE_HIGH"` | `"LOW"` | `"CRITICALLY_LOW"` | `"OFF_SCALE_LOW"` | `"critically_low"` | `"critically_high"` | `"off_scale_low"` | `"off_scale_high"` | `"--"`
|
|
16
16
|
|
|
17
17
|
## Returns
|
|
18
18
|
|
|
19
|
-
`undefined` \| `"
|
|
19
|
+
`undefined` \| `"normal"` \| `"high"` \| `"low"` \| `"critically_low"` \| `"critically_high"` \| `"off_scale_low"` \| `"off_scale_high"`
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **parseDate**(`dateString`): `Date`
|
|
6
6
|
|
|
7
|
-
Defined in: packages/framework/esm-utils/
|
|
7
|
+
Defined in: [packages/framework/esm-utils/src/dates/date-util.ts:99](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-utils/src/dates/date-util.ts#L99)
|
|
8
8
|
|
|
9
9
|
Utility function to parse an arbitrary string into a date.
|
|
10
10
|
Uses `dayjs(dateString)`.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **registerDefaultCalendar**(`locale`, `calendar`): `void`
|
|
6
6
|
|
|
7
|
-
Defined in: packages/framework/esm-utils/
|
|
7
|
+
Defined in: [packages/framework/esm-utils/src/dates/date-util.ts:157](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-utils/src/dates/date-util.ts#L157)
|
|
8
8
|
|
|
9
9
|
Provides the name of the calendar to associate, as a default, with the given base locale.
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **reportError**(`err`): `void`
|
|
6
6
|
|
|
7
|
-
Defined in: packages/framework/esm-error-handling/
|
|
7
|
+
Defined in: [packages/framework/esm-error-handling/src/index.ts:43](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-error-handling/src/index.ts#L43)
|
|
8
8
|
|
|
9
9
|
Reports an error to the global error handler. The error will be displayed
|
|
10
10
|
to the user as a toast notification. This function ensures the error is
|
package/docs/functions/retry.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
# Function: retry()
|
|
4
4
|
|
|
5
|
-
> **retry**\<`T`\>(`fn`, `options
|
|
5
|
+
> **retry**\<`T`\>(`fn`, `options`): `Promise`\<`T`\>
|
|
6
6
|
|
|
7
|
-
Defined in: packages/framework/esm-utils/
|
|
7
|
+
Defined in: [packages/framework/esm-utils/src/retry.ts:40](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-utils/src/retry.ts#L40)
|
|
8
8
|
|
|
9
9
|
Executes the specified function and retries executing on failure with a custom backoff strategy
|
|
10
10
|
defined by the options.
|
|
@@ -27,9 +27,9 @@ If not configured otherwise, this function uses the following default options:
|
|
|
27
27
|
|
|
28
28
|
The function to be executed and retried on failure.
|
|
29
29
|
|
|
30
|
-
### options
|
|
30
|
+
### options
|
|
31
31
|
|
|
32
|
-
[`RetryOptions`](../interfaces/RetryOptions.md)
|
|
32
|
+
[`RetryOptions`](../interfaces/RetryOptions.md) = `{}`
|
|
33
33
|
|
|
34
34
|
Additional options which configure the retry behavior.
|
|
35
35
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Function: saveVisit()
|
|
4
4
|
|
|
5
|
-
> **saveVisit**(`payload`, `abortController`): `Promise
|
|
5
|
+
> **saveVisit**(`payload`, `abortController`): `Promise`\<[`FetchResponse`](../interfaces/FetchResponse.md)\<[`Visit`](../interfaces/Visit.md)\>\>
|
|
6
6
|
|
|
7
7
|
Defined in: [packages/framework/esm-emr-api/src/visit-utils.ts:134](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-emr-api/src/visit-utils.ts#L134)
|
|
8
8
|
|
|
@@ -25,7 +25,7 @@ An AbortController to allow cancellation of the request.
|
|
|
25
25
|
|
|
26
26
|
## Returns
|
|
27
27
|
|
|
28
|
-
`Promise
|
|
28
|
+
`Promise`\<[`FetchResponse`](../interfaces/FetchResponse.md)\<[`Visit`](../interfaces/Visit.md)\>\>
|
|
29
29
|
|
|
30
30
|
A Promise that resolves with the FetchResponse containing the created Visit.
|
|
31
31
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **selectPreferredName**(`patient`, ...`preferredNames`): `undefined` \| `HumanName`
|
|
6
6
|
|
|
7
|
-
Defined in: packages/framework/esm-utils/
|
|
7
|
+
Defined in: [packages/framework/esm-utils/src/patient-helpers.ts:60](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-utils/src/patient-helpers.ts#L60)
|
|
8
8
|
|
|
9
9
|
Select the preferred name from the collection of names associated with a patient.
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **shallowEqual**(`a`, `b`): `boolean`
|
|
6
6
|
|
|
7
|
-
Defined in: packages/framework/esm-utils/
|
|
7
|
+
Defined in: [packages/framework/esm-utils/src/shallowEqual.ts:13](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-utils/src/shallowEqual.ts#L13)
|
|
8
8
|
|
|
9
9
|
Checks whether two objects are equal, using a shallow comparison, similar to React.
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **subscribeActionableNotificationShown**(`cb`): () => `void`
|
|
6
6
|
|
|
7
|
-
Defined in: packages/framework/esm-globals/
|
|
7
|
+
Defined in: [packages/framework/esm-globals/src/events.ts:116](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-globals/src/events.ts#L116)
|
|
8
8
|
|
|
9
9
|
## Parameters
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **subscribeConnectivity**(`cb`): () => `void`
|
|
6
6
|
|
|
7
|
-
Defined in: packages/framework/esm-globals/
|
|
7
|
+
Defined in: [packages/framework/esm-globals/src/events.ts:24](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-globals/src/events.ts#L24)
|
|
8
8
|
|
|
9
9
|
## Parameters
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **subscribeConnectivityChanged**(`cb`): () => `void`
|
|
6
6
|
|
|
7
|
-
Defined in: packages/framework/esm-globals/
|
|
7
|
+
Defined in: [packages/framework/esm-globals/src/events.ts:13](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-globals/src/events.ts#L13)
|
|
8
8
|
|
|
9
9
|
## Parameters
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **subscribeNotificationShown**(`cb`): () => `void`
|
|
6
6
|
|
|
7
|
-
Defined in: packages/framework/esm-globals/
|
|
7
|
+
Defined in: [packages/framework/esm-globals/src/events.ts:109](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-globals/src/events.ts#L109)
|
|
8
8
|
|
|
9
9
|
## Parameters
|
|
10
10
|
|