@medplum/core 2.1.10 → 2.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/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,27 +2228,27 @@ 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.
1963
2235
  * @category Authentication
1964
2236
  */
1965
2237
  signInWithExternalAuth(authorizeUrl: string, clientId: string, redirectUri: string, baseLogin: BaseLoginRequest): Promise<void>;
1966
2238
  /**
1967
2239
  * 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.
2240
+ * @param token - The access token that was generated by the external identity provider.
2241
+ * @param clientId - The ID of the `ClientApplication` in your Medplum project that will be making the exchange request.
1970
2242
  * @returns The user profile resource.
1971
2243
  * @category Authentication
1972
2244
  */
1973
2245
  exchangeExternalAccessToken(token: string, clientId?: string): Promise<ProfileResource>;
1974
2246
  /**
1975
2247
  * 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.
2248
+ * @param authorizeUrl - The external authorization URL.
2249
+ * @param clientId - The external client ID.
2250
+ * @param redirectUri - The external identity provider redirect URI.
2251
+ * @param loginRequest - The Medplum login request.
1980
2252
  * @returns The external identity provider redirect URI.
1981
2253
  * @category Authentication
1982
2254
  */
@@ -1985,7 +2257,7 @@ export declare class MedplumClient extends EventTarget_2 {
1985
2257
  * Builds a FHIR URL from a collection of URL path components.
1986
2258
  * For example, `buildUrl('/Patient', '123')` returns `fhir/R4/Patient/123`.
1987
2259
  * @category HTTP
1988
- * @param path The path component of the URL.
2260
+ * @param path - The path component of the URL.
1989
2261
  * @returns The well-formed FHIR URL.
1990
2262
  */
1991
2263
  fhirUrl(...path: string[]): URL;
@@ -1993,14 +2265,15 @@ export declare class MedplumClient extends EventTarget_2 {
1993
2265
  * Builds a FHIR search URL from a search query or structured query object.
1994
2266
  * @category HTTP
1995
2267
  * @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.
2268
+ * @param resourceType - The FHIR resource type.
2269
+ * @param query - The FHIR search query or structured query object. Can be any valid input to the URLSearchParams() constructor.
1998
2270
  * @returns The well-formed FHIR URL.
1999
2271
  */
2000
2272
  fhirSearchUrl(resourceType: ResourceType, query: QueryTypes): URL;
2001
2273
  /**
2002
2274
  * Sends a FHIR search request.
2003
2275
  *
2276
+ * @example
2004
2277
  * Example using a FHIR search string:
2005
2278
  *
2006
2279
  * ```typescript
@@ -2008,6 +2281,7 @@ export declare class MedplumClient extends EventTarget_2 {
2008
2281
  * console.log(bundle);
2009
2282
  * ```
2010
2283
  *
2284
+ * @example
2011
2285
  * The return value is a FHIR bundle:
2012
2286
  *
2013
2287
  * ```json
@@ -2032,6 +2306,7 @@ export declare class MedplumClient extends EventTarget_2 {
2032
2306
  * }
2033
2307
  * ```
2034
2308
  *
2309
+ * @example
2035
2310
  * To query the count of a search, use the summary feature like so:
2036
2311
  *
2037
2312
  * ```typescript
@@ -2040,9 +2315,9 @@ export declare class MedplumClient extends EventTarget_2 {
2040
2315
  *
2041
2316
  * See FHIR search for full details: https://www.hl7.org/fhir/search.html
2042
2317
  * @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.
2318
+ * @param resourceType - The FHIR resource type.
2319
+ * @param query - Optional FHIR search query or structured query object. Can be any valid input to the URLSearchParams() constructor.
2320
+ * @param options - Optional fetch options.
2046
2321
  * @returns Promise to the search result bundle.
2047
2322
  */
2048
2323
  search<K extends ResourceType>(resourceType: K, query?: QueryTypes, options?: RequestInit): ReadablePromise<Bundle<ExtractResource<K>>>;
@@ -2051,6 +2326,7 @@ export declare class MedplumClient extends EventTarget_2 {
2051
2326
  *
2052
2327
  * This is a convenience method for `search()` that returns the first resource rather than a `Bundle`.
2053
2328
  *
2329
+ * @example
2054
2330
  * Example using a FHIR search string:
2055
2331
  *
2056
2332
  * ```typescript
@@ -2062,9 +2338,9 @@ export declare class MedplumClient extends EventTarget_2 {
2062
2338
  *
2063
2339
  * See FHIR search for full details: https://www.hl7.org/fhir/search.html
2064
2340
  * @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.
2341
+ * @param resourceType - The FHIR resource type.
2342
+ * @param query - Optional FHIR search query or structured query object. Can be any valid input to the URLSearchParams() constructor.
2343
+ * @param options - Optional fetch options.
2068
2344
  * @returns Promise to the first search result.
2069
2345
  */
2070
2346
  searchOne<K extends ResourceType>(resourceType: K, query?: QueryTypes, options?: RequestInit): ReadablePromise<ExtractResource<K> | undefined>;
@@ -2073,6 +2349,7 @@ export declare class MedplumClient extends EventTarget_2 {
2073
2349
  *
2074
2350
  * This is a convenience method for `search()` that returns the resources as an array rather than a `Bundle`.
2075
2351
  *
2352
+ * @example
2076
2353
  * Example using a FHIR search string:
2077
2354
  *
2078
2355
  * ```typescript
@@ -2084,9 +2361,9 @@ export declare class MedplumClient extends EventTarget_2 {
2084
2361
  *
2085
2362
  * See FHIR search for full details: https://www.hl7.org/fhir/search.html
2086
2363
  * @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.
2364
+ * @param resourceType - The FHIR resource type.
2365
+ * @param query - Optional FHIR search query or structured query object. Can be any valid input to the URLSearchParams() constructor.
2366
+ * @param options - Optional fetch options.
2090
2367
  * @returns Promise to the array of search results.
2091
2368
  */
2092
2369
  searchResources<K extends ResourceType>(resourceType: K, query?: QueryTypes, options?: RequestInit): ReadablePromise<ResourceArray<ExtractResource<K>>>;
@@ -2096,6 +2373,7 @@ export declare class MedplumClient extends EventTarget_2 {
2096
2373
  * over a series of FHIR search requests for paginated search results. Each iteration of the generator yields
2097
2374
  * the array of resources on each page.
2098
2375
  *
2376
+ * @example
2099
2377
  *
2100
2378
  * ```typescript
2101
2379
  * for await (const page of medplum.searchResourcePages('Patient', { _count: 10 })) {
@@ -2104,10 +2382,11 @@ export declare class MedplumClient extends EventTarget_2 {
2104
2382
  * }
2105
2383
  * }
2106
2384
  * ```
2385
+ *
2107
2386
  * @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.
2387
+ * @param resourceType - The FHIR resource type.
2388
+ * @param query - Optional FHIR search query or structured query object. Can be any valid input to the URLSearchParams() constructor.
2389
+ * @param options - Optional fetch options.
2111
2390
  * @yields An async generator, where each result is an array of resources for each page.
2112
2391
  */
2113
2392
  searchResourcePages<K extends ResourceType>(resourceType: K, query?: QueryTypes, options?: RequestInit): AsyncGenerator<ResourceArray<ExtractResource<K>>>;
@@ -2115,30 +2394,31 @@ export declare class MedplumClient extends EventTarget_2 {
2115
2394
  * Searches a ValueSet resource using the "expand" operation.
2116
2395
  * See: https://www.hl7.org/fhir/operation-valueset-expand.html
2117
2396
  * @category Search
2118
- * @param system The ValueSet system url.
2119
- * @param filter The search string.
2120
- * @param options Optional fetch options.
2397
+ * @param system - The ValueSet system url.
2398
+ * @param filter - The search string.
2399
+ * @param options - Optional fetch options.
2121
2400
  * @returns Promise to expanded ValueSet.
2122
2401
  */
2123
2402
  searchValueSet(system: string, filter: string, options?: RequestInit): ReadablePromise<ValueSet>;
2124
2403
  /**
2125
2404
  * Returns a cached resource if it is available.
2126
2405
  * @category Caching
2127
- * @param resourceType The FHIR resource type.
2128
- * @param id The FHIR resource ID.
2406
+ * @param resourceType - The FHIR resource type.
2407
+ * @param id - The FHIR resource ID.
2129
2408
  * @returns The resource if it is available in the cache; undefined otherwise.
2130
2409
  */
2131
2410
  getCached<K extends ResourceType>(resourceType: K, id: string): ExtractResource<K> | undefined;
2132
2411
  /**
2133
2412
  * Returns a cached resource if it is available.
2134
2413
  * @category Caching
2135
- * @param reference The FHIR reference.
2414
+ * @param reference - The FHIR reference.
2136
2415
  * @returns The resource if it is available in the cache; undefined otherwise.
2137
2416
  */
2138
2417
  getCachedReference<T extends Resource>(reference: Reference<T>): T | undefined;
2139
2418
  /**
2140
2419
  * Reads a resource by resource type and ID.
2141
2420
  *
2421
+ * @example
2142
2422
  * Example:
2143
2423
  *
2144
2424
  * ```typescript
@@ -2148,9 +2428,9 @@ export declare class MedplumClient extends EventTarget_2 {
2148
2428
  *
2149
2429
  * See the FHIR "read" operation for full details: https://www.hl7.org/fhir/http.html#read
2150
2430
  * @category Read
2151
- * @param resourceType The FHIR resource type.
2152
- * @param id The resource ID.
2153
- * @param options Optional fetch options.
2431
+ * @param resourceType - The FHIR resource type.
2432
+ * @param id - The resource ID.
2433
+ * @param options - Optional fetch options.
2154
2434
  * @returns The resource if available; undefined otherwise.
2155
2435
  */
2156
2436
  readResource<K extends ResourceType>(resourceType: K, id: string, options?: RequestInit): ReadablePromise<ExtractResource<K>>;
@@ -2159,6 +2439,7 @@ export declare class MedplumClient extends EventTarget_2 {
2159
2439
  *
2160
2440
  * This is a convenience method for `readResource()` that accepts a `Reference` object.
2161
2441
  *
2442
+ * @example
2162
2443
  * Example:
2163
2444
  *
2164
2445
  * ```typescript
@@ -2169,8 +2450,8 @@ export declare class MedplumClient extends EventTarget_2 {
2169
2450
  *
2170
2451
  * See the FHIR "read" operation for full details: https://www.hl7.org/fhir/http.html#read
2171
2452
  * @category Read
2172
- * @param reference The FHIR reference object.
2173
- * @param options Optional fetch options.
2453
+ * @param reference - The FHIR reference object.
2454
+ * @param options - Optional fetch options.
2174
2455
  * @returns The resource if available; undefined otherwise.
2175
2456
  */
2176
2457
  readReference<T extends Resource>(reference: Reference<T>, options?: RequestInit): ReadablePromise<T>;
@@ -2178,7 +2459,7 @@ export declare class MedplumClient extends EventTarget_2 {
2178
2459
  * Requests the schema for a resource type.
2179
2460
  * If the schema is already cached, the promise is resolved immediately.
2180
2461
  * @category Schema
2181
- * @param resourceType The FHIR resource type.
2462
+ * @param resourceType - The FHIR resource type.
2182
2463
  * @returns Promise to a schema with the requested resource type.
2183
2464
  */
2184
2465
  requestSchema(resourceType: string): Promise<void>;
@@ -2187,6 +2468,7 @@ export declare class MedplumClient extends EventTarget_2 {
2187
2468
  *
2188
2469
  * The return value is a bundle of all versions of the resource.
2189
2470
  *
2471
+ * @example
2190
2472
  * Example:
2191
2473
  *
2192
2474
  * ```typescript
@@ -2196,15 +2478,16 @@ export declare class MedplumClient extends EventTarget_2 {
2196
2478
  *
2197
2479
  * See the FHIR "history" operation for full details: https://www.hl7.org/fhir/http.html#history
2198
2480
  * @category Read
2199
- * @param resourceType The FHIR resource type.
2200
- * @param id The resource ID.
2201
- * @param options Optional fetch options.
2481
+ * @param resourceType - The FHIR resource type.
2482
+ * @param id - The resource ID.
2483
+ * @param options - Optional fetch options.
2202
2484
  * @returns Promise to the resource history.
2203
2485
  */
2204
2486
  readHistory<K extends ResourceType>(resourceType: K, id: string, options?: RequestInit): ReadablePromise<Bundle<ExtractResource<K>>>;
2205
2487
  /**
2206
2488
  * Reads a specific version of a resource by resource type, ID, and version ID.
2207
2489
  *
2490
+ * @example
2208
2491
  * Example:
2209
2492
  *
2210
2493
  * ```typescript
@@ -2214,16 +2497,17 @@ export declare class MedplumClient extends EventTarget_2 {
2214
2497
  *
2215
2498
  * See the FHIR "vread" operation for full details: https://www.hl7.org/fhir/http.html#vread
2216
2499
  * @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.
2500
+ * @param resourceType - The FHIR resource type.
2501
+ * @param id - The resource ID.
2502
+ * @param vid - The version ID.
2503
+ * @param options - Optional fetch options.
2221
2504
  * @returns The resource if available; undefined otherwise.
2222
2505
  */
2223
2506
  readVersion<K extends ResourceType>(resourceType: K, id: string, vid: string, options?: RequestInit): ReadablePromise<ExtractResource<K>>;
2224
2507
  /**
2225
2508
  * Executes the Patient "everything" operation for a patient.
2226
2509
  *
2510
+ * @example
2227
2511
  * Example:
2228
2512
  *
2229
2513
  * ```typescript
@@ -2233,8 +2517,8 @@ export declare class MedplumClient extends EventTarget_2 {
2233
2517
  *
2234
2518
  * See the FHIR "patient-everything" operation for full details: https://hl7.org/fhir/operation-patient-everything.html
2235
2519
  * @category Read
2236
- * @param id The Patient Id
2237
- * @param options Optional fetch options.
2520
+ * @param id - The Patient Id
2521
+ * @param options - Optional fetch options.
2238
2522
  * @returns A Bundle of all Resources related to the Patient
2239
2523
  */
2240
2524
  readPatientEverything(id: string, options?: RequestInit): ReadablePromise<Bundle>;
@@ -2243,6 +2527,7 @@ export declare class MedplumClient extends EventTarget_2 {
2243
2527
  *
2244
2528
  * The return value is the newly created resource, including the ID and meta.
2245
2529
  *
2530
+ * @example
2246
2531
  * Example:
2247
2532
  *
2248
2533
  * ```typescript
@@ -2258,8 +2543,8 @@ export declare class MedplumClient extends EventTarget_2 {
2258
2543
  *
2259
2544
  * See the FHIR "create" operation for full details: https://www.hl7.org/fhir/http.html#create
2260
2545
  * @category Create
2261
- * @param resource The FHIR resource to create.
2262
- * @param options Optional fetch options.
2546
+ * @param resource - The FHIR resource to create.
2547
+ * @param options - Optional fetch options.
2263
2548
  * @returns The result of the create operation.
2264
2549
  */
2265
2550
  createResource<T extends Resource>(resource: T, options?: RequestInit): Promise<T>;
@@ -2268,6 +2553,7 @@ export declare class MedplumClient extends EventTarget_2 {
2268
2553
  *
2269
2554
  * The return value is the existing resource or the newly created resource, including the ID and meta.
2270
2555
  *
2556
+ * @example
2271
2557
  * Example:
2272
2558
  *
2273
2559
  * ```typescript
@@ -2298,9 +2584,9 @@ export declare class MedplumClient extends EventTarget_2 {
2298
2584
  *
2299
2585
  * See the FHIR "conditional create" operation for full details: https://www.hl7.org/fhir/http.html#ccreate
2300
2586
  * @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.
2587
+ * @param resource - The FHIR resource to create.
2588
+ * @param query - The search query for an equivalent resource (should not include resource type or "?").
2589
+ * @param options - Optional fetch options.
2304
2590
  * @returns The result of the create operation.
2305
2591
  */
2306
2592
  createResourceIfNoneExist<T extends Resource>(resource: T, query: string, options?: RequestInit): Promise<T>;
@@ -2313,6 +2599,7 @@ export declare class MedplumClient extends EventTarget_2 {
2313
2599
  *
2314
2600
  * A `File` object often comes from a `<input type="file">` element.
2315
2601
  *
2602
+ * @example
2316
2603
  * Example:
2317
2604
  *
2318
2605
  * ```typescript
@@ -2322,10 +2609,10 @@ export declare class MedplumClient extends EventTarget_2 {
2322
2609
  *
2323
2610
  * See the FHIR "create" operation for full details: https://www.hl7.org/fhir/http.html#create
2324
2611
  * @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.
2612
+ * @param data - The binary data to upload.
2613
+ * @param filename - Optional filename for the binary.
2614
+ * @param contentType - Content type for the binary.
2615
+ * @param onProgress - Optional callback for progress events.
2329
2616
  * @returns The result of the create operation.
2330
2617
  */
2331
2618
  createAttachment(data: BinarySource, filename: string | undefined, contentType: string, onProgress?: (e: ProgressEvent) => void): Promise<Attachment>;
@@ -2338,6 +2625,7 @@ export declare class MedplumClient extends EventTarget_2 {
2338
2625
  *
2339
2626
  * A `File` object often comes from a `<input type="file">` element.
2340
2627
  *
2628
+ * @example
2341
2629
  * Example:
2342
2630
  *
2343
2631
  * ```typescript
@@ -2347,10 +2635,10 @@ export declare class MedplumClient extends EventTarget_2 {
2347
2635
  *
2348
2636
  * See the FHIR "create" operation for full details: https://www.hl7.org/fhir/http.html#create
2349
2637
  * @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.
2638
+ * @param data - The binary data to upload.
2639
+ * @param filename - Optional filename for the binary.
2640
+ * @param contentType - Content type for the binary.
2641
+ * @param onProgress - Optional callback for progress events.
2354
2642
  * @returns The result of the create operation.
2355
2643
  */
2356
2644
  createBinary(data: BinarySource, filename: string | undefined, contentType: string, onProgress?: (e: ProgressEvent) => void): Promise<Binary>;
@@ -2362,6 +2650,7 @@ export declare class MedplumClient extends EventTarget_2 {
2362
2650
  *
2363
2651
  * The `docDefinition` parameter is a pdfmake document definition.
2364
2652
  *
2653
+ * @example
2365
2654
  * Example:
2366
2655
  *
2367
2656
  * ```typescript
@@ -2373,10 +2662,10 @@ export declare class MedplumClient extends EventTarget_2 {
2373
2662
  *
2374
2663
  * See the pdfmake document definition for full details: https://pdfmake.github.io/docs/0.1/document-definition-object/
2375
2664
  * @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.
2665
+ * @param docDefinition - The PDF document definition.
2666
+ * @param filename - Optional filename for the PDF binary resource.
2667
+ * @param tableLayouts - Optional pdfmake custom table layout.
2668
+ * @param fonts - Optional pdfmake custom font dictionary.
2380
2669
  * @returns The result of the create operation.
2381
2670
  */
2382
2671
  createPdf(docDefinition: TDocumentDefinitions, filename?: string, tableLayouts?: Record<string, CustomTableLayout>, fonts?: TFontDictionary): Promise<Binary>;
@@ -2385,9 +2674,9 @@ export declare class MedplumClient extends EventTarget_2 {
2385
2674
  *
2386
2675
  * This is a convenience method to handle commmon cases where a `Communication` resource is created with a `payload`.
2387
2676
  * @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.
2677
+ * @param resource - The FHIR resource to comment on.
2678
+ * @param text - The text of the comment.
2679
+ * @param options - Optional fetch options.
2391
2680
  * @returns The result of the create operation.
2392
2681
  */
2393
2682
  createComment(resource: Resource, text: string, options?: RequestInit): Promise<Communication>;
@@ -2396,6 +2685,7 @@ export declare class MedplumClient extends EventTarget_2 {
2396
2685
  *
2397
2686
  * The return value is the updated resource, including the ID and meta.
2398
2687
  *
2688
+ * @example
2399
2689
  * Example:
2400
2690
  *
2401
2691
  * ```typescript
@@ -2412,8 +2702,8 @@ export declare class MedplumClient extends EventTarget_2 {
2412
2702
  *
2413
2703
  * See the FHIR "update" operation for full details: https://www.hl7.org/fhir/http.html#update
2414
2704
  * @category Write
2415
- * @param resource The FHIR resource to update.
2416
- * @param options Optional fetch options.
2705
+ * @param resource - The FHIR resource to update.
2706
+ * @param options - Optional fetch options.
2417
2707
  * @returns The result of the update operation.
2418
2708
  */
2419
2709
  updateResource<T extends Resource>(resource: T, options?: RequestInit): Promise<T>;
@@ -2422,6 +2712,7 @@ export declare class MedplumClient extends EventTarget_2 {
2422
2712
  *
2423
2713
  * The return value is the updated resource, including the ID and meta.
2424
2714
  *
2715
+ * @example
2425
2716
  * Example:
2426
2717
  *
2427
2718
  * ```typescript
@@ -2435,16 +2726,17 @@ export declare class MedplumClient extends EventTarget_2 {
2435
2726
  *
2436
2727
  * See the JSONPatch specification for full details: https://tools.ietf.org/html/rfc6902
2437
2728
  * @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.
2729
+ * @param resourceType - The FHIR resource type.
2730
+ * @param id - The resource ID.
2731
+ * @param operations - The JSONPatch operations.
2732
+ * @param options - Optional fetch options.
2442
2733
  * @returns The result of the patch operations.
2443
2734
  */
2444
2735
  patchResource<K extends ResourceType>(resourceType: K, id: string, operations: PatchOperation[], options?: RequestInit): Promise<ExtractResource<K>>;
2445
2736
  /**
2446
2737
  * Deletes a FHIR resource by resource type and ID.
2447
2738
  *
2739
+ * @example
2448
2740
  * Example:
2449
2741
  *
2450
2742
  * ```typescript
@@ -2453,15 +2745,16 @@ export declare class MedplumClient extends EventTarget_2 {
2453
2745
  *
2454
2746
  * See the FHIR "delete" operation for full details: https://www.hl7.org/fhir/http.html#delete
2455
2747
  * @category Delete
2456
- * @param resourceType The FHIR resource type.
2457
- * @param id The resource ID.
2458
- * @param options Optional fetch options.
2748
+ * @param resourceType - The FHIR resource type.
2749
+ * @param id - The resource ID.
2750
+ * @param options - Optional fetch options.
2459
2751
  * @returns The result of the delete operation.
2460
2752
  */
2461
2753
  deleteResource(resourceType: ResourceType, id: string, options?: RequestInit): Promise<any>;
2462
2754
  /**
2463
2755
  * Executes the validate operation with the provided resource.
2464
2756
  *
2757
+ * @example
2465
2758
  * Example:
2466
2759
  *
2467
2760
  * ```typescript
@@ -2472,23 +2765,24 @@ export declare class MedplumClient extends EventTarget_2 {
2472
2765
  * ```
2473
2766
  *
2474
2767
  * 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.
2768
+ * @param resource - The FHIR resource.
2769
+ * @param options - Optional fetch options.
2477
2770
  * @returns The validate operation outcome.
2478
2771
  */
2479
2772
  validateResource<T extends Resource>(resource: T, options?: RequestInit): Promise<OperationOutcome>;
2480
2773
  /**
2481
2774
  * 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.
2775
+ * @param idOrIdentifier - The Bot ID or Identifier.
2776
+ * @param body - The content body. Strings and `File` objects are passed directly. Other objects are converted to JSON.
2777
+ * @param contentType - The content type to be included in the "Content-Type" header.
2778
+ * @param options - Optional fetch options.
2486
2779
  * @returns The Bot return value.
2487
2780
  */
2488
2781
  executeBot(idOrIdentifier: string | Identifier, body: any, contentType?: string, options?: RequestInit): Promise<any>;
2489
2782
  /**
2490
2783
  * Executes a batch or transaction of FHIR operations.
2491
2784
  *
2785
+ * @example
2492
2786
  * Example:
2493
2787
  *
2494
2788
  * ```typescript
@@ -2530,8 +2824,8 @@ export declare class MedplumClient extends EventTarget_2 {
2530
2824
  *
2531
2825
  * See The FHIR "batch/transaction" section for full details: https://hl7.org/fhir/http.html#transaction
2532
2826
  * @category Batch
2533
- * @param bundle The FHIR batch/transaction bundle.
2534
- * @param options Optional fetch options.
2827
+ * @param bundle - The FHIR batch/transaction bundle.
2828
+ * @param options - Optional fetch options.
2535
2829
  * @returns The FHIR batch/transaction response bundle.
2536
2830
  */
2537
2831
  executeBatch(bundle: Bundle, options?: RequestInit): Promise<Bundle>;
@@ -2542,6 +2836,7 @@ export declare class MedplumClient extends EventTarget_2 {
2542
2836
  *
2543
2837
  * Examples:
2544
2838
  *
2839
+ * @example
2545
2840
  * Send a simple text email:
2546
2841
  *
2547
2842
  * ```typescript
@@ -2553,6 +2848,7 @@ export declare class MedplumClient extends EventTarget_2 {
2553
2848
  * });
2554
2849
  * ```
2555
2850
  *
2851
+ * @example
2556
2852
  * Send an email with a `Binary` attachment:
2557
2853
  *
2558
2854
  * ```typescript
@@ -2569,14 +2865,15 @@ export declare class MedplumClient extends EventTarget_2 {
2569
2865
  *
2570
2866
  * See options here: https://nodemailer.com/extras/mailcomposer/
2571
2867
  * @category Media
2572
- * @param email The MailComposer options.
2573
- * @param options Optional fetch options.
2868
+ * @param email - The MailComposer options.
2869
+ * @param options - Optional fetch options.
2574
2870
  * @returns Promise to the operation outcome.
2575
2871
  */
2576
2872
  sendEmail(email: MailOptions, options?: RequestInit): Promise<OperationOutcome>;
2577
2873
  /**
2578
2874
  * Executes a GraphQL query.
2579
2875
  *
2876
+ * @example
2580
2877
  * Example:
2581
2878
  *
2582
2879
  * ```typescript
@@ -2592,6 +2889,7 @@ export declare class MedplumClient extends EventTarget_2 {
2592
2889
  * }`);
2593
2890
  * ```
2594
2891
  *
2892
+ * @example
2595
2893
  * Advanced queries such as named operations and variable substitution are supported:
2596
2894
  *
2597
2895
  * ```typescript
@@ -2615,10 +2913,10 @@ export declare class MedplumClient extends EventTarget_2 {
2615
2913
  *
2616
2914
  * See the FHIR GraphQL documentation for FHIR specific details: https://www.hl7.org/fhir/graphql.html
2617
2915
  * @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.
2916
+ * @param query - The GraphQL query.
2917
+ * @param operationName - Optional GraphQL operation name.
2918
+ * @param variables - Optional GraphQL variables.
2919
+ * @param options - Optional fetch options.
2622
2920
  * @returns The GraphQL result.
2623
2921
  */
2624
2922
  graphql(query: string, operationName?: string | null, variables?: any, options?: RequestInit): Promise<any>;
@@ -2626,21 +2924,21 @@ export declare class MedplumClient extends EventTarget_2 {
2626
2924
  * Executes the $graph operation on this resource to fetch a Bundle of resources linked to the target resource
2627
2925
  * according to a graph definition
2628
2926
  * @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.
2927
+ * @param resourceType - The FHIR resource type.
2928
+ * @param id - The resource ID.
2929
+ * @param graphName - `name` parameter of the GraphDefinition
2930
+ * @param options - Optional fetch options.
2633
2931
  * @returns A Bundle
2634
2932
  */
2635
2933
  readResourceGraph<K extends ResourceType>(resourceType: K, id: string, graphName: string, options?: RequestInit): ReadablePromise<Bundle>;
2636
2934
  /**
2637
2935
  * Pushes a message to an agent.
2638
2936
  *
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.
2937
+ * @param agent - The agent to push to.
2938
+ * @param destination - The destination device.
2939
+ * @param body - The message body.
2940
+ * @param contentType - Optional message content type.
2941
+ * @param options - Optional fetch options.
2644
2942
  * @returns Promise to the operation outcome.
2645
2943
  */
2646
2944
  pushToAgent(agent: Agent | Reference<Agent>, destination: Device | Reference<Device>, body: any, contentType?: string, options?: RequestInit): Promise<OperationOutcome>;
@@ -2651,7 +2949,7 @@ export declare class MedplumClient extends EventTarget_2 {
2651
2949
  getActiveLogin(): LoginState | undefined;
2652
2950
  /**
2653
2951
  * Sets the active login.
2654
- * @param login The new active login state.
2952
+ * @param login - The new active login state.
2655
2953
  * @category Authentication
2656
2954
  */
2657
2955
  setActiveLogin(login: LoginState): Promise<void>;
@@ -2663,8 +2961,8 @@ export declare class MedplumClient extends EventTarget_2 {
2663
2961
  getAccessToken(): string | undefined;
2664
2962
  /**
2665
2963
  * Sets the current access token.
2666
- * @param accessToken The new access token.
2667
- * @param refreshToken Optional refresh token.
2964
+ * @param accessToken - The new access token.
2965
+ * @param refreshToken - Optional refresh token.
2668
2966
  * @category Authentication
2669
2967
  */
2670
2968
  setAccessToken(accessToken: string, refreshToken?: string): void;
@@ -2735,68 +3033,68 @@ export declare class MedplumClient extends EventTarget_2 {
2735
3033
  /**
2736
3034
  * Downloads the URL as a blob. Can accept binary URLs in the form of `Binary/{id}` as well.
2737
3035
  * @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.
3036
+ * @param url - The URL to request. Can be a standard URL or one in the form of `Binary/{id}`.
3037
+ * @param options - Optional fetch request init options.
2740
3038
  * @returns Promise to the response body as a blob.
2741
3039
  */
2742
3040
  download(url: URL | string, options?: RequestInit): Promise<Blob>;
2743
3041
  /**
2744
3042
  * 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.
3043
+ * @param contents - The contents of the media file, as a string, Uint8Array, File, or Blob.
3044
+ * @param contentType - The media type of the content.
3045
+ * @param filename - The name of the file to be uploaded, or undefined if not applicable.
3046
+ * @param additionalFields - Additional fields for Media.
3047
+ * @param options - Optional fetch options.
2750
3048
  * @returns Promise that resolves to the created Media
2751
3049
  */
2752
3050
  uploadMedia(contents: string | Uint8Array | File | Blob, contentType: string, filename: string | undefined, additionalFields?: Partial<Media>, options?: RequestInit): Promise<Media>;
2753
3051
  /**
2754
3052
  * 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.
3053
+ * @param exportLevel - Optional export level. Defaults to system level export. 'Group/:id' - Group of Patients, 'Patient' - All Patients.
3054
+ * @param resourceTypes - A string of comma-delimited FHIR resource types.
3055
+ * @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).
3056
+ * @param options - Optional fetch options.
2759
3057
  * @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
3058
  */
2761
3059
  bulkExport(exportLevel?: string, resourceTypes?: string, since?: string, options?: RequestInit): Promise<Partial<BulkDataExport>>;
2762
3060
  /**
2763
3061
  * Starts an async request following the FHIR "Asynchronous Request Pattern".
2764
3062
  * See: https://hl7.org/fhir/r4/async.html
2765
- * @param url The URL to request.
2766
- * @param options Optional fetch options.
3063
+ * @param url - The URL to request.
3064
+ * @param options - Optional fetch options.
2767
3065
  * @returns The response body.
2768
3066
  */
2769
3067
  startAsyncRequest<T>(url: string, options?: RequestInit): Promise<T>;
2770
3068
  /**
2771
3069
  * 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.
3070
+ * @param key - The cache key to retrieve.
3071
+ * @param options - Optional fetch options for cache settings.
2774
3072
  * @returns The cached entry if found.
2775
3073
  */
2776
3074
  private getCacheEntry;
2777
3075
  /**
2778
3076
  * Adds a readable promise to the cache.
2779
- * @param key The cache key to store.
2780
- * @param value The readable promise to store.
3077
+ * @param key - The cache key to store.
3078
+ * @param value - The readable promise to store.
2781
3079
  */
2782
3080
  private setCacheEntry;
2783
3081
  /**
2784
3082
  * Adds a concrete value as the cache entry for the given resource.
2785
3083
  * This is used in cases where the resource is loaded indirectly.
2786
3084
  * For example, when a resource is loaded as part of a Bundle.
2787
- * @param resource The resource to cache.
3085
+ * @param resource - The resource to cache.
2788
3086
  */
2789
3087
  private cacheResource;
2790
3088
  /**
2791
3089
  * Deletes a cache entry.
2792
- * @param key The cache key to delete.
3090
+ * @param key - The cache key to delete.
2793
3091
  */
2794
3092
  private deleteCacheEntry;
2795
3093
  /**
2796
3094
  * 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.
3095
+ * @param method - The HTTP method (GET, POST, etc).
3096
+ * @param url - The target URL.
3097
+ * @param options - Optional fetch request init options.
2800
3098
  * @returns The JSON content body if available.
2801
3099
  */
2802
3100
  private request;
@@ -2811,28 +3109,28 @@ export declare class MedplumClient extends EventTarget_2 {
2811
3109
  private executeAutoBatch;
2812
3110
  /**
2813
3111
  * Adds default options to the fetch options.
2814
- * @param options The options to add defaults to.
3112
+ * @param options - The options to add defaults to.
2815
3113
  */
2816
3114
  private addFetchOptionsDefaults;
2817
3115
  /**
2818
3116
  * Sets the "Content-Type" header on fetch options.
2819
- * @param options The fetch options.
2820
- * @param contentType The new content type to set.
3117
+ * @param options - The fetch options.
3118
+ * @param contentType - The new content type to set.
2821
3119
  */
2822
3120
  private setRequestContentType;
2823
3121
  /**
2824
3122
  * Sets the body on fetch options.
2825
- * @param options The fetch options.
2826
- * @param data The new content body.
3123
+ * @param options - The fetch options.
3124
+ * @param data - The new content body.
2827
3125
  */
2828
3126
  private setRequestBody;
2829
3127
  /**
2830
3128
  * Handles an unauthenticated response from the server.
2831
3129
  * First, tries to refresh the access token and retry the request.
2832
3130
  * 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.
3131
+ * @param method - The HTTP method of the original request.
3132
+ * @param url - The URL of the original request.
3133
+ * @param options - Optional fetch request init options.
2836
3134
  * @returns The result of the retry.
2837
3135
  */
2838
3136
  private handleUnauthenticated;
@@ -2849,15 +3147,15 @@ export declare class MedplumClient extends EventTarget_2 {
2849
3147
  /**
2850
3148
  * Redirects the user to the login screen for authorization.
2851
3149
  * Clears all auth state including local storage and session storage.
2852
- * @param loginParams The authorization login parameters.
3150
+ * @param loginParams - The authorization login parameters.
2853
3151
  * @see https://openid.net/specs/openid-connect-core-1_0.html#AuthorizationEndpoint
2854
3152
  */
2855
3153
  private requestAuthorization;
2856
3154
  /**
2857
3155
  * Processes an OAuth authorization code.
2858
3156
  * 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.
3157
+ * @param code - The authorization code received by URL parameter.
3158
+ * @param loginParams - Optional login parameters.
2861
3159
  * @returns The user profile resource.
2862
3160
  * @category Authentication
2863
3161
  */
@@ -2871,6 +3169,7 @@ export declare class MedplumClient extends EventTarget_2 {
2871
3169
  /**
2872
3170
  * Starts a new OAuth2 client credentials flow.
2873
3171
  *
3172
+ * @example
2874
3173
  * ```typescript
2875
3174
  * await medplum.startClientLogin(process.env.MEDPLUM_CLIENT_ID, process.env.MEDPLUM_CLIENT_SECRET)
2876
3175
  * // Example Search
@@ -2880,14 +3179,15 @@ export declare class MedplumClient extends EventTarget_2 {
2880
3179
  * See: https://datatracker.ietf.org/doc/html/rfc6749#section-4.4
2881
3180
  *
2882
3181
  * @category Authentication
2883
- * @param clientId The client ID.
2884
- * @param clientSecret The client secret.
3182
+ * @param clientId - The client ID.
3183
+ * @param clientSecret - The client secret.
2885
3184
  * @returns Promise that resolves to the client profile.
2886
3185
  */
2887
3186
  startClientLogin(clientId: string, clientSecret: string): Promise<ProfileResource>;
2888
3187
  /**
2889
3188
  * Starts a new OAuth2 JWT bearer flow.
2890
3189
  *
3190
+ * @example
2891
3191
  * ```typescript
2892
3192
  * await medplum.startJwtBearerLogin(process.env.MEDPLUM_CLIENT_ID, process.env.MEDPLUM_JWT_BEARER_ASSERTION, 'openid profile');
2893
3193
  * // Example Search
@@ -2897,9 +3197,9 @@ export declare class MedplumClient extends EventTarget_2 {
2897
3197
  * See: https://datatracker.ietf.org/doc/html/rfc7523#section-2.1
2898
3198
  *
2899
3199
  * @category Authentication
2900
- * @param clientId The client ID.
2901
- * @param assertion The JWT assertion.
2902
- * @param scope The OAuth scope.
3200
+ * @param clientId - The client ID.
3201
+ * @param assertion - The JWT assertion.
3202
+ * @param scope - The OAuth scope.
2903
3203
  * @returns Promise that resolves to the client profile.
2904
3204
  */
2905
3205
  startJwtBearerLogin(clientId: string, assertion: string, scope: string): Promise<ProfileResource>;
@@ -2909,21 +3209,23 @@ export declare class MedplumClient extends EventTarget_2 {
2909
3209
  * See: https://datatracker.ietf.org/doc/html/rfc7523#section-2.2
2910
3210
  *
2911
3211
  * @category Authentication
2912
- * @param jwt The JWT assertion.
3212
+ * @param jwt - The JWT assertion.
2913
3213
  * @returns Promise that resolves to the client profile.
2914
3214
  */
2915
3215
  startJwtAssertionLogin(jwt: string): Promise<ProfileResource>;
2916
3216
  /**
2917
3217
  * Sets the client ID and secret for basic auth.
2918
3218
  *
2919
- * ```typescript
2920
- * medplum.setBasicAuth(process.env.MEDPLUM_CLIENT_ID, process.env.MEDPLUM_CLIENT_SECRET)
3219
+ * @example
3220
+ * ```typescript
3221
+ * medplum.setBasicAuth(process.env.MEDPLUM_CLIENT_ID, process.env.MEDPLUM_CLIENT_SECRET);
2921
3222
  * // Example Search
2922
- * await medplum.searchResources('Patient')
3223
+ * await medplum.searchResources('Patient');
2923
3224
  * ```
3225
+ *
2924
3226
  * @category Authentication
2925
- * @param clientId The client ID.
2926
- * @param clientSecret The client secret.
3227
+ * @param clientId - The client ID.
3228
+ * @param clientSecret - The client secret.
2927
3229
  */
2928
3230
  setBasicAuth(clientId: string, clientSecret: string): void;
2929
3231
  /**
@@ -2932,8 +3234,8 @@ export declare class MedplumClient extends EventTarget_2 {
2932
3234
  * Once you have the `SubscriptionRequest` returned from this method, you can call `fhircastConnect(subscriptionRequest)` to connect to the subscription stream.
2933
3235
  *
2934
3236
  * @category FHIRcast
2935
- * @param topic The topic to publish to. Usually a UUID.
2936
- * @param events An array of event names to listen for.
3237
+ * @param topic - The topic to publish to. Usually a UUID.
3238
+ * @param events - An array of event names to listen for.
2937
3239
  * @returns A `Promise` that resolves once the request completes, or rejects if it fails.
2938
3240
  */
2939
3241
  fhircastSubscribe(topic: string, events: FhircastEventName[]): Promise<SubscriptionRequest>;
@@ -2941,7 +3243,7 @@ export declare class MedplumClient extends EventTarget_2 {
2941
3243
  * Unsubscribes from the specified topic.
2942
3244
  *
2943
3245
  * @category FHIRcast
2944
- * @param subRequest A `SubscriptionRequest` representing a subscription to cancel. Mode will be set to `unsubscribe` automatically.
3246
+ * @param subRequest - A `SubscriptionRequest` representing a subscription to cancel. Mode will be set to `unsubscribe` automatically.
2945
3247
  * @returns A `Promise` that resolves when request to unsubscribe is completed.
2946
3248
  */
2947
3249
  fhircastUnsubscribe(subRequest: SubscriptionRequest): Promise<void>;
@@ -2949,7 +3251,7 @@ export declare class MedplumClient extends EventTarget_2 {
2949
3251
  * Connects to a `FHIRcast` session.
2950
3252
  *
2951
3253
  * @category FHIRcast
2952
- * @param subRequest The `SubscriptionRequest` to use for connecting.
3254
+ * @param subRequest - The `SubscriptionRequest` to use for connecting.
2953
3255
  * @returns A `FhircastConnection` which emits lifecycle events for the `FHIRcast` WebSocket connection.
2954
3256
  */
2955
3257
  fhircastConnect(subRequest: SubscriptionRequest): FhircastConnection;
@@ -2957,23 +3259,25 @@ export declare class MedplumClient extends EventTarget_2 {
2957
3259
  * Publishes a new context to a given topic for a specified event type.
2958
3260
  *
2959
3261
  * @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.
3262
+ * @param topic - The topic to publish to. Usually a UUID.
3263
+ * @param event - The name of the event to publish an updated context for, ie. `Patient-open`.
3264
+ * @param context - The updated context containing resources relevant to this event.
3265
+ * @param versionId - The `versionId` of the `anchor context` of the given event. Used for `DiagnosticReport-update` event.
2963
3266
  * @returns A `Promise` that resolves once the request completes, or rejects if it fails.
2964
3267
  */
2965
- fhircastPublish(topic: string, event: FhircastEventName, context: FhircastEventContext | FhircastEventContext[]): Promise<void>;
3268
+ fhircastPublish<EventName extends FhircastEventVersionOptional>(topic: string, event: EventName, context: FhircastEventContext<EventName> | FhircastEventContext<EventName>[], versionId?: never): Promise<void>;
3269
+ fhircastPublish<RequiredVersionEvent extends FhircastEventVersionRequired>(topic: string, event: RequiredVersionEvent, context: FhircastEventContext<RequiredVersionEvent> | FhircastEventContext<RequiredVersionEvent>[], versionId: string): Promise<void>;
2966
3270
  /**
2967
3271
  * Invite a user to a project.
2968
- * @param projectId The project ID.
2969
- * @param body The InviteRequest.
3272
+ * @param projectId - The project ID.
3273
+ * @param body - The InviteRequest.
2970
3274
  * @returns Promise that returns a project membership or an operation outcome.
2971
3275
  */
2972
3276
  invite(projectId: string, body: InviteRequest): Promise<ProjectMembership | OperationOutcome>;
2973
3277
  /**
2974
3278
  * Makes a POST request to the tokens endpoint.
2975
3279
  * See: https://openid.net/specs/openid-connect-core-1_0.html#TokenEndpoint
2976
- * @param formBody Token parameters in URL encoded format.
3280
+ * @param formBody - Token parameters in URL encoded format.
2977
3281
  * @returns The user profile resource.
2978
3282
  */
2979
3283
  private fetchTokens;
@@ -2981,7 +3285,7 @@ export declare class MedplumClient extends EventTarget_2 {
2981
3285
  * Verifies the tokens received from the auth server.
2982
3286
  * Validates the JWT against the JWKS.
2983
3287
  * See: https://openid.net/specs/openid-connect-core-1_0.html#TokenEndpoint
2984
- * @param tokens The token response.
3288
+ * @param tokens - The token response.
2985
3289
  * @returns Promise to complete.
2986
3290
  */
2987
3291
  private verifyTokens;
@@ -3112,6 +3416,7 @@ export declare interface MedplumClientOptions {
3112
3416
  *
3113
3417
  * Default is none, and PDF generation is disabled.
3114
3418
  *
3419
+ * @example
3115
3420
  * In browser environments, import the client-side pdfmake library.
3116
3421
  *
3117
3422
  * ```html
@@ -3125,6 +3430,7 @@ export declare interface MedplumClientOptions {
3125
3430
  * </script>
3126
3431
  * ```
3127
3432
  *
3433
+ * @example
3128
3434
  * In Node.js applications:
3129
3435
  *
3130
3436
  * ```ts
@@ -3302,24 +3608,24 @@ export declare class MemoryStorage implements Storage {
3302
3608
  clear(): void;
3303
3609
  /**
3304
3610
  * 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.
3611
+ * @param key - The specified storage key.
3306
3612
  * @returns The current value associated with the given key, or null if the given key does not exist.
3307
3613
  */
3308
3614
  getItem(key: string): string | null;
3309
3615
  /**
3310
3616
  * 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.
3617
+ * @param key - The storage key.
3618
+ * @param value - The new value.
3313
3619
  */
3314
3620
  setItem(key: string, value: string | null): void;
3315
3621
  /**
3316
3622
  * 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.
3623
+ * @param key - The storage key.
3318
3624
  */
3319
3625
  removeItem(key: string): void;
3320
3626
  /**
3321
3627
  * 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.
3628
+ * @param index - The numeric index.
3323
3629
  * @returns The nth key.
3324
3630
  */
3325
3631
  key(index: number): string | null;
@@ -3349,18 +3655,28 @@ export declare interface NewUserRequest {
3349
3655
 
3350
3656
  /**
3351
3657
  * 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.
3658
+ * @param error - The error value which could be a string, Error, OperationOutcome, or other unknown type.
3353
3659
  * @returns A display string for the error.
3354
3660
  */
3355
3661
  export declare function normalizeErrorString(error: unknown): string;
3356
3662
 
3357
3663
  /**
3358
3664
  * Normalizes an error object into an OperationOutcome.
3359
- * @param error The error value which could be a string, Error, OperationOutcome, or other unknown type.
3665
+ * @param error - The error value which could be a string, Error, OperationOutcome, or other unknown type.
3360
3666
  * @returns The normalized OperationOutcome.
3361
3667
  */
3362
3668
  export declare function normalizeOperationOutcome(error: unknown): OperationOutcome;
3363
3669
 
3670
+ export declare class NotEqualsAtom extends BooleanInfixOperatorAtom {
3671
+ constructor(left: Atom, right: Atom);
3672
+ eval(context: AtomContext, input: TypedValue[]): TypedValue[];
3673
+ }
3674
+
3675
+ export declare class NotEquivalentAtom extends BooleanInfixOperatorAtom {
3676
+ constructor(left: Atom, right: Atom);
3677
+ eval(context: AtomContext, input: TypedValue[]): TypedValue[];
3678
+ }
3679
+
3364
3680
  export declare const notFound: OperationOutcome;
3365
3681
 
3366
3682
  export declare const notModified: OperationOutcome;
@@ -3388,6 +3704,18 @@ export declare enum OAuthGrantType {
3388
3704
  TokenExchange = "urn:ietf:params:oauth:grant-type:token-exchange"
3389
3705
  }
3390
3706
 
3707
+ /**
3708
+ * OAuth 2.0 Client Authentication Methods
3709
+ * See: https://openid.net/specs/openid-connect-core-1_0.html#ClientAuthentication
3710
+ */
3711
+ export declare enum OAuthTokenAuthMethod {
3712
+ ClientSecretBasic = "client_secret_basic",
3713
+ ClientSecretPost = "client_secret_post",
3714
+ ClientSecretJwt = "client_secret_jwt",
3715
+ PrivateKeyJwt = "private_key_jwt",
3716
+ None = "none"
3717
+ }
3718
+
3391
3719
  /**
3392
3720
  * OAuth 2.0 Token Type Identifiers
3393
3721
  * See: https://datatracker.ietf.org/doc/html/rfc8693#name-token-type-identifiers
@@ -3412,14 +3740,14 @@ export declare class OperationOutcomeError extends Error {
3412
3740
 
3413
3741
  /**
3414
3742
  * Returns a string represenation of the operation outcome issue.
3415
- * @param issue The operation outcome issue.
3743
+ * @param issue - The operation outcome issue.
3416
3744
  * @returns The string representation of the operation outcome issue.
3417
3745
  */
3418
3746
  export declare function operationOutcomeIssueToString(issue: OperationOutcomeIssue): string;
3419
3747
 
3420
3748
  /**
3421
3749
  * Returns a string represenation of the operation outcome.
3422
- * @param outcome The operation outcome.
3750
+ * @param outcome - The operation outcome.
3423
3751
  * @returns The string representation of the operation outcome.
3424
3752
  */
3425
3753
  export declare function operationOutcomeToString(outcome: OperationOutcome): string;
@@ -3491,10 +3819,21 @@ export declare const OperatorPrecedence: {
3491
3819
  Semicolon: number;
3492
3820
  };
3493
3821
 
3822
+ /**
3823
+ * 6.5.2. or
3824
+ * Returns false if both operands evaluate to false,
3825
+ * true if either operand evaluates to true,
3826
+ * and empty (`{ }`) otherwise:
3827
+ */
3828
+ export declare class OrAtom extends BooleanInfixOperatorAtom {
3829
+ constructor(left: Atom, right: Atom);
3830
+ eval(context: AtomContext, input: TypedValue[]): TypedValue[];
3831
+ }
3832
+
3494
3833
  /**
3495
3834
  * Parses a FHIR criteria string into a SearchRequest.
3496
3835
  * FHIR criteria strings are found on resources such as Subscription.
3497
- * @param criteria The FHIR criteria string.
3836
+ * @param criteria - The FHIR criteria string.
3498
3837
  * @returns Parsed search definition.
3499
3838
  */
3500
3839
  export declare function parseCriteriaAsSearchRequest(criteria: string): SearchRequest;
@@ -3504,14 +3843,14 @@ export declare function parseCriteriaAsSearchRequest(criteria: string): SearchRe
3504
3843
  * The result can be used to evaluate the expression against a resource or other object.
3505
3844
  * This method is useful if you know that you will evaluate the same expression many times
3506
3845
  * against different resources.
3507
- * @param input The FHIRPath expression to parse.
3846
+ * @param input - The FHIRPath expression to parse.
3508
3847
  * @returns The AST representing the expression.
3509
3848
  */
3510
3849
  export declare function parseFhirPath(input: string): FhirPathAtom;
3511
3850
 
3512
3851
  /**
3513
3852
  * Parses a FHIR _filter parameter expression into an AST.
3514
- * @param input The FHIR _filter parameter expression.
3853
+ * @param input - The FHIR _filter parameter expression.
3515
3854
  * @returns The AST representing the filters.
3516
3855
  */
3517
3856
  export declare function parseFilterParameter(input: string): FhirFilterExpression;
@@ -3524,26 +3863,28 @@ export declare function parseFilterParameter(input: string): FhirFilterExpressio
3524
3863
  *
3525
3864
  * Format: YYYY[MM[DD[HH[MM[SS[. S[S[S[S]]]]]]]]][+/-ZZZZ].
3526
3865
  *
3527
- * @param hl7DateTime Date/time string.
3528
- * @param options Optional parsing options.
3866
+ * @param hl7DateTime - Date/time string.
3867
+ * @param options - Optional parsing options.
3529
3868
  * @returns The date in ISO-8601 format.
3530
3869
  */
3531
3870
  export declare function parseHl7DateTime(hl7DateTime: string | undefined, options?: Hl7DateParseOptions): string | undefined;
3532
3871
 
3533
3872
  /**
3534
3873
  * Parses the JWT payload.
3535
- * @param token JWT token.
3874
+ * @param token - JWT token.
3536
3875
  * @returns Collection of key value claims in the JWT payload.
3537
3876
  */
3538
3877
  export declare function parseJWTPayload(token: string): Record<string, number | string>;
3539
3878
 
3540
3879
  /**
3541
3880
  * Parses a FHIR Mapping Language document into an AST.
3542
- * @param input The FHIR Mapping Language document to parse.
3881
+ * @param input - The FHIR Mapping Language document to parse.
3543
3882
  * @returns The AST representing the document.
3544
3883
  */
3545
3884
  export declare function parseMappingLanguage(input: string): StructureMap;
3546
3885
 
3886
+ export declare function parseParameter(searchParam: SearchParameter, modifier: string, value: string): Filter;
3887
+
3547
3888
  export declare class Parser {
3548
3889
  private tokens;
3549
3890
  private prefixParselets;
@@ -3571,7 +3912,7 @@ export declare class ParserBuilder {
3571
3912
 
3572
3913
  /**
3573
3914
  * Parses a reference and returns a tuple of [ResourceType, ID].
3574
- * @param reference A reference to a FHIR resource.
3915
+ * @param reference - A reference to a FHIR resource.
3575
3916
  * @returns A tuple containing the `ResourceType` and the ID of the resource or `undefined` when `undefined` or an invalid reference is passed.
3576
3917
  */
3577
3918
  export declare function parseReference(reference: Reference): [ResourceType, string] | undefined;
@@ -3580,22 +3921,22 @@ export declare function parseReference(reference: undefined): undefined;
3580
3921
 
3581
3922
  /**
3582
3923
  * Parses a URL string into a SearchRequest.
3583
- * @param url The URL to parse.
3924
+ * @param url - The URL to parse.
3584
3925
  * @returns Parsed search definition.
3585
3926
  */
3586
3927
  export declare function parseSearchDefinition<T extends Resource = Resource>(url: string): SearchRequest<T>;
3587
3928
 
3588
3929
  /**
3589
3930
  * Parses a search URL into a search request.
3590
- * @param resourceType The FHIR resource type.
3591
- * @param query The collection of query string parameters.
3931
+ * @param resourceType - The FHIR resource type.
3932
+ * @param query - The collection of query string parameters.
3592
3933
  * @returns A parsed SearchRequest.
3593
3934
  */
3594
3935
  export declare function parseSearchRequest<T extends Resource = Resource>(resourceType: T['resourceType'], query: Record<string, string[] | string | undefined>): SearchRequest<T>;
3595
3936
 
3596
3937
  /**
3597
3938
  * Parses a search URL into a search request.
3598
- * @param url The search URL.
3939
+ * @param url - The search URL.
3599
3940
  * @returns A parsed SearchRequest.
3600
3941
  */
3601
3942
  export declare function parseSearchUrl<T extends Resource = Resource>(url: URL): SearchRequest<T>;
@@ -3603,7 +3944,7 @@ export declare function parseSearchUrl<T extends Resource = Resource>(url: URL):
3603
3944
  /**
3604
3945
  * Parses a StructureDefinition resource into an internal schema better suited for
3605
3946
  * programmatic validation and usage in internal systems
3606
- * @param sd The StructureDefinition resource to parse
3947
+ * @param sd - The StructureDefinition resource to parse
3607
3948
  * @returns The parsed schema for the given resource type
3608
3949
  * @experimental
3609
3950
  */
@@ -3614,8 +3955,8 @@ export declare function parseStructureDefinition(sd: StructureDefinition): Inter
3614
3955
  * any embedded FHIRPath subexpressions (e.g. `{{ %patient.id }}`) with the provided variables.
3615
3956
  *
3616
3957
  * @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
3958
+ * @param query - The X-Fhir-Query string to parse
3959
+ * @param variables - Values to pass into embedded FHIRPath expressions
3619
3960
  * @returns The parsed search request
3620
3961
  */
3621
3962
  export declare function parseXFhirQuery(query: string, variables: Record<string, TypedValue>): SearchRequest;
@@ -3634,53 +3975,53 @@ export declare type PendingSubscriptionRequest = Omit<SubscriptionRequest, 'endp
3634
3975
 
3635
3976
  /**
3636
3977
  * 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.
3978
+ * @param a - The first number.
3979
+ * @param b - The second number.
3980
+ * @param precision - Optional precision in number of digits.
3640
3981
  * @returns True if the two numbers are equal to the given precision.
3641
3982
  */
3642
3983
  export declare function preciseEquals(a: number, b: number, precision?: number): boolean;
3643
3984
 
3644
3985
  /**
3645
3986
  * 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.
3987
+ * @param a - The first number.
3988
+ * @param b - The second number.
3989
+ * @param precision - Optional precision in number of digits.
3649
3990
  * @returns True if the first number is greater than the second number to the given precision.
3650
3991
  */
3651
3992
  export declare function preciseGreaterThan(a: number, b: number, precision?: number): boolean;
3652
3993
 
3653
3994
  /**
3654
3995
  * 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.
3996
+ * @param a - The first number.
3997
+ * @param b - The second number.
3998
+ * @param precision - Optional precision in number of digits.
3658
3999
  * @returns True if the first number is greater than or equal to the second number to the given precision.
3659
4000
  */
3660
4001
  export declare function preciseGreaterThanOrEquals(a: number, b: number, precision?: number): boolean;
3661
4002
 
3662
4003
  /**
3663
4004
  * 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.
4005
+ * @param a - The first number.
4006
+ * @param b - The second number.
4007
+ * @param precision - Optional precision in number of digits.
3667
4008
  * @returns True if the first number is less than the second number to the given precision.
3668
4009
  */
3669
4010
  export declare function preciseLessThan(a: number, b: number, precision?: number): boolean;
3670
4011
 
3671
4012
  /**
3672
4013
  * 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.
4014
+ * @param a - The first number.
4015
+ * @param b - The second number.
4016
+ * @param precision - Optional precision in number of digits.
3676
4017
  * @returns True if the first number is less than or equal to the second number to the given precision.
3677
4018
  */
3678
4019
  export declare function preciseLessThanOrEquals(a: number, b: number, precision?: number): boolean;
3679
4020
 
3680
4021
  /**
3681
4022
  * 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.
4023
+ * @param a - The input number.
4024
+ * @param precision - The precision in number of digits.
3684
4025
  * @returns The number rounded to the specified number of digits.
3685
4026
  */
3686
4027
  export declare function preciseRound(a: number, precision: number): number;
@@ -3697,9 +4038,6 @@ export declare interface PrefixParselet {
3697
4038
  parse(parser: Parser, token: Token): Atom;
3698
4039
  }
3699
4040
 
3700
- /**
3701
- * @internal
3702
- */
3703
4041
  export declare type ProfileResource = Patient | Practitioner | RelatedPerson;
3704
4042
 
3705
4043
  /**
@@ -3825,21 +4163,21 @@ export declare class ReadablePromise<T> implements Promise<T> {
3825
4163
  read(): T;
3826
4164
  /**
3827
4165
  * 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.
4166
+ * @param onfulfilled - The callback to execute when the Promise is resolved.
4167
+ * @param onrejected - The callback to execute when the Promise is rejected.
3830
4168
  * @returns A Promise for the completion of which ever callback is executed.
3831
4169
  */
3832
4170
  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
4171
  /**
3834
4172
  * Attaches a callback for only the rejection of the Promise.
3835
- * @param onrejected The callback to execute when the Promise is rejected.
4173
+ * @param onrejected - The callback to execute when the Promise is rejected.
3836
4174
  * @returns A Promise for the completion of the callback.
3837
4175
  */
3838
4176
  catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<T | TResult>;
3839
4177
  /**
3840
4178
  * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
3841
4179
  * resolved value cannot be modified from the callback.
3842
- * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
4180
+ * @param onfinally - The callback to execute when the Promise is settled (fulfilled or rejected).
3843
4181
  * @returns A Promise for the completion of the callback.
3844
4182
  */
3845
4183
  finally(onfinally?: (() => void) | undefined | null): Promise<T>;
@@ -3847,7 +4185,7 @@ export declare class ReadablePromise<T> implements Promise<T> {
3847
4185
 
3848
4186
  /**
3849
4187
  * Removes duplicates in array using FHIRPath equality rules.
3850
- * @param arr The input array.
4188
+ * @param arr - The input array.
3851
4189
  * @returns The result array with duplicates removed.
3852
4190
  */
3853
4191
  export declare function removeDuplicates(arr: TypedValue[]): TypedValue[];
@@ -3859,14 +4197,14 @@ export declare function removeDuplicates(arr: TypedValue[]): TypedValue[];
3859
4197
  * In the event of cycles, this function will first create a POST request for each resource in the cycle, and then will
3860
4198
  * append a PUT request to the bundle. This ensures that each resources in the cycle is visited twice, and all
3861
4199
  * references can be resolved
3862
- * @param bundle Input bundle with type `batch` or `transaction`
4200
+ * @param bundle - Input bundle with type `batch` or `transaction`
3863
4201
  * @returns Bundle of the same type, with Bundle.entry reordered
3864
4202
  */
3865
4203
  export declare function reorderBundle(bundle: Bundle): Bundle;
3866
4204
 
3867
4205
  /**
3868
4206
  * Returns the ID portion of a reference.
3869
- * @param input A FHIR reference or resource.
4207
+ * @param input - A FHIR reference or resource.
3870
4208
  * @returns The ID portion of a reference.
3871
4209
  */
3872
4210
  export declare function resolveId(input: Reference | Resource | undefined): string | undefined;
@@ -3888,18 +4226,15 @@ export declare interface ResourceVisitor {
3888
4226
  visitProperty?: (parent: TypedValue, key: string, path: string, propertyValues: (TypedValue | TypedValue[] | undefined)[], schema: InternalTypeSchema) => void;
3889
4227
  }
3890
4228
 
3891
- /**
3892
- * @internal
3893
- */
3894
4229
  export declare type ResourceWithCode = Resource & Code;
3895
4230
 
3896
4231
  export declare const RXNORM = "http://www.nlm.nih.gov/research/umls/rxnorm";
3897
4232
 
3898
4233
  /**
3899
4234
  * 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.
4235
+ * @param resource - The resource being acted upon.
4236
+ * @param interaction - The interaction being performed on the resource.
4237
+ * @param accessPolicy - The relevant access policy for the current user.
3903
4238
  * @returns The satisfied access policy, or undefined if the access policy does not permit the given interaction.
3904
4239
  */
3905
4240
  export declare function satisfiedAccessPolicy(resource: Resource, interaction: AccessPolicyInteraction, accessPolicy: AccessPolicy | undefined): AccessPolicyResource | undefined;
@@ -3941,7 +4276,7 @@ export declare interface SearchRequest<T extends Resource = Resource> {
3941
4276
  /**
3942
4277
  * 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
4278
  *
3944
- * @param subscriptionRequest An object representing a subscription request.
4279
+ * @param subscriptionRequest - An object representing a subscription request.
3945
4280
  * @returns A serialized subscription in url-encoded form.
3946
4281
  */
3947
4282
  export declare function serializeFhircastSubscriptionRequest(subscriptionRequest: SubscriptionRequest | PendingSubscriptionRequest): string;
@@ -3950,9 +4285,9 @@ export declare function serverError(err: Error): OperationOutcome;
3950
4285
 
3951
4286
  /**
3952
4287
  * 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.
4288
+ * @param concept - The codeable concept.
4289
+ * @param system - The system string.
4290
+ * @param code - The code value.
3956
4291
  */
3957
4292
  export declare function setCodeBySystem(concept: CodeableConcept, system: string, code: string): void;
3958
4293
 
@@ -3967,9 +4302,9 @@ export declare function setCodeBySystem(concept: CodeableConcept, system: string
3967
4302
  *
3968
4303
  * Otherwise a new identifier is added.
3969
4304
  *
3970
- * @param resource The resource to add the identifier to.
3971
- * @param system The identifier system.
3972
- * @param value The identifier value.
4305
+ * @param resource - The resource to add the identifier to.
4306
+ * @param system - The identifier system.
4307
+ * @param value - The identifier value.
3973
4308
  */
3974
4309
  export declare function setIdentifier(resource: Resource & {
3975
4310
  identifier?: Identifier[];
@@ -3979,7 +4314,7 @@ export declare function singleton(collection: TypedValue[], type?: string): Type
3979
4314
 
3980
4315
  /**
3981
4316
  * Sleeps for the specified number of milliseconds.
3982
- * @param ms Time delay in milliseconds
4317
+ * @param ms - Time delay in milliseconds
3983
4318
  * @returns A promise that resolves after the specified number of milliseconds.
3984
4319
  */
3985
4320
  export declare const sleep: (ms: number) => Promise<void>;
@@ -4011,6 +4346,8 @@ export declare interface SortRule {
4011
4346
  descending?: boolean;
4012
4347
  }
4013
4348
 
4349
+ export declare function splitN(str: string, delim: string, n: number): string[];
4350
+
4014
4351
  /**
4015
4352
  * Reads data from a Readable stream and returns a Promise that resolves with a Buffer containing all the data.
4016
4353
  * @param stream - The Readable stream to read from.
@@ -4023,15 +4360,15 @@ export declare function streamToBuffer(stream: Readable): Promise<Buffer>;
4023
4360
  * Removes properties with empty string values.
4024
4361
  * Removes objects with zero properties.
4025
4362
  * See: https://www.hl7.org/fhir/json.html
4026
- * @param value The input value.
4027
- * @param pretty Optional flag to pretty-print the JSON.
4363
+ * @param value - The input value.
4364
+ * @param pretty - Optional flag to pretty-print the JSON.
4028
4365
  * @returns The resulting JSON string.
4029
4366
  */
4030
4367
  export declare function stringify(value: any, pretty?: boolean): string;
4031
4368
 
4032
4369
  /**
4033
4370
  * 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
4371
+ * @param v - The value to format as a string
4035
4372
  * @returns The stringified value
4036
4373
  */
4037
4374
  export declare function stringifyTypedValue(v: TypedValue): string;
@@ -4053,26 +4390,72 @@ export declare type SubscriptionRequest = {
4053
4390
  * Construct the subset of a resource containing a minimum set of fields. The returned resource is not guaranteed
4054
4391
  * to contain only the provided properties, and may contain others (e.g. `resourceType` and `id`)
4055
4392
  *
4056
- * @param resource The resource to subset
4057
- * @param properties The minimum properties to include in the subset
4393
+ * @param resource - The resource to subset
4394
+ * @param properties - The minimum properties to include in the subset
4058
4395
  * @returns The modified resource, containing the listed properties and possibly other mandatory ones
4059
4396
  */
4060
4397
  export declare function subsetResource<T extends Resource>(resource: T | undefined, properties: string[]): T | undefined;
4061
4398
 
4399
+ export declare class SymbolAtom implements Atom {
4400
+ readonly name: string;
4401
+ constructor(name: string);
4402
+ eval(context: AtomContext, input: TypedValue[]): TypedValue[];
4403
+ private evalValue;
4404
+ toString(): string;
4405
+ }
4406
+
4062
4407
  /**
4063
4408
  * Converts unknown object into a JavaScript boolean.
4064
4409
  * Note that this is different than the FHIRPath "toBoolean",
4065
4410
  * which has particular semantics around arrays, empty arrays, and type conversions.
4066
- * @param obj Any value or array of values.
4411
+ * @param obj - Any value or array of values.
4067
4412
  * @returns The converted boolean value according to FHIRPath rules.
4068
4413
  */
4069
4414
  export declare function toJsBoolean(obj: TypedValue[]): boolean;
4070
4415
 
4071
- declare interface Token extends Marker {
4416
+ export declare interface Token extends Marker {
4072
4417
  id: string;
4073
4418
  value: string;
4074
4419
  }
4075
4420
 
4421
+ export declare class Tokenizer {
4422
+ private readonly str;
4423
+ private readonly keywords;
4424
+ private readonly operators;
4425
+ private readonly dateTimeLiterals;
4426
+ private readonly symbolRegex;
4427
+ private readonly result;
4428
+ private readonly pos;
4429
+ private readonly markStack;
4430
+ constructor(str: string, keywords: string[], operators: string[], options?: TokenizerOptions);
4431
+ tokenize(): Token[];
4432
+ private prevToken;
4433
+ private peekToken;
4434
+ private consumeToken;
4435
+ private consumeWhitespace;
4436
+ private consumeMultiLineComment;
4437
+ private consumeSingleLineComment;
4438
+ private consumeString;
4439
+ private consumeBacktickSymbol;
4440
+ private consumeDateTime;
4441
+ private consumeNumber;
4442
+ private consumeSymbol;
4443
+ private consumeOperator;
4444
+ private consumeWhile;
4445
+ private curr;
4446
+ private prev;
4447
+ private peek;
4448
+ private mark;
4449
+ private reset;
4450
+ private advance;
4451
+ private buildToken;
4452
+ }
4453
+
4454
+ export declare interface TokenizerOptions {
4455
+ dateTimeLiterals?: boolean;
4456
+ symbolRegex?: RegExp;
4457
+ }
4458
+
4076
4459
  export declare interface TokenResponse {
4077
4460
  readonly token_type: string;
4078
4461
  readonly id_token: string;
@@ -4087,7 +4470,7 @@ export declare const tooManyRequests: OperationOutcome;
4087
4470
 
4088
4471
  /**
4089
4472
  * Returns a "best guess" TypedValue for a given value.
4090
- * @param value The unknown value to check.
4473
+ * @param value - The unknown value to check.
4091
4474
  * @returns A "best guess" TypedValue for the given value.
4092
4475
  */
4093
4476
  export declare function toTypedValue(value: unknown): TypedValue;
@@ -4128,12 +4511,24 @@ export declare type TypeName<T> = T extends string ? 'string' : T extends number
4128
4511
 
4129
4512
  export declare const UCUM = "http://unitsofmeasure.org";
4130
4513
 
4514
+ export declare class UnaryOperatorAtom extends PrefixOperatorAtom {
4515
+ readonly impl: (x: TypedValue[]) => TypedValue[];
4516
+ constructor(operator: string, child: Atom, impl: (x: TypedValue[]) => TypedValue[]);
4517
+ eval(context: AtomContext, input: TypedValue[]): TypedValue[];
4518
+ toString(): string;
4519
+ }
4520
+
4131
4521
  export declare const unauthorized: OperationOutcome;
4132
4522
 
4523
+ export declare class UnionAtom extends InfixOperatorAtom {
4524
+ constructor(left: Atom, right: Atom);
4525
+ eval(context: AtomContext, input: TypedValue[]): TypedValue[];
4526
+ }
4527
+
4133
4528
  /**
4134
4529
  * Validates that a `SubscriptionRequest`.
4135
4530
  *
4136
- * @param subscriptionRequest The `SubscriptionRequest` to validate.
4531
+ * @param subscriptionRequest - The `SubscriptionRequest` to validate.
4137
4532
  * @returns A `boolean` indicating whether or not the `SubscriptionRequest` is valid.
4138
4533
  */
4139
4534
  export declare function validateFhircastSubscriptionRequest(subscriptionRequest: SubscriptionRequest | PendingSubscriptionRequest): boolean;
@@ -4142,9 +4537,11 @@ export declare function validateResource(resource: Resource, profile?: Structure
4142
4537
 
4143
4538
  /**
4144
4539
  * Validates that the given string is a valid FHIR resource type.
4540
+ *
4145
4541
  * On success, silently returns void.
4146
4542
  * On failure, throws an OperationOutcomeError.
4147
4543
  *
4544
+ * @example
4148
4545
  * ```ts
4149
4546
  * validateResourceType('Patient'); // nothing
4150
4547
  * validateResourceType('XYZ'); // throws OperationOutcomeError
@@ -4152,6 +4549,7 @@ export declare function validateResource(resource: Resource, profile?: Structure
4152
4549
  *
4153
4550
  * Note that this depends on globalSchema, which is populated by the StructureDefinition loader.
4154
4551
  *
4552
+ * @example
4155
4553
  * In a server context, you can load all schema definitions:
4156
4554
  *
4157
4555
  * ```ts
@@ -4162,6 +4560,7 @@ export declare function validateResource(resource: Resource, profile?: Structure
4162
4560
  * indexStructureDefinitionBundle(readJson('fhir/r4/profiles-resources.json') as Bundle);
4163
4561
  * ```
4164
4562
  *
4563
+ * @example
4165
4564
  * In a client context, you can load the schema definitions using MedplumClient:
4166
4565
  *
4167
4566
  * ```ts
@@ -4170,7 +4569,8 @@ export declare function validateResource(resource: Resource, profile?: Structure
4170
4569
  * const medplum = new MedplumClient();
4171
4570
  * await medplum.requestSchema('Patient');
4172
4571
  * ```
4173
- * @param resourceType The candidate resource type string.
4572
+ *
4573
+ * @param resourceType - The candidate resource type string.
4174
4574
  */
4175
4575
  export declare function validateResourceType(resourceType: string): void;
4176
4576
 
@@ -4178,4 +4578,15 @@ export declare function validationError(details: string): OperationOutcome;
4178
4578
 
4179
4579
  export declare type ValueOrExternalSecret<T extends ExternalSecretPrimitive> = T | ExternalSecret<T>;
4180
4580
 
4581
+ /**
4582
+ * 6.5.4. xor
4583
+ * Returns true if exactly one of the operands evaluates to true,
4584
+ * false if either both operands evaluate to true or both operands evaluate to false,
4585
+ * and the empty collection otherwise.
4586
+ */
4587
+ export declare class XorAtom extends BooleanInfixOperatorAtom {
4588
+ constructor(left: Atom, right: Atom);
4589
+ eval(context: AtomContext, input: TypedValue[]): TypedValue[];
4590
+ }
4591
+
4181
4592
  export { }