@medplum/react 3.1.8 → 3.1.10

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.
@@ -70,6 +70,7 @@ import { SearchRequest } from '@medplum/core';
70
70
  import { ServiceRequest } from '@medplum/fhirtypes';
71
71
  import { Slot } from '@medplum/fhirtypes';
72
72
  import { StructureDefinition } from '@medplum/fhirtypes';
73
+ import { Subscription } from '@medplum/fhirtypes';
73
74
  import { Task } from '@medplum/fhirtypes';
74
75
  import { TextProps } from '@mantine/core';
75
76
  import { Timing } from '@medplum/fhirtypes';
@@ -939,6 +940,11 @@ export declare interface QuestionnaireBuilderProps {
939
940
 
940
941
  export declare function QuestionnaireForm(props: QuestionnaireFormProps): JSX.Element | null;
941
942
 
943
+ export declare const QuestionnaireFormContext: Context< {
944
+ subject?: Reference<Resource> | undefined;
945
+ encounter?: Reference<Encounter> | undefined;
946
+ }>;
947
+
942
948
  export declare interface QuestionnaireFormProps {
943
949
  readonly questionnaire: Questionnaire | Reference<Questionnaire>;
944
950
  readonly subject?: Reference;
@@ -1538,7 +1544,20 @@ export declare function useSearchOne<K extends ResourceType>(resourceType: K, qu
1538
1544
  */
1539
1545
  export declare function useSearchResources<K extends ResourceType>(resourceType: K, query?: QueryTypes): [ResourceArray<ExtractResource<K>> | undefined, boolean, OperationOutcome | undefined];
1540
1546
 
1541
- export declare function useSubscription(criteria: string, callback: (bundle: Bundle) => void): void;
1547
+ /**
1548
+ * Creates an in-memory `Subscription` resource with the given criteria on the Medplum server and calls the given callback when an event notification is triggered by a resource interaction over a WebSocket connection.
1549
+ *
1550
+ * Subscriptions created with this hook are lightweight, share a single WebSocket connection, and are automatically untracked and cleaned up when the containing component is no longer mounted.
1551
+ *
1552
+ * @param criteria - The FHIR search criteria to subscribe to.
1553
+ * @param callback - The callback to call when a notification event `Bundle` for this `Subscription` is received.
1554
+ * @param options - Optional options used to configure the created `Subscription`.
1555
+ */
1556
+ export declare function useSubscription(criteria: string, callback: (bundle: Bundle) => void, options?: UseSubscriptionOptions): void;
1557
+
1558
+ export declare type UseSubscriptionOptions = {
1559
+ subscriptionProps?: Partial<Subscription>;
1560
+ };
1542
1561
 
1543
1562
  /**
1544
1563
  * A low-level component to autocomplete based on a FHIR Valueset.
@@ -70,6 +70,7 @@ import { SearchRequest } from '@medplum/core';
70
70
  import { ServiceRequest } from '@medplum/fhirtypes';
71
71
  import { Slot } from '@medplum/fhirtypes';
72
72
  import { StructureDefinition } from '@medplum/fhirtypes';
73
+ import { Subscription } from '@medplum/fhirtypes';
73
74
  import { Task } from '@medplum/fhirtypes';
74
75
  import { TextProps } from '@mantine/core';
75
76
  import { Timing } from '@medplum/fhirtypes';
@@ -939,6 +940,11 @@ export declare interface QuestionnaireBuilderProps {
939
940
 
940
941
  export declare function QuestionnaireForm(props: QuestionnaireFormProps): JSX.Element | null;
941
942
 
943
+ export declare const QuestionnaireFormContext: Context< {
944
+ subject?: Reference<Resource> | undefined;
945
+ encounter?: Reference<Encounter> | undefined;
946
+ }>;
947
+
942
948
  export declare interface QuestionnaireFormProps {
943
949
  readonly questionnaire: Questionnaire | Reference<Questionnaire>;
944
950
  readonly subject?: Reference;
@@ -1538,7 +1544,20 @@ export declare function useSearchOne<K extends ResourceType>(resourceType: K, qu
1538
1544
  */
1539
1545
  export declare function useSearchResources<K extends ResourceType>(resourceType: K, query?: QueryTypes): [ResourceArray<ExtractResource<K>> | undefined, boolean, OperationOutcome | undefined];
1540
1546
 
1541
- export declare function useSubscription(criteria: string, callback: (bundle: Bundle) => void): void;
1547
+ /**
1548
+ * Creates an in-memory `Subscription` resource with the given criteria on the Medplum server and calls the given callback when an event notification is triggered by a resource interaction over a WebSocket connection.
1549
+ *
1550
+ * Subscriptions created with this hook are lightweight, share a single WebSocket connection, and are automatically untracked and cleaned up when the containing component is no longer mounted.
1551
+ *
1552
+ * @param criteria - The FHIR search criteria to subscribe to.
1553
+ * @param callback - The callback to call when a notification event `Bundle` for this `Subscription` is received.
1554
+ * @param options - Optional options used to configure the created `Subscription`.
1555
+ */
1556
+ export declare function useSubscription(criteria: string, callback: (bundle: Bundle) => void, options?: UseSubscriptionOptions): void;
1557
+
1558
+ export declare type UseSubscriptionOptions = {
1559
+ subscriptionProps?: Partial<Subscription>;
1560
+ };
1542
1561
 
1543
1562
  /**
1544
1563
  * A low-level component to autocomplete based on a FHIR Valueset.