@medplum/react 5.1.24 → 5.1.27
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/dist/cjs/index.cjs +10 -9
- package/dist/cjs/index.cjs.map +4 -4
- package/dist/cjs/index.css +1 -1
- package/dist/cjs/index.css.map +4 -4
- package/dist/cjs/index.d.ts +239 -17
- package/dist/esm/index.css +1 -1
- package/dist/esm/index.css.map +4 -4
- package/dist/esm/index.d.ts +239 -17
- package/dist/esm/index.mjs +10 -9
- package/dist/esm/index.mjs.map +4 -4
- package/package.json +18 -18
package/dist/esm/index.d.ts
CHANGED
|
@@ -52,8 +52,14 @@ import type { MantineColor } from '@mantine/core';
|
|
|
52
52
|
import type { MeasureReport } from '@medplum/fhirtypes';
|
|
53
53
|
import type { Media } from '@medplum/fhirtypes';
|
|
54
54
|
import type { Medication } from '@medplum/fhirtypes';
|
|
55
|
+
import type { MedicationCartClearRequest } from '@medplum/core';
|
|
56
|
+
import type { MedicationCartManageResponse } from '@medplum/core';
|
|
57
|
+
import type { MedicationCartRemoveRequest } from '@medplum/core';
|
|
58
|
+
import type { MedicationCheckoutRequest } from '@medplum/core';
|
|
59
|
+
import type { MedicationCheckoutResponse } from '@medplum/core';
|
|
55
60
|
import type { MedicationOrderRequest } from '@medplum/core';
|
|
56
61
|
import type { MedicationOrderResponse } from '@medplum/core';
|
|
62
|
+
import type { MedicationRequest } from '@medplum/fhirtypes';
|
|
57
63
|
import type { MedicationSearchParams } from '@medplum/core';
|
|
58
64
|
import type { MedplumClient } from '@medplum/core';
|
|
59
65
|
import { MemoExoticComponent } from 'react';
|
|
@@ -66,8 +72,10 @@ import type { ObservationDefinitionQualifiedInterval } from '@medplum/fhirtypes'
|
|
|
66
72
|
import type { OperationOutcome } from '@medplum/fhirtypes';
|
|
67
73
|
import type { OperationOutcomeIssue } from '@medplum/fhirtypes';
|
|
68
74
|
import { Operator } from '@medplum/core';
|
|
75
|
+
import type { OrderSetSyncResponse } from '@medplum/core';
|
|
69
76
|
import type { Organization } from '@medplum/fhirtypes';
|
|
70
77
|
import type { PaperProps } from '@mantine/core';
|
|
78
|
+
import type { PasswordInputProps } from '@mantine/core';
|
|
71
79
|
import type { Patient } from '@medplum/fhirtypes';
|
|
72
80
|
import { PATIENT_PREFERRED_PHARMACY_URL } from '@medplum/core';
|
|
73
81
|
import type { Period } from '@medplum/fhirtypes';
|
|
@@ -98,6 +106,7 @@ import { removePreferredPharmacyFromPatient } from '@medplum/core';
|
|
|
98
106
|
import type { RequestGroup } from '@medplum/fhirtypes';
|
|
99
107
|
import type { Resource } from '@medplum/fhirtypes';
|
|
100
108
|
import type { ResourceArray } from '@medplum/core';
|
|
109
|
+
import type { ResourceModifiedEvent } from '@medplum/core';
|
|
101
110
|
import type { ResourceType } from '@medplum/fhirtypes';
|
|
102
111
|
import type { Schedule } from '@medplum/fhirtypes';
|
|
103
112
|
import type { SearchParameter } from '@medplum/fhirtypes';
|
|
@@ -469,6 +478,16 @@ export declare function buildInitialResponse(questionnaire: Questionnaire, quest
|
|
|
469
478
|
|
|
470
479
|
export declare function buildInitialResponseItem(item: QuestionnaireItem): QuestionnaireResponseItem;
|
|
471
480
|
|
|
481
|
+
/**
|
|
482
|
+
* Returns a display label for a search parameter code.
|
|
483
|
+
*
|
|
484
|
+
* Meta fields keep their underscore-prefixed code so they don't collide with same-named
|
|
485
|
+
* elements (e.g. `ProjectMembership.project` vs `_project`).
|
|
486
|
+
* @param code - The search parameter code.
|
|
487
|
+
* @returns The display label for the search parameter.
|
|
488
|
+
*/
|
|
489
|
+
export declare function buildSearchParamFieldLabel(code: string): string;
|
|
490
|
+
|
|
472
491
|
export declare function CalendarDateInput(props: CalendarDateInputProps): JSX.Element;
|
|
473
492
|
|
|
474
493
|
export declare interface CalendarDateInputProps {
|
|
@@ -1048,6 +1067,13 @@ export declare function isCheckboxCell(el: Element): boolean;
|
|
|
1048
1067
|
*/
|
|
1049
1068
|
export declare function isChoiceQuestion(item: QuestionnaireItem): boolean;
|
|
1050
1069
|
|
|
1070
|
+
/**
|
|
1071
|
+
* Returns true if the given search parameter code refers to a resource metadata field.
|
|
1072
|
+
* @param code - The search parameter code.
|
|
1073
|
+
* @returns True if the code is a meta search parameter.
|
|
1074
|
+
*/
|
|
1075
|
+
export declare function isMetaSearchParam(code: string): boolean;
|
|
1076
|
+
|
|
1051
1077
|
export { isOrganizationArray }
|
|
1052
1078
|
|
|
1053
1079
|
/**
|
|
@@ -1062,6 +1088,15 @@ export declare function isSortDescending(definition: SearchRequest): boolean;
|
|
|
1062
1088
|
|
|
1063
1089
|
export declare function isSupportedProfileStructureDefinition(profile?: StructureDefinition): profile is SupportedProfileStructureDefinition;
|
|
1064
1090
|
|
|
1091
|
+
/**
|
|
1092
|
+
* Returns true if an error thrown while expanding a ValueSet means the value set itself is
|
|
1093
|
+
* unavailable — a permanent 400/404 (e.g. "ValueSet not found"). Transient failures (429 rate
|
|
1094
|
+
* limit, 401, 5xx, network) return false so a blip never disables a field.
|
|
1095
|
+
* @param err - The error thrown by `valueSetExpand`.
|
|
1096
|
+
* @returns True for a permanent 400/404, false for a transient failure.
|
|
1097
|
+
*/
|
|
1098
|
+
export declare function isValueSetUnavailableError(err: unknown): boolean;
|
|
1099
|
+
|
|
1065
1100
|
/**
|
|
1066
1101
|
* Kills a browser event.
|
|
1067
1102
|
* Prevents default behavior.
|
|
@@ -1090,8 +1125,8 @@ export declare interface LinkTabsProps extends Omit<TabsProps, 'value' | 'onChan
|
|
|
1090
1125
|
* @returns The ListWithDetailPane React node.
|
|
1091
1126
|
*/
|
|
1092
1127
|
export declare function ListWithDetailPane<T extends {
|
|
1093
|
-
id
|
|
1094
|
-
} =
|
|
1128
|
+
id?: string;
|
|
1129
|
+
} = Resource>(props: ListWithDetailPaneProps<T>): JSX.Element;
|
|
1095
1130
|
|
|
1096
1131
|
export declare interface ListWithDetailPaneDetailContext {
|
|
1097
1132
|
readonly refresh: () => Promise<void>;
|
|
@@ -1101,21 +1136,21 @@ export declare interface ListWithDetailPaneDetailContext {
|
|
|
1101
1136
|
export declare type ListWithDetailPaneHeaderProps = ListWithDetailPaneTextHeaderProps | ListWithDetailPaneTabsHeaderProps;
|
|
1102
1137
|
|
|
1103
1138
|
export declare interface ListWithDetailPaneItemContext<T extends {
|
|
1104
|
-
id
|
|
1105
|
-
} =
|
|
1139
|
+
id?: string;
|
|
1140
|
+
} = Resource> {
|
|
1106
1141
|
readonly selected: boolean;
|
|
1107
1142
|
readonly index: number;
|
|
1108
1143
|
readonly items: T[];
|
|
1109
1144
|
}
|
|
1110
1145
|
|
|
1111
1146
|
export declare type ListWithDetailPaneProps<T extends {
|
|
1112
|
-
id
|
|
1113
|
-
} =
|
|
1147
|
+
id?: string;
|
|
1148
|
+
} = Resource> = ListWithDetailPanePropsBase<T> & ListWithDetailPaneHeaderProps;
|
|
1114
1149
|
|
|
1115
1150
|
/** Props shared by every ListWithDetailPane, independent of the header style. */
|
|
1116
1151
|
export declare interface ListWithDetailPanePropsBase<T extends {
|
|
1117
|
-
id
|
|
1118
|
-
} =
|
|
1152
|
+
id?: string;
|
|
1153
|
+
} = Resource> {
|
|
1119
1154
|
/** The current page of items to render in the list. */
|
|
1120
1155
|
readonly items: T[];
|
|
1121
1156
|
/** When true, the list area shows the skeleton instead of items. */
|
|
@@ -1189,8 +1224,13 @@ export declare interface MeasureReportDisplayProps {
|
|
|
1189
1224
|
readonly measureReport: MeasureReport | Reference<MeasureReport>;
|
|
1190
1225
|
}
|
|
1191
1226
|
|
|
1227
|
+
/** Thrown by {@link UseMedicationCartReturn.checkout} when an {@link UseMedicationCartReturn.addToCart} call is still in flight. */
|
|
1228
|
+
export declare const MEDICATION_CART_ADD_IN_PROGRESS = "Cannot checkout while a medication is still being added to the cart";
|
|
1229
|
+
|
|
1192
1230
|
export declare interface MedicationIFrameOptions {
|
|
1193
1231
|
readonly patientId?: string;
|
|
1232
|
+
/** Selected practice location for multi-practice deployments. */
|
|
1233
|
+
readonly organization?: Reference<Organization>;
|
|
1194
1234
|
readonly onPatientSyncSuccess?: () => void;
|
|
1195
1235
|
readonly onIframeSuccess?: (url: string) => void;
|
|
1196
1236
|
readonly onError?: (err: unknown) => void;
|
|
@@ -1439,6 +1479,7 @@ export declare function OperationOutcomeAlert(props: OperationOutcomeAlertProps)
|
|
|
1439
1479
|
export declare interface OperationOutcomeAlertProps extends AlertProps {
|
|
1440
1480
|
readonly outcome?: OperationOutcome;
|
|
1441
1481
|
readonly issues?: OperationOutcomeIssue[];
|
|
1482
|
+
readonly displayOkOutcomes?: boolean;
|
|
1442
1483
|
}
|
|
1443
1484
|
|
|
1444
1485
|
export declare function Panel(props: PanelProps): JSX.Element;
|
|
@@ -1463,6 +1504,15 @@ export declare interface ParticipantFilterProps {
|
|
|
1463
1504
|
readonly onFilterChange: (participants: Reference<Patient | Practitioner>[]) => void;
|
|
1464
1505
|
}
|
|
1465
1506
|
|
|
1507
|
+
/**
|
|
1508
|
+
* Mantine's `PasswordInput` sets `tabIndex={-1}` and `aria-hidden` on the visibility toggle button
|
|
1509
|
+
* unless `visibilityToggleButtonProps` is provided, which removes it from the keyboard tab order and
|
|
1510
|
+
* hides it from assistive technology. This wrapper defaults the toggle to be keyboard accessible.
|
|
1511
|
+
* @param props - The password input props.
|
|
1512
|
+
* @returns The password input component.
|
|
1513
|
+
*/
|
|
1514
|
+
export declare function PasswordInput(props: PasswordInputProps): JSX.Element;
|
|
1515
|
+
|
|
1466
1516
|
export { PATIENT_PREFERRED_PHARMACY_URL }
|
|
1467
1517
|
|
|
1468
1518
|
export declare function PatientAccountsForm(props: PatientAccountsFormProps): JSX.Element;
|
|
@@ -1561,8 +1611,33 @@ export declare interface PharmacyDialogProps {
|
|
|
1561
1611
|
readonly patient: Patient;
|
|
1562
1612
|
readonly onSubmit: (pharmacy: Organization) => void;
|
|
1563
1613
|
readonly onClose: () => void;
|
|
1564
|
-
readonly onSearch: (params: PharmacySearchParams) => Promise<Organization[]>;
|
|
1614
|
+
readonly onSearch: (params: PharmacySearchParams & Record<string, unknown>) => Promise<Organization[]>;
|
|
1565
1615
|
readonly onAddToFavorites: (params: AddFavoriteParams) => Promise<AddPharmacyResponse>;
|
|
1616
|
+
/** Optional fields rendered inside the search form above the submit button. */
|
|
1617
|
+
readonly renderBeforeSearchButton?: ReactNode;
|
|
1618
|
+
/**
|
|
1619
|
+
* Extra search parameters merged into the bot request (e.g. vendor-specific filters).
|
|
1620
|
+
* `handleSearch` depends on this callback, so callers should memoize it (e.g. `useCallback`)
|
|
1621
|
+
* to avoid re-creating the search handler on every render.
|
|
1622
|
+
*/
|
|
1623
|
+
readonly getExtraSearchParams?: () => Record<string, unknown>;
|
|
1624
|
+
/** Optional per-field placeholder overrides for the search form. */
|
|
1625
|
+
readonly searchPlaceholders?: PharmacySearchFieldPlaceholders;
|
|
1626
|
+
}
|
|
1627
|
+
|
|
1628
|
+
/**
|
|
1629
|
+
* Placeholder text for each pharmacy search field. Vendors can override these to
|
|
1630
|
+
* reflect their own API constraints (e.g. DoseSpot requires a 3-character minimum
|
|
1631
|
+
* on text searches, whereas ScriptSure expects a 2-letter state and 5-digit ZIP).
|
|
1632
|
+
*/
|
|
1633
|
+
export declare interface PharmacySearchFieldPlaceholders {
|
|
1634
|
+
readonly name?: string;
|
|
1635
|
+
readonly city?: string;
|
|
1636
|
+
readonly state?: string;
|
|
1637
|
+
readonly zip?: string;
|
|
1638
|
+
readonly phoneOrFax?: string;
|
|
1639
|
+
readonly address?: string;
|
|
1640
|
+
readonly ncpdpID?: string;
|
|
1566
1641
|
}
|
|
1567
1642
|
|
|
1568
1643
|
export { PharmacySearchParams }
|
|
@@ -1837,6 +1912,7 @@ export declare interface RegisterFormProps {
|
|
|
1837
1912
|
readonly recaptchaSiteKey?: string;
|
|
1838
1913
|
readonly children?: ReactNode;
|
|
1839
1914
|
readonly onSuccess: () => void;
|
|
1915
|
+
readonly onSignIn?: () => void;
|
|
1840
1916
|
}
|
|
1841
1917
|
|
|
1842
1918
|
/**
|
|
@@ -2184,6 +2260,22 @@ export declare class SearchClickEvent extends Event {
|
|
|
2184
2260
|
*/
|
|
2185
2261
|
export declare function SearchControl(props: SearchControlProps): JSX.Element;
|
|
2186
2262
|
|
|
2263
|
+
/**
|
|
2264
|
+
* An additional, computed column appended after the search-result columns.
|
|
2265
|
+
*
|
|
2266
|
+
* Unlike the columns derived from {@link SearchControlProps.search} fields, an
|
|
2267
|
+
* additional column is not backed by a search parameter and has no sort/filter
|
|
2268
|
+
* menu: it renders arbitrary content per row. Use it for values that must be
|
|
2269
|
+
* computed or fetched separately from the searched resource (e.g. a related
|
|
2270
|
+
* resource's status).
|
|
2271
|
+
*/
|
|
2272
|
+
export declare interface SearchControlAdditionalColumn {
|
|
2273
|
+
/** The column header text. */
|
|
2274
|
+
readonly name: string;
|
|
2275
|
+
/** Renders the cell contents for the given row resource. */
|
|
2276
|
+
readonly renderCell: (resource: Resource) => ReactNode;
|
|
2277
|
+
}
|
|
2278
|
+
|
|
2187
2279
|
/**
|
|
2188
2280
|
* The SearchControlField type describes a field in the search control.
|
|
2189
2281
|
*
|
|
@@ -2220,6 +2312,8 @@ export declare interface SearchControlField {
|
|
|
2220
2312
|
export declare interface SearchControlProps {
|
|
2221
2313
|
readonly search: SearchRequest;
|
|
2222
2314
|
readonly checkboxesEnabled?: boolean;
|
|
2315
|
+
/** Additional computed columns rendered after the search-result columns. */
|
|
2316
|
+
readonly additionalColumns?: readonly SearchControlAdditionalColumn[];
|
|
2223
2317
|
readonly hideToolbar?: boolean;
|
|
2224
2318
|
readonly hideFilters?: boolean;
|
|
2225
2319
|
readonly onLoad?: (e: SearchLoadEvent) => void;
|
|
@@ -2558,8 +2652,63 @@ export declare type TranscriptItem = {
|
|
|
2558
2652
|
|
|
2559
2653
|
export declare function typedValueToResponseItem(item: QuestionnaireItem, value: TypedValue): QuestionnaireResponseItemAnswer | undefined;
|
|
2560
2654
|
|
|
2655
|
+
export declare function UnavailableNote({ text, color, message }: UnavailableNoteProps): JSX.Element;
|
|
2656
|
+
|
|
2657
|
+
export declare interface UnavailableNoteProps {
|
|
2658
|
+
readonly text: string;
|
|
2659
|
+
readonly color: string;
|
|
2660
|
+
readonly message: string;
|
|
2661
|
+
}
|
|
2662
|
+
|
|
2561
2663
|
export declare const useCachedBinaryUrl: (binaryUrl: string | undefined) => string | undefined;
|
|
2562
2664
|
|
|
2665
|
+
/**
|
|
2666
|
+
* Vendor-neutral hook for the full **medication cart** lifecycle: add a draft
|
|
2667
|
+
* line (`createResource`), check out a set of drafts into the vendor's batch
|
|
2668
|
+
* approval queue (`$checkout-medications`), and remove/clear cart lines
|
|
2669
|
+
* (`$remove-cart-medication` / `$clear-cart`).
|
|
2670
|
+
*
|
|
2671
|
+
* Cart checkout / remove / clear hit project-scoped **FHIR custom operations**
|
|
2672
|
+
* whose backing Bot is chosen at deploy time via an `OperationDefinition`
|
|
2673
|
+
* carrying the `operationDefinition-implementation` extension — see
|
|
2674
|
+
* [bot operations docs](https://www.medplum.com/docs/bots/custom-fhir-operations).
|
|
2675
|
+
* The server's `tryCustomOperation` dispatch handles the OD → Bot lookup, so
|
|
2676
|
+
* projects swap vendors by deploying a different bot under the same code.
|
|
2677
|
+
*
|
|
2678
|
+
* `addToCart` is plain FHIR `createResource` (no `$add-cart` operation): the
|
|
2679
|
+
* Medplum-side cart is the set of draft `MedicationRequest`s. Vendor staging
|
|
2680
|
+
* (e.g. ScriptSure MedCart) happens at checkout. Vendors without a batch
|
|
2681
|
+
* approval queue (e.g. DoseSpot iframe-first) simply never call `checkout` /
|
|
2682
|
+
* `removeFromCart` / `clearCart`.
|
|
2683
|
+
*
|
|
2684
|
+
* Requests for the custom operations are encoded as `Parameters` bodies and
|
|
2685
|
+
* decoded by the matching `@medplum/core` helpers. Per-line outcomes arrive in
|
|
2686
|
+
* `response.items`.
|
|
2687
|
+
*
|
|
2688
|
+
* @returns Cart add / checkout / remove / clear callbacks plus `adding` state.
|
|
2689
|
+
*/
|
|
2690
|
+
export declare function useMedicationCart(): UseMedicationCartReturn;
|
|
2691
|
+
|
|
2692
|
+
export declare interface UseMedicationCartReturn {
|
|
2693
|
+
/**
|
|
2694
|
+
* Persist a draft `MedicationRequest` as a cart line via plain FHIR
|
|
2695
|
+
* `createResource` (no custom operation). Vendor staging happens later at
|
|
2696
|
+
* {@link UseMedicationCartReturn.checkout}.
|
|
2697
|
+
*/
|
|
2698
|
+
addToCart: (medicationRequest: MedicationRequest) => Promise<MedicationRequest>;
|
|
2699
|
+
/** True while one or more {@link UseMedicationCartReturn.addToCart} calls are in flight. */
|
|
2700
|
+
adding: boolean;
|
|
2701
|
+
/**
|
|
2702
|
+
* Submit draft cart lines to the vendor's batch approval queue and return an
|
|
2703
|
+
* embeddable approval-widget URL. Refuses while {@link UseMedicationCartReturn.adding} is true.
|
|
2704
|
+
*/
|
|
2705
|
+
checkout: (input: MedicationCheckoutRequest) => Promise<MedicationCheckoutResponse>;
|
|
2706
|
+
/** Remove a single draft `MedicationRequest` from the patient's vendor cart. */
|
|
2707
|
+
removeFromCart: (input: MedicationCartRemoveRequest) => Promise<MedicationCartManageResponse>;
|
|
2708
|
+
/** Remove every item from the patient's vendor cart. */
|
|
2709
|
+
clearCart: (input: MedicationCartClearRequest) => Promise<MedicationCartManageResponse>;
|
|
2710
|
+
}
|
|
2711
|
+
|
|
2563
2712
|
/**
|
|
2564
2713
|
* Generic React hook that syncs a patient to a medication-order vendor and
|
|
2565
2714
|
* returns the chart iframe URL.
|
|
@@ -2643,6 +2792,8 @@ export declare interface UseMedicationOrderSetOptions {
|
|
|
2643
2792
|
/** Vendor-side order set id, when picked directly (escape hatch when no synced PD exists yet). */
|
|
2644
2793
|
readonly vendorOrderSetId?: number | string;
|
|
2645
2794
|
readonly appId?: string;
|
|
2795
|
+
/** Selected practice location for multi-practice deployments. */
|
|
2796
|
+
readonly organization?: Reference<Organization>;
|
|
2646
2797
|
}
|
|
2647
2798
|
|
|
2648
2799
|
export declare interface UseMedicationOrderSetReturn {
|
|
@@ -2725,14 +2876,18 @@ export declare function usePatientSummaryData(patient: Patient | Reference<Patie
|
|
|
2725
2876
|
* Encapsulates calls to a search-pharmacy bot and an add-patient-pharmacy bot,
|
|
2726
2877
|
* and can be composed with the generic `PharmacyDialog` component from `@medplum/react`.
|
|
2727
2878
|
*
|
|
2879
|
+
* The search param type is generic so vendor hooks can widen it with their own
|
|
2880
|
+
* filters (e.g. ScriptSure `specialties`); the extra keys are passed through to
|
|
2881
|
+
* the bot as-is at runtime.
|
|
2882
|
+
*
|
|
2728
2883
|
* @param searchBotIdentifier - Bot identifier for the pharmacy search bot.
|
|
2729
2884
|
* @param addPharmacyBotIdentifier - Bot identifier for the add-patient-pharmacy bot.
|
|
2730
2885
|
* @returns An object with `searchPharmacies` and `addToFavorites` callbacks.
|
|
2731
2886
|
*/
|
|
2732
|
-
export declare function usePharmacySearch(searchBotIdentifier: Identifier, addPharmacyBotIdentifier: Identifier): UsePharmacySearchReturn
|
|
2887
|
+
export declare function usePharmacySearch<T extends PharmacySearchParams = PharmacySearchParams>(searchBotIdentifier: Identifier, addPharmacyBotIdentifier: Identifier): UsePharmacySearchReturn<T>;
|
|
2733
2888
|
|
|
2734
|
-
export declare interface UsePharmacySearchReturn {
|
|
2735
|
-
searchPharmacies: (params:
|
|
2889
|
+
export declare interface UsePharmacySearchReturn<T extends PharmacySearchParams = PharmacySearchParams> {
|
|
2890
|
+
searchPharmacies: (params: T) => Promise<Organization[]>;
|
|
2736
2891
|
addToFavorites: (params: AddFavoriteParams) => Promise<AddPharmacyResponse>;
|
|
2737
2892
|
}
|
|
2738
2893
|
|
|
@@ -2802,6 +2957,30 @@ export declare interface UseResourceBoardResult<T extends Resource = Resource> {
|
|
|
2802
2957
|
readonly refresh: () => Promise<void>;
|
|
2803
2958
|
}
|
|
2804
2959
|
|
|
2960
|
+
/**
|
|
2961
|
+
* React hook for observing FHIR resource modifications made through the Medplum client.
|
|
2962
|
+
*
|
|
2963
|
+
* The callback is invoked whenever this client instance creates, updates, patches, or deletes
|
|
2964
|
+
* a resource of one of the given types, including modifications announced with
|
|
2965
|
+
* `MedplumClient.notifyResourceModified`. Use it to keep local component state in sync with
|
|
2966
|
+
* mutations made elsewhere in the application. Subscribing to a single resource type narrows
|
|
2967
|
+
* the event so `event.resource` is typed to that resource, no type guard required:
|
|
2968
|
+
*
|
|
2969
|
+
* ```tsx
|
|
2970
|
+
* useResourceModified('Slot', (event) => {
|
|
2971
|
+
* // event.resource is `WithId<Slot> | undefined`
|
|
2972
|
+
* });
|
|
2973
|
+
* useResourceModified(['Slot', 'Appointment'], () => refreshSchedule());
|
|
2974
|
+
* ```
|
|
2975
|
+
*
|
|
2976
|
+
* Modifications made by other clients (or other users) are not observed;
|
|
2977
|
+
* use `useSubscription` for server-side change notifications.
|
|
2978
|
+
*
|
|
2979
|
+
* @param resourceType - The resource type or types to observe.
|
|
2980
|
+
* @param callback - Invoked with the event payload for each matching modification.
|
|
2981
|
+
*/
|
|
2982
|
+
export declare function useResourceModified<K extends ResourceType>(resourceType: K | K[], callback: (event: ResourceModifiedEvent<ExtractResource<K>>) => void): void;
|
|
2983
|
+
|
|
2805
2984
|
/**
|
|
2806
2985
|
* React hook for searching FHIR resources.
|
|
2807
2986
|
*
|
|
@@ -2875,13 +3054,18 @@ export declare type UseSubscriptionOptions = {
|
|
|
2875
3054
|
* to the configured e-prescribing vendor via the `$sync-orderset` custom FHIR operation
|
|
2876
3055
|
* (`POST /fhir/R4/PlanDefinition/$sync-orderset`).
|
|
2877
3056
|
*
|
|
2878
|
-
*
|
|
2879
|
-
*
|
|
2880
|
-
*
|
|
3057
|
+
* Resolves with the decoded `OrderSetSyncResponse` so callers can surface
|
|
3058
|
+
* per-action failures (`results[i].status === 'failed'` / `failedCount > 0`) —
|
|
3059
|
+
* without this, an order set that only partially synced would silently apply
|
|
3060
|
+
* with fewer meds than the PlanDefinition requested.
|
|
3061
|
+
*
|
|
3062
|
+
* Resolves with `undefined` when the operation is not deployed (i.e. no
|
|
3063
|
+
* e-prescribing vendor is configured for the project), so callers do not need to
|
|
3064
|
+
* guard against missing integrations.
|
|
2881
3065
|
*
|
|
2882
|
-
* @returns A stable `syncOrderSet(planDefinitionId)` callback.
|
|
3066
|
+
* @returns A stable `syncOrderSet(planDefinitionId, organization?)` callback.
|
|
2883
3067
|
*/
|
|
2884
|
-
export declare function useSyncOrderSet(): (planDefinitionId: string) => Promise<
|
|
3068
|
+
export declare function useSyncOrderSet(): (planDefinitionId: string, organization?: Reference<Organization>) => Promise<OrderSetSyncResponse | undefined>;
|
|
2885
3069
|
|
|
2886
3070
|
export declare function useThreadInbox({ query, threadId }: UseThreadInboxOptions): UseThreadInboxReturn;
|
|
2887
3071
|
|
|
@@ -2901,6 +3085,30 @@ export declare interface UseThreadInboxReturn {
|
|
|
2901
3085
|
refreshThreadMessages: () => Promise<void>;
|
|
2902
3086
|
}
|
|
2903
3087
|
|
|
3088
|
+
/**
|
|
3089
|
+
* Probes a set of ValueSet URLs for availability, each with a filter-free, count-limited expansion.
|
|
3090
|
+
*
|
|
3091
|
+
* A filter-free probe means a 400/404 unambiguously describes the value set itself (unlike a
|
|
3092
|
+
* user-typed search, whose 400 can be filter-specific), so the verdict is safe to act on. Repeated
|
|
3093
|
+
* probes of the same URL are deduplicated by the `MedplumClient` request cache, which caches
|
|
3094
|
+
* rejections too, so many fields bound to the same missing value set cost one request. Recovery
|
|
3095
|
+
* after a value set is imported happens on the next mount (i.e. a page refresh) — there is no live
|
|
3096
|
+
* subscription. Transient failures (429/5xx/network) resolve as available so a blip never disables
|
|
3097
|
+
* a field; only a permanent 400/404 marks a URL unavailable.
|
|
3098
|
+
* @param urls - The ValueSet URLs to probe. Falsy entries are ignored, and duplicates collapse to a
|
|
3099
|
+
* single probe.
|
|
3100
|
+
* @returns The availability verdict, with `loading` true until every requested URL has settled.
|
|
3101
|
+
*/
|
|
3102
|
+
export declare function useValueSetAvailabilities(urls: readonly (string | undefined)[]): ValueSetAvailability;
|
|
3103
|
+
|
|
3104
|
+
/**
|
|
3105
|
+
* Probes a single ValueSet's availability once on mount. A thin wrapper around
|
|
3106
|
+
* {@link useValueSetAvailabilities} for the common single-value-set case.
|
|
3107
|
+
* @param url - The ValueSet URL, or undefined for unbound inputs (always available).
|
|
3108
|
+
* @returns undefined while the probe is in flight, true if available, false if unavailable.
|
|
3109
|
+
*/
|
|
3110
|
+
export declare function useValueSetAvailability(url: string | undefined): boolean | undefined;
|
|
3111
|
+
|
|
2904
3112
|
export declare function useWhisper({ language, model, onTranscript, idleTimeoutMs, }: UseWhisperOptions): UseWhisperResult;
|
|
2905
3113
|
|
|
2906
3114
|
export declare type UseWhisperOptions = {
|
|
@@ -2922,6 +3130,8 @@ export declare type UseWhisperResult = {
|
|
|
2922
3130
|
start: () => Promise<void>;
|
|
2923
3131
|
stop: () => void;
|
|
2924
3132
|
isListening: boolean;
|
|
3133
|
+
muted: boolean;
|
|
3134
|
+
setMuted: (value: boolean) => void;
|
|
2925
3135
|
};
|
|
2926
3136
|
|
|
2927
3137
|
/**
|
|
@@ -2940,6 +3150,18 @@ export declare interface ValueSetAutocompleteProps extends Omit<AsyncAutocomplet
|
|
|
2940
3150
|
readonly withHelpText?: boolean;
|
|
2941
3151
|
}
|
|
2942
3152
|
|
|
3153
|
+
/**
|
|
3154
|
+
* The result of probing one or more ValueSet URLs for availability.
|
|
3155
|
+
*/
|
|
3156
|
+
export declare interface ValueSetAvailability {
|
|
3157
|
+
/** True while at least one requested URL is still being probed. */
|
|
3158
|
+
readonly loading: boolean;
|
|
3159
|
+
/** The subset of requested URLs known to be available. */
|
|
3160
|
+
readonly available: string[];
|
|
3161
|
+
/** The subset of requested URLs known to be unavailable (a permanent 400/404). */
|
|
3162
|
+
readonly unavailable: string[];
|
|
3163
|
+
}
|
|
3164
|
+
|
|
2943
3165
|
export declare function valueSetElementToCoding(element: ValueSetExpansionContains): Coding;
|
|
2944
3166
|
|
|
2945
3167
|
/** Vitals section — searches for Observation resources with category vital-signs. */
|