@medplum/core 5.2.16 → 5.2.18

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.
@@ -4637,6 +4637,13 @@ export declare interface MedicationCheckoutRequest {
4637
4637
  readonly appId?: string;
4638
4638
  /** Selected practice location; omit for single-practice prescribers. */
4639
4639
  readonly organization?: Reference<Organization>;
4640
+ /**
4641
+ * Show only this request's lines in the approval widget. Other lines staged
4642
+ * from drafts are taken out of the vendor cart first and their drafts are
4643
+ * kept for a later checkout. Omit for the default whole-cart behavior;
4644
+ * `false` is the same as omitting it.
4645
+ */
4646
+ readonly exclusive?: boolean;
4640
4647
  }
4641
4648
 
4642
4649
  /**
@@ -4662,6 +4669,48 @@ export declare interface MedicationCheckoutResponse {
4662
4669
  /** Vendor-side patient id (numeric in ScriptSure today). */
4663
4670
  readonly vendorPatientId: number;
4664
4671
  readonly items: MedicationCheckoutItemResult[];
4672
+ /**
4673
+ * Set only for `exclusive` requests: true when the approval widget shows
4674
+ * exactly this request's lines. When false, see `retainedItems` and failed
4675
+ * `unstagedItems` for what else the prescriber will see. Absent when the
4676
+ * deployed bot predates the option (it ignores the input), so treat absent as
4677
+ * false.
4678
+ */
4679
+ readonly exclusive?: boolean;
4680
+ /** Exclusive requests only. */
4681
+ readonly unstagedItems?: MedicationCheckoutUnstagedItem[];
4682
+ /** Exclusive requests only. */
4683
+ readonly retainedItems?: MedicationCheckoutRetainedItem[];
4684
+ }
4685
+
4686
+ /**
4687
+ * One line an exclusive checkout left in the vendor cart, so the approval
4688
+ * widget still shows it.
4689
+ * - `vendor-only`: no draft of this patient staged the line.
4690
+ * - `locked`: the vendor reports the cart as in use by another user, so nothing was removed.
4691
+ * - `concurrent`: someone else added the line while the checkout ran.
4692
+ * - `other`: a reason this client version does not recognize.
4693
+ */
4694
+ export declare interface MedicationCheckoutRetainedItem {
4695
+ readonly reason: 'vendor-only' | 'locked' | 'concurrent' | 'other';
4696
+ readonly vendorLineId?: string;
4697
+ readonly medicationRequestId?: string;
4698
+ /** Vendor-supplied display text; render as plain text. */
4699
+ readonly drugName?: string;
4700
+ /** Vendor-supplied display name of whoever staged the line; render as plain text. */
4701
+ readonly createdBy?: string;
4702
+ }
4703
+
4704
+ /**
4705
+ * One line an exclusive checkout took out of the vendor cart, keeping its
4706
+ * draft. `failed` means the line is still in the cart (see `error`).
4707
+ */
4708
+ export declare interface MedicationCheckoutUnstagedItem {
4709
+ readonly medicationRequestId?: string;
4710
+ /** Vendor line id, when the vendor reported one. */
4711
+ readonly vendorLineId?: string;
4712
+ readonly status: 'unstaged' | 'failed';
4713
+ readonly error?: string;
4665
4714
  }
4666
4715
 
4667
4716
  /**
@@ -7038,6 +7087,8 @@ export declare interface MedplumInfraConfig {
7038
7087
  loadBalancerLoggingBucket?: string;
7039
7088
  loadBalancerLoggingPrefix?: string;
7040
7089
  loadBalancerAlgorithm?: 'round_robin' | 'least_outstanding_requests' | 'weighted_random';
7090
+ /** ELB security policy for the HTTPS listeners, e.g. `ELBSecurityPolicy-TLS13-1-2-PQ-2025-09`. Defaults to `ELBSecurityPolicy-TLS13-1-2-2021-06`. */
7091
+ loadBalancerSslPolicy?: string;
7041
7092
  guardDutyMalwareProtectionEnabled?: boolean;
7042
7093
  /** With guardDutyMalwareProtectionEnabled, scan only via Binary $scan, and only block Binaries with threats found. */
7043
7094
  guardDutyMalwareProtectionOnDemandOnly?: boolean;
@@ -7277,6 +7328,8 @@ export declare interface MedplumSourceInfraConfig {
7277
7328
  loadBalancerLoggingBucket?: ValueOrExternalSecret<string>;
7278
7329
  loadBalancerLoggingPrefix?: ValueOrExternalSecret<string>;
7279
7330
  loadBalancerAlgorithm?: ValueOrExternalSecret<'round_robin' | 'least_outstanding_requests' | 'weighted_random'>;
7331
+ /** ELB security policy for the HTTPS listeners, e.g. `ELBSecurityPolicy-TLS13-1-2-PQ-2025-09`. Defaults to `ELBSecurityPolicy-TLS13-1-2-2021-06`. */
7332
+ loadBalancerSslPolicy?: ValueOrExternalSecret<string>;
7280
7333
  guardDutyMalwareProtectionEnabled?: ValueOrExternalSecret<boolean>;
7281
7334
  /** With guardDutyMalwareProtectionEnabled, scan only via Binary $scan, and only block Binaries with threats found. */
7282
7335
  guardDutyMalwareProtectionOnDemandOnly?: ValueOrExternalSecret<boolean>;
@@ -7832,6 +7885,10 @@ export declare function parametersToMedicationCartManageResponse(params: Paramet
7832
7885
  * one queued/failed line); the scalar `approvalUrl` / `vendorPatientId` are read
7833
7886
  * once.
7834
7887
  *
7888
+ * `exclusive` is decoded fail-closed, since a client opens the approval widget
7889
+ * without a warning on `true`: it is `true` only when every `exclusive` value is
7890
+ * `true` and no retained, failed, or unparseable unstaged line comes with it.
7891
+ *
7835
7892
  * @param params - The `Parameters` resource returned by the operation.
7836
7893
  * @returns A vendor-neutral {@link MedicationCheckoutResponse}.
7837
7894
  */
@@ -8714,6 +8771,16 @@ export declare class ParserBuilder {
8714
8771
 
8715
8772
  export declare type SamplingInfo = Omit<SampledData, 'data'>;
8716
8773
 
8774
+ /**
8775
+ * Finds the access policy entry that permits each interaction on a resource.
8776
+ * Equivalent to calling `satisfiedAccessPolicy` for each interaction, but evaluates each entry's criteria at most once.
8777
+ * @param resource - The resource being acted upon.
8778
+ * @param interactions - The interactions being performed on the resource.
8779
+ * @param accessPolicy - The relevant access policy for the current user.
8780
+ * @returns The satisfied access policy for each interaction, in the same order, or undefined where none permits it.
8781
+ */
8782
+ export declare function satisfiedAccessPolicies(resource: Resource, interactions: readonly AccessPolicyInteraction[], accessPolicy: AccessPolicy): (AccessPolicyResource | undefined)[];
8783
+
8717
8784
  /**
8718
8785
  * Checks that there is an access policy permitting the given resource interaction, returning the matching policy object.
8719
8786
  * @param resource - The resource being acted upon.
@@ -9024,6 +9091,16 @@ export declare class ParserBuilder {
9024
9091
  */
9025
9092
  export declare function setScheduleSchedulingParameter<T extends Schedule>(schedule: T, service: WithId<HealthcareService>, subextension: SchedulingParameterExtension): T;
9026
9093
 
9094
+ /**
9095
+ * Shallow check if the given interaction on a resource type matches the resource access policy.
9096
+ * Does not evaluate the policy's compartment or criteria.
9097
+ * @param policy - The AccessPolicy resource policy.
9098
+ * @param resourceType - The candidate resource type.
9099
+ * @param interaction - Interaction type to check against the policy.
9100
+ * @returns True when the resource type matches the resource policy.
9101
+ */
9102
+ export declare function shallowMatchesResourcePolicy(policy: AccessPolicyResource, resourceType: ResourceType, interaction: AccessPolicyInteraction): boolean;
9103
+
9027
9104
  export declare function singleton(collection: TypedValue[], type?: string): TypedValue | undefined;
9028
9105
 
9029
9106
  export declare function singularize<T>(value: T | T[] | undefined): T | undefined;
@@ -4637,6 +4637,13 @@ export declare interface MedicationCheckoutRequest {
4637
4637
  readonly appId?: string;
4638
4638
  /** Selected practice location; omit for single-practice prescribers. */
4639
4639
  readonly organization?: Reference<Organization>;
4640
+ /**
4641
+ * Show only this request's lines in the approval widget. Other lines staged
4642
+ * from drafts are taken out of the vendor cart first and their drafts are
4643
+ * kept for a later checkout. Omit for the default whole-cart behavior;
4644
+ * `false` is the same as omitting it.
4645
+ */
4646
+ readonly exclusive?: boolean;
4640
4647
  }
4641
4648
 
4642
4649
  /**
@@ -4662,6 +4669,48 @@ export declare interface MedicationCheckoutResponse {
4662
4669
  /** Vendor-side patient id (numeric in ScriptSure today). */
4663
4670
  readonly vendorPatientId: number;
4664
4671
  readonly items: MedicationCheckoutItemResult[];
4672
+ /**
4673
+ * Set only for `exclusive` requests: true when the approval widget shows
4674
+ * exactly this request's lines. When false, see `retainedItems` and failed
4675
+ * `unstagedItems` for what else the prescriber will see. Absent when the
4676
+ * deployed bot predates the option (it ignores the input), so treat absent as
4677
+ * false.
4678
+ */
4679
+ readonly exclusive?: boolean;
4680
+ /** Exclusive requests only. */
4681
+ readonly unstagedItems?: MedicationCheckoutUnstagedItem[];
4682
+ /** Exclusive requests only. */
4683
+ readonly retainedItems?: MedicationCheckoutRetainedItem[];
4684
+ }
4685
+
4686
+ /**
4687
+ * One line an exclusive checkout left in the vendor cart, so the approval
4688
+ * widget still shows it.
4689
+ * - `vendor-only`: no draft of this patient staged the line.
4690
+ * - `locked`: the vendor reports the cart as in use by another user, so nothing was removed.
4691
+ * - `concurrent`: someone else added the line while the checkout ran.
4692
+ * - `other`: a reason this client version does not recognize.
4693
+ */
4694
+ export declare interface MedicationCheckoutRetainedItem {
4695
+ readonly reason: 'vendor-only' | 'locked' | 'concurrent' | 'other';
4696
+ readonly vendorLineId?: string;
4697
+ readonly medicationRequestId?: string;
4698
+ /** Vendor-supplied display text; render as plain text. */
4699
+ readonly drugName?: string;
4700
+ /** Vendor-supplied display name of whoever staged the line; render as plain text. */
4701
+ readonly createdBy?: string;
4702
+ }
4703
+
4704
+ /**
4705
+ * One line an exclusive checkout took out of the vendor cart, keeping its
4706
+ * draft. `failed` means the line is still in the cart (see `error`).
4707
+ */
4708
+ export declare interface MedicationCheckoutUnstagedItem {
4709
+ readonly medicationRequestId?: string;
4710
+ /** Vendor line id, when the vendor reported one. */
4711
+ readonly vendorLineId?: string;
4712
+ readonly status: 'unstaged' | 'failed';
4713
+ readonly error?: string;
4665
4714
  }
4666
4715
 
4667
4716
  /**
@@ -7038,6 +7087,8 @@ export declare interface MedplumInfraConfig {
7038
7087
  loadBalancerLoggingBucket?: string;
7039
7088
  loadBalancerLoggingPrefix?: string;
7040
7089
  loadBalancerAlgorithm?: 'round_robin' | 'least_outstanding_requests' | 'weighted_random';
7090
+ /** ELB security policy for the HTTPS listeners, e.g. `ELBSecurityPolicy-TLS13-1-2-PQ-2025-09`. Defaults to `ELBSecurityPolicy-TLS13-1-2-2021-06`. */
7091
+ loadBalancerSslPolicy?: string;
7041
7092
  guardDutyMalwareProtectionEnabled?: boolean;
7042
7093
  /** With guardDutyMalwareProtectionEnabled, scan only via Binary $scan, and only block Binaries with threats found. */
7043
7094
  guardDutyMalwareProtectionOnDemandOnly?: boolean;
@@ -7277,6 +7328,8 @@ export declare interface MedplumSourceInfraConfig {
7277
7328
  loadBalancerLoggingBucket?: ValueOrExternalSecret<string>;
7278
7329
  loadBalancerLoggingPrefix?: ValueOrExternalSecret<string>;
7279
7330
  loadBalancerAlgorithm?: ValueOrExternalSecret<'round_robin' | 'least_outstanding_requests' | 'weighted_random'>;
7331
+ /** ELB security policy for the HTTPS listeners, e.g. `ELBSecurityPolicy-TLS13-1-2-PQ-2025-09`. Defaults to `ELBSecurityPolicy-TLS13-1-2-2021-06`. */
7332
+ loadBalancerSslPolicy?: ValueOrExternalSecret<string>;
7280
7333
  guardDutyMalwareProtectionEnabled?: ValueOrExternalSecret<boolean>;
7281
7334
  /** With guardDutyMalwareProtectionEnabled, scan only via Binary $scan, and only block Binaries with threats found. */
7282
7335
  guardDutyMalwareProtectionOnDemandOnly?: ValueOrExternalSecret<boolean>;
@@ -7832,6 +7885,10 @@ export declare function parametersToMedicationCartManageResponse(params: Paramet
7832
7885
  * one queued/failed line); the scalar `approvalUrl` / `vendorPatientId` are read
7833
7886
  * once.
7834
7887
  *
7888
+ * `exclusive` is decoded fail-closed, since a client opens the approval widget
7889
+ * without a warning on `true`: it is `true` only when every `exclusive` value is
7890
+ * `true` and no retained, failed, or unparseable unstaged line comes with it.
7891
+ *
7835
7892
  * @param params - The `Parameters` resource returned by the operation.
7836
7893
  * @returns A vendor-neutral {@link MedicationCheckoutResponse}.
7837
7894
  */
@@ -8714,6 +8771,16 @@ export declare class ParserBuilder {
8714
8771
 
8715
8772
  export declare type SamplingInfo = Omit<SampledData, 'data'>;
8716
8773
 
8774
+ /**
8775
+ * Finds the access policy entry that permits each interaction on a resource.
8776
+ * Equivalent to calling `satisfiedAccessPolicy` for each interaction, but evaluates each entry's criteria at most once.
8777
+ * @param resource - The resource being acted upon.
8778
+ * @param interactions - The interactions being performed on the resource.
8779
+ * @param accessPolicy - The relevant access policy for the current user.
8780
+ * @returns The satisfied access policy for each interaction, in the same order, or undefined where none permits it.
8781
+ */
8782
+ export declare function satisfiedAccessPolicies(resource: Resource, interactions: readonly AccessPolicyInteraction[], accessPolicy: AccessPolicy): (AccessPolicyResource | undefined)[];
8783
+
8717
8784
  /**
8718
8785
  * Checks that there is an access policy permitting the given resource interaction, returning the matching policy object.
8719
8786
  * @param resource - The resource being acted upon.
@@ -9024,6 +9091,16 @@ export declare class ParserBuilder {
9024
9091
  */
9025
9092
  export declare function setScheduleSchedulingParameter<T extends Schedule>(schedule: T, service: WithId<HealthcareService>, subextension: SchedulingParameterExtension): T;
9026
9093
 
9094
+ /**
9095
+ * Shallow check if the given interaction on a resource type matches the resource access policy.
9096
+ * Does not evaluate the policy's compartment or criteria.
9097
+ * @param policy - The AccessPolicy resource policy.
9098
+ * @param resourceType - The candidate resource type.
9099
+ * @param interaction - Interaction type to check against the policy.
9100
+ * @returns True when the resource type matches the resource policy.
9101
+ */
9102
+ export declare function shallowMatchesResourcePolicy(policy: AccessPolicyResource, resourceType: ResourceType, interaction: AccessPolicyInteraction): boolean;
9103
+
9027
9104
  export declare function singleton(collection: TypedValue[], type?: string): TypedValue | undefined;
9028
9105
 
9029
9106
  export declare function singularize<T>(value: T | T[] | undefined): T | undefined;