@medplum/core 3.2.6 → 3.2.7

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.
@@ -245,7 +245,7 @@ export declare function assertContextVersionOptional(event: string): asserts eve
245
245
  */
246
246
  export declare function assertOk<T>(outcome: OperationOutcome, resource: T | undefined): asserts resource is T;
247
247
 
248
- export declare interface AsyncResourceVisitor {
248
+ export declare interface AsyncCrawlerVisitor {
249
249
  onEnterObject?: (path: string, value: TypedValueWithPath, schema: InternalTypeSchema) => Promise<void>;
250
250
  onExitObject?: (path: string, value: TypedValueWithPath, schema: InternalTypeSchema) => Promise<void>;
251
251
  onEnterResource?: (path: string, value: TypedValueWithPath, schema: InternalTypeSchema) => Promise<void>;
@@ -253,6 +253,9 @@ export declare interface AsyncResourceVisitor {
253
253
  visitPropertyAsync: (parent: TypedValueWithPath, key: string, path: string, value: TypedValueWithPath | TypedValueWithPath[], schema: InternalTypeSchema) => Promise<void>;
254
254
  }
255
255
 
256
+ /** @deprecated - Use AsyncCrawlerVisitor instead */
257
+ export declare type AsyncResourceVisitor = AsyncCrawlerVisitor;
258
+
256
259
  export declare interface Atom {
257
260
  eval(context: AtomContext, input: TypedValue[]): TypedValue[];
258
261
  toString(): string;
@@ -542,15 +545,29 @@ export declare type ConvertToUnion<T> = T[keyof T];
542
545
 
543
546
  export declare const CPT = "http://www.ama-assn.org/go/cpt";
544
547
 
548
+ export declare interface CrawlerOptions {
549
+ skipMissingProperties?: boolean;
550
+ schema?: InternalTypeSchema;
551
+ initialPath?: string;
552
+ }
553
+
554
+ export declare interface CrawlerVisitor {
555
+ onEnterObject?: (path: string, value: TypedValueWithPath, schema: InternalTypeSchema) => void;
556
+ onExitObject?: (path: string, value: TypedValueWithPath, schema: InternalTypeSchema) => void;
557
+ onEnterResource?: (path: string, value: TypedValueWithPath, schema: InternalTypeSchema) => void;
558
+ onExitResource?: (path: string, value: TypedValueWithPath, schema: InternalTypeSchema) => void;
559
+ visitProperty: (parent: TypedValueWithPath, key: string, path: string, propertyValues: (TypedValueWithPath | TypedValueWithPath[])[], schema: InternalTypeSchema) => void;
560
+ }
561
+
545
562
  /**
546
563
  * Crawls the resource synchronously.
547
564
  * @param resource - The resource to crawl.
548
565
  * @param visitor - The visitor functions to apply while crawling.
549
566
  * @param schema - The schema to use for the resource.
550
567
  * @param initialPath - The path within the resource form which to start crawling.
551
- * @deprecated
568
+ * @deprecated - Use crawlTypedValue instead
552
569
  */
553
- export declare function crawlResource(resource: Resource, visitor: ResourceVisitor, schema?: InternalTypeSchema, initialPath?: string): void;
570
+ export declare function crawlResource(resource: Resource, visitor: CrawlerVisitor, schema?: InternalTypeSchema, initialPath?: string): void;
554
571
 
555
572
  /**
556
573
  * Crawls the resource asynchronously.
@@ -558,25 +575,45 @@ export declare function crawlResource(resource: Resource, visitor: ResourceVisit
558
575
  * @param visitor - The visitor functions to apply while crawling.
559
576
  * @param options - Options for how to crawl the resource.
560
577
  * @returns void
561
- * @deprecated
578
+ * @deprecated - Use crawlTypedValueAsync instead
562
579
  */
563
- export declare function crawlResource(resource: Resource, visitor: AsyncResourceVisitor, options: ResourceCrawlerOptions): Promise<void>;
580
+ export declare function crawlResource(resource: Resource, visitor: AsyncCrawlerVisitor, options: CrawlerOptions): Promise<void>;
564
581
 
565
582
  /**
566
583
  * Crawls the resource synchronously.
567
584
  * @param resource - The resource to crawl.
568
585
  * @param visitor - The visitor functions to apply while crawling.
569
586
  * @param options - Options for how to crawl the resource.
587
+ * @deprecated - Use crawlTypedValue instead
570
588
  */
571
- export declare function crawlResource(resource: Resource, visitor: ResourceVisitor, options?: ResourceCrawlerOptions): void;
589
+ export declare function crawlResource(resource: Resource, visitor: CrawlerVisitor, options?: CrawlerOptions): void;
572
590
 
573
591
  /**
574
592
  * Crawls the resource asynchronously.
575
593
  * @param resource - The resource to crawl.
576
594
  * @param visitor - The visitor functions to apply while crawling.
577
595
  * @param options - Options for how to crawl the resource.
596
+ * @returns Promise
597
+ * @deprecated - Use crawlTypedValueAsync instead
598
+ */
599
+ export declare function crawlResourceAsync(resource: Resource, visitor: AsyncCrawlerVisitor, options: CrawlerOptions): Promise<void>;
600
+
601
+ /**
602
+ * Crawls the typed value synchronously.
603
+ * @param typedValue - The typed value to crawl.
604
+ * @param visitor - The visitor functions to apply while crawling.
605
+ * @param options - Options for how to crawl the typed value.
578
606
  */
579
- export declare function crawlResourceAsync(resource: Resource, visitor: AsyncResourceVisitor, options: ResourceCrawlerOptions): Promise<void>;
607
+ export declare function crawlTypedValue(typedValue: TypedValue, visitor: CrawlerVisitor, options?: CrawlerOptions): void;
608
+
609
+ /**
610
+ * Crawls the typed value asynchronously.
611
+ * @param typedValue - The typed value to crawl.
612
+ * @param visitor - The visitor functions to apply while crawling.
613
+ * @param options - Options for how to crawl the typed value.
614
+ * @returns Promise to crawl the typed value.
615
+ */
616
+ export declare function crawlTypedValueAsync(typedValue: TypedValue, visitor: AsyncCrawlerVisitor, options?: CrawlerOptions): Promise<void>;
580
617
 
581
618
  /**
582
619
  * Binary upload options.
@@ -2080,6 +2117,7 @@ export declare interface InternalSchemaElement {
2080
2117
  export declare interface InternalTypeSchema {
2081
2118
  name: string;
2082
2119
  type: string;
2120
+ path: string;
2083
2121
  title?: string;
2084
2122
  url?: string;
2085
2123
  kind?: string;
@@ -2237,6 +2275,13 @@ export declare function isPopulated<T extends {
2237
2275
  length: number;
2238
2276
  } | object>(arg: CanBePopulated | undefined | null): arg is T;
2239
2277
 
2278
+ /**
2279
+ * Returns true if the type code is a primitive type.
2280
+ * @param code - The type code to check.
2281
+ * @returns True if the type code is a primitive type.
2282
+ */
2283
+ export declare function isPrimitiveType(code: string): boolean;
2284
+
2240
2285
  export declare function isProfileLoaded(profileUrl: string): boolean;
2241
2286
 
2242
2287
  /**
@@ -4359,6 +4404,7 @@ export declare interface MedplumInfraConfig {
4359
4404
  rdsInstances: number;
4360
4405
  rdsInstanceType: string;
4361
4406
  rdsInstanceVersion?: string;
4407
+ rdsInstanceParameters?: StringMap;
4362
4408
  rdsSecretsArn?: string;
4363
4409
  rdsReaderInstanceType?: string;
4364
4410
  rdsProxyEnabled?: boolean;
@@ -4484,6 +4530,7 @@ export declare interface MedplumSourceInfraConfig {
4484
4530
  rdsSecretsArn?: ValueOrExternalSecret<string>;
4485
4531
  rdsReaderInstanceType?: ValueOrExternalSecret<string>;
4486
4532
  rdsProxyEnabled?: ValueOrExternalSecret<boolean>;
4533
+ rdsClusterParameters?: StringMap;
4487
4534
  cacheNodeType?: ValueOrExternalSecret<string>;
4488
4535
  cacheSecurityGroupId?: ValueOrExternalSecret<string>;
4489
4536
  desiredServerCount: ValueOrExternalSecret<number>;
@@ -5335,11 +5382,8 @@ export declare type ResourceArray<T extends Resource = Resource> = T[] & {
5335
5382
  bundle: Bundle<T>;
5336
5383
  };
5337
5384
 
5338
- export declare type ResourceCrawlerOptions = {
5339
- skipMissingProperties?: boolean;
5340
- schema?: InternalTypeSchema;
5341
- initialPath?: string;
5342
- };
5385
+ /** @deprecated - Use CrawlerOptions instead */
5386
+ export declare type ResourceCrawlerOptions = CrawlerOptions;
5343
5387
 
5344
5388
  export declare type ResourceMatchesSubscriptionCriteria = {
5345
5389
  resource: Resource;
@@ -5351,13 +5395,8 @@ export declare type ResourceMatchesSubscriptionCriteria = {
5351
5395
 
5352
5396
  export declare function resourceMatchesSubscriptionCriteria({ resource, subscription, context, getPreviousResource, logger, }: ResourceMatchesSubscriptionCriteria): Promise<boolean>;
5353
5397
 
5354
- export declare interface ResourceVisitor {
5355
- onEnterObject?: (path: string, value: TypedValueWithPath, schema: InternalTypeSchema) => void;
5356
- onExitObject?: (path: string, value: TypedValueWithPath, schema: InternalTypeSchema) => void;
5357
- onEnterResource?: (path: string, value: TypedValueWithPath, schema: InternalTypeSchema) => void;
5358
- onExitResource?: (path: string, value: TypedValueWithPath, schema: InternalTypeSchema) => void;
5359
- visitProperty: (parent: TypedValueWithPath, key: string, path: string, propertyValues: (TypedValueWithPath | TypedValueWithPath[])[], schema: InternalTypeSchema) => void;
5360
- }
5398
+ /** @deprecated - Use CrawlerVisitor instead */
5399
+ export declare type ResourceVisitor = CrawlerVisitor;
5361
5400
 
5362
5401
  export declare type ResourceWithCode = Resource & Code;
5363
5402
 
@@ -5396,6 +5435,7 @@ export declare interface SearchRequest<T extends Resource = Resource> {
5396
5435
  readonly resourceType: T['resourceType'];
5397
5436
  filters?: Filter[];
5398
5437
  sortRules?: SortRule[];
5438
+ cursor?: string;
5399
5439
  offset?: number;
5400
5440
  count?: number;
5401
5441
  fields?: string[];
@@ -5568,10 +5608,10 @@ export declare type StringMap = {
5568
5608
  *
5569
5609
  * @param structureMap - The StructureMap to transform.
5570
5610
  * @param input - The input values.
5571
- * @param loader - Optional loader function for loading imported StructureMaps.
5611
+ * @param transformMaps - Optional collection of imported StructureMaps and ConceptMaps.
5572
5612
  * @returns The transformed values.
5573
5613
  */
5574
- export declare function structureMapTransform(structureMap: StructureMap, input: TypedValue[], loader?: (url: string) => StructureMap[]): TypedValue[];
5614
+ export declare function structureMapTransform(structureMap: StructureMap, input: TypedValue[], transformMaps?: TransformMapCollection): TypedValue[];
5575
5615
 
5576
5616
  export declare interface SubManagerOptions {
5577
5617
  ReconnectingWebSocket?: IReconnectingWebSocketCtor;
@@ -5784,6 +5824,17 @@ export declare function toPeriod(input: unknown): Period | undefined;
5784
5824
  */
5785
5825
  export declare function toTypedValue(value: unknown): TypedValue;
5786
5826
 
5827
+ /**
5828
+ * The TransformMapCollection class is a collection of StructureMap and ConceptMap resources.
5829
+ * It is used to store and retrieve imported StructureMaps and ConceptMaps by URL.
5830
+ */
5831
+ export declare class TransformMapCollection {
5832
+ readonly resources: (StructureMap | ConceptMap)[];
5833
+ constructor(resources?: (StructureMap | ConceptMap)[]);
5834
+ get<K extends ResourceType>(resourceType: K, url: string): ExtractResource<K>[];
5835
+ private matchesUrl;
5836
+ }
5837
+
5787
5838
  export declare function tryGetDataType(type: string, profileUrl?: string): InternalTypeSchema | undefined;
5788
5839
 
5789
5840
  /**
@@ -245,7 +245,7 @@ export declare function assertContextVersionOptional(event: string): asserts eve
245
245
  */
246
246
  export declare function assertOk<T>(outcome: OperationOutcome, resource: T | undefined): asserts resource is T;
247
247
 
248
- export declare interface AsyncResourceVisitor {
248
+ export declare interface AsyncCrawlerVisitor {
249
249
  onEnterObject?: (path: string, value: TypedValueWithPath, schema: InternalTypeSchema) => Promise<void>;
250
250
  onExitObject?: (path: string, value: TypedValueWithPath, schema: InternalTypeSchema) => Promise<void>;
251
251
  onEnterResource?: (path: string, value: TypedValueWithPath, schema: InternalTypeSchema) => Promise<void>;
@@ -253,6 +253,9 @@ export declare interface AsyncResourceVisitor {
253
253
  visitPropertyAsync: (parent: TypedValueWithPath, key: string, path: string, value: TypedValueWithPath | TypedValueWithPath[], schema: InternalTypeSchema) => Promise<void>;
254
254
  }
255
255
 
256
+ /** @deprecated - Use AsyncCrawlerVisitor instead */
257
+ export declare type AsyncResourceVisitor = AsyncCrawlerVisitor;
258
+
256
259
  export declare interface Atom {
257
260
  eval(context: AtomContext, input: TypedValue[]): TypedValue[];
258
261
  toString(): string;
@@ -542,15 +545,29 @@ export declare type ConvertToUnion<T> = T[keyof T];
542
545
 
543
546
  export declare const CPT = "http://www.ama-assn.org/go/cpt";
544
547
 
548
+ export declare interface CrawlerOptions {
549
+ skipMissingProperties?: boolean;
550
+ schema?: InternalTypeSchema;
551
+ initialPath?: string;
552
+ }
553
+
554
+ export declare interface CrawlerVisitor {
555
+ onEnterObject?: (path: string, value: TypedValueWithPath, schema: InternalTypeSchema) => void;
556
+ onExitObject?: (path: string, value: TypedValueWithPath, schema: InternalTypeSchema) => void;
557
+ onEnterResource?: (path: string, value: TypedValueWithPath, schema: InternalTypeSchema) => void;
558
+ onExitResource?: (path: string, value: TypedValueWithPath, schema: InternalTypeSchema) => void;
559
+ visitProperty: (parent: TypedValueWithPath, key: string, path: string, propertyValues: (TypedValueWithPath | TypedValueWithPath[])[], schema: InternalTypeSchema) => void;
560
+ }
561
+
545
562
  /**
546
563
  * Crawls the resource synchronously.
547
564
  * @param resource - The resource to crawl.
548
565
  * @param visitor - The visitor functions to apply while crawling.
549
566
  * @param schema - The schema to use for the resource.
550
567
  * @param initialPath - The path within the resource form which to start crawling.
551
- * @deprecated
568
+ * @deprecated - Use crawlTypedValue instead
552
569
  */
553
- export declare function crawlResource(resource: Resource, visitor: ResourceVisitor, schema?: InternalTypeSchema, initialPath?: string): void;
570
+ export declare function crawlResource(resource: Resource, visitor: CrawlerVisitor, schema?: InternalTypeSchema, initialPath?: string): void;
554
571
 
555
572
  /**
556
573
  * Crawls the resource asynchronously.
@@ -558,25 +575,45 @@ export declare function crawlResource(resource: Resource, visitor: ResourceVisit
558
575
  * @param visitor - The visitor functions to apply while crawling.
559
576
  * @param options - Options for how to crawl the resource.
560
577
  * @returns void
561
- * @deprecated
578
+ * @deprecated - Use crawlTypedValueAsync instead
562
579
  */
563
- export declare function crawlResource(resource: Resource, visitor: AsyncResourceVisitor, options: ResourceCrawlerOptions): Promise<void>;
580
+ export declare function crawlResource(resource: Resource, visitor: AsyncCrawlerVisitor, options: CrawlerOptions): Promise<void>;
564
581
 
565
582
  /**
566
583
  * Crawls the resource synchronously.
567
584
  * @param resource - The resource to crawl.
568
585
  * @param visitor - The visitor functions to apply while crawling.
569
586
  * @param options - Options for how to crawl the resource.
587
+ * @deprecated - Use crawlTypedValue instead
570
588
  */
571
- export declare function crawlResource(resource: Resource, visitor: ResourceVisitor, options?: ResourceCrawlerOptions): void;
589
+ export declare function crawlResource(resource: Resource, visitor: CrawlerVisitor, options?: CrawlerOptions): void;
572
590
 
573
591
  /**
574
592
  * Crawls the resource asynchronously.
575
593
  * @param resource - The resource to crawl.
576
594
  * @param visitor - The visitor functions to apply while crawling.
577
595
  * @param options - Options for how to crawl the resource.
596
+ * @returns Promise
597
+ * @deprecated - Use crawlTypedValueAsync instead
598
+ */
599
+ export declare function crawlResourceAsync(resource: Resource, visitor: AsyncCrawlerVisitor, options: CrawlerOptions): Promise<void>;
600
+
601
+ /**
602
+ * Crawls the typed value synchronously.
603
+ * @param typedValue - The typed value to crawl.
604
+ * @param visitor - The visitor functions to apply while crawling.
605
+ * @param options - Options for how to crawl the typed value.
578
606
  */
579
- export declare function crawlResourceAsync(resource: Resource, visitor: AsyncResourceVisitor, options: ResourceCrawlerOptions): Promise<void>;
607
+ export declare function crawlTypedValue(typedValue: TypedValue, visitor: CrawlerVisitor, options?: CrawlerOptions): void;
608
+
609
+ /**
610
+ * Crawls the typed value asynchronously.
611
+ * @param typedValue - The typed value to crawl.
612
+ * @param visitor - The visitor functions to apply while crawling.
613
+ * @param options - Options for how to crawl the typed value.
614
+ * @returns Promise to crawl the typed value.
615
+ */
616
+ export declare function crawlTypedValueAsync(typedValue: TypedValue, visitor: AsyncCrawlerVisitor, options?: CrawlerOptions): Promise<void>;
580
617
 
581
618
  /**
582
619
  * Binary upload options.
@@ -2080,6 +2117,7 @@ export declare interface InternalSchemaElement {
2080
2117
  export declare interface InternalTypeSchema {
2081
2118
  name: string;
2082
2119
  type: string;
2120
+ path: string;
2083
2121
  title?: string;
2084
2122
  url?: string;
2085
2123
  kind?: string;
@@ -2237,6 +2275,13 @@ export declare function isPopulated<T extends {
2237
2275
  length: number;
2238
2276
  } | object>(arg: CanBePopulated | undefined | null): arg is T;
2239
2277
 
2278
+ /**
2279
+ * Returns true if the type code is a primitive type.
2280
+ * @param code - The type code to check.
2281
+ * @returns True if the type code is a primitive type.
2282
+ */
2283
+ export declare function isPrimitiveType(code: string): boolean;
2284
+
2240
2285
  export declare function isProfileLoaded(profileUrl: string): boolean;
2241
2286
 
2242
2287
  /**
@@ -4359,6 +4404,7 @@ export declare interface MedplumInfraConfig {
4359
4404
  rdsInstances: number;
4360
4405
  rdsInstanceType: string;
4361
4406
  rdsInstanceVersion?: string;
4407
+ rdsInstanceParameters?: StringMap;
4362
4408
  rdsSecretsArn?: string;
4363
4409
  rdsReaderInstanceType?: string;
4364
4410
  rdsProxyEnabled?: boolean;
@@ -4484,6 +4530,7 @@ export declare interface MedplumSourceInfraConfig {
4484
4530
  rdsSecretsArn?: ValueOrExternalSecret<string>;
4485
4531
  rdsReaderInstanceType?: ValueOrExternalSecret<string>;
4486
4532
  rdsProxyEnabled?: ValueOrExternalSecret<boolean>;
4533
+ rdsClusterParameters?: StringMap;
4487
4534
  cacheNodeType?: ValueOrExternalSecret<string>;
4488
4535
  cacheSecurityGroupId?: ValueOrExternalSecret<string>;
4489
4536
  desiredServerCount: ValueOrExternalSecret<number>;
@@ -5335,11 +5382,8 @@ export declare type ResourceArray<T extends Resource = Resource> = T[] & {
5335
5382
  bundle: Bundle<T>;
5336
5383
  };
5337
5384
 
5338
- export declare type ResourceCrawlerOptions = {
5339
- skipMissingProperties?: boolean;
5340
- schema?: InternalTypeSchema;
5341
- initialPath?: string;
5342
- };
5385
+ /** @deprecated - Use CrawlerOptions instead */
5386
+ export declare type ResourceCrawlerOptions = CrawlerOptions;
5343
5387
 
5344
5388
  export declare type ResourceMatchesSubscriptionCriteria = {
5345
5389
  resource: Resource;
@@ -5351,13 +5395,8 @@ export declare type ResourceMatchesSubscriptionCriteria = {
5351
5395
 
5352
5396
  export declare function resourceMatchesSubscriptionCriteria({ resource, subscription, context, getPreviousResource, logger, }: ResourceMatchesSubscriptionCriteria): Promise<boolean>;
5353
5397
 
5354
- export declare interface ResourceVisitor {
5355
- onEnterObject?: (path: string, value: TypedValueWithPath, schema: InternalTypeSchema) => void;
5356
- onExitObject?: (path: string, value: TypedValueWithPath, schema: InternalTypeSchema) => void;
5357
- onEnterResource?: (path: string, value: TypedValueWithPath, schema: InternalTypeSchema) => void;
5358
- onExitResource?: (path: string, value: TypedValueWithPath, schema: InternalTypeSchema) => void;
5359
- visitProperty: (parent: TypedValueWithPath, key: string, path: string, propertyValues: (TypedValueWithPath | TypedValueWithPath[])[], schema: InternalTypeSchema) => void;
5360
- }
5398
+ /** @deprecated - Use CrawlerVisitor instead */
5399
+ export declare type ResourceVisitor = CrawlerVisitor;
5361
5400
 
5362
5401
  export declare type ResourceWithCode = Resource & Code;
5363
5402
 
@@ -5396,6 +5435,7 @@ export declare interface SearchRequest<T extends Resource = Resource> {
5396
5435
  readonly resourceType: T['resourceType'];
5397
5436
  filters?: Filter[];
5398
5437
  sortRules?: SortRule[];
5438
+ cursor?: string;
5399
5439
  offset?: number;
5400
5440
  count?: number;
5401
5441
  fields?: string[];
@@ -5568,10 +5608,10 @@ export declare type StringMap = {
5568
5608
  *
5569
5609
  * @param structureMap - The StructureMap to transform.
5570
5610
  * @param input - The input values.
5571
- * @param loader - Optional loader function for loading imported StructureMaps.
5611
+ * @param transformMaps - Optional collection of imported StructureMaps and ConceptMaps.
5572
5612
  * @returns The transformed values.
5573
5613
  */
5574
- export declare function structureMapTransform(structureMap: StructureMap, input: TypedValue[], loader?: (url: string) => StructureMap[]): TypedValue[];
5614
+ export declare function structureMapTransform(structureMap: StructureMap, input: TypedValue[], transformMaps?: TransformMapCollection): TypedValue[];
5575
5615
 
5576
5616
  export declare interface SubManagerOptions {
5577
5617
  ReconnectingWebSocket?: IReconnectingWebSocketCtor;
@@ -5784,6 +5824,17 @@ export declare function toPeriod(input: unknown): Period | undefined;
5784
5824
  */
5785
5825
  export declare function toTypedValue(value: unknown): TypedValue;
5786
5826
 
5827
+ /**
5828
+ * The TransformMapCollection class is a collection of StructureMap and ConceptMap resources.
5829
+ * It is used to store and retrieve imported StructureMaps and ConceptMaps by URL.
5830
+ */
5831
+ export declare class TransformMapCollection {
5832
+ readonly resources: (StructureMap | ConceptMap)[];
5833
+ constructor(resources?: (StructureMap | ConceptMap)[]);
5834
+ get<K extends ResourceType>(resourceType: K, url: string): ExtractResource<K>[];
5835
+ private matchesUrl;
5836
+ }
5837
+
5787
5838
  export declare function tryGetDataType(type: string, profileUrl?: string): InternalTypeSchema | undefined;
5788
5839
 
5789
5840
  /**