@medplum/core 2.1.10 → 2.1.12

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/types.d.ts CHANGED
@@ -88,9 +88,26 @@ export declare interface AddressFormatOptions {
88
88
 
89
89
  export declare const allOk: OperationOutcome;
90
90
 
91
+ /**
92
+ * 6.5.1. and
93
+ * Returns true if both operands evaluate to true,
94
+ * false if either operand evaluates to false,
95
+ * and the empty collection otherwise.
96
+ */
97
+ export declare class AndAtom extends BooleanInfixOperatorAtom {
98
+ constructor(left: Atom, right: Atom);
99
+ eval(context: AtomContext, input: TypedValue[]): TypedValue[];
100
+ }
101
+
102
+ export declare class ArithemticOperatorAtom extends BooleanInfixOperatorAtom {
103
+ readonly impl: (x: number, y: number) => number | boolean;
104
+ constructor(operator: string, left: Atom, right: Atom, impl: (x: number, y: number) => number | boolean);
105
+ eval(context: AtomContext, input: TypedValue[]): TypedValue[];
106
+ }
107
+
91
108
  /**
92
109
  * Converts an ArrayBuffer to a base-64 encoded string.
93
- * @param arrayBuffer The input array buffer.
110
+ * @param arrayBuffer - The input array buffer.
94
111
  * @returns The base-64 encoded string.
95
112
  */
96
113
  export declare function arrayBufferToBase64(arrayBuffer: ArrayBuffer): string;
@@ -98,17 +115,24 @@ export declare function arrayBufferToBase64(arrayBuffer: ArrayBuffer): string;
98
115
  /**
99
116
  * Converts an ArrayBuffer to hex string.
100
117
  * See: https://stackoverflow.com/a/55200387
101
- * @param arrayBuffer The input array buffer.
118
+ * @param arrayBuffer - The input array buffer.
102
119
  * @returns The resulting hex string.
103
120
  */
104
121
  export declare function arrayBufferToHex(arrayBuffer: ArrayBuffer): string;
105
122
 
106
123
  export declare function arrayify<T>(value: T | T[] | undefined): T[] | undefined;
107
124
 
125
+ export declare class AsAtom extends InfixOperatorAtom {
126
+ constructor(left: Atom, right: Atom);
127
+ eval(context: AtomContext, input: TypedValue[]): TypedValue[];
128
+ }
129
+
130
+ export declare function assertContextVersionOptional(event: string): asserts event is FhircastEventVersionOptional;
131
+
108
132
  /**
109
133
  * Asserts that the operation completed successfully and that the resource is defined.
110
- * @param outcome The operation outcome.
111
- * @param resource The resource that may or may not have been returned.
134
+ * @param outcome - The operation outcome.
135
+ * @param resource - The resource that may or may not have been returned.
112
136
  */
113
137
  export declare function assertOk<T>(outcome: OperationOutcome, resource: T | undefined): asserts resource is T;
114
138
 
@@ -146,9 +170,13 @@ export declare type BaseSchema = Record<string, {
146
170
  */
147
171
  export declare type BinarySource = string | File | Blob | Uint8Array;
148
172
 
173
+ export declare abstract class BooleanInfixOperatorAtom extends InfixOperatorAtom {
174
+ abstract eval(context: AtomContext, input: TypedValue[]): TypedValue[];
175
+ }
176
+
149
177
  /**
150
178
  * Returns a single element array with a typed boolean value.
151
- * @param value The primitive boolean value.
179
+ * @param value - The primitive boolean value.
152
180
  * @returns Single element array with a typed boolean value.
153
181
  */
154
182
  export declare function booleanToTypedValue(value: boolean): [TypedValue];
@@ -163,8 +191,8 @@ export declare function buildTypeName(components: string[]): string;
163
191
 
164
192
  /**
165
193
  * Calculates the age in years from the birth date.
166
- * @param birthDateStr The birth date or start date in ISO-8601 format YYYY-MM-DD.
167
- * @param endDateStr Optional end date in ISO-8601 format YYYY-MM-DD. Default value is today.
194
+ * @param birthDateStr - The birth date or start date in ISO-8601 format YYYY-MM-DD.
195
+ * @param endDateStr - Optional end date in ISO-8601 format YYYY-MM-DD. Default value is today.
168
196
  * @returns The age in years, months, and days.
169
197
  */
170
198
  export declare function calculateAge(birthDateStr: string, endDateStr?: string): {
@@ -178,16 +206,16 @@ export declare function calculateAge(birthDateStr: string, endDateStr?: string):
178
206
  * If the age is greater than or equal to 2 years, then the age is displayed in years.
179
207
  * If the age is greater than or equal to 1 month, then the age is displayed in months.
180
208
  * Otherwise, the age is displayed in days.
181
- * @param birthDateStr The birth date or start date in ISO-8601 format YYYY-MM-DD.
182
- * @param endDateStr Optional end date in ISO-8601 format YYYY-MM-DD. Default value is today.
209
+ * @param birthDateStr - The birth date or start date in ISO-8601 format YYYY-MM-DD.
210
+ * @param endDateStr - Optional end date in ISO-8601 format YYYY-MM-DD. Default value is today.
183
211
  * @returns The age string.
184
212
  */
185
213
  export declare function calculateAgeString(birthDateStr: string, endDateStr?: string): string | undefined;
186
214
 
187
215
  /**
188
216
  * Determines if the current user can read the specified resource type.
189
- * @param accessPolicy The access policy.
190
- * @param resourceType The resource type.
217
+ * @param accessPolicy - The access policy.
218
+ * @param resourceType - The resource type.
191
219
  * @returns True if the current user can read the specified resource type.
192
220
  */
193
221
  export declare function canReadResourceType(accessPolicy: AccessPolicy, resourceType: ResourceType): boolean;
@@ -195,8 +223,8 @@ export declare function canReadResourceType(accessPolicy: AccessPolicy, resource
195
223
  /**
196
224
  * Determines if the current user can write the specified resource.
197
225
  * This is a more in-depth check after building the candidate result of a write operation.
198
- * @param accessPolicy The access policy.
199
- * @param resource The resource.
226
+ * @param accessPolicy - The access policy.
227
+ * @param resource - The resource.
200
228
  * @returns True if the current user can write the specified resource type.
201
229
  */
202
230
  export declare function canWriteResource(accessPolicy: AccessPolicy, resource: Resource): boolean;
@@ -205,8 +233,8 @@ export declare function canWriteResource(accessPolicy: AccessPolicy, resource: R
205
233
  * Determines if the current user can write the specified resource type.
206
234
  * This is a preliminary check before evaluating a write operation in depth.
207
235
  * If a user cannot write a resource type at all, then don't bother looking up previous versions.
208
- * @param accessPolicy The access policy.
209
- * @param resourceType The resource type.
236
+ * @param accessPolicy - The access policy.
237
+ * @param resourceType - The resource type.
210
238
  * @returns True if the current user can write the specified resource type.
211
239
  */
212
240
  export declare function canWriteResourceType(accessPolicy: AccessPolicy, resourceType: ResourceType): boolean;
@@ -217,9 +245,9 @@ export declare function capitalize(word: string): string;
217
245
  * Recursively checks for null values in an object.
218
246
  *
219
247
  * Note that "null" is a special value in JSON that is not allowed in FHIR.
220
- * @param value Input value of any type.
221
- * @param path Path string to the value for OperationOutcome.
222
- * @param issues Output list of issues.
248
+ * @param value - Input value of any type.
249
+ * @param path - Path string to the value for OperationOutcome.
250
+ * @param issues - Output list of issues.
223
251
  */
224
252
  export declare function checkForNull(value: unknown, path: string, issues: OperationOutcomeIssue[]): void;
225
253
 
@@ -240,18 +268,22 @@ export declare class ClientStorage {
240
268
  setObject<T>(key: string, value: T): void;
241
269
  }
242
270
 
243
- declare interface Code {
271
+ export declare interface Code {
244
272
  code?: CodeableConcept;
245
273
  }
246
274
 
247
275
  /**
248
276
  * Allowed values for `code_challenge_method` in a PKCE exchange.
249
- * @internal
250
277
  */
251
278
  export declare type CodeChallengeMethod = 'plain' | 'S256';
252
279
 
253
280
  export declare function compressElement(element: InternalSchemaElement): Partial<InternalSchemaElement>;
254
281
 
282
+ export declare class ConcatAtom extends InfixOperatorAtom {
283
+ constructor(left: Atom, right: Atom);
284
+ eval(context: AtomContext, input: TypedValue[]): TypedValue[];
285
+ }
286
+
255
287
  export declare interface Constraint {
256
288
  key: string;
257
289
  severity: 'error' | 'warning';
@@ -259,30 +291,35 @@ export declare interface Constraint {
259
291
  description: string;
260
292
  }
261
293
 
294
+ export declare class ContainsAtom extends BooleanInfixOperatorAtom {
295
+ constructor(left: Atom, right: Atom);
296
+ eval(context: AtomContext, input: TypedValue[]): TypedValue[];
297
+ }
298
+
262
299
  /**
263
300
  * Content type constants.
264
301
  */
265
302
  export declare const ContentType: {
266
- CSS: string;
267
- FAVICON: string;
268
- FHIR_JSON: string;
269
- FORM_URL_ENCODED: string;
270
- HL7_V2: string;
271
- HTML: string;
272
- JAVASCRIPT: string;
273
- JSON: string;
274
- JSON_PATCH: string;
275
- PNG: string;
276
- SVG: string;
277
- TEXT: string;
278
- TYPESCRIPT: string;
303
+ readonly CSS: "text/css";
304
+ readonly FAVICON: "image/vnd.microsoft.icon";
305
+ readonly FHIR_JSON: "application/fhir+json";
306
+ readonly FORM_URL_ENCODED: "application/x-www-form-urlencoded";
307
+ readonly HL7_V2: "x-application/hl7-v2+er7";
308
+ readonly HTML: "text/html";
309
+ readonly JAVASCRIPT: "text/javascript";
310
+ readonly JSON: "application/json";
311
+ readonly JSON_PATCH: "application/json-patch+json";
312
+ readonly PNG: "image/png";
313
+ readonly SVG: "image/svg+xml";
314
+ readonly TEXT: "text/plain";
315
+ readonly TYPESCRIPT: "text/typescript";
279
316
  };
280
317
 
281
318
  /**
282
319
  * Converts a resource with contained resources to a transaction bundle.
283
320
  * This function is useful when creating a resource that contains other resources.
284
321
  * Handles local references and topological sorting.
285
- * @param resource The input resource which may or may not include contained resources.
322
+ * @param resource - The input resource which may or may not include contained resources.
286
323
  * @returns A bundle with the input resource and all contained resources.
287
324
  */
288
325
  export declare function convertContainedResourcesToBundle(resource: Resource & {
@@ -295,11 +332,13 @@ export declare function convertContainedResourcesToBundle(resource: Resource & {
295
332
  */
296
333
  /**
297
334
  * Takes a bundle and creates a Transaction Type bundle
298
- * @param bundle The Bundle object that we'll receive from the search query
335
+ * @param bundle - The Bundle object that we'll receive from the search query
299
336
  * @returns transaction type bundle
300
337
  */
301
338
  export declare function convertToTransactionBundle(bundle: Bundle): Bundle;
302
339
 
340
+ export declare type ConvertToUnion<T> = T[keyof T];
341
+
303
342
  export declare const CPT = "http://www.ama-assn.org/go/cpt";
304
343
 
305
344
  export declare function crawlResource(resource: Resource, visitor: ResourceVisitor, schema?: InternalTypeSchema, initialPath?: string): void;
@@ -311,12 +350,15 @@ export declare const created: OperationOutcome;
311
350
  /**
312
351
  * Creates a serializable JSON payload for the `FHIRcast` protocol
313
352
  *
314
- * @param topic The topic that this message will be published on. Usually a UUID.
315
- * @param event The event name, ie. "patient-open" or "patient-close".
316
- * @param context The updated context, containing new versions of resources related to this event.
353
+ * @param topic - The topic that this message will be published on. Usually a UUID.
354
+ * @param event - The event name, ie. "Patient-open" or "Patient-close".
355
+ * @param context - The updated context, containing new versions of resources related to this event.
356
+ * @param versionId - The current `versionId` of the anchor context. For example, in `DiagnosticReport-update`, it's the `versionId` of the `DiagnosticReport`.
317
357
  * @returns A serializable `FhircastMessagePayload`.
318
358
  */
319
- export declare function createFhircastMessagePayload(topic: string, event: FhircastEventName, context: FhircastEventContext | FhircastEventContext[]): FhircastMessagePayload;
359
+ export declare function createFhircastMessagePayload<EventName extends FhircastEventVersionOptional>(topic: string, event: EventName, context: FhircastValidContextForEvent<EventName> | FhircastValidContextForEvent<EventName>[], versionId?: never): FhircastMessagePayload<EventName>;
360
+
361
+ export declare function createFhircastMessagePayload<EventName extends FhircastEventVersionRequired>(topic: string, event: EventName, context: FhircastValidContextForEvent<EventName> | FhircastValidContextForEvent<EventName>[], versionId: string): FhircastMessagePayload<EventName>;
320
362
 
321
363
  export declare interface CreatePdfFunction {
322
364
  (docDefinition: TDocumentDefinitions, tableLayouts?: Record<string, CustomTableLayout> | undefined, fonts?: TFontDictionary | undefined): Promise<any>;
@@ -326,7 +368,7 @@ export declare function createProcessingIssue(expression: string, message: strin
326
368
 
327
369
  /**
328
370
  * Creates a reference resource.
329
- * @param resource The FHIR reesource.
371
+ * @param resource - The FHIR reesource.
330
372
  * @returns A reference resource.
331
373
  */
332
374
  export declare function createReference<T extends Resource>(resource: T): Reference<T>;
@@ -336,7 +378,7 @@ export declare function createStructureIssue(expression: string, details: string
336
378
  /**
337
379
  * Decodes a base64 string.
338
380
  * Handles both browser and Node environments.
339
- * @param data The base-64 encoded input string.
381
+ * @param data - The base-64 encoded input string.
340
382
  * @returns The decoded string.
341
383
  */
342
384
  export declare function decodeBase64(data: string): string;
@@ -351,7 +393,7 @@ export declare function decodeBase64(data: string): string;
351
393
  *
352
394
  * See: https://web.dev/structured-clone/
353
395
  * See: https://stackoverflow.com/questions/40488190/how-is-structured-clone-algorithm-different-from-deep-copy
354
- * @param input The input to clone.
396
+ * @param input - The input to clone.
355
397
  * @returns A deep clone of the input.
356
398
  */
357
399
  export declare function deepClone<T>(input: T): T;
@@ -359,9 +401,9 @@ export declare function deepClone<T>(input: T): T;
359
401
  /**
360
402
  * Resource equality.
361
403
  * Ignores meta.versionId and meta.lastUpdated.
362
- * @param object1 The first object.
363
- * @param object2 The second object.
364
- * @param path Optional path string.
404
+ * @param object1 - The first object.
405
+ * @param object2 - The second object.
406
+ * @param path - Optional path string.
365
407
  * @returns True if the objects are equal.
366
408
  */
367
409
  export declare function deepEquals(object1: unknown, object2: unknown, path?: string): boolean;
@@ -369,8 +411,8 @@ export declare function deepEquals(object1: unknown, object2: unknown, path?: st
369
411
  /**
370
412
  * Checks if object2 includes all fields and values of object1.
371
413
  * It doesn't matter if object2 has extra fields.
372
- * @param value The object to test if contained in pattern.
373
- * @param pattern The object to test against.
414
+ * @param value - The object to test if contained in pattern.
415
+ * @param pattern - The object to test against.
374
416
  * @returns True if pattern includes all fields and values of value.
375
417
  */
376
418
  export declare function deepIncludes(value: any, pattern: any): boolean;
@@ -379,6 +421,12 @@ export declare const DEFAULT_ACCEPT: string;
379
421
 
380
422
  export declare const DEFAULT_SEARCH_COUNT = 20;
381
423
 
424
+ export declare class DotAtom extends InfixOperatorAtom {
425
+ constructor(left: Atom, right: Atom);
426
+ eval(context: AtomContext, input: TypedValue[]): TypedValue[];
427
+ toString(): string;
428
+ }
429
+
382
430
  export declare interface ElementType {
383
431
  code: string;
384
432
  targetProfile?: string[];
@@ -391,34 +439,49 @@ export declare interface EmailPasswordLoginRequest extends BaseLoginRequest {
391
439
  readonly remember?: boolean;
392
440
  }
393
441
 
442
+ export declare class EmptySetAtom implements Atom {
443
+ eval(): [];
444
+ toString(): string;
445
+ }
446
+
394
447
  /**
395
448
  * Encodes a base64 string.
396
449
  * Handles both browser and Node environments.
397
- * @param data The unencoded input string.
450
+ * @param data - The unencoded input string.
398
451
  * @returns The base-64 encoded string.
399
452
  */
400
453
  export declare function encodeBase64(data: string): string;
401
454
 
402
455
  /**
403
456
  * Encrypts a string with SHA256 encryption.
404
- * @param str The unencrypted input string.
457
+ * @param str - The unencrypted input string.
405
458
  * @returns The encrypted value in an ArrayBuffer.
406
459
  */
407
460
  export declare function encryptSHA256(str: string): Promise<ArrayBuffer>;
408
461
 
462
+ export declare class EqualsAtom extends BooleanInfixOperatorAtom {
463
+ constructor(left: Atom, right: Atom);
464
+ eval(context: AtomContext, input: TypedValue[]): TypedValue[];
465
+ }
466
+
467
+ export declare class EquivalentAtom extends BooleanInfixOperatorAtom {
468
+ constructor(left: Atom, right: Atom);
469
+ eval(context: AtomContext, input: TypedValue[]): TypedValue[];
470
+ }
471
+
409
472
  /**
410
473
  * Evaluates a FHIRPath expression against a resource or other object.
411
- * @param expression The FHIRPath expression to parse.
412
- * @param input The resource or object to evaluate the expression against.
474
+ * @param expression - The FHIRPath expression to parse.
475
+ * @param input - The resource or object to evaluate the expression against.
413
476
  * @returns The result of the FHIRPath expression against the resource or object.
414
477
  */
415
478
  export declare function evalFhirPath(expression: string, input: unknown): unknown[];
416
479
 
417
480
  /**
418
481
  * Evaluates a FHIRPath expression against a resource or other object.
419
- * @param expression The FHIRPath expression to parse.
420
- * @param input The resource or object to evaluate the expression against.
421
- * @param variables A map of variables for eval input.
482
+ * @param expression - The FHIRPath expression to parse.
483
+ * @param input - The resource or object to evaluate the expression against.
484
+ * @param variables - A map of variables for eval input.
422
485
  * @returns The result of the FHIRPath expression against the resource or object.
423
486
  */
424
487
  export declare function evalFhirPathTyped(expression: string, input: TypedValue[], variables?: Record<string, TypedValue>): TypedValue[];
@@ -457,24 +520,152 @@ export declare const ExternalSecretSystems: {
457
520
  readonly aws_ssm_parameter_store: "aws_ssm_parameter_store";
458
521
  };
459
522
 
460
- export declare interface FetchLike {
461
- (url: string, options?: any): Promise<any>;
462
- }
463
-
464
- declare const FHIRCAST_CONTEXT_KEY_LOOKUP: {
465
- readonly study: "ImagingStudy";
466
- readonly patient: "Patient";
467
- readonly encounter: "Encounter";
523
+ export declare type FetchLike = (url: string, options?: any) => Promise<any>;
524
+
525
+ export declare const FHIRCAST_EVENT_NAMES: {
526
+ readonly 'Patient-open': "Patient-open";
527
+ readonly 'Patient-close': "Patient-close";
528
+ readonly 'ImagingStudy-open': "ImagingStudy-open";
529
+ readonly 'ImagingStudy-close': "ImagingStudy-close";
530
+ readonly 'Encounter-open': "Encounter-open";
531
+ readonly 'Encounter-close': "Encounter-close";
532
+ readonly 'DiagnosticReport-open': "DiagnosticReport-open";
533
+ readonly 'DiagnosticReport-close': "DiagnosticReport-close";
534
+ readonly 'DiagnosticReport-select': "DiagnosticReport-select";
535
+ readonly 'DiagnosticReport-update': "DiagnosticReport-update";
536
+ readonly syncerror: "syncerror";
468
537
  };
469
538
 
470
- declare const FHIRCAST_EVENT_NAMES: {
471
- readonly 'patient-open': "patient-open";
472
- readonly 'patient-close': "patient-close";
473
- readonly 'imagingstudy-open': "imagingstudy-open";
474
- readonly 'imagingstudy-close': "imagingstudy-close";
539
+ export declare const FHIRCAST_EVENT_RESOURCES: {
540
+ readonly 'Patient-open': {
541
+ readonly patient: {
542
+ readonly resourceType: "Patient";
543
+ };
544
+ readonly encounter: {
545
+ readonly resourceType: "Encounter";
546
+ readonly optional: true;
547
+ };
548
+ };
549
+ readonly 'Patient-close': {
550
+ readonly patient: {
551
+ readonly resourceType: "Patient";
552
+ };
553
+ readonly encounter: {
554
+ readonly resourceType: "Encounter";
555
+ readonly optional: true;
556
+ };
557
+ };
558
+ readonly 'ImagingStudy-open': {
559
+ readonly study: {
560
+ readonly resourceType: "ImagingStudy";
561
+ };
562
+ readonly encounter: {
563
+ readonly resourceType: "Encounter";
564
+ readonly optional: true;
565
+ };
566
+ readonly patient: {
567
+ readonly resourceType: "Patient";
568
+ readonly optional: true;
569
+ };
570
+ };
571
+ readonly 'ImagingStudy-close': {
572
+ readonly study: {
573
+ readonly resourceType: "ImagingStudy";
574
+ };
575
+ readonly encounter: {
576
+ readonly resourceType: "Encounter";
577
+ readonly optional: true;
578
+ };
579
+ readonly patient: {
580
+ readonly resourceType: "Patient";
581
+ readonly optional: true;
582
+ };
583
+ };
584
+ readonly 'Encounter-open': {
585
+ readonly encounter: {
586
+ readonly resourceType: "Encounter";
587
+ };
588
+ readonly patient: {
589
+ readonly resourceType: "Patient";
590
+ };
591
+ };
592
+ readonly 'Encounter-close': {
593
+ readonly encounter: {
594
+ readonly resourceType: "Encounter";
595
+ };
596
+ readonly patient: {
597
+ readonly resourceType: "Patient";
598
+ };
599
+ };
600
+ readonly 'DiagnosticReport-open': {
601
+ readonly report: {
602
+ readonly resourceType: "DiagnosticReport";
603
+ };
604
+ readonly encounter: {
605
+ readonly resourceType: "Encounter";
606
+ readonly optional: true;
607
+ };
608
+ readonly study: {
609
+ readonly resourceType: "ImagingStudy";
610
+ readonly optional: true;
611
+ readonly manyAllowed: true;
612
+ };
613
+ readonly patient: {
614
+ readonly resourceType: "Patient";
615
+ };
616
+ };
617
+ readonly 'DiagnosticReport-close': {
618
+ readonly report: {
619
+ readonly resourceType: "DiagnosticReport";
620
+ };
621
+ readonly encounter: {
622
+ readonly resourceType: "Encounter";
623
+ readonly optional: true;
624
+ };
625
+ readonly study: {
626
+ readonly resourceType: "ImagingStudy";
627
+ readonly optional: true;
628
+ readonly manyAllowed: true;
629
+ };
630
+ readonly patient: {
631
+ readonly resourceType: "Patient";
632
+ };
633
+ };
634
+ readonly 'DiagnosticReport-select': {
635
+ readonly report: {
636
+ readonly resourceType: "DiagnosticReport";
637
+ };
638
+ readonly select: {
639
+ readonly resourceType: "*";
640
+ readonly isArray: true;
641
+ };
642
+ };
643
+ readonly 'DiagnosticReport-update': {
644
+ readonly report: {
645
+ readonly resourceType: "DiagnosticReport";
646
+ };
647
+ readonly patient: {
648
+ readonly resourceType: "Patient";
649
+ readonly optional: true;
650
+ };
651
+ readonly study: {
652
+ readonly resourceType: "ImagingStudy";
653
+ readonly optional: true;
654
+ };
655
+ readonly updates: {
656
+ readonly resourceType: "Bundle";
657
+ };
658
+ };
659
+ readonly syncerror: {
660
+ readonly operationoutcome: {
661
+ readonly resourceType: "OperationOutcome";
662
+ };
663
+ };
475
664
  };
476
665
 
477
- declare const FHIRCAST_RESOURCE_TYPES: readonly ["Patient", "Encounter", "ImagingStudy"];
666
+ export declare const FHIRCAST_EVENT_VERSION_REQUIRED: readonly ["DiagnosticReport-update"];
667
+
668
+ export declare const FHIRCAST_RESOURCE_TYPES: readonly ["Patient", "Encounter", "ImagingStudy", "DiagnosticReport", "OperationOutcome", "Bundle"];
478
669
 
479
670
  export declare type FhircastConnectEvent = {
480
671
  type: 'connect';
@@ -495,7 +686,7 @@ export declare class FhircastConnection extends TypedEventTarget<FhircastSubscri
495
686
  private websocket;
496
687
  /**
497
688
  * Creates a new `FhircastConnection`.
498
- * @param subRequest The subscription request to initialize the connection from.
689
+ * @param subRequest - The subscription request to initialize the connection from.
499
690
  */
500
691
  constructor(subRequest: SubscriptionRequest);
501
692
  disconnect(): void;
@@ -505,45 +696,75 @@ export declare type FhircastDisconnectEvent = {
505
696
  type: 'disconnect';
506
697
  };
507
698
 
508
- export declare type FhircastEventContext<K extends FhircastEventContextKey = FhircastEventContextKey> = {
509
- key: K;
510
- resource: Resource & {
511
- resourceType: FhircastEventContextMap[K];
512
- id: string;
513
- };
699
+ export declare type FhircastEventContext<EventName extends FhircastEventName = FhircastEventName, K extends FhircastEventContextKey<EventName> = FhircastEventContextKey<EventName>> = FhircastEventContextMap<EventName>[K] extends infer _Ev extends FhircastEventContextDetails ? _Ev['isArray'] extends true ? FhircastMultiResourceContext<EventName, K> : FhircastSingleResourceContext<EventName, K> : never;
700
+
701
+ export declare type FhircastEventContextDetails = {
702
+ resourceType: FhircastResourceType | '*';
703
+ optional?: boolean;
704
+ manyAllowed?: boolean;
705
+ isArray?: boolean;
514
706
  };
515
707
 
516
- declare type FhircastEventContextKey = keyof FhircastEventContextMap;
708
+ export declare type FhircastEventContextKey<EventName extends FhircastEventName = FhircastEventName> = keyof FhircastEventContextMap<EventName>;
517
709
 
518
- declare type FhircastEventContextMap = typeof FHIRCAST_CONTEXT_KEY_LOOKUP;
710
+ export declare type FhircastEventContextMap<EventName extends FhircastEventName = FhircastEventName> = (typeof FHIRCAST_EVENT_RESOURCES)[EventName];
519
711
 
520
712
  export declare type FhircastEventName = keyof typeof FHIRCAST_EVENT_NAMES;
521
713
 
522
- export declare type FhircastEventPayload = {
714
+ export declare type FhircastEventPayload<EventName extends FhircastEventName = FhircastEventName, K extends FhircastEventContextKey<EventName> = FhircastEventContextKey<EventName>> = {
523
715
  'hub.topic': string;
524
- 'hub.event': string;
525
- context: FhircastEventContext[];
716
+ 'hub.event': EventName;
717
+ context: FhircastEventContext<EventName, K>[];
718
+ 'context.versionId'?: string;
719
+ 'context.priorVersionId'?: string;
526
720
  };
527
721
 
722
+ export declare type FhircastEventResource<EventName extends FhircastEventName = FhircastEventName, K extends FhircastEventContextKey<EventName> = FhircastEventContextKey<EventName>> = FhircastEventContextMap<EventName>[K] extends infer _Ev extends FhircastEventContextDetails ? FhircastEventResourceType<EventName, K> extends '*' ? Resource & {
723
+ id: string;
724
+ } : Resource & {
725
+ resourceType: FhircastEventResourceType<EventName, K>;
726
+ id: string;
727
+ } : never;
728
+
729
+ export declare type FhircastEventResourceType<EventName extends FhircastEventName = FhircastEventName, K extends FhircastEventContextKey<EventName> = FhircastEventContextKey<EventName>> = FhircastEventContextMap<EventName>[K] extends infer _Ev extends FhircastEventContextDetails ? _Ev['resourceType'] : never;
730
+
731
+ export declare type FhircastEventVersionOptional = Exclude<FhircastEventName, FhircastEventVersionRequired>;
732
+
733
+ export declare type FhircastEventVersionRequired = (typeof FHIRCAST_EVENT_VERSION_REQUIRED)[number];
734
+
528
735
  export declare type FhircastMessageEvent = {
529
736
  type: 'message';
530
737
  payload: FhircastMessagePayload;
531
738
  };
532
739
 
533
- export declare type FhircastMessagePayload = {
740
+ export declare type FhircastMessagePayload<EventName extends FhircastEventName = FhircastEventName> = {
534
741
  timestamp: string;
535
742
  id: string;
536
- event: FhircastEventPayload;
743
+ event: FhircastEventPayload<EventName>;
744
+ };
745
+
746
+ export declare type FhircastMultiResourceContext<EventName extends FhircastEventName = FhircastEventName, K extends FhircastEventContextKey<EventName> = FhircastEventContextKey<EventName>> = {
747
+ key: K;
748
+ resources: FhircastEventResource<EventName, K>[];
537
749
  };
538
750
 
539
751
  export declare type FhircastResourceType = (typeof FHIRCAST_RESOURCE_TYPES)[number];
540
752
 
753
+ export declare type FhircastSingleResourceContext<EventName extends FhircastEventName = FhircastEventName, K extends FhircastEventContextKey<EventName> = FhircastEventContextKey<EventName>> = {
754
+ key: K;
755
+ resource: FhircastEventResource<EventName, K>;
756
+ };
757
+
541
758
  export declare type FhircastSubscriptionEventMap = {
542
759
  connect: FhircastConnectEvent;
543
760
  message: FhircastMessageEvent;
544
761
  disconnect: FhircastDisconnectEvent;
545
762
  };
546
763
 
764
+ export declare type FhircastValidContextForEvent<EventName extends FhircastEventName = FhircastEventName> = ConvertToUnion<{
765
+ [key in FhircastEventContextKey<EventName>]: FhircastEventContext<EventName, key>;
766
+ }>;
767
+
547
768
  /**
548
769
  * The FhirFilterComparison class represents a comparison expression.
549
770
  */
@@ -581,21 +802,21 @@ export declare class FhirFilterNegation {
581
802
 
582
803
  /**
583
804
  * Determines if two arrays are equal according to FHIRPath equality rules.
584
- * @param x The first array.
585
- * @param y The second array.
805
+ * @param x - The first array.
806
+ * @param y - The second array.
586
807
  * @returns FHIRPath true if the arrays are equal.
587
808
  */
588
809
  export declare function fhirPathArrayEquals(x: TypedValue[], y: TypedValue[]): TypedValue[];
589
810
 
590
811
  /**
591
812
  * Determines if two arrays are equivalent according to FHIRPath equality rules.
592
- * @param x The first array.
593
- * @param y The second array.
813
+ * @param x - The first array.
814
+ * @param y - The second array.
594
815
  * @returns FHIRPath true if the arrays are equivalent.
595
816
  */
596
817
  export declare function fhirPathArrayEquivalent(x: TypedValue[], y: TypedValue[]): TypedValue[];
597
818
 
598
- declare class FhirPathAtom implements Atom {
819
+ export declare class FhirPathAtom implements Atom {
599
820
  readonly original: string;
600
821
  readonly child: Atom;
601
822
  constructor(original: string, child: Atom);
@@ -605,31 +826,31 @@ declare class FhirPathAtom implements Atom {
605
826
 
606
827
  /**
607
828
  * Determines if two values are equal according to FHIRPath equality rules.
608
- * @param x The first value.
609
- * @param y The second value.
829
+ * @param x - The first value.
830
+ * @param y - The second value.
610
831
  * @returns True if equal.
611
832
  */
612
833
  export declare function fhirPathEquals(x: TypedValue, y: TypedValue): TypedValue[];
613
834
 
614
835
  /**
615
836
  * Determines if two values are equivalent according to FHIRPath equality rules.
616
- * @param x The first value.
617
- * @param y The second value.
837
+ * @param x - The first value.
838
+ * @param y - The second value.
618
839
  * @returns True if equivalent.
619
840
  */
620
841
  export declare function fhirPathEquivalent(x: TypedValue, y: TypedValue): TypedValue[];
621
842
 
622
843
  /**
623
844
  * Determines if the typed value is the desired type.
624
- * @param typedValue The typed value to check.
625
- * @param desiredType The desired type name.
845
+ * @param typedValue - The typed value to check.
846
+ * @param desiredType - The desired type name.
626
847
  * @returns True if the typed value is of the desired type.
627
848
  */
628
849
  export declare function fhirPathIs(typedValue: TypedValue, desiredType: string): boolean;
629
850
 
630
851
  /**
631
852
  * Returns a negated FHIRPath boolean expression.
632
- * @param input The input array.
853
+ * @param input - The input array.
633
854
  * @returns The negated type value array.
634
855
  */
635
856
  export declare function fhirPathNot(input: TypedValue[]): TypedValue[];
@@ -666,19 +887,19 @@ export declare interface Filter {
666
887
 
667
888
  /**
668
889
  * Tries to find an observation interval for the given patient and value.
669
- * @param definition The observation definition.
670
- * @param patient The patient.
671
- * @param value The observation value.
672
- * @param category Optional interval category restriction.
890
+ * @param definition - The observation definition.
891
+ * @param patient - The patient.
892
+ * @param value - The observation value.
893
+ * @param category - Optional interval category restriction.
673
894
  * @returns The observation interval if found; otherwise undefined.
674
895
  */
675
896
  export declare function findObservationInterval(definition: ObservationDefinition, patient: Patient, value: number, category?: 'reference' | 'critical' | 'absolute'): ObservationDefinitionQualifiedInterval | undefined;
676
897
 
677
898
  /**
678
899
  * Tries to find an observation reference range for the given patient and condition names.
679
- * @param definition The observation definition.
680
- * @param patient The patient.
681
- * @param names The condition names.
900
+ * @param definition - The observation definition.
901
+ * @param patient - The patient.
902
+ * @param names - The condition names.
682
903
  * @returns The observation interval if found; otherwise undefined.
683
904
  */
684
905
  export declare function findObservationReferenceRange(definition: ObservationDefinition, patient: Patient, names: string[]): ObservationDefinitionQualifiedInterval | undefined;
@@ -696,22 +917,22 @@ export declare const forbidden: OperationOutcome;
696
917
 
697
918
  /**
698
919
  * Formats a FHIR Address as a string.
699
- * @param address The address to format.
700
- * @param options Optional address format options.
920
+ * @param address - The address to format.
921
+ * @param options - Optional address format options.
701
922
  * @returns The formatted address string.
702
923
  */
703
924
  export declare function formatAddress(address: Address, options?: AddressFormatOptions): string;
704
925
 
705
926
  /**
706
927
  * Formats a CodeableConcept element as a string.
707
- * @param codeableConcept A FHIR CodeableConcept element
928
+ * @param codeableConcept - A FHIR CodeableConcept element
708
929
  * @returns The codeable concept as a string.
709
930
  */
710
931
  export declare function formatCodeableConcept(codeableConcept: CodeableConcept | undefined): string;
711
932
 
712
933
  /**
713
934
  * Formats a Coding element as a string.
714
- * @param coding A FHIR Coding element
935
+ * @param coding - A FHIR Coding element
715
936
  * @returns The coding as a string.
716
937
  */
717
938
  export declare function formatCoding(coding: Coding | undefined): string;
@@ -719,9 +940,9 @@ export declare function formatCoding(coding: Coding | undefined): string;
719
940
  /**
720
941
  * Formats a FHIR date string as a human readable string.
721
942
  * Handles missing values and invalid dates.
722
- * @param date The date to format.
723
- * @param locales Optional locales.
724
- * @param options Optional date format options.
943
+ * @param date - The date to format.
944
+ * @param locales - Optional locales.
945
+ * @param options - Optional date format options.
725
946
  * @returns The formatted date string.
726
947
  */
727
948
  export declare function formatDate(date: string | undefined, locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions | undefined): string;
@@ -729,38 +950,38 @@ export declare function formatDate(date: string | undefined, locales?: Intl.Loca
729
950
  /**
730
951
  * Formats a FHIR dateTime string as a human readable string.
731
952
  * Handles missing values and invalid dates.
732
- * @param dateTime The dateTime to format.
733
- * @param locales Optional locales.
734
- * @param options Optional dateTime format options.
953
+ * @param dateTime - The dateTime to format.
954
+ * @param locales - Optional locales.
955
+ * @param options - Optional dateTime format options.
735
956
  * @returns The formatted dateTime string.
736
957
  */
737
958
  export declare function formatDateTime(dateTime: string | undefined, locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions | undefined): string;
738
959
 
739
960
  /**
740
961
  * Formats the family name portion of a FHIR HumanName element.
741
- * @param name The name to format.
962
+ * @param name - The name to format.
742
963
  * @returns The formatted family name string.
743
964
  */
744
965
  export declare function formatFamilyName(name: HumanName): string;
745
966
 
746
967
  /**
747
968
  * Formats the given name portion of a FHIR HumanName element.
748
- * @param name The name to format.
969
+ * @param name - The name to format.
749
970
  * @returns The formatted given name string.
750
971
  */
751
972
  export declare function formatGivenName(name: HumanName): string;
752
973
 
753
974
  /**
754
975
  * Formats an ISO date/time string into an HL7 date/time string.
755
- * @param isoDate The ISO date/time string.
976
+ * @param isoDate - The ISO date/time string.
756
977
  * @returns The HL7 date/time string.
757
978
  */
758
979
  export declare function formatHl7DateTime(isoDate: Date | string): string;
759
980
 
760
981
  /**
761
982
  * Formats a FHIR HumanName as a string.
762
- * @param name The name to format.
763
- * @param options Optional name format options.
983
+ * @param name - The name to format.
984
+ * @param options - Optional name format options.
764
985
  * @returns The formatted name string.
765
986
  */
766
987
  export declare function formatHumanName(name: HumanName, options?: HumanNameFormatOptions): string;
@@ -769,33 +990,33 @@ export declare function formatMoney(money: Money | undefined): string;
769
990
 
770
991
  /**
771
992
  * Formats a FHIR Observation resource value as a string.
772
- * @param obs A FHIR Observation resource.
993
+ * @param obs - A FHIR Observation resource.
773
994
  * @returns A human-readable string representation of the Observation.
774
995
  */
775
996
  export declare function formatObservationValue(obs: Observation | ObservationComponent | undefined): string;
776
997
 
777
998
  /**
778
999
  * Formats a FHIR Period as a human readable string.
779
- * @param period The period to format.
780
- * @param locales Optional locales.
781
- * @param options Optional period format options.
1000
+ * @param period - The period to format.
1001
+ * @param locales - Optional locales.
1002
+ * @param options - Optional period format options.
782
1003
  * @returns The formatted period string.
783
1004
  */
784
1005
  export declare function formatPeriod(period: Period | undefined, locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions | undefined): string;
785
1006
 
786
1007
  /**
787
1008
  * Returns a human-readable string for a FHIR Quantity datatype, taking into account units and comparators
788
- * @param quantity A FHIR Quantity element
789
- * @param precision Number of decimal places to display in the rendered quantity values
1009
+ * @param quantity - A FHIR Quantity element
1010
+ * @param precision - Number of decimal places to display in the rendered quantity values
790
1011
  * @returns A human-readable string representation of the Quantity
791
1012
  */
792
1013
  export declare function formatQuantity(quantity: Quantity | undefined, precision?: number): string;
793
1014
 
794
1015
  /**
795
1016
  * Returns a human-readable string for a FHIR Range datatype, taking into account one-sided ranges
796
- * @param range A FHIR Range element
797
- * @param precision Number of decimal places to display in the rendered quantity values
798
- * @param exclusive If true, one-sided ranges will be rendered with the '>' or '<' bounds rather than '>=' or '<='
1017
+ * @param range - A FHIR Range element
1018
+ * @param precision - Number of decimal places to display in the rendered quantity values
1019
+ * @param exclusive - If true, one-sided ranges will be rendered with the `>` or `<` bounds rather than `>=` or `<=`
799
1020
  * @returns A human-readable string representation of the Range
800
1021
  */
801
1022
  export declare function formatRange(range: Range_2 | undefined, precision?: number, exclusive?: boolean): string;
@@ -803,7 +1024,7 @@ export declare function formatRange(range: Range_2 | undefined, precision?: numb
803
1024
  /**
804
1025
  * Formats a search definition object into a query string.
805
1026
  * Note: The return value does not include the resource type.
806
- * @param definition The search definition.
1027
+ * @param definition - The search definition.
807
1028
  * @returns Formatted URL.
808
1029
  */
809
1030
  export declare function formatSearchQuery(definition: SearchRequest): string;
@@ -811,20 +1032,28 @@ export declare function formatSearchQuery(definition: SearchRequest): string;
811
1032
  /**
812
1033
  * Formats a FHIR time string as a human readable string.
813
1034
  * Handles missing values and invalid dates.
814
- * @param time The date to format.
815
- * @param locales Optional locales.
816
- * @param options Optional time format options.
1035
+ * @param time - The date to format.
1036
+ * @param locales - Optional locales.
1037
+ * @param options - Optional time format options.
817
1038
  * @returns The formatted time string.
818
1039
  */
819
1040
  export declare function formatTime(time: string | undefined, locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions | undefined): string;
820
1041
 
821
1042
  /**
822
1043
  * Formats a FHIR Timing as a human readable string.
823
- * @param timing The timing to format.
1044
+ * @param timing - The timing to format.
824
1045
  * @returns The formatted timing string.
825
1046
  */
826
1047
  export declare function formatTiming(timing: Timing | undefined): string;
827
1048
 
1049
+ export declare class FunctionAtom implements Atom {
1050
+ readonly name: string;
1051
+ readonly args: Atom[];
1052
+ constructor(name: string, args: Atom[]);
1053
+ eval(context: AtomContext, input: TypedValue[]): TypedValue[];
1054
+ toString(): string;
1055
+ }
1056
+
828
1057
  /**
829
1058
  * Cross platform random UUID generator
830
1059
  * Note that this is not intended for production use, but rather for testing
@@ -838,15 +1067,15 @@ export declare function getAllDataTypes(): Record<string, InternalTypeSchema>;
838
1067
 
839
1068
  /**
840
1069
  * Returns an array of questionnaire answers as a map by link ID.
841
- * @param response The questionnaire response resource.
1070
+ * @param response - The questionnaire response resource.
842
1071
  * @returns Questionnaire answer arrays mapped by link ID.
843
1072
  */
844
1073
  export declare function getAllQuestionnaireAnswers(response: QuestionnaireResponse): Record<string, QuestionnaireResponseItemAnswer[]>;
845
1074
 
846
1075
  /**
847
1076
  * Tries to find a code string for a given system within a given codeable concept.
848
- * @param concept The codeable concept.
849
- * @param system The system string.
1077
+ * @param concept - The codeable concept.
1078
+ * @param system - The system string.
850
1079
  * @returns The code if found; otherwise undefined.
851
1080
  */
852
1081
  export declare function getCodeBySystem(concept: CodeableConcept, system: string): string | undefined;
@@ -857,14 +1086,14 @@ export declare function getDataType(type: string): InternalTypeSchema;
857
1086
  * Returns a Date property as a Date.
858
1087
  * When working with JSON objects, Dates are often serialized as ISO-8601 strings.
859
1088
  * When that happens, we need to safely convert to a proper Date object.
860
- * @param date The date property value, which could be a string or a Date object.
1089
+ * @param date - The date property value, which could be a string or a Date object.
861
1090
  * @returns A Date object.
862
1091
  */
863
1092
  export declare function getDateProperty(date: string | undefined): Date | undefined;
864
1093
 
865
1094
  /**
866
1095
  * Returns a display string for the resource.
867
- * @param resource The input resource.
1096
+ * @param resource - The input resource.
868
1097
  * @returns Human friendly display string.
869
1098
  */
870
1099
  export declare function getDisplayString(resource: Resource): string;
@@ -872,15 +1101,15 @@ export declare function getDisplayString(resource: Resource): string;
872
1101
  /**
873
1102
  * Returns an element definition by type and property name.
874
1103
  * Handles content references.
875
- * @param typeName The type name.
876
- * @param propertyName The property name.
1104
+ * @param typeName - The type name.
1105
+ * @param propertyName - The property name.
877
1106
  * @returns The element definition if found.
878
1107
  */
879
1108
  export declare function getElementDefinition(typeName: string, propertyName: string): InternalSchemaElement | undefined;
880
1109
 
881
1110
  /**
882
1111
  * Returns the type name for an ElementDefinition.
883
- * @param elementDefinition The element definition.
1112
+ * @param elementDefinition - The element definition.
884
1113
  * @returns The Medplum type name.
885
1114
  */
886
1115
  export declare function getElementDefinitionTypeName(elementDefinition: ElementDefinition): string;
@@ -891,16 +1120,16 @@ export declare function getExpressionsForResourceType(resourceType: string, expr
891
1120
 
892
1121
  /**
893
1122
  * Returns an extension by extension URLs.
894
- * @param resource The base resource.
895
- * @param urls Array of extension URLs. Each entry represents a nested extension.
1123
+ * @param resource - The base resource.
1124
+ * @param urls - Array of extension URLs. Each entry represents a nested extension.
896
1125
  * @returns The extension object if found; undefined otherwise.
897
1126
  */
898
1127
  export declare function getExtension(resource: any, ...urls: string[]): Extension | undefined;
899
1128
 
900
1129
  /**
901
1130
  * Returns an extension value by extension URLs.
902
- * @param resource The base resource.
903
- * @param urls Array of extension URLs. Each entry represents a nested extension.
1131
+ * @param resource - The base resource.
1132
+ * @param urls - Array of extension URLs. Each entry represents a nested extension.
904
1133
  * @returns The extension value if found; undefined otherwise.
905
1134
  */
906
1135
  export declare function getExtensionValue(resource: any, ...urls: string[]): string | undefined;
@@ -911,15 +1140,15 @@ export declare function getExtensionValue(resource: any, ...urls: string[]): str
911
1140
  * If multiple identifiers exist with the same system, the first one is returned.
912
1141
  *
913
1142
  * If the system is not found, then returns undefined.
914
- * @param resource The resource to check.
915
- * @param system The identifier system.
1143
+ * @param resource - The resource to check.
1144
+ * @param system - The identifier system.
916
1145
  * @returns The identifier value if found; otherwise undefined.
917
1146
  */
918
1147
  export declare function getIdentifier(resource: Resource, system: string): string | undefined;
919
1148
 
920
1149
  /**
921
1150
  * Returns an image URL for the resource, if one is available.
922
- * @param resource The input resource.
1151
+ * @param resource - The input resource.
923
1152
  * @returns The image URL for the resource or undefined.
924
1153
  */
925
1154
  export declare function getImageSrc(resource: Resource): string | undefined;
@@ -928,14 +1157,14 @@ export declare function getNestedProperty(value: TypedValue, key: string): (Type
928
1157
 
929
1158
  /**
930
1159
  * Returns a human friendly display name for a FHIR element definition path.
931
- * @param path The FHIR element definition path.
1160
+ * @param path - The FHIR element definition path.
932
1161
  * @returns The best guess of the display name.
933
1162
  */
934
1163
  export declare function getPropertyDisplayName(path: string): string;
935
1164
 
936
1165
  /**
937
1166
  * Returns all questionnaire answers as a map by link ID.
938
- * @param response The questionnaire response resource.
1167
+ * @param response - The questionnaire response resource.
939
1168
  * @returns Questionnaire answers mapped by link ID.
940
1169
  */
941
1170
  export declare function getQuestionnaireAnswers(response: QuestionnaireResponse): Record<string, QuestionnaireResponseItemAnswer>;
@@ -948,7 +1177,7 @@ export declare function getRandomString(): string;
948
1177
 
949
1178
  /**
950
1179
  * Returns a reference string for a resource.
951
- * @param input The FHIR resource or reference.
1180
+ * @param input - The FHIR resource or reference.
952
1181
  * @returns A reference string of the form resourceType/id.
953
1182
  */
954
1183
  export declare function getReferenceString(input: Reference | Resource): string;
@@ -962,8 +1191,8 @@ export declare function getResourceTypes(): ResourceType[];
962
1191
 
963
1192
  /**
964
1193
  * Returns a search parameter for a resource type by search code.
965
- * @param resourceType The FHIR resource type.
966
- * @param code The search parameter code.
1194
+ * @param resourceType - The FHIR resource type.
1195
+ * @param code - The search parameter code.
967
1196
  * @returns The search parameter if found, otherwise undefined.
968
1197
  */
969
1198
  export declare function getSearchParameter(resourceType: string, code: string): SearchParameter | undefined;
@@ -977,15 +1206,15 @@ export declare function getSearchParameter(resourceType: string, code: string):
977
1206
  * 1) The "date" type includes "date", "datetime", and "period".
978
1207
  * 2) The "token" type includes enums and booleans.
979
1208
  * 3) Arrays/multiple values are not reflected at all.
980
- * @param resourceType The root resource type.
981
- * @param searchParam The search parameter.
1209
+ * @param resourceType - The root resource type.
1210
+ * @param searchParam - The search parameter.
982
1211
  * @returns The search parameter type details.
983
1212
  */
984
1213
  export declare function getSearchParameterDetails(resourceType: string, searchParam: SearchParameter): SearchParameterDetails;
985
1214
 
986
1215
  /**
987
1216
  * Returns the search parameters for the resource type indexed by search code.
988
- * @param resourceType The resource type.
1217
+ * @param resourceType - The resource type.
989
1218
  * @returns The search parameters for the resource type indexed by search code.
990
1219
  */
991
1220
  export declare function getSearchParameters(resourceType: string): Record<string, SearchParameter> | undefined;
@@ -998,8 +1227,8 @@ export declare function getStatus(outcome: OperationOutcome): number;
998
1227
  * For example, "Observation.value[x]" can be "valueString", "valueInteger", "valueQuantity", etc.
999
1228
  * According to the spec, there can only be one property for a given element definition.
1000
1229
  * This function returns the value and the type.
1001
- * @param input The base context (FHIR resource or backbone element).
1002
- * @param path The property path.
1230
+ * @param input - The base context (FHIR resource or backbone element).
1231
+ * @param path - The property path.
1003
1232
  * @returns The value of the property and the property type.
1004
1233
  */
1005
1234
  export declare function getTypedPropertyValue(input: TypedValue, path: string): TypedValue[] | TypedValue | undefined;
@@ -1071,15 +1300,15 @@ export declare class Hl7Field {
1071
1300
  readonly components: string[][];
1072
1301
  /**
1073
1302
  * Creates a new HL7 field.
1074
- * @param components The HL7 components.
1075
- * @param context Optional HL7 parsing context.
1303
+ * @param components - The HL7 components.
1304
+ * @param context - Optional HL7 parsing context.
1076
1305
  */
1077
1306
  constructor(components: string[][], context?: Hl7Context);
1078
1307
  /**
1079
1308
  * Returns an HL7 component by index.
1080
- * @param component The component index.
1081
- * @param subcomponent Optional subcomponent index.
1082
- * @param repetition Optional repetition index.
1309
+ * @param component - The component index.
1310
+ * @param subcomponent - Optional subcomponent index.
1311
+ * @param repetition - Optional repetition index.
1083
1312
  * @returns The string value of the specified component.
1084
1313
  * @deprecated Use getComponent() instead. This method will be removed in a future release.
1085
1314
  */
@@ -1093,9 +1322,9 @@ export declare class Hl7Field {
1093
1322
  *
1094
1323
  * This aligns with HL7 component names such as MSH.9.2.
1095
1324
  *
1096
- * @param component The component index.
1097
- * @param subcomponent Optional subcomponent index.
1098
- * @param repetition Optional repetition index.
1325
+ * @param component - The component index.
1326
+ * @param subcomponent - Optional subcomponent index.
1327
+ * @param repetition - Optional repetition index.
1099
1328
  * @returns The string value of the specified component.
1100
1329
  */
1101
1330
  getComponent(component: number, subcomponent?: number, repetition?: number): string;
@@ -1106,8 +1335,8 @@ export declare class Hl7Field {
1106
1335
  toString(): string;
1107
1336
  /**
1108
1337
  * Parses an HL7 field string into an Hl7Field object.
1109
- * @param text The HL7 field text.
1110
- * @param context Optional HL7 parsing context.
1338
+ * @param text - The HL7 field text.
1339
+ * @param context - Optional HL7 parsing context.
1111
1340
  * @returns The parsed HL7 field.
1112
1341
  */
1113
1342
  static parse(text: string, context?: Hl7Context): Hl7Field;
@@ -1122,8 +1351,8 @@ export declare class Hl7Message {
1122
1351
  readonly segments: Hl7Segment[];
1123
1352
  /**
1124
1353
  * Creates a new HL7 message.
1125
- * @param segments The HL7 segments.
1126
- * @param context Optional HL7 parsing context.
1354
+ * @param segments - The HL7 segments.
1355
+ * @param context - Optional HL7 parsing context.
1127
1356
  */
1128
1357
  constructor(segments: Hl7Segment[], context?: Hl7Context);
1129
1358
  /**
@@ -1133,14 +1362,14 @@ export declare class Hl7Message {
1133
1362
  get header(): Hl7Segment;
1134
1363
  /**
1135
1364
  * Returns an HL7 segment by index or by name.
1136
- * @param index The HL7 segment index or name.
1365
+ * @param index - The HL7 segment index or name.
1137
1366
  * @returns The HL7 segment if found; otherwise, undefined.
1138
1367
  * @deprecated Use getSegment() instead. This method will be removed in a future release.
1139
1368
  */
1140
1369
  get(index: number | string): Hl7Segment | undefined;
1141
1370
  /**
1142
1371
  * Returns all HL7 segments of a given name.
1143
- * @param name The HL7 segment name.
1372
+ * @param name - The HL7 segment name.
1144
1373
  * @returns An array of HL7 segments with the specified name.
1145
1374
  * @deprecated Use getAllSegments() instead. This method will be removed in a future release.
1146
1375
  */
@@ -1152,13 +1381,13 @@ export declare class Hl7Message {
1152
1381
  *
1153
1382
  * When using a string index, this method returns the first segment with the specified name.
1154
1383
  *
1155
- * @param index The HL7 segment index or name.
1384
+ * @param index - The HL7 segment index or name.
1156
1385
  * @returns The HL7 segment if found; otherwise, undefined.
1157
1386
  */
1158
1387
  getSegment(index: number | string): Hl7Segment | undefined;
1159
1388
  /**
1160
1389
  * Returns all HL7 segments of a given name.
1161
- * @param name The HL7 segment name.
1390
+ * @param name - The HL7 segment name.
1162
1391
  * @returns An array of HL7 segments with the specified name.
1163
1392
  */
1164
1393
  getAllSegments(name: string): Hl7Segment[];
@@ -1175,7 +1404,7 @@ export declare class Hl7Message {
1175
1404
  private buildAckMessageType;
1176
1405
  /**
1177
1406
  * Parses an HL7 message string into an Hl7Message object.
1178
- * @param text The HL7 message text.
1407
+ * @param text - The HL7 message text.
1179
1408
  * @returns The parsed HL7 message.
1180
1409
  */
1181
1410
  static parse(text: string): Hl7Message;
@@ -1192,13 +1421,13 @@ export declare class Hl7Segment {
1192
1421
  readonly fields: Hl7Field[];
1193
1422
  /**
1194
1423
  * Creates a new HL7 segment.
1195
- * @param fields The HL7 fields. The first field is the segment name.
1196
- * @param context Optional HL7 parsing context.
1424
+ * @param fields - The HL7 fields. The first field is the segment name.
1425
+ * @param context - Optional HL7 parsing context.
1197
1426
  */
1198
1427
  constructor(fields: Hl7Field[] | string[], context?: Hl7Context);
1199
1428
  /**
1200
1429
  * Returns an HL7 field by index.
1201
- * @param index The HL7 field index.
1430
+ * @param index - The HL7 field index.
1202
1431
  * @returns The HL7 field.
1203
1432
  * @deprecated Use getSegment() instead. This method includes the segment name in the index, which leads to confusing behavior. This method will be removed in a future release.
1204
1433
  */
@@ -1214,7 +1443,7 @@ export declare class Hl7Segment {
1214
1443
  *
1215
1444
  * Field zero is the segment name.
1216
1445
  *
1217
- * @param index The HL7 field index.
1446
+ * @param index - The HL7 field index.
1218
1447
  * @returns The HL7 field.
1219
1448
  */
1220
1449
  getField(index: number): Hl7Field;
@@ -1229,10 +1458,10 @@ export declare class Hl7Segment {
1229
1458
  *
1230
1459
  * This aligns with HL7 component names such as MSH.9.2.
1231
1460
  *
1232
- * @param fieldIndex The HL7 field index.
1233
- * @param component The component index.
1234
- * @param subcomponent Optional subcomponent index.
1235
- * @param repetition Optional repetition index.
1461
+ * @param fieldIndex - The HL7 field index.
1462
+ * @param component - The component index.
1463
+ * @param subcomponent - Optional subcomponent index.
1464
+ * @param repetition - Optional repetition index.
1236
1465
  * @returns The string value of the specified component.
1237
1466
  */
1238
1467
  getComponent(fieldIndex: number, component: number, subcomponent?: number, repetition?: number): string;
@@ -1243,8 +1472,8 @@ export declare class Hl7Segment {
1243
1472
  toString(): string;
1244
1473
  /**
1245
1474
  * Parses an HL7 segment string into an Hl7Segment object.
1246
- * @param text The HL7 segment text.
1247
- * @param context Optional HL7 parsing context.
1475
+ * @param text - The HL7 segment text.
1476
+ * @param context - Optional HL7 parsing context.
1248
1477
  * @returns The parsed HL7 segment.
1249
1478
  */
1250
1479
  static parse(text: string, context?: Hl7Context): Hl7Segment;
@@ -1259,6 +1488,22 @@ export declare interface HumanNameFormatOptions {
1259
1488
 
1260
1489
  export declare const ICD10 = "http://hl7.org/fhir/sid/icd-10";
1261
1490
 
1491
+ /**
1492
+ * 6.5.5. implies
1493
+ * Returns true if left is true and right is true,
1494
+ * true left is false and right true, false or empty
1495
+ * true left is empty
1496
+ */
1497
+ export declare class ImpliesAtom extends BooleanInfixOperatorAtom {
1498
+ constructor(left: Atom, right: Atom);
1499
+ eval(context: AtomContext, input: TypedValue[]): TypedValue[];
1500
+ }
1501
+
1502
+ export declare class InAtom extends BooleanInfixOperatorAtom {
1503
+ constructor(left: Atom, right: Atom);
1504
+ eval(context: AtomContext, input: TypedValue[]): TypedValue[];
1505
+ }
1506
+
1262
1507
  export declare interface IncludeTarget {
1263
1508
  resourceType: string;
1264
1509
  searchParam: string;
@@ -1296,17 +1541,25 @@ export declare interface IndexedStructureDefinition {
1296
1541
  };
1297
1542
  }
1298
1543
 
1544
+ export declare class IndexerAtom implements Atom {
1545
+ readonly left: Atom;
1546
+ readonly expr: Atom;
1547
+ constructor(left: Atom, expr: Atom);
1548
+ eval(context: AtomContext, input: TypedValue[]): TypedValue[];
1549
+ toString(): string;
1550
+ }
1551
+
1299
1552
  /**
1300
1553
  * Indexes a SearchParameter resource for fast lookup.
1301
1554
  * Indexes by SearchParameter.code, which is the query string parameter name.
1302
- * @param searchParam The SearchParameter resource.
1555
+ * @param searchParam - The SearchParameter resource.
1303
1556
  * @see {@link IndexedStructureDefinition} for more details on indexed StructureDefinitions.
1304
1557
  */
1305
1558
  export declare function indexSearchParameter(searchParam: SearchParameter): void;
1306
1559
 
1307
1560
  /**
1308
1561
  * Indexes a bundle of SearchParameter resources for faster lookup.
1309
- * @param bundle A FHIR bundle SearchParameter resources.
1562
+ * @param bundle - A FHIR bundle SearchParameter resources.
1310
1563
  * @see {@link IndexedStructureDefinition} for more details on indexed StructureDefinitions.
1311
1564
  */
1312
1565
  export declare function indexSearchParameterBundle(bundle: Bundle<SearchParameter>): void;
@@ -1382,15 +1635,22 @@ export declare interface InviteRequest {
1382
1635
 
1383
1636
  export declare function isAccepted(outcome: OperationOutcome): boolean;
1384
1637
 
1638
+ export declare class IsAtom extends BooleanInfixOperatorAtom {
1639
+ constructor(left: Atom, right: Atom);
1640
+ eval(context: AtomContext, input: TypedValue[]): TypedValue[];
1641
+ }
1642
+
1385
1643
  export declare function isCompletedSubscriptionRequest(subscriptionRequest: SubscriptionRequest | PendingSubscriptionRequest): subscriptionRequest is SubscriptionRequest;
1386
1644
 
1645
+ export declare function isContextVersionRequired(event: string): event is FhircastEventVersionRequired;
1646
+
1387
1647
  export declare function isCreated(outcome: OperationOutcome): boolean;
1388
1648
 
1389
1649
  export declare function isDataTypeLoaded(type: string): boolean;
1390
1650
 
1391
1651
  /**
1392
1652
  * Returns true if the value is empty (null, undefined, empty string, or empty object).
1393
- * @param v Any value.
1653
+ * @param v - Any value.
1394
1654
  * @returns True if the value is an empty string or an empty object.
1395
1655
  */
1396
1656
  export declare function isEmpty(v: any): boolean;
@@ -1398,7 +1658,7 @@ export declare function isEmpty(v: any): boolean;
1398
1658
  /**
1399
1659
  * Checks if a `ResourceType` can be used in a `FHIRcast` context.
1400
1660
  *
1401
- * @param resourceType A `ResourceType` to test.
1661
+ * @param resourceType - A `ResourceType` to test.
1402
1662
  * @returns `true` if this is a resource type associated with `FHIRcast` contexts, otherwise returns `false`.
1403
1663
  */
1404
1664
  export declare function isFhircastResourceType(resourceType: FhircastResourceType): boolean;
@@ -1407,7 +1667,7 @@ export declare function isGone(outcome: OperationOutcome): boolean;
1407
1667
 
1408
1668
  /**
1409
1669
  * Returns true if the token is a JWT.
1410
- * @param token The potential JWT token.
1670
+ * @param token - The potential JWT token.
1411
1671
  * @returns True if the token is a JWT.
1412
1672
  */
1413
1673
  export declare function isJwt(token: string): boolean;
@@ -1416,7 +1676,7 @@ export declare function isLowerCase(c: string): boolean;
1416
1676
 
1417
1677
  /**
1418
1678
  * Returns true if the access token was issued by a Medplum server.
1419
- * @param accessToken An access token of unknown origin.
1679
+ * @param accessToken - An access token of unknown origin.
1420
1680
  * @returns True if the access token was issued by a Medplum server.
1421
1681
  */
1422
1682
  export declare function isMedplumAccessToken(accessToken: string): boolean;
@@ -1425,7 +1685,7 @@ export declare function isNotFound(outcome: OperationOutcome): boolean;
1425
1685
 
1426
1686
  /**
1427
1687
  * Returns true if the input is an object.
1428
- * @param obj The candidate object.
1688
+ * @param obj - The candidate object.
1429
1689
  * @returns True if the input is a non-null non-undefined object.
1430
1690
  */
1431
1691
  export declare function isObject(obj: unknown): obj is Record<string, unknown>;
@@ -1437,14 +1697,14 @@ export declare function isOperationOutcome(value: unknown): value is OperationOu
1437
1697
  /**
1438
1698
  * Determines if the input is a Period object.
1439
1699
  * This is heuristic based, as we do not have strong typing at runtime.
1440
- * @param input The input value.
1700
+ * @param input - The input value.
1441
1701
  * @returns True if the input is a period.
1442
1702
  */
1443
1703
  export declare function isPeriod(input: unknown): input is Period;
1444
1704
 
1445
1705
  /**
1446
1706
  * Returns true if the resource is a "ProfileResource".
1447
- * @param resource The FHIR resource.
1707
+ * @param resource - The FHIR resource.
1448
1708
  * @returns True if the resource is a "ProfileResource".
1449
1709
  */
1450
1710
  export declare function isProfileResource(resource: Resource): resource is ProfileResource;
@@ -1452,7 +1712,7 @@ export declare function isProfileResource(resource: Resource): resource is Profi
1452
1712
  /**
1453
1713
  * Determines if the input is a Quantity object.
1454
1714
  * This is heuristic based, as we do not have strong typing at runtime.
1455
- * @param input The input value.
1715
+ * @param input - The input value.
1456
1716
  * @returns True if the input is a quantity.
1457
1717
  */
1458
1718
  export declare function isQuantity(input: unknown): input is Quantity;
@@ -1461,7 +1721,7 @@ export declare function isQuantityEquivalent(x: Quantity, y: Quantity): boolean;
1461
1721
 
1462
1722
  /**
1463
1723
  * Typeguard to validate that an object is a FHIR resource
1464
- * @param value The object to check
1724
+ * @param value - The object to check
1465
1725
  * @returns True if the input is of type 'object' and contains property 'reference'
1466
1726
  */
1467
1727
  export declare function isReference(value: unknown): value is Reference & {
@@ -1470,7 +1730,7 @@ export declare function isReference(value: unknown): value is Reference & {
1470
1730
 
1471
1731
  /**
1472
1732
  * Typeguard to validate that an object is a FHIR resource
1473
- * @param value The object to check
1733
+ * @param value - The object to check
1474
1734
  * @returns True if the input is of type 'object' and contains property 'resourceType'
1475
1735
  */
1476
1736
  export declare function isResource(value: unknown): value is Resource;
@@ -1478,33 +1738,34 @@ export declare function isResource(value: unknown): value is Resource;
1478
1738
  /**
1479
1739
  * Returns true if the given string is a valid FHIR resource type.
1480
1740
  *
1741
+ * @example
1481
1742
  * ```ts
1482
1743
  * isResourceType('Patient'); // true
1483
1744
  * isResourceType('XYZ'); // false
1484
1745
  * ```
1485
1746
  *
1486
- * @param resourceType The candidate resource type string.
1747
+ * @param resourceType - The candidate resource type string.
1487
1748
  * @returns True if the resource type is a valid FHIR resource type.
1488
1749
  */
1489
1750
  export declare function isResourceType(resourceType: string): boolean;
1490
1751
 
1491
1752
  /**
1492
1753
  * Returns true if the type schema is a non-abstract FHIR resource.
1493
- * @param typeSchema The type schema to check.
1754
+ * @param typeSchema - The type schema to check.
1494
1755
  * @returns True if the type schema is a non-abstract FHIR resource.
1495
1756
  */
1496
1757
  export declare function isResourceTypeSchema(typeSchema: InternalTypeSchema): boolean;
1497
1758
 
1498
1759
  /**
1499
1760
  * Returns true if the input array is an array of strings.
1500
- * @param arr Input array.
1761
+ * @param arr - Input array.
1501
1762
  * @returns True if the input array is an array of strings.
1502
1763
  */
1503
1764
  export declare function isStringArray(arr: any[]): arr is string[];
1504
1765
 
1505
1766
  /**
1506
1767
  * Returns true if the input string is a UUID.
1507
- * @param input The input string.
1768
+ * @param input - The input string.
1508
1769
  * @returns True if the input string matches the UUID format.
1509
1770
  */
1510
1771
  export declare function isUUID(input: string): input is `${string}-${string}-${string}-${string}-${string}`;
@@ -1512,11 +1773,18 @@ export declare function isUUID(input: string): input is `${string}-${string}-${s
1512
1773
  /**
1513
1774
  * Returns true if the given date object is a valid date.
1514
1775
  * Dates can be invalid if created by parsing an invalid string.
1515
- * @param date A date object.
1776
+ * @param date - A date object.
1516
1777
  * @returns Returns true if the date is a valid date.
1517
1778
  */
1518
1779
  export declare function isValidDate(date: Date): boolean;
1519
1780
 
1781
+ export declare class LiteralAtom implements Atom {
1782
+ readonly value: TypedValue;
1783
+ constructor(value: TypedValue);
1784
+ eval(): TypedValue[];
1785
+ toString(): string;
1786
+ }
1787
+
1520
1788
  export declare function loadDataType(sd: StructureDefinition): void;
1521
1789
 
1522
1790
  export declare interface LoginAuthenticationResponse {
@@ -1559,19 +1827,19 @@ export declare class LRUCache<T> {
1559
1827
  clear(): void;
1560
1828
  /**
1561
1829
  * Returns the value for the given key.
1562
- * @param key The key to retrieve.
1830
+ * @param key - The key to retrieve.
1563
1831
  * @returns The value if found; undefined otherwise.
1564
1832
  */
1565
1833
  get(key: string): T | undefined;
1566
1834
  /**
1567
1835
  * Sets the value for the given key.
1568
- * @param key The key to set.
1569
- * @param val The value to set.
1836
+ * @param key - The key to set.
1837
+ * @param val - The value to set.
1570
1838
  */
1571
1839
  set(key: string, val: T): void;
1572
1840
  /**
1573
1841
  * Deletes the value for the given key.
1574
- * @param key The key to delete.
1842
+ * @param key - The key to delete.
1575
1843
  */
1576
1844
  delete(key: string): void;
1577
1845
  /**
@@ -1616,7 +1884,7 @@ export declare type MailDestination = string | MailAddress | string[] | MailAddr
1616
1884
  * Compatible with nodemailer Mail.Options.
1617
1885
  */
1618
1886
  export declare interface MailOptions {
1619
- /** The e-mail address of the sender. All e-mail addresses can be plain 'sender@server.com' or formatted 'Sender Name <sender@server.com>' */
1887
+ /** The e-mail address of the sender. All e-mail addresses can be plain `sender@server.com` or formatted `Sender Name <sender@server.com>` */
1620
1888
  readonly from?: string | MailAddress;
1621
1889
  /** An e-mail address that will appear on the Sender: field */
1622
1890
  readonly sender?: string | MailAddress;
@@ -1638,7 +1906,7 @@ export declare interface MailOptions {
1638
1906
  readonly attachments?: MailAttachment[];
1639
1907
  }
1640
1908
 
1641
- declare interface Marker {
1909
+ export declare interface Marker {
1642
1910
  index: number;
1643
1911
  line: number;
1644
1912
  column: number;
@@ -1646,9 +1914,9 @@ declare interface Marker {
1646
1914
 
1647
1915
  /**
1648
1916
  * Returns true if the resource satisfies the current access policy.
1649
- * @param accessPolicy The access policy.
1650
- * @param resource The resource.
1651
- * @param readonlyMode True if the resource is being read.
1917
+ * @param accessPolicy - The access policy.
1918
+ * @param resource - The resource.
1919
+ * @param readonlyMode - True if the resource is being read.
1652
1920
  * @returns True if the resource matches the access policy.
1653
1921
  * @deprecated Use satisfiedAccessPolicy() instead.
1654
1922
  */
@@ -1656,17 +1924,17 @@ export declare function matchesAccessPolicy(accessPolicy: AccessPolicy, resource
1656
1924
 
1657
1925
  /**
1658
1926
  * Returns true if the value is in the range accounting for precision.
1659
- * @param value The numeric value.
1660
- * @param range The numeric range.
1661
- * @param precision Optional precision in number of digits.
1927
+ * @param value - The numeric value.
1928
+ * @param range - The numeric range.
1929
+ * @param precision - Optional precision in number of digits.
1662
1930
  * @returns True if the value is within the range.
1663
1931
  */
1664
1932
  export declare function matchesRange(value: number, range: Range_2, precision?: number): boolean;
1665
1933
 
1666
1934
  /**
1667
1935
  * Determines if the resource matches the search request.
1668
- * @param resource The resource that was created or updated.
1669
- * @param searchRequest The subscription criteria as a search request.
1936
+ * @param resource - The resource that was created or updated.
1937
+ * @param searchRequest - The subscription criteria as a search request.
1670
1938
  * @returns True if the resource satisfies the search request.
1671
1939
  */
1672
1940
  export declare function matchesSearchRequest(resource: Resource, searchRequest: SearchRequest): boolean;
@@ -1679,14 +1947,15 @@ export declare const MEDPLUM_VERSION: string;
1679
1947
  * The client can be used in the browser, in a Node.js application, or in a Medplum Bot.
1680
1948
  *
1681
1949
  * The client provides helpful methods for common operations such as:
1682
- * 1) Authenticating
1683
- * 2) Creating resources
1684
- * 2) Reading resources
1685
- * 3) Updating resources
1686
- * 5) Deleting resources
1687
- * 6) Searching
1688
- * 7) Making GraphQL queries
1950
+ * 1. Authenticating
1951
+ * 2. Creating resources
1952
+ * 3. Reading resources
1953
+ * 4. Updating resources
1954
+ * 5. Deleting resources
1955
+ * 6. Searching
1956
+ * 7. Making GraphQL queries
1689
1957
  *
1958
+ * @example
1690
1959
  * Here is a quick example of how to use the client:
1691
1960
  *
1692
1961
  * ```typescript
@@ -1694,6 +1963,7 @@ export declare const MEDPLUM_VERSION: string;
1694
1963
  * const medplum = new MedplumClient();
1695
1964
  * ```
1696
1965
  *
1966
+ * @example
1697
1967
  * Create a `Patient`:
1698
1968
  *
1699
1969
  * ```typescript
@@ -1706,6 +1976,7 @@ export declare const MEDPLUM_VERSION: string;
1706
1976
  * });
1707
1977
  * ```
1708
1978
  *
1979
+ * @example
1709
1980
  * Read a `Patient` by ID:
1710
1981
  *
1711
1982
  * ```typescript
@@ -1713,6 +1984,7 @@ export declare const MEDPLUM_VERSION: string;
1713
1984
  * console.log(patient.name[0].given[0]);
1714
1985
  * ```
1715
1986
  *
1987
+ * @example
1716
1988
  * Search for a `Patient` by name:
1717
1989
  *
1718
1990
  * ```typescript
@@ -1796,7 +2068,7 @@ export declare class MedplumClient extends EventTarget_2 {
1796
2068
  /**
1797
2069
  * Invalidates any cached values or cached requests for the given URL.
1798
2070
  * @category Caching
1799
- * @param url The URL to invalidate.
2071
+ * @param url - The URL to invalidate.
1800
2072
  */
1801
2073
  invalidateUrl(url: URL | string): void;
1802
2074
  /**
@@ -1807,7 +2079,7 @@ export declare class MedplumClient extends EventTarget_2 {
1807
2079
  /**
1808
2080
  * Invalidates all cached search results or cached requests for the given resourceType.
1809
2081
  * @category Caching
1810
- * @param resourceType The resource type to invalidate.
2082
+ * @param resourceType - The resource type to invalidate.
1811
2083
  */
1812
2084
  invalidateSearches<K extends ResourceType>(resourceType: K): void;
1813
2085
  /**
@@ -1817,8 +2089,8 @@ export declare class MedplumClient extends EventTarget_2 {
1817
2089
  * For common operations, we recommend using higher level methods
1818
2090
  * such as `readResource()`, `search()`, etc.
1819
2091
  * @category HTTP
1820
- * @param url The target URL.
1821
- * @param options Optional fetch options.
2092
+ * @param url - The target URL.
2093
+ * @param options - Optional fetch options.
1822
2094
  * @returns Promise to the response content.
1823
2095
  */
1824
2096
  get<T = any>(url: URL | string, options?: RequestInit): ReadablePromise<T>;
@@ -1829,10 +2101,10 @@ export declare class MedplumClient extends EventTarget_2 {
1829
2101
  * For common operations, we recommend using higher level methods
1830
2102
  * such as `createResource()`.
1831
2103
  * @category HTTP
1832
- * @param url The target URL.
1833
- * @param body The content body. Strings and `File` objects are passed directly. Other objects are converted to JSON.
1834
- * @param contentType The content type to be included in the "Content-Type" header.
1835
- * @param options Optional fetch options.
2104
+ * @param url - The target URL.
2105
+ * @param body - The content body. Strings and `File` objects are passed directly. Other objects are converted to JSON.
2106
+ * @param contentType - The content type to be included in the "Content-Type" header.
2107
+ * @param options - Optional fetch options.
1836
2108
  * @returns Promise to the response content.
1837
2109
  */
1838
2110
  post(url: URL | string, body: any, contentType?: string, options?: RequestInit): Promise<any>;
@@ -1843,10 +2115,10 @@ export declare class MedplumClient extends EventTarget_2 {
1843
2115
  * For common operations, we recommend using higher level methods
1844
2116
  * such as `updateResource()`.
1845
2117
  * @category HTTP
1846
- * @param url The target URL.
1847
- * @param body The content body. Strings and `File` objects are passed directly. Other objects are converted to JSON.
1848
- * @param contentType The content type to be included in the "Content-Type" header.
1849
- * @param options Optional fetch options.
2118
+ * @param url - The target URL.
2119
+ * @param body - The content body. Strings and `File` objects are passed directly. Other objects are converted to JSON.
2120
+ * @param contentType - The content type to be included in the "Content-Type" header.
2121
+ * @param options - Optional fetch options.
1850
2122
  * @returns Promise to the response content.
1851
2123
  */
1852
2124
  put(url: URL | string, body: any, contentType?: string, options?: RequestInit): Promise<any>;
@@ -1857,9 +2129,9 @@ export declare class MedplumClient extends EventTarget_2 {
1857
2129
  * For common operations, we recommend using higher level methods
1858
2130
  * such as `patchResource()`.
1859
2131
  * @category HTTP
1860
- * @param url The target URL.
1861
- * @param operations Array of JSONPatch operations.
1862
- * @param options Optional fetch options.
2132
+ * @param url - The target URL.
2133
+ * @param operations - Array of JSONPatch operations.
2134
+ * @param options - Optional fetch options.
1863
2135
  * @returns Promise to the response content.
1864
2136
  */
1865
2137
  patch(url: URL | string, operations: PatchOperation[], options?: RequestInit): Promise<any>;
@@ -1871,8 +2143,8 @@ export declare class MedplumClient extends EventTarget_2 {
1871
2143
  * For common operations, we recommend using higher level methods
1872
2144
  * such as `deleteResource()`.
1873
2145
  * @category HTTP
1874
- * @param url The target URL.
1875
- * @param options Optional fetch options.
2146
+ * @param url - The target URL.
2147
+ * @param options - Optional fetch options.
1876
2148
  * @returns Promise to the response content.
1877
2149
  */
1878
2150
  delete(url: URL | string, options?: RequestInit): Promise<any>;
@@ -1883,8 +2155,8 @@ export declare class MedplumClient extends EventTarget_2 {
1883
2155
  * 1) New Practitioner and new Project
1884
2156
  * 2) New Patient registration
1885
2157
  * @category Authentication
1886
- * @param newUserRequest Register request including email and password.
1887
- * @param options Optional fetch options.
2158
+ * @param newUserRequest - Register request including email and password.
2159
+ * @param options - Optional fetch options.
1888
2160
  * @returns Promise to the authentication response.
1889
2161
  */
1890
2162
  startNewUser(newUserRequest: NewUserRequest, options?: RequestInit): Promise<LoginAuthenticationResponse>;
@@ -1892,8 +2164,8 @@ export declare class MedplumClient extends EventTarget_2 {
1892
2164
  * Initiates a new project flow.
1893
2165
  *
1894
2166
  * This requires a partial login from `startNewUser` or `startNewGoogleUser`.
1895
- * @param newProjectRequest Register request including email and password.
1896
- * @param options Optional fetch options.
2167
+ * @param newProjectRequest - Register request including email and password.
2168
+ * @param options - Optional fetch options.
1897
2169
  * @returns Promise to the authentication response.
1898
2170
  */
1899
2171
  startNewProject(newProjectRequest: NewProjectRequest, options?: RequestInit): Promise<LoginAuthenticationResponse>;
@@ -1901,16 +2173,16 @@ export declare class MedplumClient extends EventTarget_2 {
1901
2173
  * Initiates a new patient flow.
1902
2174
  *
1903
2175
  * This requires a partial login from `startNewUser` or `startNewGoogleUser`.
1904
- * @param newPatientRequest Register request including email and password.
1905
- * @param options Optional fetch options.
2176
+ * @param newPatientRequest - Register request including email and password.
2177
+ * @param options - Optional fetch options.
1906
2178
  * @returns Promise to the authentication response.
1907
2179
  */
1908
2180
  startNewPatient(newPatientRequest: NewPatientRequest, options?: RequestInit): Promise<LoginAuthenticationResponse>;
1909
2181
  /**
1910
2182
  * Initiates a user login flow.
1911
2183
  * @category Authentication
1912
- * @param loginRequest Login request including email and password.
1913
- * @param options Optional fetch options.
2184
+ * @param loginRequest - Login request including email and password.
2185
+ * @param options - Optional fetch options.
1914
2186
  * @returns Promise to the authentication response.
1915
2187
  */
1916
2188
  startLogin(loginRequest: EmailPasswordLoginRequest, options?: RequestInit): Promise<LoginAuthenticationResponse>;
@@ -1919,8 +2191,8 @@ export declare class MedplumClient extends EventTarget_2 {
1919
2191
  * The response parameter is the result of a Google authentication.
1920
2192
  * See: https://developers.google.com/identity/gsi/web/guides/handle-credential-responses-js-functions
1921
2193
  * @category Authentication
1922
- * @param loginRequest Login request including Google credential response.
1923
- * @param options Optional fetch options.
2194
+ * @param loginRequest - Login request including Google credential response.
2195
+ * @param options - Optional fetch options.
1924
2196
  * @returns Promise to the authentication response.
1925
2197
  */
1926
2198
  startGoogleLogin(loginRequest: GoogleLoginRequest, options?: RequestInit): Promise<LoginAuthenticationResponse>;
@@ -1929,7 +2201,7 @@ export declare class MedplumClient extends EventTarget_2 {
1929
2201
  * If the login request already includes a code challenge, it is returned.
1930
2202
  * Otherwise, a new PKCE code challenge is generated.
1931
2203
  * @category Authentication
1932
- * @param loginRequest The original login request.
2204
+ * @param loginRequest - The original login request.
1933
2205
  * @returns The PKCE code challenge and method.
1934
2206
  */
1935
2207
  ensureCodeChallenge<T extends BaseLoginRequest>(loginRequest: T): Promise<T>;
@@ -1944,7 +2216,7 @@ export declare class MedplumClient extends EventTarget_2 {
1944
2216
  * Returns true if the user is signed in.
1945
2217
  * This may result in navigating away to the sign in page.
1946
2218
  * @category Authentication
1947
- * @param loginParams Optional login parameters.
2219
+ * @param loginParams - Optional login parameters.
1948
2220
  * @returns The user profile resource if available.
1949
2221
  */
1950
2222
  signInWithRedirect(loginParams?: Partial<BaseLoginRequest>): Promise<ProfileResource | undefined>;
@@ -1956,36 +2228,38 @@ export declare class MedplumClient extends EventTarget_2 {
1956
2228
  signOutWithRedirect(): void;
1957
2229
  /**
1958
2230
  * Initiates sign in with an external identity provider.
1959
- * @param authorizeUrl The external authorization URL.
1960
- * @param clientId The external client ID.
1961
- * @param redirectUri The external identity provider redirect URI.
1962
- * @param baseLogin The Medplum login request.
2231
+ * @param authorizeUrl - The external authorization URL.
2232
+ * @param clientId - The external client ID.
2233
+ * @param redirectUri - The external identity provider redirect URI.
2234
+ * @param baseLogin - The Medplum login request.
2235
+ * @param pkceEnabled - Whether `PKCE` should be enabled for this external auth request. Defaults to `true`.
1963
2236
  * @category Authentication
1964
2237
  */
1965
- signInWithExternalAuth(authorizeUrl: string, clientId: string, redirectUri: string, baseLogin: BaseLoginRequest): Promise<void>;
2238
+ signInWithExternalAuth(authorizeUrl: string, clientId: string, redirectUri: string, baseLogin: BaseLoginRequest, pkceEnabled?: boolean): Promise<void>;
1966
2239
  /**
1967
2240
  * Exchange an external access token for a Medplum access token.
1968
- * @param token The access token that was generated by the external identity provider.
1969
- * @param clientId The ID of the `ClientApplication` in your Medplum project that will be making the exchange request.
2241
+ * @param token - The access token that was generated by the external identity provider.
2242
+ * @param clientId - The ID of the `ClientApplication` in your Medplum project that will be making the exchange request.
1970
2243
  * @returns The user profile resource.
1971
2244
  * @category Authentication
1972
2245
  */
1973
2246
  exchangeExternalAccessToken(token: string, clientId?: string): Promise<ProfileResource>;
1974
2247
  /**
1975
2248
  * Builds the external identity provider redirect URI.
1976
- * @param authorizeUrl The external authorization URL.
1977
- * @param clientId The external client ID.
1978
- * @param redirectUri The external identity provider redirect URI.
1979
- * @param loginRequest The Medplum login request.
2249
+ * @param authorizeUrl - The external authorization URL.
2250
+ * @param clientId - The external client ID.
2251
+ * @param redirectUri - The external identity provider redirect URI.
2252
+ * @param loginRequest - The Medplum login request.
2253
+ * @param pkceEnabled - Whether `PKCE` should be enabled for this external auth request. Defaults to `true`.
1980
2254
  * @returns The external identity provider redirect URI.
1981
2255
  * @category Authentication
1982
2256
  */
1983
- getExternalAuthRedirectUri(authorizeUrl: string, clientId: string, redirectUri: string, loginRequest: BaseLoginRequest): string;
2257
+ getExternalAuthRedirectUri(authorizeUrl: string, clientId: string, redirectUri: string, loginRequest: BaseLoginRequest, pkceEnabled?: boolean): string;
1984
2258
  /**
1985
2259
  * Builds a FHIR URL from a collection of URL path components.
1986
2260
  * For example, `buildUrl('/Patient', '123')` returns `fhir/R4/Patient/123`.
1987
2261
  * @category HTTP
1988
- * @param path The path component of the URL.
2262
+ * @param path - The path component of the URL.
1989
2263
  * @returns The well-formed FHIR URL.
1990
2264
  */
1991
2265
  fhirUrl(...path: string[]): URL;
@@ -1993,14 +2267,15 @@ export declare class MedplumClient extends EventTarget_2 {
1993
2267
  * Builds a FHIR search URL from a search query or structured query object.
1994
2268
  * @category HTTP
1995
2269
  * @category Search
1996
- * @param resourceType The FHIR resource type.
1997
- * @param query The FHIR search query or structured query object. Can be any valid input to the URLSearchParams() constructor.
2270
+ * @param resourceType - The FHIR resource type.
2271
+ * @param query - The FHIR search query or structured query object. Can be any valid input to the URLSearchParams() constructor.
1998
2272
  * @returns The well-formed FHIR URL.
1999
2273
  */
2000
2274
  fhirSearchUrl(resourceType: ResourceType, query: QueryTypes): URL;
2001
2275
  /**
2002
2276
  * Sends a FHIR search request.
2003
2277
  *
2278
+ * @example
2004
2279
  * Example using a FHIR search string:
2005
2280
  *
2006
2281
  * ```typescript
@@ -2008,6 +2283,7 @@ export declare class MedplumClient extends EventTarget_2 {
2008
2283
  * console.log(bundle);
2009
2284
  * ```
2010
2285
  *
2286
+ * @example
2011
2287
  * The return value is a FHIR bundle:
2012
2288
  *
2013
2289
  * ```json
@@ -2032,6 +2308,7 @@ export declare class MedplumClient extends EventTarget_2 {
2032
2308
  * }
2033
2309
  * ```
2034
2310
  *
2311
+ * @example
2035
2312
  * To query the count of a search, use the summary feature like so:
2036
2313
  *
2037
2314
  * ```typescript
@@ -2040,9 +2317,9 @@ export declare class MedplumClient extends EventTarget_2 {
2040
2317
  *
2041
2318
  * See FHIR search for full details: https://www.hl7.org/fhir/search.html
2042
2319
  * @category Search
2043
- * @param resourceType The FHIR resource type.
2044
- * @param query Optional FHIR search query or structured query object. Can be any valid input to the URLSearchParams() constructor.
2045
- * @param options Optional fetch options.
2320
+ * @param resourceType - The FHIR resource type.
2321
+ * @param query - Optional FHIR search query or structured query object. Can be any valid input to the URLSearchParams() constructor.
2322
+ * @param options - Optional fetch options.
2046
2323
  * @returns Promise to the search result bundle.
2047
2324
  */
2048
2325
  search<K extends ResourceType>(resourceType: K, query?: QueryTypes, options?: RequestInit): ReadablePromise<Bundle<ExtractResource<K>>>;
@@ -2051,6 +2328,7 @@ export declare class MedplumClient extends EventTarget_2 {
2051
2328
  *
2052
2329
  * This is a convenience method for `search()` that returns the first resource rather than a `Bundle`.
2053
2330
  *
2331
+ * @example
2054
2332
  * Example using a FHIR search string:
2055
2333
  *
2056
2334
  * ```typescript
@@ -2062,9 +2340,9 @@ export declare class MedplumClient extends EventTarget_2 {
2062
2340
  *
2063
2341
  * See FHIR search for full details: https://www.hl7.org/fhir/search.html
2064
2342
  * @category Search
2065
- * @param resourceType The FHIR resource type.
2066
- * @param query Optional FHIR search query or structured query object. Can be any valid input to the URLSearchParams() constructor.
2067
- * @param options Optional fetch options.
2343
+ * @param resourceType - The FHIR resource type.
2344
+ * @param query - Optional FHIR search query or structured query object. Can be any valid input to the URLSearchParams() constructor.
2345
+ * @param options - Optional fetch options.
2068
2346
  * @returns Promise to the first search result.
2069
2347
  */
2070
2348
  searchOne<K extends ResourceType>(resourceType: K, query?: QueryTypes, options?: RequestInit): ReadablePromise<ExtractResource<K> | undefined>;
@@ -2073,6 +2351,7 @@ export declare class MedplumClient extends EventTarget_2 {
2073
2351
  *
2074
2352
  * This is a convenience method for `search()` that returns the resources as an array rather than a `Bundle`.
2075
2353
  *
2354
+ * @example
2076
2355
  * Example using a FHIR search string:
2077
2356
  *
2078
2357
  * ```typescript
@@ -2084,9 +2363,9 @@ export declare class MedplumClient extends EventTarget_2 {
2084
2363
  *
2085
2364
  * See FHIR search for full details: https://www.hl7.org/fhir/search.html
2086
2365
  * @category Search
2087
- * @param resourceType The FHIR resource type.
2088
- * @param query Optional FHIR search query or structured query object. Can be any valid input to the URLSearchParams() constructor.
2089
- * @param options Optional fetch options.
2366
+ * @param resourceType - The FHIR resource type.
2367
+ * @param query - Optional FHIR search query or structured query object. Can be any valid input to the URLSearchParams() constructor.
2368
+ * @param options - Optional fetch options.
2090
2369
  * @returns Promise to the array of search results.
2091
2370
  */
2092
2371
  searchResources<K extends ResourceType>(resourceType: K, query?: QueryTypes, options?: RequestInit): ReadablePromise<ResourceArray<ExtractResource<K>>>;
@@ -2096,6 +2375,7 @@ export declare class MedplumClient extends EventTarget_2 {
2096
2375
  * over a series of FHIR search requests for paginated search results. Each iteration of the generator yields
2097
2376
  * the array of resources on each page.
2098
2377
  *
2378
+ * @example
2099
2379
  *
2100
2380
  * ```typescript
2101
2381
  * for await (const page of medplum.searchResourcePages('Patient', { _count: 10 })) {
@@ -2104,10 +2384,11 @@ export declare class MedplumClient extends EventTarget_2 {
2104
2384
  * }
2105
2385
  * }
2106
2386
  * ```
2387
+ *
2107
2388
  * @category Search
2108
- * @param resourceType The FHIR resource type.
2109
- * @param query Optional FHIR search query or structured query object. Can be any valid input to the URLSearchParams() constructor.
2110
- * @param options Optional fetch options.
2389
+ * @param resourceType - The FHIR resource type.
2390
+ * @param query - Optional FHIR search query or structured query object. Can be any valid input to the URLSearchParams() constructor.
2391
+ * @param options - Optional fetch options.
2111
2392
  * @yields An async generator, where each result is an array of resources for each page.
2112
2393
  */
2113
2394
  searchResourcePages<K extends ResourceType>(resourceType: K, query?: QueryTypes, options?: RequestInit): AsyncGenerator<ResourceArray<ExtractResource<K>>>;
@@ -2115,30 +2396,31 @@ export declare class MedplumClient extends EventTarget_2 {
2115
2396
  * Searches a ValueSet resource using the "expand" operation.
2116
2397
  * See: https://www.hl7.org/fhir/operation-valueset-expand.html
2117
2398
  * @category Search
2118
- * @param system The ValueSet system url.
2119
- * @param filter The search string.
2120
- * @param options Optional fetch options.
2399
+ * @param system - The ValueSet system url.
2400
+ * @param filter - The search string.
2401
+ * @param options - Optional fetch options.
2121
2402
  * @returns Promise to expanded ValueSet.
2122
2403
  */
2123
2404
  searchValueSet(system: string, filter: string, options?: RequestInit): ReadablePromise<ValueSet>;
2124
2405
  /**
2125
2406
  * Returns a cached resource if it is available.
2126
2407
  * @category Caching
2127
- * @param resourceType The FHIR resource type.
2128
- * @param id The FHIR resource ID.
2408
+ * @param resourceType - The FHIR resource type.
2409
+ * @param id - The FHIR resource ID.
2129
2410
  * @returns The resource if it is available in the cache; undefined otherwise.
2130
2411
  */
2131
2412
  getCached<K extends ResourceType>(resourceType: K, id: string): ExtractResource<K> | undefined;
2132
2413
  /**
2133
2414
  * Returns a cached resource if it is available.
2134
2415
  * @category Caching
2135
- * @param reference The FHIR reference.
2416
+ * @param reference - The FHIR reference.
2136
2417
  * @returns The resource if it is available in the cache; undefined otherwise.
2137
2418
  */
2138
2419
  getCachedReference<T extends Resource>(reference: Reference<T>): T | undefined;
2139
2420
  /**
2140
2421
  * Reads a resource by resource type and ID.
2141
2422
  *
2423
+ * @example
2142
2424
  * Example:
2143
2425
  *
2144
2426
  * ```typescript
@@ -2148,9 +2430,9 @@ export declare class MedplumClient extends EventTarget_2 {
2148
2430
  *
2149
2431
  * See the FHIR "read" operation for full details: https://www.hl7.org/fhir/http.html#read
2150
2432
  * @category Read
2151
- * @param resourceType The FHIR resource type.
2152
- * @param id The resource ID.
2153
- * @param options Optional fetch options.
2433
+ * @param resourceType - The FHIR resource type.
2434
+ * @param id - The resource ID.
2435
+ * @param options - Optional fetch options.
2154
2436
  * @returns The resource if available; undefined otherwise.
2155
2437
  */
2156
2438
  readResource<K extends ResourceType>(resourceType: K, id: string, options?: RequestInit): ReadablePromise<ExtractResource<K>>;
@@ -2159,6 +2441,7 @@ export declare class MedplumClient extends EventTarget_2 {
2159
2441
  *
2160
2442
  * This is a convenience method for `readResource()` that accepts a `Reference` object.
2161
2443
  *
2444
+ * @example
2162
2445
  * Example:
2163
2446
  *
2164
2447
  * ```typescript
@@ -2169,8 +2452,8 @@ export declare class MedplumClient extends EventTarget_2 {
2169
2452
  *
2170
2453
  * See the FHIR "read" operation for full details: https://www.hl7.org/fhir/http.html#read
2171
2454
  * @category Read
2172
- * @param reference The FHIR reference object.
2173
- * @param options Optional fetch options.
2455
+ * @param reference - The FHIR reference object.
2456
+ * @param options - Optional fetch options.
2174
2457
  * @returns The resource if available; undefined otherwise.
2175
2458
  */
2176
2459
  readReference<T extends Resource>(reference: Reference<T>, options?: RequestInit): ReadablePromise<T>;
@@ -2178,7 +2461,7 @@ export declare class MedplumClient extends EventTarget_2 {
2178
2461
  * Requests the schema for a resource type.
2179
2462
  * If the schema is already cached, the promise is resolved immediately.
2180
2463
  * @category Schema
2181
- * @param resourceType The FHIR resource type.
2464
+ * @param resourceType - The FHIR resource type.
2182
2465
  * @returns Promise to a schema with the requested resource type.
2183
2466
  */
2184
2467
  requestSchema(resourceType: string): Promise<void>;
@@ -2187,6 +2470,7 @@ export declare class MedplumClient extends EventTarget_2 {
2187
2470
  *
2188
2471
  * The return value is a bundle of all versions of the resource.
2189
2472
  *
2473
+ * @example
2190
2474
  * Example:
2191
2475
  *
2192
2476
  * ```typescript
@@ -2196,15 +2480,16 @@ export declare class MedplumClient extends EventTarget_2 {
2196
2480
  *
2197
2481
  * See the FHIR "history" operation for full details: https://www.hl7.org/fhir/http.html#history
2198
2482
  * @category Read
2199
- * @param resourceType The FHIR resource type.
2200
- * @param id The resource ID.
2201
- * @param options Optional fetch options.
2483
+ * @param resourceType - The FHIR resource type.
2484
+ * @param id - The resource ID.
2485
+ * @param options - Optional fetch options.
2202
2486
  * @returns Promise to the resource history.
2203
2487
  */
2204
2488
  readHistory<K extends ResourceType>(resourceType: K, id: string, options?: RequestInit): ReadablePromise<Bundle<ExtractResource<K>>>;
2205
2489
  /**
2206
2490
  * Reads a specific version of a resource by resource type, ID, and version ID.
2207
2491
  *
2492
+ * @example
2208
2493
  * Example:
2209
2494
  *
2210
2495
  * ```typescript
@@ -2214,16 +2499,17 @@ export declare class MedplumClient extends EventTarget_2 {
2214
2499
  *
2215
2500
  * See the FHIR "vread" operation for full details: https://www.hl7.org/fhir/http.html#vread
2216
2501
  * @category Read
2217
- * @param resourceType The FHIR resource type.
2218
- * @param id The resource ID.
2219
- * @param vid The version ID.
2220
- * @param options Optional fetch options.
2502
+ * @param resourceType - The FHIR resource type.
2503
+ * @param id - The resource ID.
2504
+ * @param vid - The version ID.
2505
+ * @param options - Optional fetch options.
2221
2506
  * @returns The resource if available; undefined otherwise.
2222
2507
  */
2223
2508
  readVersion<K extends ResourceType>(resourceType: K, id: string, vid: string, options?: RequestInit): ReadablePromise<ExtractResource<K>>;
2224
2509
  /**
2225
2510
  * Executes the Patient "everything" operation for a patient.
2226
2511
  *
2512
+ * @example
2227
2513
  * Example:
2228
2514
  *
2229
2515
  * ```typescript
@@ -2233,8 +2519,8 @@ export declare class MedplumClient extends EventTarget_2 {
2233
2519
  *
2234
2520
  * See the FHIR "patient-everything" operation for full details: https://hl7.org/fhir/operation-patient-everything.html
2235
2521
  * @category Read
2236
- * @param id The Patient Id
2237
- * @param options Optional fetch options.
2522
+ * @param id - The Patient Id
2523
+ * @param options - Optional fetch options.
2238
2524
  * @returns A Bundle of all Resources related to the Patient
2239
2525
  */
2240
2526
  readPatientEverything(id: string, options?: RequestInit): ReadablePromise<Bundle>;
@@ -2243,6 +2529,7 @@ export declare class MedplumClient extends EventTarget_2 {
2243
2529
  *
2244
2530
  * The return value is the newly created resource, including the ID and meta.
2245
2531
  *
2532
+ * @example
2246
2533
  * Example:
2247
2534
  *
2248
2535
  * ```typescript
@@ -2258,8 +2545,8 @@ export declare class MedplumClient extends EventTarget_2 {
2258
2545
  *
2259
2546
  * See the FHIR "create" operation for full details: https://www.hl7.org/fhir/http.html#create
2260
2547
  * @category Create
2261
- * @param resource The FHIR resource to create.
2262
- * @param options Optional fetch options.
2548
+ * @param resource - The FHIR resource to create.
2549
+ * @param options - Optional fetch options.
2263
2550
  * @returns The result of the create operation.
2264
2551
  */
2265
2552
  createResource<T extends Resource>(resource: T, options?: RequestInit): Promise<T>;
@@ -2268,6 +2555,7 @@ export declare class MedplumClient extends EventTarget_2 {
2268
2555
  *
2269
2556
  * The return value is the existing resource or the newly created resource, including the ID and meta.
2270
2557
  *
2558
+ * @example
2271
2559
  * Example:
2272
2560
  *
2273
2561
  * ```typescript
@@ -2298,9 +2586,9 @@ export declare class MedplumClient extends EventTarget_2 {
2298
2586
  *
2299
2587
  * See the FHIR "conditional create" operation for full details: https://www.hl7.org/fhir/http.html#ccreate
2300
2588
  * @category Create
2301
- * @param resource The FHIR resource to create.
2302
- * @param query The search query for an equivalent resource (should not include resource type or "?").
2303
- * @param options Optional fetch options.
2589
+ * @param resource - The FHIR resource to create.
2590
+ * @param query - The search query for an equivalent resource (should not include resource type or "?").
2591
+ * @param options - Optional fetch options.
2304
2592
  * @returns The result of the create operation.
2305
2593
  */
2306
2594
  createResourceIfNoneExist<T extends Resource>(resource: T, query: string, options?: RequestInit): Promise<T>;
@@ -2313,6 +2601,7 @@ export declare class MedplumClient extends EventTarget_2 {
2313
2601
  *
2314
2602
  * A `File` object often comes from a `<input type="file">` element.
2315
2603
  *
2604
+ * @example
2316
2605
  * Example:
2317
2606
  *
2318
2607
  * ```typescript
@@ -2322,10 +2611,10 @@ export declare class MedplumClient extends EventTarget_2 {
2322
2611
  *
2323
2612
  * See the FHIR "create" operation for full details: https://www.hl7.org/fhir/http.html#create
2324
2613
  * @category Create
2325
- * @param data The binary data to upload.
2326
- * @param filename Optional filename for the binary.
2327
- * @param contentType Content type for the binary.
2328
- * @param onProgress Optional callback for progress events.
2614
+ * @param data - The binary data to upload.
2615
+ * @param filename - Optional filename for the binary.
2616
+ * @param contentType - Content type for the binary.
2617
+ * @param onProgress - Optional callback for progress events.
2329
2618
  * @returns The result of the create operation.
2330
2619
  */
2331
2620
  createAttachment(data: BinarySource, filename: string | undefined, contentType: string, onProgress?: (e: ProgressEvent) => void): Promise<Attachment>;
@@ -2338,6 +2627,7 @@ export declare class MedplumClient extends EventTarget_2 {
2338
2627
  *
2339
2628
  * A `File` object often comes from a `<input type="file">` element.
2340
2629
  *
2630
+ * @example
2341
2631
  * Example:
2342
2632
  *
2343
2633
  * ```typescript
@@ -2347,10 +2637,10 @@ export declare class MedplumClient extends EventTarget_2 {
2347
2637
  *
2348
2638
  * See the FHIR "create" operation for full details: https://www.hl7.org/fhir/http.html#create
2349
2639
  * @category Create
2350
- * @param data The binary data to upload.
2351
- * @param filename Optional filename for the binary.
2352
- * @param contentType Content type for the binary.
2353
- * @param onProgress Optional callback for progress events.
2640
+ * @param data - The binary data to upload.
2641
+ * @param filename - Optional filename for the binary.
2642
+ * @param contentType - Content type for the binary.
2643
+ * @param onProgress - Optional callback for progress events.
2354
2644
  * @returns The result of the create operation.
2355
2645
  */
2356
2646
  createBinary(data: BinarySource, filename: string | undefined, contentType: string, onProgress?: (e: ProgressEvent) => void): Promise<Binary>;
@@ -2362,6 +2652,7 @@ export declare class MedplumClient extends EventTarget_2 {
2362
2652
  *
2363
2653
  * The `docDefinition` parameter is a pdfmake document definition.
2364
2654
  *
2655
+ * @example
2365
2656
  * Example:
2366
2657
  *
2367
2658
  * ```typescript
@@ -2373,10 +2664,10 @@ export declare class MedplumClient extends EventTarget_2 {
2373
2664
  *
2374
2665
  * See the pdfmake document definition for full details: https://pdfmake.github.io/docs/0.1/document-definition-object/
2375
2666
  * @category Media
2376
- * @param docDefinition The PDF document definition.
2377
- * @param filename Optional filename for the PDF binary resource.
2378
- * @param tableLayouts Optional pdfmake custom table layout.
2379
- * @param fonts Optional pdfmake custom font dictionary.
2667
+ * @param docDefinition - The PDF document definition.
2668
+ * @param filename - Optional filename for the PDF binary resource.
2669
+ * @param tableLayouts - Optional pdfmake custom table layout.
2670
+ * @param fonts - Optional pdfmake custom font dictionary.
2380
2671
  * @returns The result of the create operation.
2381
2672
  */
2382
2673
  createPdf(docDefinition: TDocumentDefinitions, filename?: string, tableLayouts?: Record<string, CustomTableLayout>, fonts?: TFontDictionary): Promise<Binary>;
@@ -2385,9 +2676,9 @@ export declare class MedplumClient extends EventTarget_2 {
2385
2676
  *
2386
2677
  * This is a convenience method to handle commmon cases where a `Communication` resource is created with a `payload`.
2387
2678
  * @category Create
2388
- * @param resource The FHIR resource to comment on.
2389
- * @param text The text of the comment.
2390
- * @param options Optional fetch options.
2679
+ * @param resource - The FHIR resource to comment on.
2680
+ * @param text - The text of the comment.
2681
+ * @param options - Optional fetch options.
2391
2682
  * @returns The result of the create operation.
2392
2683
  */
2393
2684
  createComment(resource: Resource, text: string, options?: RequestInit): Promise<Communication>;
@@ -2396,6 +2687,7 @@ export declare class MedplumClient extends EventTarget_2 {
2396
2687
  *
2397
2688
  * The return value is the updated resource, including the ID and meta.
2398
2689
  *
2690
+ * @example
2399
2691
  * Example:
2400
2692
  *
2401
2693
  * ```typescript
@@ -2412,8 +2704,8 @@ export declare class MedplumClient extends EventTarget_2 {
2412
2704
  *
2413
2705
  * See the FHIR "update" operation for full details: https://www.hl7.org/fhir/http.html#update
2414
2706
  * @category Write
2415
- * @param resource The FHIR resource to update.
2416
- * @param options Optional fetch options.
2707
+ * @param resource - The FHIR resource to update.
2708
+ * @param options - Optional fetch options.
2417
2709
  * @returns The result of the update operation.
2418
2710
  */
2419
2711
  updateResource<T extends Resource>(resource: T, options?: RequestInit): Promise<T>;
@@ -2422,6 +2714,7 @@ export declare class MedplumClient extends EventTarget_2 {
2422
2714
  *
2423
2715
  * The return value is the updated resource, including the ID and meta.
2424
2716
  *
2717
+ * @example
2425
2718
  * Example:
2426
2719
  *
2427
2720
  * ```typescript
@@ -2435,16 +2728,17 @@ export declare class MedplumClient extends EventTarget_2 {
2435
2728
  *
2436
2729
  * See the JSONPatch specification for full details: https://tools.ietf.org/html/rfc6902
2437
2730
  * @category Write
2438
- * @param resourceType The FHIR resource type.
2439
- * @param id The resource ID.
2440
- * @param operations The JSONPatch operations.
2441
- * @param options Optional fetch options.
2731
+ * @param resourceType - The FHIR resource type.
2732
+ * @param id - The resource ID.
2733
+ * @param operations - The JSONPatch operations.
2734
+ * @param options - Optional fetch options.
2442
2735
  * @returns The result of the patch operations.
2443
2736
  */
2444
2737
  patchResource<K extends ResourceType>(resourceType: K, id: string, operations: PatchOperation[], options?: RequestInit): Promise<ExtractResource<K>>;
2445
2738
  /**
2446
2739
  * Deletes a FHIR resource by resource type and ID.
2447
2740
  *
2741
+ * @example
2448
2742
  * Example:
2449
2743
  *
2450
2744
  * ```typescript
@@ -2453,15 +2747,16 @@ export declare class MedplumClient extends EventTarget_2 {
2453
2747
  *
2454
2748
  * See the FHIR "delete" operation for full details: https://www.hl7.org/fhir/http.html#delete
2455
2749
  * @category Delete
2456
- * @param resourceType The FHIR resource type.
2457
- * @param id The resource ID.
2458
- * @param options Optional fetch options.
2750
+ * @param resourceType - The FHIR resource type.
2751
+ * @param id - The resource ID.
2752
+ * @param options - Optional fetch options.
2459
2753
  * @returns The result of the delete operation.
2460
2754
  */
2461
2755
  deleteResource(resourceType: ResourceType, id: string, options?: RequestInit): Promise<any>;
2462
2756
  /**
2463
2757
  * Executes the validate operation with the provided resource.
2464
2758
  *
2759
+ * @example
2465
2760
  * Example:
2466
2761
  *
2467
2762
  * ```typescript
@@ -2472,23 +2767,24 @@ export declare class MedplumClient extends EventTarget_2 {
2472
2767
  * ```
2473
2768
  *
2474
2769
  * See the FHIR "$validate" operation for full details: https://www.hl7.org/fhir/resource-operation-validate.html
2475
- * @param resource The FHIR resource.
2476
- * @param options Optional fetch options.
2770
+ * @param resource - The FHIR resource.
2771
+ * @param options - Optional fetch options.
2477
2772
  * @returns The validate operation outcome.
2478
2773
  */
2479
2774
  validateResource<T extends Resource>(resource: T, options?: RequestInit): Promise<OperationOutcome>;
2480
2775
  /**
2481
2776
  * Executes a bot by ID or Identifier.
2482
- * @param idOrIdentifier The Bot ID or Identifier.
2483
- * @param body The content body. Strings and `File` objects are passed directly. Other objects are converted to JSON.
2484
- * @param contentType The content type to be included in the "Content-Type" header.
2485
- * @param options Optional fetch options.
2777
+ * @param idOrIdentifier - The Bot ID or Identifier.
2778
+ * @param body - The content body. Strings and `File` objects are passed directly. Other objects are converted to JSON.
2779
+ * @param contentType - The content type to be included in the "Content-Type" header.
2780
+ * @param options - Optional fetch options.
2486
2781
  * @returns The Bot return value.
2487
2782
  */
2488
2783
  executeBot(idOrIdentifier: string | Identifier, body: any, contentType?: string, options?: RequestInit): Promise<any>;
2489
2784
  /**
2490
2785
  * Executes a batch or transaction of FHIR operations.
2491
2786
  *
2787
+ * @example
2492
2788
  * Example:
2493
2789
  *
2494
2790
  * ```typescript
@@ -2530,8 +2826,8 @@ export declare class MedplumClient extends EventTarget_2 {
2530
2826
  *
2531
2827
  * See The FHIR "batch/transaction" section for full details: https://hl7.org/fhir/http.html#transaction
2532
2828
  * @category Batch
2533
- * @param bundle The FHIR batch/transaction bundle.
2534
- * @param options Optional fetch options.
2829
+ * @param bundle - The FHIR batch/transaction bundle.
2830
+ * @param options - Optional fetch options.
2535
2831
  * @returns The FHIR batch/transaction response bundle.
2536
2832
  */
2537
2833
  executeBatch(bundle: Bundle, options?: RequestInit): Promise<Bundle>;
@@ -2542,6 +2838,7 @@ export declare class MedplumClient extends EventTarget_2 {
2542
2838
  *
2543
2839
  * Examples:
2544
2840
  *
2841
+ * @example
2545
2842
  * Send a simple text email:
2546
2843
  *
2547
2844
  * ```typescript
@@ -2553,6 +2850,7 @@ export declare class MedplumClient extends EventTarget_2 {
2553
2850
  * });
2554
2851
  * ```
2555
2852
  *
2853
+ * @example
2556
2854
  * Send an email with a `Binary` attachment:
2557
2855
  *
2558
2856
  * ```typescript
@@ -2569,14 +2867,15 @@ export declare class MedplumClient extends EventTarget_2 {
2569
2867
  *
2570
2868
  * See options here: https://nodemailer.com/extras/mailcomposer/
2571
2869
  * @category Media
2572
- * @param email The MailComposer options.
2573
- * @param options Optional fetch options.
2870
+ * @param email - The MailComposer options.
2871
+ * @param options - Optional fetch options.
2574
2872
  * @returns Promise to the operation outcome.
2575
2873
  */
2576
2874
  sendEmail(email: MailOptions, options?: RequestInit): Promise<OperationOutcome>;
2577
2875
  /**
2578
2876
  * Executes a GraphQL query.
2579
2877
  *
2878
+ * @example
2580
2879
  * Example:
2581
2880
  *
2582
2881
  * ```typescript
@@ -2592,6 +2891,7 @@ export declare class MedplumClient extends EventTarget_2 {
2592
2891
  * }`);
2593
2892
  * ```
2594
2893
  *
2894
+ * @example
2595
2895
  * Advanced queries such as named operations and variable substitution are supported:
2596
2896
  *
2597
2897
  * ```typescript
@@ -2615,10 +2915,10 @@ export declare class MedplumClient extends EventTarget_2 {
2615
2915
  *
2616
2916
  * See the FHIR GraphQL documentation for FHIR specific details: https://www.hl7.org/fhir/graphql.html
2617
2917
  * @category Read
2618
- * @param query The GraphQL query.
2619
- * @param operationName Optional GraphQL operation name.
2620
- * @param variables Optional GraphQL variables.
2621
- * @param options Optional fetch options.
2918
+ * @param query - The GraphQL query.
2919
+ * @param operationName - Optional GraphQL operation name.
2920
+ * @param variables - Optional GraphQL variables.
2921
+ * @param options - Optional fetch options.
2622
2922
  * @returns The GraphQL result.
2623
2923
  */
2624
2924
  graphql(query: string, operationName?: string | null, variables?: any, options?: RequestInit): Promise<any>;
@@ -2626,21 +2926,21 @@ export declare class MedplumClient extends EventTarget_2 {
2626
2926
  * Executes the $graph operation on this resource to fetch a Bundle of resources linked to the target resource
2627
2927
  * according to a graph definition
2628
2928
  * @category Read
2629
- * @param resourceType The FHIR resource type.
2630
- * @param id The resource ID.
2631
- * @param graphName `name` parameter of the GraphDefinition
2632
- * @param options Optional fetch options.
2929
+ * @param resourceType - The FHIR resource type.
2930
+ * @param id - The resource ID.
2931
+ * @param graphName - `name` parameter of the GraphDefinition
2932
+ * @param options - Optional fetch options.
2633
2933
  * @returns A Bundle
2634
2934
  */
2635
2935
  readResourceGraph<K extends ResourceType>(resourceType: K, id: string, graphName: string, options?: RequestInit): ReadablePromise<Bundle>;
2636
2936
  /**
2637
2937
  * Pushes a message to an agent.
2638
2938
  *
2639
- * @param agent The agent to push to.
2640
- * @param destination The destination device.
2641
- * @param body The message body.
2642
- * @param contentType Optional message content type.
2643
- * @param options Optional fetch options.
2939
+ * @param agent - The agent to push to.
2940
+ * @param destination - The destination device.
2941
+ * @param body - The message body.
2942
+ * @param contentType - Optional message content type.
2943
+ * @param options - Optional fetch options.
2644
2944
  * @returns Promise to the operation outcome.
2645
2945
  */
2646
2946
  pushToAgent(agent: Agent | Reference<Agent>, destination: Device | Reference<Device>, body: any, contentType?: string, options?: RequestInit): Promise<OperationOutcome>;
@@ -2651,7 +2951,7 @@ export declare class MedplumClient extends EventTarget_2 {
2651
2951
  getActiveLogin(): LoginState | undefined;
2652
2952
  /**
2653
2953
  * Sets the active login.
2654
- * @param login The new active login state.
2954
+ * @param login - The new active login state.
2655
2955
  * @category Authentication
2656
2956
  */
2657
2957
  setActiveLogin(login: LoginState): Promise<void>;
@@ -2663,8 +2963,8 @@ export declare class MedplumClient extends EventTarget_2 {
2663
2963
  getAccessToken(): string | undefined;
2664
2964
  /**
2665
2965
  * Sets the current access token.
2666
- * @param accessToken The new access token.
2667
- * @param refreshToken Optional refresh token.
2966
+ * @param accessToken - The new access token.
2967
+ * @param refreshToken - Optional refresh token.
2668
2968
  * @category Authentication
2669
2969
  */
2670
2970
  setAccessToken(accessToken: string, refreshToken?: string): void;
@@ -2735,68 +3035,68 @@ export declare class MedplumClient extends EventTarget_2 {
2735
3035
  /**
2736
3036
  * Downloads the URL as a blob. Can accept binary URLs in the form of `Binary/{id}` as well.
2737
3037
  * @category Read
2738
- * @param url The URL to request. Can be a standard URL or one in the form of `Binary/{id}`.
2739
- * @param options Optional fetch request init options.
3038
+ * @param url - The URL to request. Can be a standard URL or one in the form of `Binary/{id}`.
3039
+ * @param options - Optional fetch request init options.
2740
3040
  * @returns Promise to the response body as a blob.
2741
3041
  */
2742
3042
  download(url: URL | string, options?: RequestInit): Promise<Blob>;
2743
3043
  /**
2744
3044
  * Upload media to the server and create a Media instance for the uploaded content.
2745
- * @param contents The contents of the media file, as a string, Uint8Array, File, or Blob.
2746
- * @param contentType The media type of the content.
2747
- * @param filename The name of the file to be uploaded, or undefined if not applicable.
2748
- * @param additionalFields Additional fields for Media.
2749
- * @param options Optional fetch options.
3045
+ * @param contents - The contents of the media file, as a string, Uint8Array, File, or Blob.
3046
+ * @param contentType - The media type of the content.
3047
+ * @param filename - The name of the file to be uploaded, or undefined if not applicable.
3048
+ * @param additionalFields - Additional fields for Media.
3049
+ * @param options - Optional fetch options.
2750
3050
  * @returns Promise that resolves to the created Media
2751
3051
  */
2752
3052
  uploadMedia(contents: string | Uint8Array | File | Blob, contentType: string, filename: string | undefined, additionalFields?: Partial<Media>, options?: RequestInit): Promise<Media>;
2753
3053
  /**
2754
3054
  * Performs Bulk Data Export operation request flow. See The FHIR "Bulk Data Export" for full details: https://build.fhir.org/ig/HL7/bulk-data/export.html#bulk-data-export
2755
- * @param exportLevel Optional export level. Defaults to system level export. 'Group/:id' - Group of Patients, 'Patient' - All Patients.
2756
- * @param resourceTypes A string of comma-delimited FHIR resource types.
2757
- * @param since Resources will be included in the response if their state has changed after the supplied time (e.g. if Resource.meta.lastUpdated is later than the supplied _since time).
2758
- * @param options Optional fetch options.
3055
+ * @param exportLevel - Optional export level. Defaults to system level export. 'Group/:id' - Group of Patients, 'Patient' - All Patients.
3056
+ * @param resourceTypes - A string of comma-delimited FHIR resource types.
3057
+ * @param since - Resources will be included in the response if their state has changed after the supplied time (e.g. if Resource.meta.lastUpdated is later than the supplied _since time).
3058
+ * @param options - Optional fetch options.
2759
3059
  * @returns Bulk Data Response containing links to Bulk Data files. See "Response - Complete Status" for full details: https://build.fhir.org/ig/HL7/bulk-data/export.html#response---complete-status
2760
3060
  */
2761
3061
  bulkExport(exportLevel?: string, resourceTypes?: string, since?: string, options?: RequestInit): Promise<Partial<BulkDataExport>>;
2762
3062
  /**
2763
3063
  * Starts an async request following the FHIR "Asynchronous Request Pattern".
2764
3064
  * See: https://hl7.org/fhir/r4/async.html
2765
- * @param url The URL to request.
2766
- * @param options Optional fetch options.
3065
+ * @param url - The URL to request.
3066
+ * @param options - Optional fetch options.
2767
3067
  * @returns The response body.
2768
3068
  */
2769
3069
  startAsyncRequest<T>(url: string, options?: RequestInit): Promise<T>;
2770
3070
  /**
2771
3071
  * Returns the cache entry if available and not expired.
2772
- * @param key The cache key to retrieve.
2773
- * @param options Optional fetch options for cache settings.
3072
+ * @param key - The cache key to retrieve.
3073
+ * @param options - Optional fetch options for cache settings.
2774
3074
  * @returns The cached entry if found.
2775
3075
  */
2776
3076
  private getCacheEntry;
2777
3077
  /**
2778
3078
  * Adds a readable promise to the cache.
2779
- * @param key The cache key to store.
2780
- * @param value The readable promise to store.
3079
+ * @param key - The cache key to store.
3080
+ * @param value - The readable promise to store.
2781
3081
  */
2782
3082
  private setCacheEntry;
2783
3083
  /**
2784
3084
  * Adds a concrete value as the cache entry for the given resource.
2785
3085
  * This is used in cases where the resource is loaded indirectly.
2786
3086
  * For example, when a resource is loaded as part of a Bundle.
2787
- * @param resource The resource to cache.
3087
+ * @param resource - The resource to cache.
2788
3088
  */
2789
3089
  private cacheResource;
2790
3090
  /**
2791
3091
  * Deletes a cache entry.
2792
- * @param key The cache key to delete.
3092
+ * @param key - The cache key to delete.
2793
3093
  */
2794
3094
  private deleteCacheEntry;
2795
3095
  /**
2796
3096
  * Makes an HTTP request.
2797
- * @param method The HTTP method (GET, POST, etc).
2798
- * @param url The target URL.
2799
- * @param options Optional fetch request init options.
3097
+ * @param method - The HTTP method (GET, POST, etc).
3098
+ * @param url - The target URL.
3099
+ * @param options - Optional fetch request init options.
2800
3100
  * @returns The JSON content body if available.
2801
3101
  */
2802
3102
  private request;
@@ -2811,28 +3111,28 @@ export declare class MedplumClient extends EventTarget_2 {
2811
3111
  private executeAutoBatch;
2812
3112
  /**
2813
3113
  * Adds default options to the fetch options.
2814
- * @param options The options to add defaults to.
3114
+ * @param options - The options to add defaults to.
2815
3115
  */
2816
3116
  private addFetchOptionsDefaults;
2817
3117
  /**
2818
3118
  * Sets the "Content-Type" header on fetch options.
2819
- * @param options The fetch options.
2820
- * @param contentType The new content type to set.
3119
+ * @param options - The fetch options.
3120
+ * @param contentType - The new content type to set.
2821
3121
  */
2822
3122
  private setRequestContentType;
2823
3123
  /**
2824
3124
  * Sets the body on fetch options.
2825
- * @param options The fetch options.
2826
- * @param data The new content body.
3125
+ * @param options - The fetch options.
3126
+ * @param data - The new content body.
2827
3127
  */
2828
3128
  private setRequestBody;
2829
3129
  /**
2830
3130
  * Handles an unauthenticated response from the server.
2831
3131
  * First, tries to refresh the access token and retry the request.
2832
3132
  * Otherwise, calls unauthenticated callbacks and rejects.
2833
- * @param method The HTTP method of the original request.
2834
- * @param url The URL of the original request.
2835
- * @param options Optional fetch request init options.
3133
+ * @param method - The HTTP method of the original request.
3134
+ * @param url - The URL of the original request.
3135
+ * @param options - Optional fetch request init options.
2836
3136
  * @returns The result of the retry.
2837
3137
  */
2838
3138
  private handleUnauthenticated;
@@ -2849,15 +3149,15 @@ export declare class MedplumClient extends EventTarget_2 {
2849
3149
  /**
2850
3150
  * Redirects the user to the login screen for authorization.
2851
3151
  * Clears all auth state including local storage and session storage.
2852
- * @param loginParams The authorization login parameters.
3152
+ * @param loginParams - The authorization login parameters.
2853
3153
  * @see https://openid.net/specs/openid-connect-core-1_0.html#AuthorizationEndpoint
2854
3154
  */
2855
3155
  private requestAuthorization;
2856
3156
  /**
2857
3157
  * Processes an OAuth authorization code.
2858
3158
  * See: https://openid.net/specs/openid-connect-core-1_0.html#TokenRequest
2859
- * @param code The authorization code received by URL parameter.
2860
- * @param loginParams Optional login parameters.
3159
+ * @param code - The authorization code received by URL parameter.
3160
+ * @param loginParams - Optional login parameters.
2861
3161
  * @returns The user profile resource.
2862
3162
  * @category Authentication
2863
3163
  */
@@ -2871,6 +3171,7 @@ export declare class MedplumClient extends EventTarget_2 {
2871
3171
  /**
2872
3172
  * Starts a new OAuth2 client credentials flow.
2873
3173
  *
3174
+ * @example
2874
3175
  * ```typescript
2875
3176
  * await medplum.startClientLogin(process.env.MEDPLUM_CLIENT_ID, process.env.MEDPLUM_CLIENT_SECRET)
2876
3177
  * // Example Search
@@ -2880,14 +3181,15 @@ export declare class MedplumClient extends EventTarget_2 {
2880
3181
  * See: https://datatracker.ietf.org/doc/html/rfc6749#section-4.4
2881
3182
  *
2882
3183
  * @category Authentication
2883
- * @param clientId The client ID.
2884
- * @param clientSecret The client secret.
3184
+ * @param clientId - The client ID.
3185
+ * @param clientSecret - The client secret.
2885
3186
  * @returns Promise that resolves to the client profile.
2886
3187
  */
2887
3188
  startClientLogin(clientId: string, clientSecret: string): Promise<ProfileResource>;
2888
3189
  /**
2889
3190
  * Starts a new OAuth2 JWT bearer flow.
2890
3191
  *
3192
+ * @example
2891
3193
  * ```typescript
2892
3194
  * await medplum.startJwtBearerLogin(process.env.MEDPLUM_CLIENT_ID, process.env.MEDPLUM_JWT_BEARER_ASSERTION, 'openid profile');
2893
3195
  * // Example Search
@@ -2897,9 +3199,9 @@ export declare class MedplumClient extends EventTarget_2 {
2897
3199
  * See: https://datatracker.ietf.org/doc/html/rfc7523#section-2.1
2898
3200
  *
2899
3201
  * @category Authentication
2900
- * @param clientId The client ID.
2901
- * @param assertion The JWT assertion.
2902
- * @param scope The OAuth scope.
3202
+ * @param clientId - The client ID.
3203
+ * @param assertion - The JWT assertion.
3204
+ * @param scope - The OAuth scope.
2903
3205
  * @returns Promise that resolves to the client profile.
2904
3206
  */
2905
3207
  startJwtBearerLogin(clientId: string, assertion: string, scope: string): Promise<ProfileResource>;
@@ -2909,21 +3211,23 @@ export declare class MedplumClient extends EventTarget_2 {
2909
3211
  * See: https://datatracker.ietf.org/doc/html/rfc7523#section-2.2
2910
3212
  *
2911
3213
  * @category Authentication
2912
- * @param jwt The JWT assertion.
3214
+ * @param jwt - The JWT assertion.
2913
3215
  * @returns Promise that resolves to the client profile.
2914
3216
  */
2915
3217
  startJwtAssertionLogin(jwt: string): Promise<ProfileResource>;
2916
3218
  /**
2917
3219
  * Sets the client ID and secret for basic auth.
2918
3220
  *
2919
- * ```typescript
2920
- * medplum.setBasicAuth(process.env.MEDPLUM_CLIENT_ID, process.env.MEDPLUM_CLIENT_SECRET)
3221
+ * @example
3222
+ * ```typescript
3223
+ * medplum.setBasicAuth(process.env.MEDPLUM_CLIENT_ID, process.env.MEDPLUM_CLIENT_SECRET);
2921
3224
  * // Example Search
2922
- * await medplum.searchResources('Patient')
3225
+ * await medplum.searchResources('Patient');
2923
3226
  * ```
3227
+ *
2924
3228
  * @category Authentication
2925
- * @param clientId The client ID.
2926
- * @param clientSecret The client secret.
3229
+ * @param clientId - The client ID.
3230
+ * @param clientSecret - The client secret.
2927
3231
  */
2928
3232
  setBasicAuth(clientId: string, clientSecret: string): void;
2929
3233
  /**
@@ -2932,8 +3236,8 @@ export declare class MedplumClient extends EventTarget_2 {
2932
3236
  * Once you have the `SubscriptionRequest` returned from this method, you can call `fhircastConnect(subscriptionRequest)` to connect to the subscription stream.
2933
3237
  *
2934
3238
  * @category FHIRcast
2935
- * @param topic The topic to publish to. Usually a UUID.
2936
- * @param events An array of event names to listen for.
3239
+ * @param topic - The topic to publish to. Usually a UUID.
3240
+ * @param events - An array of event names to listen for.
2937
3241
  * @returns A `Promise` that resolves once the request completes, or rejects if it fails.
2938
3242
  */
2939
3243
  fhircastSubscribe(topic: string, events: FhircastEventName[]): Promise<SubscriptionRequest>;
@@ -2941,7 +3245,7 @@ export declare class MedplumClient extends EventTarget_2 {
2941
3245
  * Unsubscribes from the specified topic.
2942
3246
  *
2943
3247
  * @category FHIRcast
2944
- * @param subRequest A `SubscriptionRequest` representing a subscription to cancel. Mode will be set to `unsubscribe` automatically.
3248
+ * @param subRequest - A `SubscriptionRequest` representing a subscription to cancel. Mode will be set to `unsubscribe` automatically.
2945
3249
  * @returns A `Promise` that resolves when request to unsubscribe is completed.
2946
3250
  */
2947
3251
  fhircastUnsubscribe(subRequest: SubscriptionRequest): Promise<void>;
@@ -2949,7 +3253,7 @@ export declare class MedplumClient extends EventTarget_2 {
2949
3253
  * Connects to a `FHIRcast` session.
2950
3254
  *
2951
3255
  * @category FHIRcast
2952
- * @param subRequest The `SubscriptionRequest` to use for connecting.
3256
+ * @param subRequest - The `SubscriptionRequest` to use for connecting.
2953
3257
  * @returns A `FhircastConnection` which emits lifecycle events for the `FHIRcast` WebSocket connection.
2954
3258
  */
2955
3259
  fhircastConnect(subRequest: SubscriptionRequest): FhircastConnection;
@@ -2957,23 +3261,25 @@ export declare class MedplumClient extends EventTarget_2 {
2957
3261
  * Publishes a new context to a given topic for a specified event type.
2958
3262
  *
2959
3263
  * @category FHIRcast
2960
- * @param topic The topic to publish to. Usually a UUID.
2961
- * @param event The name of the event to publish an updated context for, ie. `patient-open`.
2962
- * @param context The updated context containing resources relevant to this event.
3264
+ * @param topic - The topic to publish to. Usually a UUID.
3265
+ * @param event - The name of the event to publish an updated context for, ie. `Patient-open`.
3266
+ * @param context - The updated context containing resources relevant to this event.
3267
+ * @param versionId - The `versionId` of the `anchor context` of the given event. Used for `DiagnosticReport-update` event.
2963
3268
  * @returns A `Promise` that resolves once the request completes, or rejects if it fails.
2964
3269
  */
2965
- fhircastPublish(topic: string, event: FhircastEventName, context: FhircastEventContext | FhircastEventContext[]): Promise<void>;
3270
+ fhircastPublish<EventName extends FhircastEventVersionOptional>(topic: string, event: EventName, context: FhircastEventContext<EventName> | FhircastEventContext<EventName>[], versionId?: never): Promise<void>;
3271
+ fhircastPublish<RequiredVersionEvent extends FhircastEventVersionRequired>(topic: string, event: RequiredVersionEvent, context: FhircastEventContext<RequiredVersionEvent> | FhircastEventContext<RequiredVersionEvent>[], versionId: string): Promise<void>;
2966
3272
  /**
2967
3273
  * Invite a user to a project.
2968
- * @param projectId The project ID.
2969
- * @param body The InviteRequest.
3274
+ * @param projectId - The project ID.
3275
+ * @param body - The InviteRequest.
2970
3276
  * @returns Promise that returns a project membership or an operation outcome.
2971
3277
  */
2972
3278
  invite(projectId: string, body: InviteRequest): Promise<ProjectMembership | OperationOutcome>;
2973
3279
  /**
2974
3280
  * Makes a POST request to the tokens endpoint.
2975
3281
  * See: https://openid.net/specs/openid-connect-core-1_0.html#TokenEndpoint
2976
- * @param formBody Token parameters in URL encoded format.
3282
+ * @param formBody - Token parameters in URL encoded format.
2977
3283
  * @returns The user profile resource.
2978
3284
  */
2979
3285
  private fetchTokens;
@@ -2981,7 +3287,7 @@ export declare class MedplumClient extends EventTarget_2 {
2981
3287
  * Verifies the tokens received from the auth server.
2982
3288
  * Validates the JWT against the JWKS.
2983
3289
  * See: https://openid.net/specs/openid-connect-core-1_0.html#TokenEndpoint
2984
- * @param tokens The token response.
3290
+ * @param tokens - The token response.
2985
3291
  * @returns Promise to complete.
2986
3292
  */
2987
3293
  private verifyTokens;
@@ -3112,6 +3418,7 @@ export declare interface MedplumClientOptions {
3112
3418
  *
3113
3419
  * Default is none, and PDF generation is disabled.
3114
3420
  *
3421
+ * @example
3115
3422
  * In browser environments, import the client-side pdfmake library.
3116
3423
  *
3117
3424
  * ```html
@@ -3125,6 +3432,7 @@ export declare interface MedplumClientOptions {
3125
3432
  * </script>
3126
3433
  * ```
3127
3434
  *
3435
+ * @example
3128
3436
  * In Node.js applications:
3129
3437
  *
3130
3438
  * ```ts
@@ -3302,24 +3610,24 @@ export declare class MemoryStorage implements Storage {
3302
3610
  clear(): void;
3303
3611
  /**
3304
3612
  * Returns the current value associated with the given key, or null if the given key does not exist.
3305
- * @param key The specified storage key.
3613
+ * @param key - The specified storage key.
3306
3614
  * @returns The current value associated with the given key, or null if the given key does not exist.
3307
3615
  */
3308
3616
  getItem(key: string): string | null;
3309
3617
  /**
3310
3618
  * Sets the value of the pair identified by key to value, creating a new key/value pair if none existed for key previously.
3311
- * @param key The storage key.
3312
- * @param value The new value.
3619
+ * @param key - The storage key.
3620
+ * @param value - The new value.
3313
3621
  */
3314
3622
  setItem(key: string, value: string | null): void;
3315
3623
  /**
3316
3624
  * Removes the key/value pair with the given key, if a key/value pair with the given key exists.
3317
- * @param key The storage key.
3625
+ * @param key - The storage key.
3318
3626
  */
3319
3627
  removeItem(key: string): void;
3320
3628
  /**
3321
3629
  * Returns the name of the nth key, or null if n is greater than or equal to the number of key/value pairs.
3322
- * @param index The numeric index.
3630
+ * @param index - The numeric index.
3323
3631
  * @returns The nth key.
3324
3632
  */
3325
3633
  key(index: number): string | null;
@@ -3349,18 +3657,28 @@ export declare interface NewUserRequest {
3349
3657
 
3350
3658
  /**
3351
3659
  * Normalizes an error object into a displayable error string.
3352
- * @param error The error value which could be a string, Error, OperationOutcome, or other unknown type.
3660
+ * @param error - The error value which could be a string, Error, OperationOutcome, or other unknown type.
3353
3661
  * @returns A display string for the error.
3354
3662
  */
3355
3663
  export declare function normalizeErrorString(error: unknown): string;
3356
3664
 
3357
3665
  /**
3358
3666
  * Normalizes an error object into an OperationOutcome.
3359
- * @param error The error value which could be a string, Error, OperationOutcome, or other unknown type.
3667
+ * @param error - The error value which could be a string, Error, OperationOutcome, or other unknown type.
3360
3668
  * @returns The normalized OperationOutcome.
3361
3669
  */
3362
3670
  export declare function normalizeOperationOutcome(error: unknown): OperationOutcome;
3363
3671
 
3672
+ export declare class NotEqualsAtom extends BooleanInfixOperatorAtom {
3673
+ constructor(left: Atom, right: Atom);
3674
+ eval(context: AtomContext, input: TypedValue[]): TypedValue[];
3675
+ }
3676
+
3677
+ export declare class NotEquivalentAtom extends BooleanInfixOperatorAtom {
3678
+ constructor(left: Atom, right: Atom);
3679
+ eval(context: AtomContext, input: TypedValue[]): TypedValue[];
3680
+ }
3681
+
3364
3682
  export declare const notFound: OperationOutcome;
3365
3683
 
3366
3684
  export declare const notModified: OperationOutcome;
@@ -3388,6 +3706,18 @@ export declare enum OAuthGrantType {
3388
3706
  TokenExchange = "urn:ietf:params:oauth:grant-type:token-exchange"
3389
3707
  }
3390
3708
 
3709
+ /**
3710
+ * OAuth 2.0 Client Authentication Methods
3711
+ * See: https://openid.net/specs/openid-connect-core-1_0.html#ClientAuthentication
3712
+ */
3713
+ export declare enum OAuthTokenAuthMethod {
3714
+ ClientSecretBasic = "client_secret_basic",
3715
+ ClientSecretPost = "client_secret_post",
3716
+ ClientSecretJwt = "client_secret_jwt",
3717
+ PrivateKeyJwt = "private_key_jwt",
3718
+ None = "none"
3719
+ }
3720
+
3391
3721
  /**
3392
3722
  * OAuth 2.0 Token Type Identifiers
3393
3723
  * See: https://datatracker.ietf.org/doc/html/rfc8693#name-token-type-identifiers
@@ -3412,14 +3742,14 @@ export declare class OperationOutcomeError extends Error {
3412
3742
 
3413
3743
  /**
3414
3744
  * Returns a string represenation of the operation outcome issue.
3415
- * @param issue The operation outcome issue.
3745
+ * @param issue - The operation outcome issue.
3416
3746
  * @returns The string representation of the operation outcome issue.
3417
3747
  */
3418
3748
  export declare function operationOutcomeIssueToString(issue: OperationOutcomeIssue): string;
3419
3749
 
3420
3750
  /**
3421
3751
  * Returns a string represenation of the operation outcome.
3422
- * @param outcome The operation outcome.
3752
+ * @param outcome - The operation outcome.
3423
3753
  * @returns The string representation of the operation outcome.
3424
3754
  */
3425
3755
  export declare function operationOutcomeToString(outcome: OperationOutcome): string;
@@ -3491,10 +3821,21 @@ export declare const OperatorPrecedence: {
3491
3821
  Semicolon: number;
3492
3822
  };
3493
3823
 
3824
+ /**
3825
+ * 6.5.2. or
3826
+ * Returns false if both operands evaluate to false,
3827
+ * true if either operand evaluates to true,
3828
+ * and empty (`{ }`) otherwise:
3829
+ */
3830
+ export declare class OrAtom extends BooleanInfixOperatorAtom {
3831
+ constructor(left: Atom, right: Atom);
3832
+ eval(context: AtomContext, input: TypedValue[]): TypedValue[];
3833
+ }
3834
+
3494
3835
  /**
3495
3836
  * Parses a FHIR criteria string into a SearchRequest.
3496
3837
  * FHIR criteria strings are found on resources such as Subscription.
3497
- * @param criteria The FHIR criteria string.
3838
+ * @param criteria - The FHIR criteria string.
3498
3839
  * @returns Parsed search definition.
3499
3840
  */
3500
3841
  export declare function parseCriteriaAsSearchRequest(criteria: string): SearchRequest;
@@ -3504,14 +3845,14 @@ export declare function parseCriteriaAsSearchRequest(criteria: string): SearchRe
3504
3845
  * The result can be used to evaluate the expression against a resource or other object.
3505
3846
  * This method is useful if you know that you will evaluate the same expression many times
3506
3847
  * against different resources.
3507
- * @param input The FHIRPath expression to parse.
3848
+ * @param input - The FHIRPath expression to parse.
3508
3849
  * @returns The AST representing the expression.
3509
3850
  */
3510
3851
  export declare function parseFhirPath(input: string): FhirPathAtom;
3511
3852
 
3512
3853
  /**
3513
3854
  * Parses a FHIR _filter parameter expression into an AST.
3514
- * @param input The FHIR _filter parameter expression.
3855
+ * @param input - The FHIR _filter parameter expression.
3515
3856
  * @returns The AST representing the filters.
3516
3857
  */
3517
3858
  export declare function parseFilterParameter(input: string): FhirFilterExpression;
@@ -3524,26 +3865,28 @@ export declare function parseFilterParameter(input: string): FhirFilterExpressio
3524
3865
  *
3525
3866
  * Format: YYYY[MM[DD[HH[MM[SS[. S[S[S[S]]]]]]]]][+/-ZZZZ].
3526
3867
  *
3527
- * @param hl7DateTime Date/time string.
3528
- * @param options Optional parsing options.
3868
+ * @param hl7DateTime - Date/time string.
3869
+ * @param options - Optional parsing options.
3529
3870
  * @returns The date in ISO-8601 format.
3530
3871
  */
3531
3872
  export declare function parseHl7DateTime(hl7DateTime: string | undefined, options?: Hl7DateParseOptions): string | undefined;
3532
3873
 
3533
3874
  /**
3534
3875
  * Parses the JWT payload.
3535
- * @param token JWT token.
3876
+ * @param token - JWT token.
3536
3877
  * @returns Collection of key value claims in the JWT payload.
3537
3878
  */
3538
3879
  export declare function parseJWTPayload(token: string): Record<string, number | string>;
3539
3880
 
3540
3881
  /**
3541
3882
  * Parses a FHIR Mapping Language document into an AST.
3542
- * @param input The FHIR Mapping Language document to parse.
3883
+ * @param input - The FHIR Mapping Language document to parse.
3543
3884
  * @returns The AST representing the document.
3544
3885
  */
3545
3886
  export declare function parseMappingLanguage(input: string): StructureMap;
3546
3887
 
3888
+ export declare function parseParameter(searchParam: SearchParameter, modifier: string, value: string): Filter;
3889
+
3547
3890
  export declare class Parser {
3548
3891
  private tokens;
3549
3892
  private prefixParselets;
@@ -3571,7 +3914,7 @@ export declare class ParserBuilder {
3571
3914
 
3572
3915
  /**
3573
3916
  * Parses a reference and returns a tuple of [ResourceType, ID].
3574
- * @param reference A reference to a FHIR resource.
3917
+ * @param reference - A reference to a FHIR resource.
3575
3918
  * @returns A tuple containing the `ResourceType` and the ID of the resource or `undefined` when `undefined` or an invalid reference is passed.
3576
3919
  */
3577
3920
  export declare function parseReference(reference: Reference): [ResourceType, string] | undefined;
@@ -3580,22 +3923,22 @@ export declare function parseReference(reference: undefined): undefined;
3580
3923
 
3581
3924
  /**
3582
3925
  * Parses a URL string into a SearchRequest.
3583
- * @param url The URL to parse.
3926
+ * @param url - The URL to parse.
3584
3927
  * @returns Parsed search definition.
3585
3928
  */
3586
3929
  export declare function parseSearchDefinition<T extends Resource = Resource>(url: string): SearchRequest<T>;
3587
3930
 
3588
3931
  /**
3589
3932
  * Parses a search URL into a search request.
3590
- * @param resourceType The FHIR resource type.
3591
- * @param query The collection of query string parameters.
3933
+ * @param resourceType - The FHIR resource type.
3934
+ * @param query - The collection of query string parameters.
3592
3935
  * @returns A parsed SearchRequest.
3593
3936
  */
3594
3937
  export declare function parseSearchRequest<T extends Resource = Resource>(resourceType: T['resourceType'], query: Record<string, string[] | string | undefined>): SearchRequest<T>;
3595
3938
 
3596
3939
  /**
3597
3940
  * Parses a search URL into a search request.
3598
- * @param url The search URL.
3941
+ * @param url - The search URL.
3599
3942
  * @returns A parsed SearchRequest.
3600
3943
  */
3601
3944
  export declare function parseSearchUrl<T extends Resource = Resource>(url: URL): SearchRequest<T>;
@@ -3603,7 +3946,7 @@ export declare function parseSearchUrl<T extends Resource = Resource>(url: URL):
3603
3946
  /**
3604
3947
  * Parses a StructureDefinition resource into an internal schema better suited for
3605
3948
  * programmatic validation and usage in internal systems
3606
- * @param sd The StructureDefinition resource to parse
3949
+ * @param sd - The StructureDefinition resource to parse
3607
3950
  * @returns The parsed schema for the given resource type
3608
3951
  * @experimental
3609
3952
  */
@@ -3614,8 +3957,8 @@ export declare function parseStructureDefinition(sd: StructureDefinition): Inter
3614
3957
  * any embedded FHIRPath subexpressions (e.g. `{{ %patient.id }}`) with the provided variables.
3615
3958
  *
3616
3959
  * @see https://hl7.org/fhir/fhir-xquery.html
3617
- * @param query The X-Fhir-Query string to parse
3618
- * @param variables Values to pass into embedded FHIRPath expressions
3960
+ * @param query - The X-Fhir-Query string to parse
3961
+ * @param variables - Values to pass into embedded FHIRPath expressions
3619
3962
  * @returns The parsed search request
3620
3963
  */
3621
3964
  export declare function parseXFhirQuery(query: string, variables: Record<string, TypedValue>): SearchRequest;
@@ -3634,53 +3977,53 @@ export declare type PendingSubscriptionRequest = Omit<SubscriptionRequest, 'endp
3634
3977
 
3635
3978
  /**
3636
3979
  * Returns true if the two numbers are equal to the given precision.
3637
- * @param a The first number.
3638
- * @param b The second number.
3639
- * @param precision Optional precision in number of digits.
3980
+ * @param a - The first number.
3981
+ * @param b - The second number.
3982
+ * @param precision - Optional precision in number of digits.
3640
3983
  * @returns True if the two numbers are equal to the given precision.
3641
3984
  */
3642
3985
  export declare function preciseEquals(a: number, b: number, precision?: number): boolean;
3643
3986
 
3644
3987
  /**
3645
3988
  * Returns true if the first number is greater than the second number to the given precision.
3646
- * @param a The first number.
3647
- * @param b The second number.
3648
- * @param precision Optional precision in number of digits.
3989
+ * @param a - The first number.
3990
+ * @param b - The second number.
3991
+ * @param precision - Optional precision in number of digits.
3649
3992
  * @returns True if the first number is greater than the second number to the given precision.
3650
3993
  */
3651
3994
  export declare function preciseGreaterThan(a: number, b: number, precision?: number): boolean;
3652
3995
 
3653
3996
  /**
3654
3997
  * Returns true if the first number is greater than or equal to the second number to the given precision.
3655
- * @param a The first number.
3656
- * @param b The second number.
3657
- * @param precision Optional precision in number of digits.
3998
+ * @param a - The first number.
3999
+ * @param b - The second number.
4000
+ * @param precision - Optional precision in number of digits.
3658
4001
  * @returns True if the first number is greater than or equal to the second number to the given precision.
3659
4002
  */
3660
4003
  export declare function preciseGreaterThanOrEquals(a: number, b: number, precision?: number): boolean;
3661
4004
 
3662
4005
  /**
3663
4006
  * Returns true if the first number is less than the second number to the given precision.
3664
- * @param a The first number.
3665
- * @param b The second number.
3666
- * @param precision Optional precision in number of digits.
4007
+ * @param a - The first number.
4008
+ * @param b - The second number.
4009
+ * @param precision - Optional precision in number of digits.
3667
4010
  * @returns True if the first number is less than the second number to the given precision.
3668
4011
  */
3669
4012
  export declare function preciseLessThan(a: number, b: number, precision?: number): boolean;
3670
4013
 
3671
4014
  /**
3672
4015
  * Returns true if the first number is less than or equal to the second number to the given precision.
3673
- * @param a The first number.
3674
- * @param b The second number.
3675
- * @param precision Optional precision in number of digits.
4016
+ * @param a - The first number.
4017
+ * @param b - The second number.
4018
+ * @param precision - Optional precision in number of digits.
3676
4019
  * @returns True if the first number is less than or equal to the second number to the given precision.
3677
4020
  */
3678
4021
  export declare function preciseLessThanOrEquals(a: number, b: number, precision?: number): boolean;
3679
4022
 
3680
4023
  /**
3681
4024
  * Returns the input number rounded to the specified number of digits.
3682
- * @param a The input number.
3683
- * @param precision The precision in number of digits.
4025
+ * @param a - The input number.
4026
+ * @param precision - The precision in number of digits.
3684
4027
  * @returns The number rounded to the specified number of digits.
3685
4028
  */
3686
4029
  export declare function preciseRound(a: number, precision: number): number;
@@ -3697,9 +4040,6 @@ export declare interface PrefixParselet {
3697
4040
  parse(parser: Parser, token: Token): Atom;
3698
4041
  }
3699
4042
 
3700
- /**
3701
- * @internal
3702
- */
3703
4043
  export declare type ProfileResource = Patient | Practitioner | RelatedPerson;
3704
4044
 
3705
4045
  /**
@@ -3825,21 +4165,21 @@ export declare class ReadablePromise<T> implements Promise<T> {
3825
4165
  read(): T;
3826
4166
  /**
3827
4167
  * Attaches callbacks for the resolution and/or rejection of the Promise.
3828
- * @param onfulfilled The callback to execute when the Promise is resolved.
3829
- * @param onrejected The callback to execute when the Promise is rejected.
4168
+ * @param onfulfilled - The callback to execute when the Promise is resolved.
4169
+ * @param onrejected - The callback to execute when the Promise is rejected.
3830
4170
  * @returns A Promise for the completion of which ever callback is executed.
3831
4171
  */
3832
4172
  then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2>;
3833
4173
  /**
3834
4174
  * Attaches a callback for only the rejection of the Promise.
3835
- * @param onrejected The callback to execute when the Promise is rejected.
4175
+ * @param onrejected - The callback to execute when the Promise is rejected.
3836
4176
  * @returns A Promise for the completion of the callback.
3837
4177
  */
3838
4178
  catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<T | TResult>;
3839
4179
  /**
3840
4180
  * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
3841
4181
  * resolved value cannot be modified from the callback.
3842
- * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
4182
+ * @param onfinally - The callback to execute when the Promise is settled (fulfilled or rejected).
3843
4183
  * @returns A Promise for the completion of the callback.
3844
4184
  */
3845
4185
  finally(onfinally?: (() => void) | undefined | null): Promise<T>;
@@ -3847,7 +4187,7 @@ export declare class ReadablePromise<T> implements Promise<T> {
3847
4187
 
3848
4188
  /**
3849
4189
  * Removes duplicates in array using FHIRPath equality rules.
3850
- * @param arr The input array.
4190
+ * @param arr - The input array.
3851
4191
  * @returns The result array with duplicates removed.
3852
4192
  */
3853
4193
  export declare function removeDuplicates(arr: TypedValue[]): TypedValue[];
@@ -3859,14 +4199,14 @@ export declare function removeDuplicates(arr: TypedValue[]): TypedValue[];
3859
4199
  * In the event of cycles, this function will first create a POST request for each resource in the cycle, and then will
3860
4200
  * append a PUT request to the bundle. This ensures that each resources in the cycle is visited twice, and all
3861
4201
  * references can be resolved
3862
- * @param bundle Input bundle with type `batch` or `transaction`
4202
+ * @param bundle - Input bundle with type `batch` or `transaction`
3863
4203
  * @returns Bundle of the same type, with Bundle.entry reordered
3864
4204
  */
3865
4205
  export declare function reorderBundle(bundle: Bundle): Bundle;
3866
4206
 
3867
4207
  /**
3868
4208
  * Returns the ID portion of a reference.
3869
- * @param input A FHIR reference or resource.
4209
+ * @param input - A FHIR reference or resource.
3870
4210
  * @returns The ID portion of a reference.
3871
4211
  */
3872
4212
  export declare function resolveId(input: Reference | Resource | undefined): string | undefined;
@@ -3888,18 +4228,15 @@ export declare interface ResourceVisitor {
3888
4228
  visitProperty?: (parent: TypedValue, key: string, path: string, propertyValues: (TypedValue | TypedValue[] | undefined)[], schema: InternalTypeSchema) => void;
3889
4229
  }
3890
4230
 
3891
- /**
3892
- * @internal
3893
- */
3894
4231
  export declare type ResourceWithCode = Resource & Code;
3895
4232
 
3896
4233
  export declare const RXNORM = "http://www.nlm.nih.gov/research/umls/rxnorm";
3897
4234
 
3898
4235
  /**
3899
4236
  * Checks that there is an access policy permitting the given resource interaction, returning the matching policy object.
3900
- * @param resource The resource being acted upon.
3901
- * @param interaction The interaction being performed on the resource.
3902
- * @param accessPolicy The relevant access policy for the current user.
4237
+ * @param resource - The resource being acted upon.
4238
+ * @param interaction - The interaction being performed on the resource.
4239
+ * @param accessPolicy - The relevant access policy for the current user.
3903
4240
  * @returns The satisfied access policy, or undefined if the access policy does not permit the given interaction.
3904
4241
  */
3905
4242
  export declare function satisfiedAccessPolicy(resource: Resource, interaction: AccessPolicyInteraction, accessPolicy: AccessPolicy | undefined): AccessPolicyResource | undefined;
@@ -3941,7 +4278,7 @@ export declare interface SearchRequest<T extends Resource = Resource> {
3941
4278
  /**
3942
4279
  * Creates a serialized url-encoded payload for a `FHIRcast` subscription from a `SubscriptionRequest` object that can be directly used in an HTTP request to the Hub.
3943
4280
  *
3944
- * @param subscriptionRequest An object representing a subscription request.
4281
+ * @param subscriptionRequest - An object representing a subscription request.
3945
4282
  * @returns A serialized subscription in url-encoded form.
3946
4283
  */
3947
4284
  export declare function serializeFhircastSubscriptionRequest(subscriptionRequest: SubscriptionRequest | PendingSubscriptionRequest): string;
@@ -3950,9 +4287,9 @@ export declare function serverError(err: Error): OperationOutcome;
3950
4287
 
3951
4288
  /**
3952
4289
  * Sets a code for a given system within a given codeable concept.
3953
- * @param concept The codeable concept.
3954
- * @param system The system string.
3955
- * @param code The code value.
4290
+ * @param concept - The codeable concept.
4291
+ * @param system - The system string.
4292
+ * @param code - The code value.
3956
4293
  */
3957
4294
  export declare function setCodeBySystem(concept: CodeableConcept, system: string, code: string): void;
3958
4295
 
@@ -3967,9 +4304,9 @@ export declare function setCodeBySystem(concept: CodeableConcept, system: string
3967
4304
  *
3968
4305
  * Otherwise a new identifier is added.
3969
4306
  *
3970
- * @param resource The resource to add the identifier to.
3971
- * @param system The identifier system.
3972
- * @param value The identifier value.
4307
+ * @param resource - The resource to add the identifier to.
4308
+ * @param system - The identifier system.
4309
+ * @param value - The identifier value.
3973
4310
  */
3974
4311
  export declare function setIdentifier(resource: Resource & {
3975
4312
  identifier?: Identifier[];
@@ -3979,7 +4316,7 @@ export declare function singleton(collection: TypedValue[], type?: string): Type
3979
4316
 
3980
4317
  /**
3981
4318
  * Sleeps for the specified number of milliseconds.
3982
- * @param ms Time delay in milliseconds
4319
+ * @param ms - Time delay in milliseconds
3983
4320
  * @returns A promise that resolves after the specified number of milliseconds.
3984
4321
  */
3985
4322
  export declare const sleep: (ms: number) => Promise<void>;
@@ -4011,6 +4348,8 @@ export declare interface SortRule {
4011
4348
  descending?: boolean;
4012
4349
  }
4013
4350
 
4351
+ export declare function splitN(str: string, delim: string, n: number): string[];
4352
+
4014
4353
  /**
4015
4354
  * Reads data from a Readable stream and returns a Promise that resolves with a Buffer containing all the data.
4016
4355
  * @param stream - The Readable stream to read from.
@@ -4023,15 +4362,15 @@ export declare function streamToBuffer(stream: Readable): Promise<Buffer>;
4023
4362
  * Removes properties with empty string values.
4024
4363
  * Removes objects with zero properties.
4025
4364
  * See: https://www.hl7.org/fhir/json.html
4026
- * @param value The input value.
4027
- * @param pretty Optional flag to pretty-print the JSON.
4365
+ * @param value - The input value.
4366
+ * @param pretty - Optional flag to pretty-print the JSON.
4028
4367
  * @returns The resulting JSON string.
4029
4368
  */
4030
4369
  export declare function stringify(value: any, pretty?: boolean): string;
4031
4370
 
4032
4371
  /**
4033
4372
  * Output the string representation of a value, suitable for use as part of a search query.
4034
- * @param v The value to format as a string
4373
+ * @param v - The value to format as a string
4035
4374
  * @returns The stringified value
4036
4375
  */
4037
4376
  export declare function stringifyTypedValue(v: TypedValue): string;
@@ -4053,26 +4392,72 @@ export declare type SubscriptionRequest = {
4053
4392
  * Construct the subset of a resource containing a minimum set of fields. The returned resource is not guaranteed
4054
4393
  * to contain only the provided properties, and may contain others (e.g. `resourceType` and `id`)
4055
4394
  *
4056
- * @param resource The resource to subset
4057
- * @param properties The minimum properties to include in the subset
4395
+ * @param resource - The resource to subset
4396
+ * @param properties - The minimum properties to include in the subset
4058
4397
  * @returns The modified resource, containing the listed properties and possibly other mandatory ones
4059
4398
  */
4060
4399
  export declare function subsetResource<T extends Resource>(resource: T | undefined, properties: string[]): T | undefined;
4061
4400
 
4401
+ export declare class SymbolAtom implements Atom {
4402
+ readonly name: string;
4403
+ constructor(name: string);
4404
+ eval(context: AtomContext, input: TypedValue[]): TypedValue[];
4405
+ private evalValue;
4406
+ toString(): string;
4407
+ }
4408
+
4062
4409
  /**
4063
4410
  * Converts unknown object into a JavaScript boolean.
4064
4411
  * Note that this is different than the FHIRPath "toBoolean",
4065
4412
  * which has particular semantics around arrays, empty arrays, and type conversions.
4066
- * @param obj Any value or array of values.
4413
+ * @param obj - Any value or array of values.
4067
4414
  * @returns The converted boolean value according to FHIRPath rules.
4068
4415
  */
4069
4416
  export declare function toJsBoolean(obj: TypedValue[]): boolean;
4070
4417
 
4071
- declare interface Token extends Marker {
4418
+ export declare interface Token extends Marker {
4072
4419
  id: string;
4073
4420
  value: string;
4074
4421
  }
4075
4422
 
4423
+ export declare class Tokenizer {
4424
+ private readonly str;
4425
+ private readonly keywords;
4426
+ private readonly operators;
4427
+ private readonly dateTimeLiterals;
4428
+ private readonly symbolRegex;
4429
+ private readonly result;
4430
+ private readonly pos;
4431
+ private readonly markStack;
4432
+ constructor(str: string, keywords: string[], operators: string[], options?: TokenizerOptions);
4433
+ tokenize(): Token[];
4434
+ private prevToken;
4435
+ private peekToken;
4436
+ private consumeToken;
4437
+ private consumeWhitespace;
4438
+ private consumeMultiLineComment;
4439
+ private consumeSingleLineComment;
4440
+ private consumeString;
4441
+ private consumeBacktickSymbol;
4442
+ private consumeDateTime;
4443
+ private consumeNumber;
4444
+ private consumeSymbol;
4445
+ private consumeOperator;
4446
+ private consumeWhile;
4447
+ private curr;
4448
+ private prev;
4449
+ private peek;
4450
+ private mark;
4451
+ private reset;
4452
+ private advance;
4453
+ private buildToken;
4454
+ }
4455
+
4456
+ export declare interface TokenizerOptions {
4457
+ dateTimeLiterals?: boolean;
4458
+ symbolRegex?: RegExp;
4459
+ }
4460
+
4076
4461
  export declare interface TokenResponse {
4077
4462
  readonly token_type: string;
4078
4463
  readonly id_token: string;
@@ -4087,7 +4472,7 @@ export declare const tooManyRequests: OperationOutcome;
4087
4472
 
4088
4473
  /**
4089
4474
  * Returns a "best guess" TypedValue for a given value.
4090
- * @param value The unknown value to check.
4475
+ * @param value - The unknown value to check.
4091
4476
  * @returns A "best guess" TypedValue for the given value.
4092
4477
  */
4093
4478
  export declare function toTypedValue(value: unknown): TypedValue;
@@ -4128,12 +4513,24 @@ export declare type TypeName<T> = T extends string ? 'string' : T extends number
4128
4513
 
4129
4514
  export declare const UCUM = "http://unitsofmeasure.org";
4130
4515
 
4516
+ export declare class UnaryOperatorAtom extends PrefixOperatorAtom {
4517
+ readonly impl: (x: TypedValue[]) => TypedValue[];
4518
+ constructor(operator: string, child: Atom, impl: (x: TypedValue[]) => TypedValue[]);
4519
+ eval(context: AtomContext, input: TypedValue[]): TypedValue[];
4520
+ toString(): string;
4521
+ }
4522
+
4131
4523
  export declare const unauthorized: OperationOutcome;
4132
4524
 
4525
+ export declare class UnionAtom extends InfixOperatorAtom {
4526
+ constructor(left: Atom, right: Atom);
4527
+ eval(context: AtomContext, input: TypedValue[]): TypedValue[];
4528
+ }
4529
+
4133
4530
  /**
4134
4531
  * Validates that a `SubscriptionRequest`.
4135
4532
  *
4136
- * @param subscriptionRequest The `SubscriptionRequest` to validate.
4533
+ * @param subscriptionRequest - The `SubscriptionRequest` to validate.
4137
4534
  * @returns A `boolean` indicating whether or not the `SubscriptionRequest` is valid.
4138
4535
  */
4139
4536
  export declare function validateFhircastSubscriptionRequest(subscriptionRequest: SubscriptionRequest | PendingSubscriptionRequest): boolean;
@@ -4142,9 +4539,11 @@ export declare function validateResource(resource: Resource, profile?: Structure
4142
4539
 
4143
4540
  /**
4144
4541
  * Validates that the given string is a valid FHIR resource type.
4542
+ *
4145
4543
  * On success, silently returns void.
4146
4544
  * On failure, throws an OperationOutcomeError.
4147
4545
  *
4546
+ * @example
4148
4547
  * ```ts
4149
4548
  * validateResourceType('Patient'); // nothing
4150
4549
  * validateResourceType('XYZ'); // throws OperationOutcomeError
@@ -4152,6 +4551,7 @@ export declare function validateResource(resource: Resource, profile?: Structure
4152
4551
  *
4153
4552
  * Note that this depends on globalSchema, which is populated by the StructureDefinition loader.
4154
4553
  *
4554
+ * @example
4155
4555
  * In a server context, you can load all schema definitions:
4156
4556
  *
4157
4557
  * ```ts
@@ -4162,6 +4562,7 @@ export declare function validateResource(resource: Resource, profile?: Structure
4162
4562
  * indexStructureDefinitionBundle(readJson('fhir/r4/profiles-resources.json') as Bundle);
4163
4563
  * ```
4164
4564
  *
4565
+ * @example
4165
4566
  * In a client context, you can load the schema definitions using MedplumClient:
4166
4567
  *
4167
4568
  * ```ts
@@ -4170,7 +4571,8 @@ export declare function validateResource(resource: Resource, profile?: Structure
4170
4571
  * const medplum = new MedplumClient();
4171
4572
  * await medplum.requestSchema('Patient');
4172
4573
  * ```
4173
- * @param resourceType The candidate resource type string.
4574
+ *
4575
+ * @param resourceType - The candidate resource type string.
4174
4576
  */
4175
4577
  export declare function validateResourceType(resourceType: string): void;
4176
4578
 
@@ -4178,4 +4580,15 @@ export declare function validationError(details: string): OperationOutcome;
4178
4580
 
4179
4581
  export declare type ValueOrExternalSecret<T extends ExternalSecretPrimitive> = T | ExternalSecret<T>;
4180
4582
 
4583
+ /**
4584
+ * 6.5.4. xor
4585
+ * Returns true if exactly one of the operands evaluates to true,
4586
+ * false if either both operands evaluate to true or both operands evaluate to false,
4587
+ * and the empty collection otherwise.
4588
+ */
4589
+ export declare class XorAtom extends BooleanInfixOperatorAtom {
4590
+ constructor(left: Atom, right: Atom);
4591
+ eval(context: AtomContext, input: TypedValue[]): TypedValue[];
4592
+ }
4593
+
4181
4594
  export { }