@medplum/core 4.1.9 → 4.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.
@@ -72,25 +72,25 @@ export declare const AccessPolicyInteraction: {
72
72
  readonly READ: "read";
73
73
  readonly VREAD: "vread";
74
74
  readonly UPDATE: "update";
75
- readonly PATCH: "patch";
76
75
  readonly DELETE: "delete";
77
76
  readonly HISTORY: "history";
78
- readonly HISTORY_INSTANCE: "history-instance";
79
- readonly HISTORY_TYPE: "history-type";
80
- readonly HISTORY_SYSTEM: "history-system";
81
77
  readonly CREATE: "create";
82
78
  readonly SEARCH: "search";
83
- readonly SEARCH_TYPE: "search-type";
84
- readonly SEARCH_SYSTEM: "search-system";
85
- readonly SEARCH_COMPARTMENT: "search-compartment";
86
- readonly CAPABILITIES: "capabilities";
87
- readonly TRANSACTION: "transaction";
88
- readonly BATCH: "batch";
89
- readonly OPERATION: "operation";
90
79
  };
91
80
 
92
81
  export declare type AccessPolicyInteraction = (typeof AccessPolicyInteraction)[keyof typeof AccessPolicyInteraction];
93
82
 
83
+ /**
84
+ * Shallow check that an interaction is permitted by the AccessPolicy on a given resource type,
85
+ * at least for some resources. A more in-depth check for the specific resource(s) being accessed
86
+ * is required in addition to this one.
87
+ * @param accessPolicy - The AccessPolicy to check against.
88
+ * @param interaction - The FHIR interaction being performed.
89
+ * @param resourceType - The type of resource being interacted with.
90
+ * @returns True when the interaction is provisionally permitted by the AccessPolicy.
91
+ */
92
+ export declare function accessPolicySupportsInteraction(accessPolicy: AccessPolicy, interaction: AccessPolicyInteraction, resourceType: ResourceType): boolean;
93
+
94
94
  export declare const AckCode: {
95
95
  /** AA - Application Accept */
96
96
  readonly AA: "AA";
@@ -406,6 +406,7 @@ export declare type CanBePopulated = {
406
406
  * @param accessPolicy - The access policy.
407
407
  * @param resourceType - The resource type.
408
408
  * @returns True if the current user can read the specified resource type.
409
+ * @deprecated Use accessPolicySupportsInteraction() instead.
409
410
  */
410
411
  export declare function canReadResourceType(accessPolicy: AccessPolicy, resourceType: ResourceType): boolean;
411
412
 
@@ -415,6 +416,7 @@ export declare function canReadResourceType(accessPolicy: AccessPolicy, resource
415
416
  * @param accessPolicy - The access policy.
416
417
  * @param resource - The resource.
417
418
  * @returns True if the current user can write the specified resource type.
419
+ * @deprecated Use satisfiedAccessPolicy() instead.
418
420
  */
419
421
  export declare function canWriteResource(accessPolicy: AccessPolicy, resource: Resource): boolean;
420
422
 
@@ -425,6 +427,7 @@ export declare function canWriteResource(accessPolicy: AccessPolicy, resource: R
425
427
  * @param accessPolicy - The access policy.
426
428
  * @param resourceType - The resource type.
427
429
  * @returns True if the current user can write the specified resource type.
430
+ * @deprecated Use accessPolicySupportsInteraction() instead.
428
431
  */
429
432
  export declare function canWriteResourceType(accessPolicy: AccessPolicy, resourceType: ResourceType): boolean;
430
433
 
@@ -728,6 +731,15 @@ export declare type CurrentContext<T extends FhircastAnchorResourceType | '' = F
728
731
  context: FhircastEventContext<AnchorResourceOpenEvent<T>>[];
729
732
  } : never;
730
733
 
734
+ export declare interface DataSampleOptions {
735
+ /** Code for the data points. */
736
+ code?: CodeableConcept;
737
+ /** Unit for the data points. */
738
+ unit?: QuantityUnit;
739
+ /** Sampling information for high-frequency Observations. */
740
+ sampling?: Omit<SampledData, 'data'>;
741
+ }
742
+
731
743
  export declare class DataSampler {
732
744
  private code?;
733
745
  private unit?;
@@ -735,15 +747,8 @@ export declare class DataSampler {
735
747
  private readonly dataPoints;
736
748
  /**
737
749
  * @param opts - Optional parameters.
738
- * @param opts.code - Code for data points.
739
- * @param opts.unit - Unit for data points.
740
- * @param opts.sampling - Sampling information for high-frequency Observations.
741
- */
742
- constructor(opts?: {
743
- code?: CodeableConcept;
744
- unit?: QuantityUnit;
745
- sampling?: SamplingInfo;
746
- });
750
+ */
751
+ constructor(opts?: DataSampleOptions);
747
752
  addObservation(obs: Observation): void;
748
753
  addData(...data: number[]): void;
749
754
  private checkUnit;
@@ -5702,6 +5707,8 @@ export declare class ReadablePromise<T> implements Promise<T> {
5702
5707
  finally(onfinally?: (() => void) | null): Promise<T>;
5703
5708
  }
5704
5709
 
5710
+ export declare const readInteractions: AccessPolicyInteraction[];
5711
+
5705
5712
  export declare class ReconnectingWebSocket<WS extends IWebSocket = WebSocket> extends TypedEventTarget<WebSocketEventMap_2> implements IReconnectingWebSocket {
5706
5713
  private _ws;
5707
5714
  private _retryCount;
@@ -72,25 +72,25 @@ export declare const AccessPolicyInteraction: {
72
72
  readonly READ: "read";
73
73
  readonly VREAD: "vread";
74
74
  readonly UPDATE: "update";
75
- readonly PATCH: "patch";
76
75
  readonly DELETE: "delete";
77
76
  readonly HISTORY: "history";
78
- readonly HISTORY_INSTANCE: "history-instance";
79
- readonly HISTORY_TYPE: "history-type";
80
- readonly HISTORY_SYSTEM: "history-system";
81
77
  readonly CREATE: "create";
82
78
  readonly SEARCH: "search";
83
- readonly SEARCH_TYPE: "search-type";
84
- readonly SEARCH_SYSTEM: "search-system";
85
- readonly SEARCH_COMPARTMENT: "search-compartment";
86
- readonly CAPABILITIES: "capabilities";
87
- readonly TRANSACTION: "transaction";
88
- readonly BATCH: "batch";
89
- readonly OPERATION: "operation";
90
79
  };
91
80
 
92
81
  export declare type AccessPolicyInteraction = (typeof AccessPolicyInteraction)[keyof typeof AccessPolicyInteraction];
93
82
 
83
+ /**
84
+ * Shallow check that an interaction is permitted by the AccessPolicy on a given resource type,
85
+ * at least for some resources. A more in-depth check for the specific resource(s) being accessed
86
+ * is required in addition to this one.
87
+ * @param accessPolicy - The AccessPolicy to check against.
88
+ * @param interaction - The FHIR interaction being performed.
89
+ * @param resourceType - The type of resource being interacted with.
90
+ * @returns True when the interaction is provisionally permitted by the AccessPolicy.
91
+ */
92
+ export declare function accessPolicySupportsInteraction(accessPolicy: AccessPolicy, interaction: AccessPolicyInteraction, resourceType: ResourceType): boolean;
93
+
94
94
  export declare const AckCode: {
95
95
  /** AA - Application Accept */
96
96
  readonly AA: "AA";
@@ -406,6 +406,7 @@ export declare type CanBePopulated = {
406
406
  * @param accessPolicy - The access policy.
407
407
  * @param resourceType - The resource type.
408
408
  * @returns True if the current user can read the specified resource type.
409
+ * @deprecated Use accessPolicySupportsInteraction() instead.
409
410
  */
410
411
  export declare function canReadResourceType(accessPolicy: AccessPolicy, resourceType: ResourceType): boolean;
411
412
 
@@ -415,6 +416,7 @@ export declare function canReadResourceType(accessPolicy: AccessPolicy, resource
415
416
  * @param accessPolicy - The access policy.
416
417
  * @param resource - The resource.
417
418
  * @returns True if the current user can write the specified resource type.
419
+ * @deprecated Use satisfiedAccessPolicy() instead.
418
420
  */
419
421
  export declare function canWriteResource(accessPolicy: AccessPolicy, resource: Resource): boolean;
420
422
 
@@ -425,6 +427,7 @@ export declare function canWriteResource(accessPolicy: AccessPolicy, resource: R
425
427
  * @param accessPolicy - The access policy.
426
428
  * @param resourceType - The resource type.
427
429
  * @returns True if the current user can write the specified resource type.
430
+ * @deprecated Use accessPolicySupportsInteraction() instead.
428
431
  */
429
432
  export declare function canWriteResourceType(accessPolicy: AccessPolicy, resourceType: ResourceType): boolean;
430
433
 
@@ -728,6 +731,15 @@ export declare type CurrentContext<T extends FhircastAnchorResourceType | '' = F
728
731
  context: FhircastEventContext<AnchorResourceOpenEvent<T>>[];
729
732
  } : never;
730
733
 
734
+ export declare interface DataSampleOptions {
735
+ /** Code for the data points. */
736
+ code?: CodeableConcept;
737
+ /** Unit for the data points. */
738
+ unit?: QuantityUnit;
739
+ /** Sampling information for high-frequency Observations. */
740
+ sampling?: Omit<SampledData, 'data'>;
741
+ }
742
+
731
743
  export declare class DataSampler {
732
744
  private code?;
733
745
  private unit?;
@@ -735,15 +747,8 @@ export declare class DataSampler {
735
747
  private readonly dataPoints;
736
748
  /**
737
749
  * @param opts - Optional parameters.
738
- * @param opts.code - Code for data points.
739
- * @param opts.unit - Unit for data points.
740
- * @param opts.sampling - Sampling information for high-frequency Observations.
741
- */
742
- constructor(opts?: {
743
- code?: CodeableConcept;
744
- unit?: QuantityUnit;
745
- sampling?: SamplingInfo;
746
- });
750
+ */
751
+ constructor(opts?: DataSampleOptions);
747
752
  addObservation(obs: Observation): void;
748
753
  addData(...data: number[]): void;
749
754
  private checkUnit;
@@ -5702,6 +5707,8 @@ export declare class ReadablePromise<T> implements Promise<T> {
5702
5707
  finally(onfinally?: (() => void) | null): Promise<T>;
5703
5708
  }
5704
5709
 
5710
+ export declare const readInteractions: AccessPolicyInteraction[];
5711
+
5705
5712
  export declare class ReconnectingWebSocket<WS extends IWebSocket = WebSocket> extends TypedEventTarget<WebSocketEventMap_2> implements IReconnectingWebSocket {
5706
5713
  private _ws;
5707
5714
  private _retryCount;