@medplum/core 5.1.29 → 5.1.31

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.
@@ -16,6 +16,7 @@ import type { CustomTableLayout } from 'pdfmake/interfaces';
16
16
  import type { Device } from '@medplum/fhirtypes';
17
17
  import type { DiagnosticReport } from '@medplum/fhirtypes';
18
18
  import type { DocumentReference } from '@medplum/fhirtypes';
19
+ import type { Duration } from '@medplum/fhirtypes';
19
20
  import type { ElementDefinition } from '@medplum/fhirtypes';
20
21
  import type { ElementDefinitionBinding } from '@medplum/fhirtypes';
21
22
  import type { Encounter } from '@medplum/fhirtypes';
@@ -936,14 +937,19 @@ export declare function conceptMapTranslate(map: ConceptMap, params: ConceptMapT
936
937
  export declare interface ConceptMapTranslateMatch {
937
938
  equivalence?: string;
938
939
  concept?: Coding;
939
- property?: ConceptMapTranslateMatchAttribute[];
940
+ property?: ConceptMapTranslateMatchProperty[];
940
941
  dependsOn?: ConceptMapTranslateMatchAttribute[];
941
942
  product?: ConceptMapTranslateMatchAttribute[];
942
943
  source?: string;
943
944
  }
944
945
 
945
946
  export declare interface ConceptMapTranslateMatchAttribute {
946
- key: string;
947
+ attribute: string;
948
+ value: TypedValue;
949
+ }
950
+
951
+ export declare interface ConceptMapTranslateMatchProperty {
952
+ uri: string;
947
953
  value: TypedValue;
948
954
  }
949
955
 
@@ -1071,6 +1077,17 @@ export declare interface CopyOperation {
1071
1077
  path: string;
1072
1078
  }
1073
1079
 
1080
+ /**
1081
+ * Counts iterable elements by a key function, returning a sparse map of key to count.
1082
+ * Matches Lodash `countBy` semantics (no zero-fill for missing keys).
1083
+ * @param items - The items to count.
1084
+ * @param keyFn - The function to extract the key from each item.
1085
+ * @returns A map of key to count for keys that appear at least once.
1086
+ */
1087
+ export declare function countBy<T, K extends keyof any>(items: Iterable<T>, keyFn: (value: T) => K): Partial<Record<K, number>>;
1088
+
1089
+ export declare function countWhere<T>(items: Iterable<T>, fn: (value: T) => boolean): number;
1090
+
1074
1091
  export declare const CPT = "http://www.ama-assn.org/go/cpt";
1075
1092
 
1076
1093
  export declare interface CrawlerOptions {
@@ -1872,7 +1889,11 @@ export declare type FhircastConnectEvent = {
1872
1889
  * 2. `message` - Contains a `payload` field containing a `FHIRcast` message payload exactly as it comes in over WebSockets.
1873
1890
  * 3. `disconnect` - An event to signal when a WebSocket connection has been closed. Fired as soon as a WebSocket emits `close`.
1874
1891
  *
1875
- * To close the connection, call `connection.disconnect()` and listen to the `disconnect` event to know when the connection has been disconnected.
1892
+ * The underlying socket reconnects on its own, so `disconnect` followed by `connect` is the normal
1893
+ * shape of a dropped connection rather than the end of the session. A subscription endpoint stays
1894
+ * valid for the lease the Hub granted it, so reconnecting resubscribes without a new `hub.subscribe`
1895
+ * request. Two things end a connection for good: calling `connection.disconnect()`, and the Hub
1896
+ * denying the subscription — after either, `connect` will not fire again.
1876
1897
  */
1877
1898
  export declare class FhircastConnection extends TypedEventTarget<FhircastSubscriptionEventMap> {
1878
1899
  readonly subRequest: SubscriptionRequest;
@@ -1880,11 +1901,17 @@ export declare class FhircastConnection extends TypedEventTarget<FhircastSubscri
1880
1901
  /**
1881
1902
  * Creates a new `FhircastConnection`.
1882
1903
  * @param subRequest - The subscription request to initialize the connection from.
1904
+ * @param options - Options for the underlying `ReconnectingWebSocket`.
1883
1905
  */
1884
- constructor(subRequest: SubscriptionRequest);
1906
+ constructor(subRequest: SubscriptionRequest, options?: FhircastConnectionOptions);
1885
1907
  disconnect(): void;
1886
1908
  }
1887
1909
 
1910
+ export declare type FhircastConnectionOptions = Options & {
1911
+ /** An alternate `ReconnectingWebSocket` implementation to open the connection with. */
1912
+ ReconnectingWebSocket?: IReconnectingWebSocketCtor;
1913
+ };
1914
+
1888
1915
  export declare type FhircastContextResourceType<EventName extends FhircastEventName, K extends FhircastEventKeys<EventName>> = (typeof FHIRCAST_EVENT_RESOURCES)[EventName][K] extends {
1889
1916
  resourceType: infer R;
1890
1917
  } ? R : never;
@@ -2518,6 +2545,25 @@ export declare function getExtensionValue(resource: any, ...urls: string[]): Ext
2518
2545
  */
2519
2546
  export declare function getIdentifier(resource: Resource, system: string): string | undefined;
2520
2547
 
2548
+ /**
2549
+ * Returns the resource identifier for the given identifier type.
2550
+ *
2551
+ * Whereas {@link getIdentifier} matches on `Identifier.system`, i.e. who assigned the identifier,
2552
+ * this matches on `Identifier.type`, i.e. what kind of identifier it is. For example,
2553
+ * {@link MRN_IDENTIFIER_TYPE} finds the medical record number no matter which organization issued it.
2554
+ *
2555
+ * Both the system and the code of the type coding must match. Matching on code alone would be
2556
+ * ambiguous, because the same code means different things in different code systems.
2557
+ *
2558
+ * If multiple identifiers exist with the same type, the first one is returned.
2559
+ *
2560
+ * If the type is not found, then returns undefined.
2561
+ * @param resource - The resource to check.
2562
+ * @param type - The identifier type coding, such as {@link MRN_IDENTIFIER_TYPE}.
2563
+ * @returns The identifier value if found; otherwise undefined.
2564
+ */
2565
+ export declare function getIdentifierByType(resource: Resource, type: Coding): string | undefined;
2566
+
2521
2567
  /**
2522
2568
  * Returns an image URL for the resource, if one is available.
2523
2569
  * @param resource - The input resource.
@@ -2622,6 +2668,13 @@ export declare function getQuestionnaireAnswers(response: QuestionnaireResponse)
2622
2668
  */
2623
2669
  export declare function getRandomString(): string;
2624
2670
 
2671
+ /**
2672
+ * Returns the number of milliseconds until a rate limit resets.
2673
+ * @param outcome - The rate limit outcome.
2674
+ * @returns Milliseconds until reset, or undefined if not present.
2675
+ */
2676
+ export declare function getRateLimitReset(outcome: OperationOutcome): number | undefined;
2677
+
2625
2678
  /**
2626
2679
  * Returns a reference string for a resource.
2627
2680
  * @param input - The FHIR resource or reference.
@@ -2784,6 +2837,8 @@ export declare interface GoogleLoginRequest extends BaseLoginRequest {
2784
2837
  */
2785
2838
  export declare function hasSchedulingParameters(resource: Schedule | HealthcareService): boolean;
2786
2839
 
2840
+ export declare const HL7_V2_0203 = "http://terminology.hl7.org/CodeSystem/v2-0203";
2841
+
2787
2842
  export declare interface Hl7AckOptions {
2788
2843
  ackCode: AckCode;
2789
2844
  errSegment?: Hl7Segment;
@@ -4283,20 +4338,20 @@ export declare interface MedicationOrderDrugInput {
4283
4338
  readonly rxNorm?: string;
4284
4339
  readonly routedMedId?: number;
4285
4340
  /**
4286
- * Vendor formulation key, paired with {@link routedMedId} to order a drug that
4341
+ * Vendor formulation key, paired with {@link MedicationOrderDrugInput.routedMedId} to order a drug that
4287
4342
  * has no dose-level product to resolve an NDC from — OTC / topical /
4288
4343
  * wide-multi-strength generics for which the vendor's dose-format lookup
4289
- * returns nothing. Supply {@link drugName} alongside it, since there is no
4344
+ * returns nothing. Supply {@link MedicationOrderDrugInput.drugName} alongside it, since there is no
4290
4345
  * catalog row to derive a name from.
4291
4346
  */
4292
4347
  readonly gcnSeqno?: number;
4293
- /** Drug name, required for a {@link gcnSeqno}-keyed line (no catalog row to name it). */
4348
+ /** Drug name, required for a {@link MedicationOrderDrugInput.gcnSeqno}-keyed line (no catalog row to name it). */
4294
4349
  readonly drugName?: string;
4295
4350
  /**
4296
- * Dose text for a {@link gcnSeqno}-keyed line, e.g. `"solution"`.
4351
+ * Dose text for a {@link MedicationOrderDrugInput.gcnSeqno}-keyed line, e.g. `"solution"`.
4297
4352
  *
4298
4353
  * Optional, and only worth sending when the caller holds dose text *separate*
4299
- * from {@link drugName} — a hand-entered form, say. Passing a full product
4354
+ * from {@link MedicationOrderDrugInput.drugName} — a hand-entered form, say. Passing a full product
4300
4355
  * label duplicates it in the description the vendor renders. When omitted, the
4301
4356
  * vendor derives the dose from the formulation key or falls back to the sig.
4302
4357
  */
@@ -4457,7 +4512,7 @@ export declare interface MedicationSearchParams {
4457
4512
  readonly rxNorm?: string;
4458
4513
  readonly routedMedId?: number;
4459
4514
  /**
4460
- * Vendor formulation keys under {@link routedMedId}, from the name-search hit.
4515
+ * Vendor formulation keys under {@link MedicationSearchParams.routedMedId}, from the name-search hit.
4461
4516
  * Only used when the drug has no dose-level products: each key is resolved to
4462
4517
  * its marketed strength so the caller still gets selectable formulations
4463
4518
  * instead of an empty result. Ignored otherwise.
@@ -5916,6 +5971,12 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
5916
5971
  * Adds default options to the fetch options.
5917
5972
  * @param options - The options to add defaults to.
5918
5973
  */
5974
+ /**
5975
+ * Determines if a URL is internal and should receive authentication credentials.
5976
+ * @param url - The URL to check
5977
+ * @returns True if the URL should receive credentials
5978
+ */
5979
+ private isInternalUrl;
5919
5980
  private addFetchOptionsDefaults;
5920
5981
  /**
5921
5982
  * Sets the "Content-Type" header on fetch options.
@@ -6153,9 +6214,10 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
6153
6214
  *
6154
6215
  * @category FHIRcast
6155
6216
  * @param subRequest - The `SubscriptionRequest` to use for connecting.
6217
+ * @param options - Options for the underlying `ReconnectingWebSocket`.
6156
6218
  * @returns A `FhircastConnection` which emits lifecycle events for the `FHIRcast` WebSocket connection.
6157
6219
  */
6158
- fhircastConnect(subRequest: SubscriptionRequest): FhircastConnection;
6220
+ fhircastConnect(subRequest: SubscriptionRequest, options?: FhircastConnectionOptions): FhircastConnection;
6159
6221
  /**
6160
6222
  * Publishes a new context to a given topic for a specified event type.
6161
6223
  *
@@ -7056,6 +7118,9 @@ export declare interface MoveOperation {
7056
7118
  path: string;
7057
7119
  }
7058
7120
 
7121
+ /** The HL7 v2 Table 0203 coding for a medical record number. */
7122
+ export declare const MRN_IDENTIFIER_TYPE: Coding;
7123
+
7059
7124
  export declare const multipleMatches: OperationOutcome;
7060
7125
 
7061
7126
  export declare const NDC = "http://hl7.org/fhir/sid/ndc";
@@ -7866,6 +7931,8 @@ export declare class ParserBuilder {
7866
7931
  */
7867
7932
  export declare type QueryTypes = URLSearchParams | string[][] | Record<string, string | number | boolean | undefined> | string | undefined;
7868
7933
 
7934
+ export declare const RATE_LIMIT_RESET_EXTENSION_URL = "https://medplum.com/fhir/StructureDefinition/rate-limit-reset";
7935
+
7869
7936
  export declare type RateLimitInfo = {
7870
7937
  /** Name of the rate limiter. */
7871
7938
  name: string;
@@ -8212,8 +8279,9 @@ export declare class ParserBuilder {
8212
8279
  * Conditional methods (`createResourceIfNoneExist`, `upsertResource`) emit
8213
8280
  * even when the server made no change, except on HTTP 304 "Not Modified".
8214
8281
  *
8215
- * @template T - The type of the modified resource. Defaults to `Resource`; narrow it (e.g. via
8216
- * `useResourceModified('Slot', ...)`) to get a typed `resource` payload without extra guards.
8282
+ * The generic type parameter `T` specifies the type of the modified resource.
8283
+ * It defaults to `Resource`; narrow it (e.g. via `useResourceModified('Slot', ...)`)
8284
+ * to get a typed `resource` payload without extra guards.
8217
8285
  */
8218
8286
  export declare interface ResourceModifiedEvent<T extends Resource = Resource> {
8219
8287
  /** The type of the modified resource. */
@@ -8250,6 +8318,15 @@ export declare class ParserBuilder {
8250
8318
  */
8251
8319
  export declare function satisfiedAccessPolicy(resource: Resource, interaction: AccessPolicyInteraction, accessPolicy: AccessPolicy | undefined): AccessPolicyResource | undefined;
8252
8320
 
8321
+ /**
8322
+ * Converts a SchedulingParameters duration to minutes.
8323
+ *
8324
+ * @param duration - The duration to convert.
8325
+ * @returns The length in minutes, or undefined when the duration has no value, a
8326
+ * negative value, or a unit scheduling does not accept.
8327
+ */
8328
+ export declare function schedulingDurationToMinutes(duration: Duration | undefined): number | undefined;
8329
+
8253
8330
  export declare const SchedulingEncounterCodingURI = "https://medplum.com/fhir/StructureDefinition/SchedulingEncounterCoding";
8254
8331
 
8255
8332
  export declare const SchedulingParametersURI = "https://medplum.com/fhir/StructureDefinition/SchedulingParameters";
@@ -8407,6 +8484,13 @@ export declare class ParserBuilder {
8407
8484
  use?: Identifier['use'];
8408
8485
  }
8409
8486
 
8487
+ /**
8488
+ * Adds the rate limit reset delay to an OperationOutcome.
8489
+ * @param outcome - The rate limit outcome.
8490
+ * @param msBeforeNext - Milliseconds until the rate limit resets.
8491
+ */
8492
+ export declare function setRateLimitReset(outcome: OperationOutcome, msBeforeNext: number): void;
8493
+
8410
8494
  /**
8411
8495
  * Immutably sets one scheduling parameter on a Schedule for a HealthcareService, so that calendar keeps
8412
8496
  * it in place of the service-level parameter of the same name. Whatever the Schedule already holds at the
@@ -8732,6 +8816,8 @@ export declare class ParserBuilder {
8732
8816
  [index: string]: any;
8733
8817
  }): string[];
8734
8818
 
8819
+ export declare function sumBy<T>(items: Iterable<T>, fn: (value: T) => number): number;
8820
+
8735
8821
  /**
8736
8822
  * Summarizes a group of Observations into a single computed summary value, with the individual values
8737
8823
  * preserved in `Observation.component.valueSampledData`.
@@ -16,6 +16,7 @@ import type { CustomTableLayout } from 'pdfmake/interfaces';
16
16
  import type { Device } from '@medplum/fhirtypes';
17
17
  import type { DiagnosticReport } from '@medplum/fhirtypes';
18
18
  import type { DocumentReference } from '@medplum/fhirtypes';
19
+ import type { Duration } from '@medplum/fhirtypes';
19
20
  import type { ElementDefinition } from '@medplum/fhirtypes';
20
21
  import type { ElementDefinitionBinding } from '@medplum/fhirtypes';
21
22
  import type { Encounter } from '@medplum/fhirtypes';
@@ -936,14 +937,19 @@ export declare function conceptMapTranslate(map: ConceptMap, params: ConceptMapT
936
937
  export declare interface ConceptMapTranslateMatch {
937
938
  equivalence?: string;
938
939
  concept?: Coding;
939
- property?: ConceptMapTranslateMatchAttribute[];
940
+ property?: ConceptMapTranslateMatchProperty[];
940
941
  dependsOn?: ConceptMapTranslateMatchAttribute[];
941
942
  product?: ConceptMapTranslateMatchAttribute[];
942
943
  source?: string;
943
944
  }
944
945
 
945
946
  export declare interface ConceptMapTranslateMatchAttribute {
946
- key: string;
947
+ attribute: string;
948
+ value: TypedValue;
949
+ }
950
+
951
+ export declare interface ConceptMapTranslateMatchProperty {
952
+ uri: string;
947
953
  value: TypedValue;
948
954
  }
949
955
 
@@ -1071,6 +1077,17 @@ export declare interface CopyOperation {
1071
1077
  path: string;
1072
1078
  }
1073
1079
 
1080
+ /**
1081
+ * Counts iterable elements by a key function, returning a sparse map of key to count.
1082
+ * Matches Lodash `countBy` semantics (no zero-fill for missing keys).
1083
+ * @param items - The items to count.
1084
+ * @param keyFn - The function to extract the key from each item.
1085
+ * @returns A map of key to count for keys that appear at least once.
1086
+ */
1087
+ export declare function countBy<T, K extends keyof any>(items: Iterable<T>, keyFn: (value: T) => K): Partial<Record<K, number>>;
1088
+
1089
+ export declare function countWhere<T>(items: Iterable<T>, fn: (value: T) => boolean): number;
1090
+
1074
1091
  export declare const CPT = "http://www.ama-assn.org/go/cpt";
1075
1092
 
1076
1093
  export declare interface CrawlerOptions {
@@ -1872,7 +1889,11 @@ export declare type FhircastConnectEvent = {
1872
1889
  * 2. `message` - Contains a `payload` field containing a `FHIRcast` message payload exactly as it comes in over WebSockets.
1873
1890
  * 3. `disconnect` - An event to signal when a WebSocket connection has been closed. Fired as soon as a WebSocket emits `close`.
1874
1891
  *
1875
- * To close the connection, call `connection.disconnect()` and listen to the `disconnect` event to know when the connection has been disconnected.
1892
+ * The underlying socket reconnects on its own, so `disconnect` followed by `connect` is the normal
1893
+ * shape of a dropped connection rather than the end of the session. A subscription endpoint stays
1894
+ * valid for the lease the Hub granted it, so reconnecting resubscribes without a new `hub.subscribe`
1895
+ * request. Two things end a connection for good: calling `connection.disconnect()`, and the Hub
1896
+ * denying the subscription — after either, `connect` will not fire again.
1876
1897
  */
1877
1898
  export declare class FhircastConnection extends TypedEventTarget<FhircastSubscriptionEventMap> {
1878
1899
  readonly subRequest: SubscriptionRequest;
@@ -1880,11 +1901,17 @@ export declare class FhircastConnection extends TypedEventTarget<FhircastSubscri
1880
1901
  /**
1881
1902
  * Creates a new `FhircastConnection`.
1882
1903
  * @param subRequest - The subscription request to initialize the connection from.
1904
+ * @param options - Options for the underlying `ReconnectingWebSocket`.
1883
1905
  */
1884
- constructor(subRequest: SubscriptionRequest);
1906
+ constructor(subRequest: SubscriptionRequest, options?: FhircastConnectionOptions);
1885
1907
  disconnect(): void;
1886
1908
  }
1887
1909
 
1910
+ export declare type FhircastConnectionOptions = Options & {
1911
+ /** An alternate `ReconnectingWebSocket` implementation to open the connection with. */
1912
+ ReconnectingWebSocket?: IReconnectingWebSocketCtor;
1913
+ };
1914
+
1888
1915
  export declare type FhircastContextResourceType<EventName extends FhircastEventName, K extends FhircastEventKeys<EventName>> = (typeof FHIRCAST_EVENT_RESOURCES)[EventName][K] extends {
1889
1916
  resourceType: infer R;
1890
1917
  } ? R : never;
@@ -2518,6 +2545,25 @@ export declare function getExtensionValue(resource: any, ...urls: string[]): Ext
2518
2545
  */
2519
2546
  export declare function getIdentifier(resource: Resource, system: string): string | undefined;
2520
2547
 
2548
+ /**
2549
+ * Returns the resource identifier for the given identifier type.
2550
+ *
2551
+ * Whereas {@link getIdentifier} matches on `Identifier.system`, i.e. who assigned the identifier,
2552
+ * this matches on `Identifier.type`, i.e. what kind of identifier it is. For example,
2553
+ * {@link MRN_IDENTIFIER_TYPE} finds the medical record number no matter which organization issued it.
2554
+ *
2555
+ * Both the system and the code of the type coding must match. Matching on code alone would be
2556
+ * ambiguous, because the same code means different things in different code systems.
2557
+ *
2558
+ * If multiple identifiers exist with the same type, the first one is returned.
2559
+ *
2560
+ * If the type is not found, then returns undefined.
2561
+ * @param resource - The resource to check.
2562
+ * @param type - The identifier type coding, such as {@link MRN_IDENTIFIER_TYPE}.
2563
+ * @returns The identifier value if found; otherwise undefined.
2564
+ */
2565
+ export declare function getIdentifierByType(resource: Resource, type: Coding): string | undefined;
2566
+
2521
2567
  /**
2522
2568
  * Returns an image URL for the resource, if one is available.
2523
2569
  * @param resource - The input resource.
@@ -2622,6 +2668,13 @@ export declare function getQuestionnaireAnswers(response: QuestionnaireResponse)
2622
2668
  */
2623
2669
  export declare function getRandomString(): string;
2624
2670
 
2671
+ /**
2672
+ * Returns the number of milliseconds until a rate limit resets.
2673
+ * @param outcome - The rate limit outcome.
2674
+ * @returns Milliseconds until reset, or undefined if not present.
2675
+ */
2676
+ export declare function getRateLimitReset(outcome: OperationOutcome): number | undefined;
2677
+
2625
2678
  /**
2626
2679
  * Returns a reference string for a resource.
2627
2680
  * @param input - The FHIR resource or reference.
@@ -2784,6 +2837,8 @@ export declare interface GoogleLoginRequest extends BaseLoginRequest {
2784
2837
  */
2785
2838
  export declare function hasSchedulingParameters(resource: Schedule | HealthcareService): boolean;
2786
2839
 
2840
+ export declare const HL7_V2_0203 = "http://terminology.hl7.org/CodeSystem/v2-0203";
2841
+
2787
2842
  export declare interface Hl7AckOptions {
2788
2843
  ackCode: AckCode;
2789
2844
  errSegment?: Hl7Segment;
@@ -4283,20 +4338,20 @@ export declare interface MedicationOrderDrugInput {
4283
4338
  readonly rxNorm?: string;
4284
4339
  readonly routedMedId?: number;
4285
4340
  /**
4286
- * Vendor formulation key, paired with {@link routedMedId} to order a drug that
4341
+ * Vendor formulation key, paired with {@link MedicationOrderDrugInput.routedMedId} to order a drug that
4287
4342
  * has no dose-level product to resolve an NDC from — OTC / topical /
4288
4343
  * wide-multi-strength generics for which the vendor's dose-format lookup
4289
- * returns nothing. Supply {@link drugName} alongside it, since there is no
4344
+ * returns nothing. Supply {@link MedicationOrderDrugInput.drugName} alongside it, since there is no
4290
4345
  * catalog row to derive a name from.
4291
4346
  */
4292
4347
  readonly gcnSeqno?: number;
4293
- /** Drug name, required for a {@link gcnSeqno}-keyed line (no catalog row to name it). */
4348
+ /** Drug name, required for a {@link MedicationOrderDrugInput.gcnSeqno}-keyed line (no catalog row to name it). */
4294
4349
  readonly drugName?: string;
4295
4350
  /**
4296
- * Dose text for a {@link gcnSeqno}-keyed line, e.g. `"solution"`.
4351
+ * Dose text for a {@link MedicationOrderDrugInput.gcnSeqno}-keyed line, e.g. `"solution"`.
4297
4352
  *
4298
4353
  * Optional, and only worth sending when the caller holds dose text *separate*
4299
- * from {@link drugName} — a hand-entered form, say. Passing a full product
4354
+ * from {@link MedicationOrderDrugInput.drugName} — a hand-entered form, say. Passing a full product
4300
4355
  * label duplicates it in the description the vendor renders. When omitted, the
4301
4356
  * vendor derives the dose from the formulation key or falls back to the sig.
4302
4357
  */
@@ -4457,7 +4512,7 @@ export declare interface MedicationSearchParams {
4457
4512
  readonly rxNorm?: string;
4458
4513
  readonly routedMedId?: number;
4459
4514
  /**
4460
- * Vendor formulation keys under {@link routedMedId}, from the name-search hit.
4515
+ * Vendor formulation keys under {@link MedicationSearchParams.routedMedId}, from the name-search hit.
4461
4516
  * Only used when the drug has no dose-level products: each key is resolved to
4462
4517
  * its marketed strength so the caller still gets selectable formulations
4463
4518
  * instead of an empty result. Ignored otherwise.
@@ -5916,6 +5971,12 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
5916
5971
  * Adds default options to the fetch options.
5917
5972
  * @param options - The options to add defaults to.
5918
5973
  */
5974
+ /**
5975
+ * Determines if a URL is internal and should receive authentication credentials.
5976
+ * @param url - The URL to check
5977
+ * @returns True if the URL should receive credentials
5978
+ */
5979
+ private isInternalUrl;
5919
5980
  private addFetchOptionsDefaults;
5920
5981
  /**
5921
5982
  * Sets the "Content-Type" header on fetch options.
@@ -6153,9 +6214,10 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
6153
6214
  *
6154
6215
  * @category FHIRcast
6155
6216
  * @param subRequest - The `SubscriptionRequest` to use for connecting.
6217
+ * @param options - Options for the underlying `ReconnectingWebSocket`.
6156
6218
  * @returns A `FhircastConnection` which emits lifecycle events for the `FHIRcast` WebSocket connection.
6157
6219
  */
6158
- fhircastConnect(subRequest: SubscriptionRequest): FhircastConnection;
6220
+ fhircastConnect(subRequest: SubscriptionRequest, options?: FhircastConnectionOptions): FhircastConnection;
6159
6221
  /**
6160
6222
  * Publishes a new context to a given topic for a specified event type.
6161
6223
  *
@@ -7056,6 +7118,9 @@ export declare interface MoveOperation {
7056
7118
  path: string;
7057
7119
  }
7058
7120
 
7121
+ /** The HL7 v2 Table 0203 coding for a medical record number. */
7122
+ export declare const MRN_IDENTIFIER_TYPE: Coding;
7123
+
7059
7124
  export declare const multipleMatches: OperationOutcome;
7060
7125
 
7061
7126
  export declare const NDC = "http://hl7.org/fhir/sid/ndc";
@@ -7866,6 +7931,8 @@ export declare class ParserBuilder {
7866
7931
  */
7867
7932
  export declare type QueryTypes = URLSearchParams | string[][] | Record<string, string | number | boolean | undefined> | string | undefined;
7868
7933
 
7934
+ export declare const RATE_LIMIT_RESET_EXTENSION_URL = "https://medplum.com/fhir/StructureDefinition/rate-limit-reset";
7935
+
7869
7936
  export declare type RateLimitInfo = {
7870
7937
  /** Name of the rate limiter. */
7871
7938
  name: string;
@@ -8212,8 +8279,9 @@ export declare class ParserBuilder {
8212
8279
  * Conditional methods (`createResourceIfNoneExist`, `upsertResource`) emit
8213
8280
  * even when the server made no change, except on HTTP 304 "Not Modified".
8214
8281
  *
8215
- * @template T - The type of the modified resource. Defaults to `Resource`; narrow it (e.g. via
8216
- * `useResourceModified('Slot', ...)`) to get a typed `resource` payload without extra guards.
8282
+ * The generic type parameter `T` specifies the type of the modified resource.
8283
+ * It defaults to `Resource`; narrow it (e.g. via `useResourceModified('Slot', ...)`)
8284
+ * to get a typed `resource` payload without extra guards.
8217
8285
  */
8218
8286
  export declare interface ResourceModifiedEvent<T extends Resource = Resource> {
8219
8287
  /** The type of the modified resource. */
@@ -8250,6 +8318,15 @@ export declare class ParserBuilder {
8250
8318
  */
8251
8319
  export declare function satisfiedAccessPolicy(resource: Resource, interaction: AccessPolicyInteraction, accessPolicy: AccessPolicy | undefined): AccessPolicyResource | undefined;
8252
8320
 
8321
+ /**
8322
+ * Converts a SchedulingParameters duration to minutes.
8323
+ *
8324
+ * @param duration - The duration to convert.
8325
+ * @returns The length in minutes, or undefined when the duration has no value, a
8326
+ * negative value, or a unit scheduling does not accept.
8327
+ */
8328
+ export declare function schedulingDurationToMinutes(duration: Duration | undefined): number | undefined;
8329
+
8253
8330
  export declare const SchedulingEncounterCodingURI = "https://medplum.com/fhir/StructureDefinition/SchedulingEncounterCoding";
8254
8331
 
8255
8332
  export declare const SchedulingParametersURI = "https://medplum.com/fhir/StructureDefinition/SchedulingParameters";
@@ -8407,6 +8484,13 @@ export declare class ParserBuilder {
8407
8484
  use?: Identifier['use'];
8408
8485
  }
8409
8486
 
8487
+ /**
8488
+ * Adds the rate limit reset delay to an OperationOutcome.
8489
+ * @param outcome - The rate limit outcome.
8490
+ * @param msBeforeNext - Milliseconds until the rate limit resets.
8491
+ */
8492
+ export declare function setRateLimitReset(outcome: OperationOutcome, msBeforeNext: number): void;
8493
+
8410
8494
  /**
8411
8495
  * Immutably sets one scheduling parameter on a Schedule for a HealthcareService, so that calendar keeps
8412
8496
  * it in place of the service-level parameter of the same name. Whatever the Schedule already holds at the
@@ -8732,6 +8816,8 @@ export declare class ParserBuilder {
8732
8816
  [index: string]: any;
8733
8817
  }): string[];
8734
8818
 
8819
+ export declare function sumBy<T>(items: Iterable<T>, fn: (value: T) => number): number;
8820
+
8735
8821
  /**
8736
8822
  * Summarizes a group of Observations into a single computed summary value, with the individual values
8737
8823
  * preserved in `Observation.component.valueSampledData`.