@medplum/core 5.1.9 → 5.1.11
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.
- package/dist/cjs/index.cjs +7 -7
- package/dist/cjs/index.cjs.map +3 -3
- package/dist/cjs/index.d.ts +115 -4
- package/dist/esm/index.d.ts +115 -4
- package/dist/esm/index.mjs +6 -6
- package/dist/esm/index.mjs.map +3 -3
- package/package.json +5 -5
package/dist/cjs/index.d.ts
CHANGED
|
@@ -2368,6 +2368,9 @@ export declare interface Hl7DateParseOptions {
|
|
|
2368
2368
|
export declare class Hl7Field {
|
|
2369
2369
|
readonly context: Hl7Context;
|
|
2370
2370
|
readonly components: string[][];
|
|
2371
|
+
/** @internal */
|
|
2372
|
+
onModified?: () => void;
|
|
2373
|
+
private cachedString;
|
|
2371
2374
|
/**
|
|
2372
2375
|
* Creates a new HL7 field.
|
|
2373
2376
|
* @param components - The HL7 components.
|
|
@@ -2420,6 +2423,7 @@ export declare class Hl7Field {
|
|
|
2420
2423
|
* @returns true if the component was set, false otherwise
|
|
2421
2424
|
*/
|
|
2422
2425
|
setComponent(component: number, value: string, subcomponent?: number, repetition?: number): boolean;
|
|
2426
|
+
private invalidateCache;
|
|
2423
2427
|
}
|
|
2424
2428
|
|
|
2425
2429
|
/**
|
|
@@ -2428,13 +2432,42 @@ export declare class Hl7Field {
|
|
|
2428
2432
|
*/
|
|
2429
2433
|
export declare class Hl7Message {
|
|
2430
2434
|
readonly context: Hl7Context;
|
|
2431
|
-
|
|
2435
|
+
/**
|
|
2436
|
+
* Internal lazy-parsed segment storage. Entries are `string` until they
|
|
2437
|
+
* are accessed (via {@link getSegment}, {@link getAllSegments}, {@link header},
|
|
2438
|
+
* or the public {@link segments} getter), at which point they are parsed in
|
|
2439
|
+
* place and replaced with their {@link Hl7Segment} form.
|
|
2440
|
+
*/
|
|
2441
|
+
private readonly _segments;
|
|
2442
|
+
/**
|
|
2443
|
+
* Maps segment name → indices into {@link _segments}. Storing indices (rather
|
|
2444
|
+
* than references to the segments themselves) keeps this map in sync with
|
|
2445
|
+
* {@link _segments} without needing a per-parse update step, and is immune to
|
|
2446
|
+
* collisions when two segments have identical raw text.
|
|
2447
|
+
*/
|
|
2448
|
+
private segmentsByName;
|
|
2449
|
+
private cachedString;
|
|
2450
|
+
/** Becomes true once every entry in `_segments` has been parsed. */
|
|
2451
|
+
private allSegmentsParsed;
|
|
2432
2452
|
/**
|
|
2433
2453
|
* Creates a new HL7 message.
|
|
2454
|
+
*
|
|
2455
|
+
* Segment strings are not parsed until they are accessed via {@link getSegment},
|
|
2456
|
+
* {@link getAllSegments}, {@link header}, or the {@link segments} getter.
|
|
2457
|
+
*
|
|
2434
2458
|
* @param segments - The HL7 segments.
|
|
2435
2459
|
* @param context - Optional HL7 parsing context.
|
|
2436
2460
|
*/
|
|
2437
|
-
constructor(segments: Hl7Segment[], context?: Hl7Context);
|
|
2461
|
+
constructor(segments: (Hl7Segment | string)[], context?: Hl7Context);
|
|
2462
|
+
/**
|
|
2463
|
+
* Returns all HL7 segments, parsing any unparsed segment strings on first access.
|
|
2464
|
+
*
|
|
2465
|
+
* Prefer {@link getSegment} or {@link getAllSegments} when you only need a subset
|
|
2466
|
+
* of segments; those methods avoid parsing unrelated segments.
|
|
2467
|
+
*
|
|
2468
|
+
* @returns The HL7 segments array.
|
|
2469
|
+
*/
|
|
2470
|
+
get segments(): Hl7Segment[];
|
|
2438
2471
|
/**
|
|
2439
2472
|
* Returns the HL7 message header.
|
|
2440
2473
|
* @returns The HL7 message header.
|
|
@@ -2461,18 +2494,35 @@ export declare class Hl7Message {
|
|
|
2461
2494
|
*
|
|
2462
2495
|
* When using a string index, this method returns the first segment with the specified name.
|
|
2463
2496
|
*
|
|
2497
|
+
* Segments are lazily parsed; the requested segment is parsed and cached on demand.
|
|
2498
|
+
*
|
|
2464
2499
|
* @param index - The HL7 segment index or name.
|
|
2465
2500
|
* @returns The HL7 segment if found; otherwise, undefined.
|
|
2466
2501
|
*/
|
|
2467
2502
|
getSegment(index: number | string): Hl7Segment | undefined;
|
|
2468
2503
|
/**
|
|
2469
2504
|
* Returns all HL7 segments of a given name.
|
|
2505
|
+
*
|
|
2506
|
+
* Only the segments that match the requested name are parsed, which avoids parsing
|
|
2507
|
+
* unrelated segments when scanning a message.
|
|
2508
|
+
*
|
|
2470
2509
|
* @param name - The HL7 segment name.
|
|
2471
2510
|
* @returns An array of HL7 segments with the specified name.
|
|
2472
2511
|
*/
|
|
2473
2512
|
getAllSegments(name: string): Hl7Segment[];
|
|
2513
|
+
/**
|
|
2514
|
+
* Parses the segment at the given index (if not already parsed), caches it back into
|
|
2515
|
+
* the segments array, and wires up the onModified callback.
|
|
2516
|
+
* @param index - The HL7 segment index.
|
|
2517
|
+
* @returns The parsed HL7 segment, or undefined if the index is out of range.
|
|
2518
|
+
*/
|
|
2519
|
+
private parseSegment;
|
|
2474
2520
|
/**
|
|
2475
2521
|
* Returns the HL7 message as a string.
|
|
2522
|
+
*
|
|
2523
|
+
* Unparsed segments are emitted directly from their original string form, which
|
|
2524
|
+
* preserves the source text without forcing a parse.
|
|
2525
|
+
*
|
|
2476
2526
|
* @returns The HL7 message as a string.
|
|
2477
2527
|
*/
|
|
2478
2528
|
toString(): string;
|
|
@@ -2499,6 +2549,9 @@ export declare class Hl7Message {
|
|
|
2499
2549
|
* @returns true if the segment was set, false otherwise
|
|
2500
2550
|
*/
|
|
2501
2551
|
setSegment(index: number | string, segment: Hl7Segment): boolean;
|
|
2552
|
+
private findSegmentIndexByName;
|
|
2553
|
+
private invalidateCache;
|
|
2554
|
+
private bindSegments;
|
|
2502
2555
|
}
|
|
2503
2556
|
|
|
2504
2557
|
/**
|
|
@@ -2509,13 +2562,37 @@ export declare class Hl7Message {
|
|
|
2509
2562
|
export declare class Hl7Segment {
|
|
2510
2563
|
readonly context: Hl7Context;
|
|
2511
2564
|
readonly name: string;
|
|
2512
|
-
|
|
2565
|
+
/**
|
|
2566
|
+
* Internal lazy-parsed field storage. Entries are `string` until they are
|
|
2567
|
+
* accessed (via {@link getField} or the public {@link fields} getter), at
|
|
2568
|
+
* which point they are parsed in place and replaced with their
|
|
2569
|
+
* {@link Hl7Field} form.
|
|
2570
|
+
*/
|
|
2571
|
+
private readonly _fields;
|
|
2572
|
+
/** Becomes true once every entry in `_fields` has been parsed. */
|
|
2573
|
+
private allFieldsParsed;
|
|
2574
|
+
private cachedString;
|
|
2575
|
+
/** @internal */
|
|
2576
|
+
onModified?: () => void;
|
|
2513
2577
|
/**
|
|
2514
2578
|
* Creates a new HL7 segment.
|
|
2579
|
+
*
|
|
2580
|
+
* Field strings are not parsed until they are accessed via {@link getField}
|
|
2581
|
+
* or via the {@link fields} getter.
|
|
2582
|
+
*
|
|
2515
2583
|
* @param fields - The HL7 fields. The first field is the segment name.
|
|
2516
2584
|
* @param context - Optional HL7 parsing context.
|
|
2517
2585
|
*/
|
|
2518
|
-
constructor(fields: Hl7Field
|
|
2586
|
+
constructor(fields: (Hl7Field | string)[], context?: Hl7Context);
|
|
2587
|
+
/**
|
|
2588
|
+
* Returns all HL7 fields, parsing any unparsed field strings on first access.
|
|
2589
|
+
*
|
|
2590
|
+
* Prefer {@link getField} when you only need a subset of fields; that method
|
|
2591
|
+
* avoids parsing unrelated fields.
|
|
2592
|
+
*
|
|
2593
|
+
* @returns The HL7 fields array.
|
|
2594
|
+
*/
|
|
2595
|
+
get fields(): Hl7Field[];
|
|
2519
2596
|
/**
|
|
2520
2597
|
* Returns an HL7 field by index.
|
|
2521
2598
|
* @param index - The HL7 field index.
|
|
@@ -2534,10 +2611,19 @@ export declare class Hl7Segment {
|
|
|
2534
2611
|
*
|
|
2535
2612
|
* Field zero is the segment name.
|
|
2536
2613
|
*
|
|
2614
|
+
* Fields are lazily parsed; the requested field is parsed and cached on demand.
|
|
2615
|
+
*
|
|
2537
2616
|
* @param index - The HL7 field index.
|
|
2538
2617
|
* @returns The HL7 field.
|
|
2539
2618
|
*/
|
|
2540
2619
|
getField(index: number): Hl7Field;
|
|
2620
|
+
/**
|
|
2621
|
+
* Parses the field at the given index (if not already parsed), caches it back into
|
|
2622
|
+
* the fields array, and wires up the onModified callback.
|
|
2623
|
+
* @param index - The HL7 field index.
|
|
2624
|
+
* @returns The parsed HL7 field, or undefined if the index is out of range.
|
|
2625
|
+
*/
|
|
2626
|
+
private parseField;
|
|
2541
2627
|
/**
|
|
2542
2628
|
* Returns an HL7 component by field index and component index.
|
|
2543
2629
|
*
|
|
@@ -2558,6 +2644,10 @@ export declare class Hl7Segment {
|
|
|
2558
2644
|
getComponent(fieldIndex: number, component: number, subcomponent?: number, repetition?: number): string;
|
|
2559
2645
|
/**
|
|
2560
2646
|
* Returns the HL7 segment as a string.
|
|
2647
|
+
*
|
|
2648
|
+
* Unparsed fields are emitted directly from their original string form, which
|
|
2649
|
+
* preserves the source text without forcing a parse.
|
|
2650
|
+
*
|
|
2561
2651
|
* @returns The HL7 segment as a string.
|
|
2562
2652
|
*/
|
|
2563
2653
|
toString(): string;
|
|
@@ -2588,6 +2678,8 @@ export declare class Hl7Segment {
|
|
|
2588
2678
|
* @returns true if the component was set, false otherwise
|
|
2589
2679
|
*/
|
|
2590
2680
|
setComponent(fieldIndex: number, component: number, value: string, subcomponent?: number, repetition?: number): boolean;
|
|
2681
|
+
private invalidateCache;
|
|
2682
|
+
private bindFields;
|
|
2591
2683
|
}
|
|
2592
2684
|
|
|
2593
2685
|
export declare const HTTP_HL7_ORG = "http://hl7.org";
|
|
@@ -4907,10 +4999,27 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
|
|
|
4907
4999
|
refreshIfExpired(gracePeriod?: number): Promise<void>;
|
|
4908
5000
|
/**
|
|
4909
5001
|
* Tries to refresh the auth tokens.
|
|
5002
|
+
*
|
|
5003
|
+
* When `navigator.locks` is available, the network call is wrapped in a Web Lock
|
|
5004
|
+
* scoped to this client's storage namespace. This serializes refresh attempts across
|
|
5005
|
+
* browser tabs/windows on the same origin so a single-use refresh token is not
|
|
5006
|
+
* consumed by more than one tab. Tabs that wait on the lock re-read the latest
|
|
5007
|
+
* tokens from storage when they acquire it and skip the network call if another tab
|
|
5008
|
+
* has already refreshed.
|
|
5009
|
+
*
|
|
5010
|
+
* @param gracePeriod - Optional grace period in milliseconds threaded through to the post-lock authentication check.
|
|
4910
5011
|
* @returns The refresh promise if available; otherwise undefined.
|
|
4911
5012
|
* @see https://openid.net/specs/openid-connect-core-1_0.html#RefreshTokens
|
|
4912
5013
|
*/
|
|
4913
5014
|
private refresh;
|
|
5015
|
+
/**
|
|
5016
|
+
* Acquires a cross-tab Web Lock (when available) and performs the token refresh.
|
|
5017
|
+
* Tabs that wait on the lock check storage on acquisition and skip the network call
|
|
5018
|
+
* if a peer tab has already produced a fresh access token.
|
|
5019
|
+
* @param gracePeriod - Optional grace period in milliseconds used by the post-lock authentication check to decide whether the current token still has enough life left to skip the network refresh.
|
|
5020
|
+
* @returns Promise that resolves when the refresh (or short-circuit) is complete.
|
|
5021
|
+
*/
|
|
5022
|
+
private runRefreshWithLock;
|
|
4914
5023
|
/**
|
|
4915
5024
|
* Starts a new OAuth2 client credentials flow.
|
|
4916
5025
|
*
|
|
@@ -5533,6 +5642,7 @@ export declare interface MedplumInfraConfig {
|
|
|
5533
5642
|
loadBalancerSecurityGroupId?: string;
|
|
5534
5643
|
loadBalancerLoggingBucket?: string;
|
|
5535
5644
|
loadBalancerLoggingPrefix?: string;
|
|
5645
|
+
loadBalancerAlgorithm?: 'round_robin' | 'least_outstanding_requests' | 'weighted_random';
|
|
5536
5646
|
clamscanEnabled: boolean;
|
|
5537
5647
|
clamscanLoggingBucket: string;
|
|
5538
5648
|
clamscanLoggingPrefix: string;
|
|
@@ -5758,6 +5868,7 @@ export declare interface MedplumSourceInfraConfig {
|
|
|
5758
5868
|
loadBalancerSecurityGroupId?: ValueOrExternalSecret<string>;
|
|
5759
5869
|
loadBalancerLoggingBucket?: ValueOrExternalSecret<string>;
|
|
5760
5870
|
loadBalancerLoggingPrefix?: ValueOrExternalSecret<string>;
|
|
5871
|
+
loadBalancerAlgorithm?: ValueOrExternalSecret<'round_robin' | 'least_outstanding_requests' | 'weighted_random'>;
|
|
5761
5872
|
clamscanEnabled: ValueOrExternalSecret<boolean>;
|
|
5762
5873
|
clamscanLoggingBucket: ValueOrExternalSecret<string>;
|
|
5763
5874
|
clamscanLoggingPrefix: ValueOrExternalSecret<string>;
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -2368,6 +2368,9 @@ export declare interface Hl7DateParseOptions {
|
|
|
2368
2368
|
export declare class Hl7Field {
|
|
2369
2369
|
readonly context: Hl7Context;
|
|
2370
2370
|
readonly components: string[][];
|
|
2371
|
+
/** @internal */
|
|
2372
|
+
onModified?: () => void;
|
|
2373
|
+
private cachedString;
|
|
2371
2374
|
/**
|
|
2372
2375
|
* Creates a new HL7 field.
|
|
2373
2376
|
* @param components - The HL7 components.
|
|
@@ -2420,6 +2423,7 @@ export declare class Hl7Field {
|
|
|
2420
2423
|
* @returns true if the component was set, false otherwise
|
|
2421
2424
|
*/
|
|
2422
2425
|
setComponent(component: number, value: string, subcomponent?: number, repetition?: number): boolean;
|
|
2426
|
+
private invalidateCache;
|
|
2423
2427
|
}
|
|
2424
2428
|
|
|
2425
2429
|
/**
|
|
@@ -2428,13 +2432,42 @@ export declare class Hl7Field {
|
|
|
2428
2432
|
*/
|
|
2429
2433
|
export declare class Hl7Message {
|
|
2430
2434
|
readonly context: Hl7Context;
|
|
2431
|
-
|
|
2435
|
+
/**
|
|
2436
|
+
* Internal lazy-parsed segment storage. Entries are `string` until they
|
|
2437
|
+
* are accessed (via {@link getSegment}, {@link getAllSegments}, {@link header},
|
|
2438
|
+
* or the public {@link segments} getter), at which point they are parsed in
|
|
2439
|
+
* place and replaced with their {@link Hl7Segment} form.
|
|
2440
|
+
*/
|
|
2441
|
+
private readonly _segments;
|
|
2442
|
+
/**
|
|
2443
|
+
* Maps segment name → indices into {@link _segments}. Storing indices (rather
|
|
2444
|
+
* than references to the segments themselves) keeps this map in sync with
|
|
2445
|
+
* {@link _segments} without needing a per-parse update step, and is immune to
|
|
2446
|
+
* collisions when two segments have identical raw text.
|
|
2447
|
+
*/
|
|
2448
|
+
private segmentsByName;
|
|
2449
|
+
private cachedString;
|
|
2450
|
+
/** Becomes true once every entry in `_segments` has been parsed. */
|
|
2451
|
+
private allSegmentsParsed;
|
|
2432
2452
|
/**
|
|
2433
2453
|
* Creates a new HL7 message.
|
|
2454
|
+
*
|
|
2455
|
+
* Segment strings are not parsed until they are accessed via {@link getSegment},
|
|
2456
|
+
* {@link getAllSegments}, {@link header}, or the {@link segments} getter.
|
|
2457
|
+
*
|
|
2434
2458
|
* @param segments - The HL7 segments.
|
|
2435
2459
|
* @param context - Optional HL7 parsing context.
|
|
2436
2460
|
*/
|
|
2437
|
-
constructor(segments: Hl7Segment[], context?: Hl7Context);
|
|
2461
|
+
constructor(segments: (Hl7Segment | string)[], context?: Hl7Context);
|
|
2462
|
+
/**
|
|
2463
|
+
* Returns all HL7 segments, parsing any unparsed segment strings on first access.
|
|
2464
|
+
*
|
|
2465
|
+
* Prefer {@link getSegment} or {@link getAllSegments} when you only need a subset
|
|
2466
|
+
* of segments; those methods avoid parsing unrelated segments.
|
|
2467
|
+
*
|
|
2468
|
+
* @returns The HL7 segments array.
|
|
2469
|
+
*/
|
|
2470
|
+
get segments(): Hl7Segment[];
|
|
2438
2471
|
/**
|
|
2439
2472
|
* Returns the HL7 message header.
|
|
2440
2473
|
* @returns The HL7 message header.
|
|
@@ -2461,18 +2494,35 @@ export declare class Hl7Message {
|
|
|
2461
2494
|
*
|
|
2462
2495
|
* When using a string index, this method returns the first segment with the specified name.
|
|
2463
2496
|
*
|
|
2497
|
+
* Segments are lazily parsed; the requested segment is parsed and cached on demand.
|
|
2498
|
+
*
|
|
2464
2499
|
* @param index - The HL7 segment index or name.
|
|
2465
2500
|
* @returns The HL7 segment if found; otherwise, undefined.
|
|
2466
2501
|
*/
|
|
2467
2502
|
getSegment(index: number | string): Hl7Segment | undefined;
|
|
2468
2503
|
/**
|
|
2469
2504
|
* Returns all HL7 segments of a given name.
|
|
2505
|
+
*
|
|
2506
|
+
* Only the segments that match the requested name are parsed, which avoids parsing
|
|
2507
|
+
* unrelated segments when scanning a message.
|
|
2508
|
+
*
|
|
2470
2509
|
* @param name - The HL7 segment name.
|
|
2471
2510
|
* @returns An array of HL7 segments with the specified name.
|
|
2472
2511
|
*/
|
|
2473
2512
|
getAllSegments(name: string): Hl7Segment[];
|
|
2513
|
+
/**
|
|
2514
|
+
* Parses the segment at the given index (if not already parsed), caches it back into
|
|
2515
|
+
* the segments array, and wires up the onModified callback.
|
|
2516
|
+
* @param index - The HL7 segment index.
|
|
2517
|
+
* @returns The parsed HL7 segment, or undefined if the index is out of range.
|
|
2518
|
+
*/
|
|
2519
|
+
private parseSegment;
|
|
2474
2520
|
/**
|
|
2475
2521
|
* Returns the HL7 message as a string.
|
|
2522
|
+
*
|
|
2523
|
+
* Unparsed segments are emitted directly from their original string form, which
|
|
2524
|
+
* preserves the source text without forcing a parse.
|
|
2525
|
+
*
|
|
2476
2526
|
* @returns The HL7 message as a string.
|
|
2477
2527
|
*/
|
|
2478
2528
|
toString(): string;
|
|
@@ -2499,6 +2549,9 @@ export declare class Hl7Message {
|
|
|
2499
2549
|
* @returns true if the segment was set, false otherwise
|
|
2500
2550
|
*/
|
|
2501
2551
|
setSegment(index: number | string, segment: Hl7Segment): boolean;
|
|
2552
|
+
private findSegmentIndexByName;
|
|
2553
|
+
private invalidateCache;
|
|
2554
|
+
private bindSegments;
|
|
2502
2555
|
}
|
|
2503
2556
|
|
|
2504
2557
|
/**
|
|
@@ -2509,13 +2562,37 @@ export declare class Hl7Message {
|
|
|
2509
2562
|
export declare class Hl7Segment {
|
|
2510
2563
|
readonly context: Hl7Context;
|
|
2511
2564
|
readonly name: string;
|
|
2512
|
-
|
|
2565
|
+
/**
|
|
2566
|
+
* Internal lazy-parsed field storage. Entries are `string` until they are
|
|
2567
|
+
* accessed (via {@link getField} or the public {@link fields} getter), at
|
|
2568
|
+
* which point they are parsed in place and replaced with their
|
|
2569
|
+
* {@link Hl7Field} form.
|
|
2570
|
+
*/
|
|
2571
|
+
private readonly _fields;
|
|
2572
|
+
/** Becomes true once every entry in `_fields` has been parsed. */
|
|
2573
|
+
private allFieldsParsed;
|
|
2574
|
+
private cachedString;
|
|
2575
|
+
/** @internal */
|
|
2576
|
+
onModified?: () => void;
|
|
2513
2577
|
/**
|
|
2514
2578
|
* Creates a new HL7 segment.
|
|
2579
|
+
*
|
|
2580
|
+
* Field strings are not parsed until they are accessed via {@link getField}
|
|
2581
|
+
* or via the {@link fields} getter.
|
|
2582
|
+
*
|
|
2515
2583
|
* @param fields - The HL7 fields. The first field is the segment name.
|
|
2516
2584
|
* @param context - Optional HL7 parsing context.
|
|
2517
2585
|
*/
|
|
2518
|
-
constructor(fields: Hl7Field
|
|
2586
|
+
constructor(fields: (Hl7Field | string)[], context?: Hl7Context);
|
|
2587
|
+
/**
|
|
2588
|
+
* Returns all HL7 fields, parsing any unparsed field strings on first access.
|
|
2589
|
+
*
|
|
2590
|
+
* Prefer {@link getField} when you only need a subset of fields; that method
|
|
2591
|
+
* avoids parsing unrelated fields.
|
|
2592
|
+
*
|
|
2593
|
+
* @returns The HL7 fields array.
|
|
2594
|
+
*/
|
|
2595
|
+
get fields(): Hl7Field[];
|
|
2519
2596
|
/**
|
|
2520
2597
|
* Returns an HL7 field by index.
|
|
2521
2598
|
* @param index - The HL7 field index.
|
|
@@ -2534,10 +2611,19 @@ export declare class Hl7Segment {
|
|
|
2534
2611
|
*
|
|
2535
2612
|
* Field zero is the segment name.
|
|
2536
2613
|
*
|
|
2614
|
+
* Fields are lazily parsed; the requested field is parsed and cached on demand.
|
|
2615
|
+
*
|
|
2537
2616
|
* @param index - The HL7 field index.
|
|
2538
2617
|
* @returns The HL7 field.
|
|
2539
2618
|
*/
|
|
2540
2619
|
getField(index: number): Hl7Field;
|
|
2620
|
+
/**
|
|
2621
|
+
* Parses the field at the given index (if not already parsed), caches it back into
|
|
2622
|
+
* the fields array, and wires up the onModified callback.
|
|
2623
|
+
* @param index - The HL7 field index.
|
|
2624
|
+
* @returns The parsed HL7 field, or undefined if the index is out of range.
|
|
2625
|
+
*/
|
|
2626
|
+
private parseField;
|
|
2541
2627
|
/**
|
|
2542
2628
|
* Returns an HL7 component by field index and component index.
|
|
2543
2629
|
*
|
|
@@ -2558,6 +2644,10 @@ export declare class Hl7Segment {
|
|
|
2558
2644
|
getComponent(fieldIndex: number, component: number, subcomponent?: number, repetition?: number): string;
|
|
2559
2645
|
/**
|
|
2560
2646
|
* Returns the HL7 segment as a string.
|
|
2647
|
+
*
|
|
2648
|
+
* Unparsed fields are emitted directly from their original string form, which
|
|
2649
|
+
* preserves the source text without forcing a parse.
|
|
2650
|
+
*
|
|
2561
2651
|
* @returns The HL7 segment as a string.
|
|
2562
2652
|
*/
|
|
2563
2653
|
toString(): string;
|
|
@@ -2588,6 +2678,8 @@ export declare class Hl7Segment {
|
|
|
2588
2678
|
* @returns true if the component was set, false otherwise
|
|
2589
2679
|
*/
|
|
2590
2680
|
setComponent(fieldIndex: number, component: number, value: string, subcomponent?: number, repetition?: number): boolean;
|
|
2681
|
+
private invalidateCache;
|
|
2682
|
+
private bindFields;
|
|
2591
2683
|
}
|
|
2592
2684
|
|
|
2593
2685
|
export declare const HTTP_HL7_ORG = "http://hl7.org";
|
|
@@ -4907,10 +4999,27 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
|
|
|
4907
4999
|
refreshIfExpired(gracePeriod?: number): Promise<void>;
|
|
4908
5000
|
/**
|
|
4909
5001
|
* Tries to refresh the auth tokens.
|
|
5002
|
+
*
|
|
5003
|
+
* When `navigator.locks` is available, the network call is wrapped in a Web Lock
|
|
5004
|
+
* scoped to this client's storage namespace. This serializes refresh attempts across
|
|
5005
|
+
* browser tabs/windows on the same origin so a single-use refresh token is not
|
|
5006
|
+
* consumed by more than one tab. Tabs that wait on the lock re-read the latest
|
|
5007
|
+
* tokens from storage when they acquire it and skip the network call if another tab
|
|
5008
|
+
* has already refreshed.
|
|
5009
|
+
*
|
|
5010
|
+
* @param gracePeriod - Optional grace period in milliseconds threaded through to the post-lock authentication check.
|
|
4910
5011
|
* @returns The refresh promise if available; otherwise undefined.
|
|
4911
5012
|
* @see https://openid.net/specs/openid-connect-core-1_0.html#RefreshTokens
|
|
4912
5013
|
*/
|
|
4913
5014
|
private refresh;
|
|
5015
|
+
/**
|
|
5016
|
+
* Acquires a cross-tab Web Lock (when available) and performs the token refresh.
|
|
5017
|
+
* Tabs that wait on the lock check storage on acquisition and skip the network call
|
|
5018
|
+
* if a peer tab has already produced a fresh access token.
|
|
5019
|
+
* @param gracePeriod - Optional grace period in milliseconds used by the post-lock authentication check to decide whether the current token still has enough life left to skip the network refresh.
|
|
5020
|
+
* @returns Promise that resolves when the refresh (or short-circuit) is complete.
|
|
5021
|
+
*/
|
|
5022
|
+
private runRefreshWithLock;
|
|
4914
5023
|
/**
|
|
4915
5024
|
* Starts a new OAuth2 client credentials flow.
|
|
4916
5025
|
*
|
|
@@ -5533,6 +5642,7 @@ export declare interface MedplumInfraConfig {
|
|
|
5533
5642
|
loadBalancerSecurityGroupId?: string;
|
|
5534
5643
|
loadBalancerLoggingBucket?: string;
|
|
5535
5644
|
loadBalancerLoggingPrefix?: string;
|
|
5645
|
+
loadBalancerAlgorithm?: 'round_robin' | 'least_outstanding_requests' | 'weighted_random';
|
|
5536
5646
|
clamscanEnabled: boolean;
|
|
5537
5647
|
clamscanLoggingBucket: string;
|
|
5538
5648
|
clamscanLoggingPrefix: string;
|
|
@@ -5758,6 +5868,7 @@ export declare interface MedplumSourceInfraConfig {
|
|
|
5758
5868
|
loadBalancerSecurityGroupId?: ValueOrExternalSecret<string>;
|
|
5759
5869
|
loadBalancerLoggingBucket?: ValueOrExternalSecret<string>;
|
|
5760
5870
|
loadBalancerLoggingPrefix?: ValueOrExternalSecret<string>;
|
|
5871
|
+
loadBalancerAlgorithm?: ValueOrExternalSecret<'round_robin' | 'least_outstanding_requests' | 'weighted_random'>;
|
|
5761
5872
|
clamscanEnabled: ValueOrExternalSecret<boolean>;
|
|
5762
5873
|
clamscanLoggingBucket: ValueOrExternalSecret<string>;
|
|
5763
5874
|
clamscanLoggingPrefix: ValueOrExternalSecret<string>;
|