@medplum/core 5.0.13 → 5.0.15

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.
@@ -34,6 +34,7 @@ import type { ObservationDefinition } from '@medplum/fhirtypes';
34
34
  import type { ObservationDefinitionQualifiedInterval } from '@medplum/fhirtypes';
35
35
  import type { OperationOutcome } from '@medplum/fhirtypes';
36
36
  import type { OperationOutcomeIssue } from '@medplum/fhirtypes';
37
+ import type { Organization } from '@medplum/fhirtypes';
37
38
  import type { Patient } from '@medplum/fhirtypes';
38
39
  import type { Period } from '@medplum/fhirtypes';
39
40
  import type { Practitioner } from '@medplum/fhirtypes';
@@ -111,6 +112,38 @@ export declare const AckCode: {
111
112
 
112
113
  export declare type AckCode = keyof typeof AckCode;
113
114
 
115
+ /**
116
+ * Parameters for adding a pharmacy to a patient's favorites.
117
+ */
118
+ export declare interface AddFavoriteParams {
119
+ patientId: string;
120
+ pharmacy: Organization;
121
+ setAsPrimary: boolean;
122
+ }
123
+
124
+ /**
125
+ * Response from adding a pharmacy to a patient's favorites.
126
+ */
127
+ export declare interface AddPharmacyResponse {
128
+ success: boolean;
129
+ message: string;
130
+ organization?: Organization;
131
+ }
132
+
133
+ /**
134
+ * Adds or updates a preferred pharmacy extension on a Patient.
135
+ * If the pharmacy already exists, updates its type. Otherwise, adds a new extension.
136
+ * If isPrimary is true, other pharmacies are set to 'preferred'.
137
+ *
138
+ * @param patient - The Patient resource to modify (will be mutated).
139
+ * @param orgRef - Reference to the Organization resource.
140
+ * @param isPrimary - Whether to set this as the primary pharmacy.
141
+ * @param preferenceTypeSystem - Optional coding system URL for pharmacy preference type.
142
+ * Defaults to {@link PHARMACY_PREFERENCE_TYPE_SYSTEM}.
143
+ * @returns The modified Patient resource.
144
+ */
145
+ export declare function addPreferredPharmacyToPatient(patient: Patient, orgRef: Reference<Organization>, isPrimary: boolean, preferenceTypeSystem?: string): Patient;
146
+
114
147
  /**
115
148
  * Adds the supplied profileUrl to the resource.meta.profile if it is not already
116
149
  * specified
@@ -932,6 +965,17 @@ export declare interface CreatePdfOptions extends Omit<CreateBinaryOptions, 'dat
932
965
  readonly fonts?: TFontDictionary;
933
966
  }
934
967
 
968
+ /**
969
+ * Creates a preferredPharmacy extension object.
970
+ *
971
+ * @param orgRef - Reference to the Organization resource.
972
+ * @param isPrimary - Whether this is the primary pharmacy.
973
+ * @param preferenceTypeSystem - Optional coding system URL for pharmacy preference type.
974
+ * Defaults to {@link PHARMACY_PREFERENCE_TYPE_SYSTEM}.
975
+ * @returns The extension object to add to a Patient.
976
+ */
977
+ export declare function createPreferredPharmacyExtension(orgRef: Reference<Organization>, isPrimary: boolean, preferenceTypeSystem?: string): Extension;
978
+
935
979
  export declare function createProcessingIssue(expression: string, message: string, err: Error, data?: Record<string, any>): OperationOutcomeIssue;
936
980
 
937
981
  /**
@@ -2092,6 +2136,18 @@ export declare function getPathDifference(parentPath: string, path: string): str
2092
2136
  */
2093
2137
  export declare function getPathDisplayName(path: string): string;
2094
2138
 
2139
+ /**
2140
+ * Extracts preferred pharmacies from a Patient resource's extensions.
2141
+ *
2142
+ * @param patient - The Patient resource.
2143
+ * @param preferenceTypeSystem - Optional coding system URL to filter by. When provided, only
2144
+ * codings with this system are considered when determining primary status. When omitted, any
2145
+ * coding with a `primary` code is matched regardless of system — this allows reading pharmacy
2146
+ * preferences written by any vendor.
2147
+ * @returns An array of PreferredPharmacy objects.
2148
+ */
2149
+ export declare function getPreferredPharmaciesFromPatient(patient: Patient, preferenceTypeSystem?: string): PreferredPharmacy[];
2150
+
2095
2151
  /**
2096
2152
  * Returns a human friendly display name for a FHIR element property or slice name
2097
2153
  * @param propertyName - The FHIR element property or slice name
@@ -2725,6 +2781,13 @@ export declare interface IReconnectingWebSocketCtor {
2725
2781
 
2726
2782
  export declare function isAccepted(outcome: OperationOutcome): boolean;
2727
2783
 
2784
+ /**
2785
+ * Type guard to validate an add pharmacy bot response.
2786
+ * @param value - The value to check.
2787
+ * @returns True if the value is a valid AddPharmacyResponse.
2788
+ */
2789
+ export declare function isAddPharmacyResponse(value: unknown): value is AddPharmacyResponse;
2790
+
2728
2791
  export declare class IsAtom extends BooleanInfixOperatorAtom {
2729
2792
  constructor(left: Atom, right: Atom);
2730
2793
  eval(context: AtomContext, input: TypedValue[]): TypedValue[];
@@ -2792,9 +2855,11 @@ export declare function isDateTimeString(input: unknown): input is string;
2792
2855
  * @param value - The value to refine
2793
2856
  * @returns boolean
2794
2857
  *
2795
- * Example usage:
2796
- * const arr: Array<number | undefined> = [1,undefined];
2797
- * const refined: Array<number> = arr.filter(isDefined);
2858
+ * @example
2859
+ * ```typescript
2860
+ * const arr: Array<number | undefined> = [1,undefined];
2861
+ * const refined: Array<number> = arr.filter(isDefined);
2862
+ * ```
2798
2863
  */
2799
2864
  export declare function isDefined<T>(value: T | undefined | null): value is T;
2800
2865
 
@@ -2861,6 +2926,13 @@ export declare function isOk(outcome: OperationOutcome): boolean;
2861
2926
 
2862
2927
  export declare function isOperationOutcome(value: unknown): value is OperationOutcome;
2863
2928
 
2929
+ /**
2930
+ * Type guard to validate that a value is an array of Organization resources.
2931
+ * @param value - The value to check.
2932
+ * @returns True if the value is an array of Organization resources.
2933
+ */
2934
+ export declare function isOrganizationArray(value: unknown): value is Organization[];
2935
+
2864
2936
  /**
2865
2937
  * Determines if the input is a Period object.
2866
2938
  * This is heuristic based, as we do not have strong typing at runtime.
@@ -3572,7 +3644,7 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
3572
3644
  * @param options - Optional fetch options.
3573
3645
  * @returns Promise to the response content.
3574
3646
  */
3575
- post(url: URL | string, body?: any, contentType?: string, options?: MedplumRequestOptions): Promise<any>;
3647
+ post<T = any>(url: URL | string, body?: any, contentType?: string, options?: MedplumRequestOptions): Promise<T>;
3576
3648
  /**
3577
3649
  * Makes an HTTP PUT request to the specified URL.
3578
3650
  *
@@ -3705,10 +3777,11 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
3705
3777
  * Exchange an external access token for a Medplum access token.
3706
3778
  * @param token - The access token that was generated by the external identity provider.
3707
3779
  * @param clientId - The ID of the `ClientApplication` in your Medplum project that will be making the exchange request.
3780
+ * @param membershipId - Optional membership ID to restrict the exchange to a specific ProjectMembership.
3708
3781
  * @returns The user profile resource.
3709
3782
  * @category Authentication
3710
3783
  */
3711
- exchangeExternalAccessToken(token: string, clientId?: string): Promise<ProfileResource>;
3784
+ exchangeExternalAccessToken(token: string, clientId?: string, membershipId?: string): Promise<ProfileResource>;
3712
3785
  /**
3713
3786
  * Builds the external identity provider redirect URI.
3714
3787
  * @param authorizeUrl - The external authorization URL.
@@ -5349,6 +5422,7 @@ export declare interface MedplumInfraConfig {
5349
5422
  rdsSecretsArn?: string;
5350
5423
  rdsReaderInstanceType?: string;
5351
5424
  rdsProxyEnabled?: boolean;
5425
+ rdsForceRetain?: boolean;
5352
5426
  cacheNodeType?: string;
5353
5427
  cacheSecurityGroupId?: string;
5354
5428
  desiredServerCount: number;
@@ -5504,6 +5578,7 @@ export declare interface MedplumSourceInfraConfig {
5504
5578
  rdsReaderInstanceType?: ValueOrExternalSecret<string>;
5505
5579
  rdsProxyEnabled?: ValueOrExternalSecret<boolean>;
5506
5580
  rdsClusterParameters?: StringMap;
5581
+ rdsForceRetain?: ValueOrExternalSecret<boolean>;
5507
5582
  rdsAutoMinorVersionUpgrade?: ValueOrExternalSecret<boolean>;
5508
5583
  cacheNodeType?: ValueOrExternalSecret<string>;
5509
5584
  cacheSecurityGroupId?: ValueOrExternalSecret<string>;
@@ -6029,8 +6104,33 @@ export declare class ParserBuilder {
6029
6104
  */
6030
6105
  export declare function pathToJSONPointer(path: string): string;
6031
6106
 
6107
+ export declare const PATIENT_PREFERRED_PHARMACY_URL = "http://hl7.org/fhir/StructureDefinition/patient-preferredPharmacy";
6108
+
6032
6109
  export declare type PendingSubscriptionRequest = Omit<SubscriptionRequest, 'endpoint'>;
6033
6110
 
6111
+ /**
6112
+ * Default pharmacy preference type system URL.
6113
+ * Vendors may define their own system URL and pass it to the pharmacy functions.
6114
+ */
6115
+ export declare const PHARMACY_PREFERENCE_TYPE_SYSTEM = "https://medplum.com/fhir/CodeSystem/pharmacy-preference-type";
6116
+
6117
+ export declare const PHARMACY_TYPE_PREFERRED = "preferred";
6118
+
6119
+ export declare const PHARMACY_TYPE_PRIMARY = "primary";
6120
+
6121
+ /**
6122
+ * Parameters for searching pharmacies.
6123
+ */
6124
+ export declare interface PharmacySearchParams {
6125
+ name?: string;
6126
+ city?: string;
6127
+ state?: string;
6128
+ zip?: string;
6129
+ address?: string;
6130
+ phoneOrFax?: string;
6131
+ ncpdpID?: string;
6132
+ }
6133
+
6034
6134
  /**
6035
6135
  * Returns true if the two numbers are equal to the given precision.
6036
6136
  * @param a - The first number.
@@ -6086,6 +6186,11 @@ export declare class ParserBuilder {
6086
6186
 
6087
6187
  export declare const preconditionFailed: OperationOutcome;
6088
6188
 
6189
+ export declare interface PreferredPharmacy {
6190
+ organizationRef: Reference<Organization>;
6191
+ isPrimary: boolean;
6192
+ }
6193
+
6089
6194
  export declare abstract class PrefixOperatorAtom implements Atom {
6090
6195
  readonly operator: string;
6091
6196
  readonly child: Atom;
@@ -6412,6 +6517,15 @@ export declare class ParserBuilder {
6412
6517
  */
6413
6518
  export declare function removeDuplicates(arr: TypedValue[]): TypedValue[];
6414
6519
 
6520
+ /**
6521
+ * Removes a preferred pharmacy extension from a Patient.
6522
+ *
6523
+ * @param patient - The Patient resource to modify (will be mutated).
6524
+ * @param orgRef - Reference to the Organization resource to remove.
6525
+ * @returns The modified Patient resource.
6526
+ */
6527
+ export declare function removePreferredPharmacyFromPatient(patient: Patient, orgRef: Reference<Organization>): Patient;
6528
+
6415
6529
  /**
6416
6530
  * Removes the supplied profileUrl from the resource.meta.profile if it is present
6417
6531
  * @param resource - A FHIR resource
@@ -6619,10 +6733,16 @@ export declare class ParserBuilder {
6619
6733
  * @param resource - The resource to add the identifier to.
6620
6734
  * @param system - The identifier system.
6621
6735
  * @param value - The identifier value.
6736
+ * @param options - Optional attributes to set
6622
6737
  */
6623
6738
  export declare function setIdentifier(resource: Resource & {
6624
6739
  identifier?: Identifier[];
6625
- }, system: string, value: string): void;
6740
+ }, system: string, value: string, options?: SetIdentifierOptions): void;
6741
+
6742
+ export declare interface SetIdentifierOptions {
6743
+ /** IdentifierUse code. See {@link https://build.fhir.org/valueset-identifier-use.html} */
6744
+ use?: Identifier['use'];
6745
+ }
6626
6746
 
6627
6747
  export declare function singleton(collection: TypedValue[], type?: string): TypedValue | undefined;
6628
6748
 
@@ -6837,6 +6957,7 @@ export declare class ParserBuilder {
6837
6957
  private readonly criteriaEntriesBySubscriptionId;
6838
6958
  private wsClosed;
6839
6959
  private pingTimer;
6960
+ private tokenRefreshTimer;
6840
6961
  private readonly pingIntervalMs;
6841
6962
  private waitingForPong;
6842
6963
  private currentProfile;
@@ -6851,6 +6972,9 @@ export declare class ParserBuilder {
6851
6972
  private removeCriteriaEntry;
6852
6973
  private subscribeToCriteria;
6853
6974
  private refreshAllSubscriptions;
6975
+ private isReconnecting;
6976
+ private rebindCriteriaEntry;
6977
+ private checkTokenExpirations;
6854
6978
  addCriteria(criteria: string, subscriptionProps?: Partial<Subscription>): SubscriptionEmitter;
6855
6979
  removeCriteria(criteria: string, subscriptionProps?: Partial<Subscription>): void;
6856
6980
  getWebSocket(): IReconnectingWebSocket;
@@ -6858,6 +6982,7 @@ export declare class ParserBuilder {
6858
6982
  reconnectWebSocket(): void;
6859
6983
  getCriteriaCount(): number;
6860
6984
  getMasterEmitter(): SubscriptionEmitter;
6985
+ reconnectIfNeeded(): Promise<void>;
6861
6986
  }
6862
6987
 
6863
6988
  /**
@@ -34,6 +34,7 @@ import type { ObservationDefinition } from '@medplum/fhirtypes';
34
34
  import type { ObservationDefinitionQualifiedInterval } from '@medplum/fhirtypes';
35
35
  import type { OperationOutcome } from '@medplum/fhirtypes';
36
36
  import type { OperationOutcomeIssue } from '@medplum/fhirtypes';
37
+ import type { Organization } from '@medplum/fhirtypes';
37
38
  import type { Patient } from '@medplum/fhirtypes';
38
39
  import type { Period } from '@medplum/fhirtypes';
39
40
  import type { Practitioner } from '@medplum/fhirtypes';
@@ -111,6 +112,38 @@ export declare const AckCode: {
111
112
 
112
113
  export declare type AckCode = keyof typeof AckCode;
113
114
 
115
+ /**
116
+ * Parameters for adding a pharmacy to a patient's favorites.
117
+ */
118
+ export declare interface AddFavoriteParams {
119
+ patientId: string;
120
+ pharmacy: Organization;
121
+ setAsPrimary: boolean;
122
+ }
123
+
124
+ /**
125
+ * Response from adding a pharmacy to a patient's favorites.
126
+ */
127
+ export declare interface AddPharmacyResponse {
128
+ success: boolean;
129
+ message: string;
130
+ organization?: Organization;
131
+ }
132
+
133
+ /**
134
+ * Adds or updates a preferred pharmacy extension on a Patient.
135
+ * If the pharmacy already exists, updates its type. Otherwise, adds a new extension.
136
+ * If isPrimary is true, other pharmacies are set to 'preferred'.
137
+ *
138
+ * @param patient - The Patient resource to modify (will be mutated).
139
+ * @param orgRef - Reference to the Organization resource.
140
+ * @param isPrimary - Whether to set this as the primary pharmacy.
141
+ * @param preferenceTypeSystem - Optional coding system URL for pharmacy preference type.
142
+ * Defaults to {@link PHARMACY_PREFERENCE_TYPE_SYSTEM}.
143
+ * @returns The modified Patient resource.
144
+ */
145
+ export declare function addPreferredPharmacyToPatient(patient: Patient, orgRef: Reference<Organization>, isPrimary: boolean, preferenceTypeSystem?: string): Patient;
146
+
114
147
  /**
115
148
  * Adds the supplied profileUrl to the resource.meta.profile if it is not already
116
149
  * specified
@@ -932,6 +965,17 @@ export declare interface CreatePdfOptions extends Omit<CreateBinaryOptions, 'dat
932
965
  readonly fonts?: TFontDictionary;
933
966
  }
934
967
 
968
+ /**
969
+ * Creates a preferredPharmacy extension object.
970
+ *
971
+ * @param orgRef - Reference to the Organization resource.
972
+ * @param isPrimary - Whether this is the primary pharmacy.
973
+ * @param preferenceTypeSystem - Optional coding system URL for pharmacy preference type.
974
+ * Defaults to {@link PHARMACY_PREFERENCE_TYPE_SYSTEM}.
975
+ * @returns The extension object to add to a Patient.
976
+ */
977
+ export declare function createPreferredPharmacyExtension(orgRef: Reference<Organization>, isPrimary: boolean, preferenceTypeSystem?: string): Extension;
978
+
935
979
  export declare function createProcessingIssue(expression: string, message: string, err: Error, data?: Record<string, any>): OperationOutcomeIssue;
936
980
 
937
981
  /**
@@ -2092,6 +2136,18 @@ export declare function getPathDifference(parentPath: string, path: string): str
2092
2136
  */
2093
2137
  export declare function getPathDisplayName(path: string): string;
2094
2138
 
2139
+ /**
2140
+ * Extracts preferred pharmacies from a Patient resource's extensions.
2141
+ *
2142
+ * @param patient - The Patient resource.
2143
+ * @param preferenceTypeSystem - Optional coding system URL to filter by. When provided, only
2144
+ * codings with this system are considered when determining primary status. When omitted, any
2145
+ * coding with a `primary` code is matched regardless of system — this allows reading pharmacy
2146
+ * preferences written by any vendor.
2147
+ * @returns An array of PreferredPharmacy objects.
2148
+ */
2149
+ export declare function getPreferredPharmaciesFromPatient(patient: Patient, preferenceTypeSystem?: string): PreferredPharmacy[];
2150
+
2095
2151
  /**
2096
2152
  * Returns a human friendly display name for a FHIR element property or slice name
2097
2153
  * @param propertyName - The FHIR element property or slice name
@@ -2725,6 +2781,13 @@ export declare interface IReconnectingWebSocketCtor {
2725
2781
 
2726
2782
  export declare function isAccepted(outcome: OperationOutcome): boolean;
2727
2783
 
2784
+ /**
2785
+ * Type guard to validate an add pharmacy bot response.
2786
+ * @param value - The value to check.
2787
+ * @returns True if the value is a valid AddPharmacyResponse.
2788
+ */
2789
+ export declare function isAddPharmacyResponse(value: unknown): value is AddPharmacyResponse;
2790
+
2728
2791
  export declare class IsAtom extends BooleanInfixOperatorAtom {
2729
2792
  constructor(left: Atom, right: Atom);
2730
2793
  eval(context: AtomContext, input: TypedValue[]): TypedValue[];
@@ -2792,9 +2855,11 @@ export declare function isDateTimeString(input: unknown): input is string;
2792
2855
  * @param value - The value to refine
2793
2856
  * @returns boolean
2794
2857
  *
2795
- * Example usage:
2796
- * const arr: Array<number | undefined> = [1,undefined];
2797
- * const refined: Array<number> = arr.filter(isDefined);
2858
+ * @example
2859
+ * ```typescript
2860
+ * const arr: Array<number | undefined> = [1,undefined];
2861
+ * const refined: Array<number> = arr.filter(isDefined);
2862
+ * ```
2798
2863
  */
2799
2864
  export declare function isDefined<T>(value: T | undefined | null): value is T;
2800
2865
 
@@ -2861,6 +2926,13 @@ export declare function isOk(outcome: OperationOutcome): boolean;
2861
2926
 
2862
2927
  export declare function isOperationOutcome(value: unknown): value is OperationOutcome;
2863
2928
 
2929
+ /**
2930
+ * Type guard to validate that a value is an array of Organization resources.
2931
+ * @param value - The value to check.
2932
+ * @returns True if the value is an array of Organization resources.
2933
+ */
2934
+ export declare function isOrganizationArray(value: unknown): value is Organization[];
2935
+
2864
2936
  /**
2865
2937
  * Determines if the input is a Period object.
2866
2938
  * This is heuristic based, as we do not have strong typing at runtime.
@@ -3572,7 +3644,7 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
3572
3644
  * @param options - Optional fetch options.
3573
3645
  * @returns Promise to the response content.
3574
3646
  */
3575
- post(url: URL | string, body?: any, contentType?: string, options?: MedplumRequestOptions): Promise<any>;
3647
+ post<T = any>(url: URL | string, body?: any, contentType?: string, options?: MedplumRequestOptions): Promise<T>;
3576
3648
  /**
3577
3649
  * Makes an HTTP PUT request to the specified URL.
3578
3650
  *
@@ -3705,10 +3777,11 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
3705
3777
  * Exchange an external access token for a Medplum access token.
3706
3778
  * @param token - The access token that was generated by the external identity provider.
3707
3779
  * @param clientId - The ID of the `ClientApplication` in your Medplum project that will be making the exchange request.
3780
+ * @param membershipId - Optional membership ID to restrict the exchange to a specific ProjectMembership.
3708
3781
  * @returns The user profile resource.
3709
3782
  * @category Authentication
3710
3783
  */
3711
- exchangeExternalAccessToken(token: string, clientId?: string): Promise<ProfileResource>;
3784
+ exchangeExternalAccessToken(token: string, clientId?: string, membershipId?: string): Promise<ProfileResource>;
3712
3785
  /**
3713
3786
  * Builds the external identity provider redirect URI.
3714
3787
  * @param authorizeUrl - The external authorization URL.
@@ -5349,6 +5422,7 @@ export declare interface MedplumInfraConfig {
5349
5422
  rdsSecretsArn?: string;
5350
5423
  rdsReaderInstanceType?: string;
5351
5424
  rdsProxyEnabled?: boolean;
5425
+ rdsForceRetain?: boolean;
5352
5426
  cacheNodeType?: string;
5353
5427
  cacheSecurityGroupId?: string;
5354
5428
  desiredServerCount: number;
@@ -5504,6 +5578,7 @@ export declare interface MedplumSourceInfraConfig {
5504
5578
  rdsReaderInstanceType?: ValueOrExternalSecret<string>;
5505
5579
  rdsProxyEnabled?: ValueOrExternalSecret<boolean>;
5506
5580
  rdsClusterParameters?: StringMap;
5581
+ rdsForceRetain?: ValueOrExternalSecret<boolean>;
5507
5582
  rdsAutoMinorVersionUpgrade?: ValueOrExternalSecret<boolean>;
5508
5583
  cacheNodeType?: ValueOrExternalSecret<string>;
5509
5584
  cacheSecurityGroupId?: ValueOrExternalSecret<string>;
@@ -6029,8 +6104,33 @@ export declare class ParserBuilder {
6029
6104
  */
6030
6105
  export declare function pathToJSONPointer(path: string): string;
6031
6106
 
6107
+ export declare const PATIENT_PREFERRED_PHARMACY_URL = "http://hl7.org/fhir/StructureDefinition/patient-preferredPharmacy";
6108
+
6032
6109
  export declare type PendingSubscriptionRequest = Omit<SubscriptionRequest, 'endpoint'>;
6033
6110
 
6111
+ /**
6112
+ * Default pharmacy preference type system URL.
6113
+ * Vendors may define their own system URL and pass it to the pharmacy functions.
6114
+ */
6115
+ export declare const PHARMACY_PREFERENCE_TYPE_SYSTEM = "https://medplum.com/fhir/CodeSystem/pharmacy-preference-type";
6116
+
6117
+ export declare const PHARMACY_TYPE_PREFERRED = "preferred";
6118
+
6119
+ export declare const PHARMACY_TYPE_PRIMARY = "primary";
6120
+
6121
+ /**
6122
+ * Parameters for searching pharmacies.
6123
+ */
6124
+ export declare interface PharmacySearchParams {
6125
+ name?: string;
6126
+ city?: string;
6127
+ state?: string;
6128
+ zip?: string;
6129
+ address?: string;
6130
+ phoneOrFax?: string;
6131
+ ncpdpID?: string;
6132
+ }
6133
+
6034
6134
  /**
6035
6135
  * Returns true if the two numbers are equal to the given precision.
6036
6136
  * @param a - The first number.
@@ -6086,6 +6186,11 @@ export declare class ParserBuilder {
6086
6186
 
6087
6187
  export declare const preconditionFailed: OperationOutcome;
6088
6188
 
6189
+ export declare interface PreferredPharmacy {
6190
+ organizationRef: Reference<Organization>;
6191
+ isPrimary: boolean;
6192
+ }
6193
+
6089
6194
  export declare abstract class PrefixOperatorAtom implements Atom {
6090
6195
  readonly operator: string;
6091
6196
  readonly child: Atom;
@@ -6412,6 +6517,15 @@ export declare class ParserBuilder {
6412
6517
  */
6413
6518
  export declare function removeDuplicates(arr: TypedValue[]): TypedValue[];
6414
6519
 
6520
+ /**
6521
+ * Removes a preferred pharmacy extension from a Patient.
6522
+ *
6523
+ * @param patient - The Patient resource to modify (will be mutated).
6524
+ * @param orgRef - Reference to the Organization resource to remove.
6525
+ * @returns The modified Patient resource.
6526
+ */
6527
+ export declare function removePreferredPharmacyFromPatient(patient: Patient, orgRef: Reference<Organization>): Patient;
6528
+
6415
6529
  /**
6416
6530
  * Removes the supplied profileUrl from the resource.meta.profile if it is present
6417
6531
  * @param resource - A FHIR resource
@@ -6619,10 +6733,16 @@ export declare class ParserBuilder {
6619
6733
  * @param resource - The resource to add the identifier to.
6620
6734
  * @param system - The identifier system.
6621
6735
  * @param value - The identifier value.
6736
+ * @param options - Optional attributes to set
6622
6737
  */
6623
6738
  export declare function setIdentifier(resource: Resource & {
6624
6739
  identifier?: Identifier[];
6625
- }, system: string, value: string): void;
6740
+ }, system: string, value: string, options?: SetIdentifierOptions): void;
6741
+
6742
+ export declare interface SetIdentifierOptions {
6743
+ /** IdentifierUse code. See {@link https://build.fhir.org/valueset-identifier-use.html} */
6744
+ use?: Identifier['use'];
6745
+ }
6626
6746
 
6627
6747
  export declare function singleton(collection: TypedValue[], type?: string): TypedValue | undefined;
6628
6748
 
@@ -6837,6 +6957,7 @@ export declare class ParserBuilder {
6837
6957
  private readonly criteriaEntriesBySubscriptionId;
6838
6958
  private wsClosed;
6839
6959
  private pingTimer;
6960
+ private tokenRefreshTimer;
6840
6961
  private readonly pingIntervalMs;
6841
6962
  private waitingForPong;
6842
6963
  private currentProfile;
@@ -6851,6 +6972,9 @@ export declare class ParserBuilder {
6851
6972
  private removeCriteriaEntry;
6852
6973
  private subscribeToCriteria;
6853
6974
  private refreshAllSubscriptions;
6975
+ private isReconnecting;
6976
+ private rebindCriteriaEntry;
6977
+ private checkTokenExpirations;
6854
6978
  addCriteria(criteria: string, subscriptionProps?: Partial<Subscription>): SubscriptionEmitter;
6855
6979
  removeCriteria(criteria: string, subscriptionProps?: Partial<Subscription>): void;
6856
6980
  getWebSocket(): IReconnectingWebSocket;
@@ -6858,6 +6982,7 @@ export declare class ParserBuilder {
6858
6982
  reconnectWebSocket(): void;
6859
6983
  getCriteriaCount(): number;
6860
6984
  getMasterEmitter(): SubscriptionEmitter;
6985
+ reconnectIfNeeded(): Promise<void>;
6861
6986
  }
6862
6987
 
6863
6988
  /**