@medplum/core 3.3.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +7 -7
- package/dist/cjs/index.cjs.map +3 -3
- package/dist/cjs/index.d.ts +36 -192
- package/dist/esm/index.d.ts +36 -192
- package/dist/esm/index.mjs +7 -7
- package/dist/esm/index.mjs.map +3 -3
- package/package.json +3 -3
package/dist/esm/index.d.ts
CHANGED
|
@@ -262,9 +262,6 @@ export declare interface AsyncCrawlerVisitor {
|
|
|
262
262
|
visitPropertyAsync: (parent: TypedValueWithPath, key: string, path: string, value: TypedValueWithPath | TypedValueWithPath[], schema: InternalTypeSchema) => Promise<void>;
|
|
263
263
|
}
|
|
264
264
|
|
|
265
|
-
/** @deprecated - Use AsyncCrawlerVisitor instead */
|
|
266
|
-
export declare type AsyncResourceVisitor = AsyncCrawlerVisitor;
|
|
267
|
-
|
|
268
265
|
export declare interface Atom {
|
|
269
266
|
eval(context: AtomContext, input: TypedValue[]): TypedValue[];
|
|
270
267
|
toString(): string;
|
|
@@ -581,45 +578,6 @@ export declare interface CrawlerVisitor {
|
|
|
581
578
|
visitProperty: (parent: TypedValueWithPath, key: string, path: string, propertyValues: (TypedValueWithPath | TypedValueWithPath[])[], schema: InternalTypeSchema) => void;
|
|
582
579
|
}
|
|
583
580
|
|
|
584
|
-
/**
|
|
585
|
-
* Crawls the resource synchronously.
|
|
586
|
-
* @param resource - The resource to crawl.
|
|
587
|
-
* @param visitor - The visitor functions to apply while crawling.
|
|
588
|
-
* @param schema - The schema to use for the resource.
|
|
589
|
-
* @param initialPath - The path within the resource form which to start crawling.
|
|
590
|
-
* @deprecated - Use crawlTypedValue instead
|
|
591
|
-
*/
|
|
592
|
-
export declare function crawlResource(resource: Resource, visitor: CrawlerVisitor, schema?: InternalTypeSchema, initialPath?: string): void;
|
|
593
|
-
|
|
594
|
-
/**
|
|
595
|
-
* Crawls the resource asynchronously.
|
|
596
|
-
* @param resource - The resource to crawl.
|
|
597
|
-
* @param visitor - The visitor functions to apply while crawling.
|
|
598
|
-
* @param options - Options for how to crawl the resource.
|
|
599
|
-
* @returns void
|
|
600
|
-
* @deprecated - Use crawlTypedValueAsync instead
|
|
601
|
-
*/
|
|
602
|
-
export declare function crawlResource(resource: Resource, visitor: AsyncCrawlerVisitor, options: CrawlerOptions): Promise<void>;
|
|
603
|
-
|
|
604
|
-
/**
|
|
605
|
-
* Crawls the resource synchronously.
|
|
606
|
-
* @param resource - The resource to crawl.
|
|
607
|
-
* @param visitor - The visitor functions to apply while crawling.
|
|
608
|
-
* @param options - Options for how to crawl the resource.
|
|
609
|
-
* @deprecated - Use crawlTypedValue instead
|
|
610
|
-
*/
|
|
611
|
-
export declare function crawlResource(resource: Resource, visitor: CrawlerVisitor, options?: CrawlerOptions): void;
|
|
612
|
-
|
|
613
|
-
/**
|
|
614
|
-
* Crawls the resource asynchronously.
|
|
615
|
-
* @param resource - The resource to crawl.
|
|
616
|
-
* @param visitor - The visitor functions to apply while crawling.
|
|
617
|
-
* @param options - Options for how to crawl the resource.
|
|
618
|
-
* @returns Promise
|
|
619
|
-
* @deprecated - Use crawlTypedValueAsync instead
|
|
620
|
-
*/
|
|
621
|
-
export declare function crawlResourceAsync(resource: Resource, visitor: AsyncCrawlerVisitor, options: CrawlerOptions): Promise<void>;
|
|
622
|
-
|
|
623
581
|
/**
|
|
624
582
|
* Crawls the typed value synchronously.
|
|
625
583
|
* @param typedValue - The typed value to crawl.
|
|
@@ -1786,7 +1744,11 @@ export declare function getRandomString(): string;
|
|
|
1786
1744
|
* @param input - The FHIR resource or reference.
|
|
1787
1745
|
* @returns A reference string of the form resourceType/id.
|
|
1788
1746
|
*/
|
|
1789
|
-
export declare function getReferenceString(input: Reference
|
|
1747
|
+
export declare function getReferenceString(input: (Reference & {
|
|
1748
|
+
reference: string;
|
|
1749
|
+
}) | WithId<Resource>): string;
|
|
1750
|
+
|
|
1751
|
+
export declare function getReferenceString(input: Reference | Resource): string | undefined;
|
|
1790
1752
|
|
|
1791
1753
|
/**
|
|
1792
1754
|
* Returns an array of all resource types.
|
|
@@ -1943,15 +1905,6 @@ export declare class Hl7Field {
|
|
|
1943
1905
|
* @param context - Optional HL7 parsing context.
|
|
1944
1906
|
*/
|
|
1945
1907
|
constructor(components: string[][], context?: Hl7Context);
|
|
1946
|
-
/**
|
|
1947
|
-
* Returns an HL7 component by index.
|
|
1948
|
-
* @param component - The component index.
|
|
1949
|
-
* @param subcomponent - Optional subcomponent index.
|
|
1950
|
-
* @param repetition - Optional repetition index.
|
|
1951
|
-
* @returns The string value of the specified component.
|
|
1952
|
-
* @deprecated Use getComponent() instead. This method will be removed in a future release.
|
|
1953
|
-
*/
|
|
1954
|
-
get(component: number, subcomponent?: number, repetition?: number): string;
|
|
1955
1908
|
/**
|
|
1956
1909
|
* Returns an HL7 component by index.
|
|
1957
1910
|
*
|
|
@@ -1999,20 +1952,6 @@ export declare class Hl7Message {
|
|
|
1999
1952
|
* @returns The HL7 message header.
|
|
2000
1953
|
*/
|
|
2001
1954
|
get header(): Hl7Segment;
|
|
2002
|
-
/**
|
|
2003
|
-
* Returns an HL7 segment by index or by name.
|
|
2004
|
-
* @param index - The HL7 segment index or name.
|
|
2005
|
-
* @returns The HL7 segment if found; otherwise, undefined.
|
|
2006
|
-
* @deprecated Use getSegment() instead. This method will be removed in a future release.
|
|
2007
|
-
*/
|
|
2008
|
-
get(index: number | string): Hl7Segment | undefined;
|
|
2009
|
-
/**
|
|
2010
|
-
* Returns all HL7 segments of a given name.
|
|
2011
|
-
* @param name - The HL7 segment name.
|
|
2012
|
-
* @returns An array of HL7 segments with the specified name.
|
|
2013
|
-
* @deprecated Use getAllSegments() instead. This method will be removed in a future release.
|
|
2014
|
-
*/
|
|
2015
|
-
getAll(name: string): Hl7Segment[];
|
|
2016
1955
|
/**
|
|
2017
1956
|
* Returns an HL7 segment by index or by name.
|
|
2018
1957
|
*
|
|
@@ -2064,13 +2003,6 @@ export declare class Hl7Segment {
|
|
|
2064
2003
|
* @param context - Optional HL7 parsing context.
|
|
2065
2004
|
*/
|
|
2066
2005
|
constructor(fields: Hl7Field[] | string[], context?: Hl7Context);
|
|
2067
|
-
/**
|
|
2068
|
-
* Returns an HL7 field by index.
|
|
2069
|
-
* @param index - The HL7 field index.
|
|
2070
|
-
* @returns The HL7 field.
|
|
2071
|
-
* @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.
|
|
2072
|
-
*/
|
|
2073
|
-
get(index: number): Hl7Field;
|
|
2074
2006
|
/**
|
|
2075
2007
|
* Returns an HL7 field by index.
|
|
2076
2008
|
*
|
|
@@ -2452,7 +2384,7 @@ export declare function isQuantityEquivalent(x: Quantity, y: Quantity): boolean;
|
|
|
2452
2384
|
export declare function isRedirect(outcome: OperationOutcome): boolean;
|
|
2453
2385
|
|
|
2454
2386
|
/**
|
|
2455
|
-
*
|
|
2387
|
+
* Type guard to validate that an object is a FHIR reference
|
|
2456
2388
|
* @param value - The object to check
|
|
2457
2389
|
* @returns True if the input is of type 'object' and contains property 'reference'
|
|
2458
2390
|
*/
|
|
@@ -2461,11 +2393,12 @@ export declare function isReference(value: unknown): value is Reference & {
|
|
|
2461
2393
|
};
|
|
2462
2394
|
|
|
2463
2395
|
/**
|
|
2464
|
-
*
|
|
2396
|
+
* Type guard to validate that an object is a FHIR resource
|
|
2465
2397
|
* @param value - The object to check
|
|
2398
|
+
* @param resourceType - Checks that the resource is of the given type
|
|
2466
2399
|
* @returns True if the input is of type 'object' and contains property 'resourceType'
|
|
2467
2400
|
*/
|
|
2468
|
-
export declare function isResource(value: unknown): value is
|
|
2401
|
+
export declare function isResource<T extends Resource>(value: unknown, resourceType?: T['resourceType']): value is T;
|
|
2469
2402
|
|
|
2470
2403
|
/**
|
|
2471
2404
|
* Returns true if the given string is a valid FHIR resource type.
|
|
@@ -2488,6 +2421,8 @@ export declare function isResourceType(resourceType: string): boolean;
|
|
|
2488
2421
|
*/
|
|
2489
2422
|
export declare function isResourceTypeSchema(typeSchema: InternalTypeSchema): boolean;
|
|
2490
2423
|
|
|
2424
|
+
export declare function isResourceWithId<T extends Resource>(resource: unknown, resourceType?: T['resourceType']): resource is WithId<T>;
|
|
2425
|
+
|
|
2491
2426
|
export declare function isSliceDefinitionWithTypes(slice: SliceDefinition): slice is SliceDefinitionWithTypes;
|
|
2492
2427
|
|
|
2493
2428
|
/**
|
|
@@ -2806,16 +2741,6 @@ export declare interface Marker {
|
|
|
2806
2741
|
|
|
2807
2742
|
export declare function matchDiscriminant(value: TypedValue | TypedValue[] | undefined, discriminator: SliceDiscriminator, slice: SliceDefinition, elements?: Record<string, InternalSchemaElement>): boolean;
|
|
2808
2743
|
|
|
2809
|
-
/**
|
|
2810
|
-
* Returns true if the resource satisfies the current access policy.
|
|
2811
|
-
* @param accessPolicy - The access policy.
|
|
2812
|
-
* @param resource - The resource.
|
|
2813
|
-
* @param readonlyMode - True if the resource is being read.
|
|
2814
|
-
* @returns True if the resource matches the access policy.
|
|
2815
|
-
* @deprecated Use satisfiedAccessPolicy() instead.
|
|
2816
|
-
*/
|
|
2817
|
-
export declare function matchesAccessPolicy(accessPolicy: AccessPolicy, resource: Resource, readonlyMode: boolean): boolean;
|
|
2818
|
-
|
|
2819
2744
|
/**
|
|
2820
2745
|
* Returns true if the value is in the range accounting for precision.
|
|
2821
2746
|
* @param value - The numeric value.
|
|
@@ -3014,7 +2939,7 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
|
|
|
3014
2939
|
* @category Caching
|
|
3015
2940
|
* @param resourceType - The resource type to invalidate.
|
|
3016
2941
|
*/
|
|
3017
|
-
invalidateSearches
|
|
2942
|
+
invalidateSearches(resourceType: ResourceType): void;
|
|
3018
2943
|
/**
|
|
3019
2944
|
* Makes an HTTP GET request to the specified URL.
|
|
3020
2945
|
*
|
|
@@ -3255,7 +3180,7 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
|
|
|
3255
3180
|
* @param options - Optional fetch options.
|
|
3256
3181
|
* @returns Promise to the search result bundle.
|
|
3257
3182
|
*/
|
|
3258
|
-
search<
|
|
3183
|
+
search<RT extends ResourceType>(resourceType: RT, query?: QueryTypes, options?: MedplumRequestOptions): ReadablePromise<Bundle<WithId<ExtractResource<RT>>>>;
|
|
3259
3184
|
/**
|
|
3260
3185
|
* Sends a FHIR search request for a single resource.
|
|
3261
3186
|
*
|
|
@@ -3278,7 +3203,7 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
|
|
|
3278
3203
|
* @param options - Optional fetch options.
|
|
3279
3204
|
* @returns Promise to the first search result.
|
|
3280
3205
|
*/
|
|
3281
|
-
searchOne<
|
|
3206
|
+
searchOne<RT extends ResourceType>(resourceType: RT, query?: QueryTypes, options?: MedplumRequestOptions): ReadablePromise<WithId<ExtractResource<RT>> | undefined>;
|
|
3282
3207
|
/**
|
|
3283
3208
|
* Sends a FHIR search request for an array of resources.
|
|
3284
3209
|
*
|
|
@@ -3301,7 +3226,7 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
|
|
|
3301
3226
|
* @param options - Optional fetch options.
|
|
3302
3227
|
* @returns Promise to the array of search results.
|
|
3303
3228
|
*/
|
|
3304
|
-
searchResources<
|
|
3229
|
+
searchResources<RT extends ResourceType>(resourceType: RT, query?: QueryTypes, options?: MedplumRequestOptions): ReadablePromise<ResourceArray<WithId<ExtractResource<RT>>>>;
|
|
3305
3230
|
/**
|
|
3306
3231
|
* Creates an
|
|
3307
3232
|
* [async generator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AsyncGenerator)
|
|
@@ -3326,18 +3251,7 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
|
|
|
3326
3251
|
* @param options - Optional fetch options.
|
|
3327
3252
|
* @yields An async generator, where each result is an array of resources for each page.
|
|
3328
3253
|
*/
|
|
3329
|
-
searchResourcePages<
|
|
3330
|
-
/**
|
|
3331
|
-
* Searches a ValueSet resource using the "expand" operation.
|
|
3332
|
-
* See: https://www.hl7.org/fhir/operation-valueset-expand.html
|
|
3333
|
-
* @category Search
|
|
3334
|
-
* @param system - The ValueSet system url.
|
|
3335
|
-
* @param filter - The search string.
|
|
3336
|
-
* @param options - Optional fetch options.
|
|
3337
|
-
* @returns Promise to expanded ValueSet.
|
|
3338
|
-
* @deprecated Use `valueSetExpand()` instead.
|
|
3339
|
-
*/
|
|
3340
|
-
searchValueSet(system: string, filter: string, options?: MedplumRequestOptions): ReadablePromise<ValueSet>;
|
|
3254
|
+
searchResourcePages<RT extends ResourceType>(resourceType: RT, query?: QueryTypes, options?: MedplumRequestOptions): AsyncGenerator<ResourceArray<WithId<ExtractResource<RT>>>>;
|
|
3341
3255
|
/**
|
|
3342
3256
|
* Searches a ValueSet resource using the "expand" operation.
|
|
3343
3257
|
* See: https://www.hl7.org/fhir/operation-valueset-expand.html
|
|
@@ -3354,7 +3268,7 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
|
|
|
3354
3268
|
* @param id - The FHIR resource ID.
|
|
3355
3269
|
* @returns The resource if it is available in the cache; undefined otherwise.
|
|
3356
3270
|
*/
|
|
3357
|
-
getCached<
|
|
3271
|
+
getCached<RT extends ResourceType>(resourceType: RT, id: string): WithId<ExtractResource<RT>> | undefined;
|
|
3358
3272
|
/**
|
|
3359
3273
|
* Returns a cached resource if it is available.
|
|
3360
3274
|
* @category Caching
|
|
@@ -3380,7 +3294,7 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
|
|
|
3380
3294
|
* @param options - Optional fetch options.
|
|
3381
3295
|
* @returns The resource if available.
|
|
3382
3296
|
*/
|
|
3383
|
-
readResource<
|
|
3297
|
+
readResource<RT extends ResourceType>(resourceType: RT, id: string, options?: MedplumRequestOptions): ReadablePromise<WithId<ExtractResource<RT>>>;
|
|
3384
3298
|
/**
|
|
3385
3299
|
* Reads a resource by `Reference`.
|
|
3386
3300
|
*
|
|
@@ -3401,7 +3315,7 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
|
|
|
3401
3315
|
* @param options - Optional fetch options.
|
|
3402
3316
|
* @returns The resource if available.
|
|
3403
3317
|
*/
|
|
3404
|
-
readReference<T extends Resource>(reference: Reference<T>, options?: MedplumRequestOptions): ReadablePromise<T
|
|
3318
|
+
readReference<T extends Resource>(reference: Reference<T>, options?: MedplumRequestOptions): ReadablePromise<WithId<T>>;
|
|
3405
3319
|
/**
|
|
3406
3320
|
* Requests the schema for a resource type.
|
|
3407
3321
|
* If the schema is already cached, the promise is resolved immediately.
|
|
@@ -3439,7 +3353,7 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
|
|
|
3439
3353
|
* @param options - Optional fetch options.
|
|
3440
3354
|
* @returns Promise to the resource history.
|
|
3441
3355
|
*/
|
|
3442
|
-
readHistory<
|
|
3356
|
+
readHistory<RT extends ResourceType>(resourceType: RT, id: string, options?: MedplumRequestOptions): ReadablePromise<Bundle<WithId<ExtractResource<RT>>>>;
|
|
3443
3357
|
/**
|
|
3444
3358
|
* Reads a specific version of a resource by resource type, ID, and version ID.
|
|
3445
3359
|
*
|
|
@@ -3459,7 +3373,7 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
|
|
|
3459
3373
|
* @param options - Optional fetch options.
|
|
3460
3374
|
* @returns The resource if available.
|
|
3461
3375
|
*/
|
|
3462
|
-
readVersion<
|
|
3376
|
+
readVersion<RT extends ResourceType>(resourceType: RT, id: string, vid: string, options?: MedplumRequestOptions): ReadablePromise<WithId<ExtractResource<RT>>>;
|
|
3463
3377
|
/**
|
|
3464
3378
|
* Executes the Patient "everything" operation for a patient.
|
|
3465
3379
|
*
|
|
@@ -3523,7 +3437,7 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
|
|
|
3523
3437
|
* @param options - Optional fetch options.
|
|
3524
3438
|
* @returns The result of the create operation.
|
|
3525
3439
|
*/
|
|
3526
|
-
createResource<T extends Resource>(resource: T, options?: MedplumRequestOptions): Promise<T
|
|
3440
|
+
createResource<T extends Resource>(resource: T, options?: MedplumRequestOptions): Promise<WithId<T>>;
|
|
3527
3441
|
/**
|
|
3528
3442
|
* Conditionally create a new FHIR resource only if some equivalent resource does not already exist on the server.
|
|
3529
3443
|
*
|
|
@@ -3565,7 +3479,7 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
|
|
|
3565
3479
|
* @param options - Optional fetch options.
|
|
3566
3480
|
* @returns The result of the create operation.
|
|
3567
3481
|
*/
|
|
3568
|
-
createResourceIfNoneExist<T extends Resource>(resource: T, query: string, options?: MedplumRequestOptions): Promise<T
|
|
3482
|
+
createResourceIfNoneExist<T extends Resource>(resource: T, query: string, options?: MedplumRequestOptions): Promise<WithId<T>>;
|
|
3569
3483
|
/**
|
|
3570
3484
|
* Upsert a resource: update it in place if it exists, otherwise create it. This is done in a single, transactional
|
|
3571
3485
|
* request to guarantee data consistency.
|
|
@@ -3574,7 +3488,7 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
|
|
|
3574
3488
|
* @param options - Optional fetch options.
|
|
3575
3489
|
* @returns The updated/created resource.
|
|
3576
3490
|
*/
|
|
3577
|
-
upsertResource<T extends Resource>(resource: T, query: QueryTypes, options?: MedplumRequestOptions): Promise<T
|
|
3491
|
+
upsertResource<T extends Resource>(resource: T, query: QueryTypes, options?: MedplumRequestOptions): Promise<WithId<T>>;
|
|
3578
3492
|
/**
|
|
3579
3493
|
* Creates a FHIR `Attachment` with the provided data content.
|
|
3580
3494
|
*
|
|
@@ -3599,17 +3513,6 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
|
|
|
3599
3513
|
* @returns The result of the create operation.
|
|
3600
3514
|
*/
|
|
3601
3515
|
createAttachment(createBinaryOptions: CreateBinaryOptions, requestOptions?: MedplumRequestOptions): Promise<Attachment>;
|
|
3602
|
-
/**
|
|
3603
|
-
* @category Create
|
|
3604
|
-
* @param data - The binary data to upload.
|
|
3605
|
-
* @param filename - Optional filename for the binary.
|
|
3606
|
-
* @param contentType - Content type for the binary.
|
|
3607
|
-
* @param onProgress - Optional callback for progress events. **NOTE:** only `options.signal` is respected when `onProgress` is also provided.
|
|
3608
|
-
* @param options - Optional fetch options. **NOTE:** only `options.signal` is respected when `onProgress` is also provided.
|
|
3609
|
-
* @returns The result of the create operation.
|
|
3610
|
-
* @deprecated Use `createAttachment` with `CreateBinaryOptions` instead. To be removed in Medplum 4.0.
|
|
3611
|
-
*/
|
|
3612
|
-
createAttachment(data: BinarySource, filename: string | undefined, contentType: string, onProgress?: (e: ProgressEvent) => void, options?: MedplumRequestOptions): Promise<Attachment>;
|
|
3613
3516
|
/**
|
|
3614
3517
|
* Creates a FHIR `Binary` resource with the provided data content.
|
|
3615
3518
|
*
|
|
@@ -3634,18 +3537,7 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
|
|
|
3634
3537
|
* @param requestOptions - Optional fetch options. **NOTE:** only `options.signal` is respected when `onProgress` is also provided.
|
|
3635
3538
|
* @returns The result of the create operation.
|
|
3636
3539
|
*/
|
|
3637
|
-
createBinary(createBinaryOptions: CreateBinaryOptions, requestOptions?: MedplumRequestOptions): Promise<Binary
|
|
3638
|
-
/**
|
|
3639
|
-
* @category Create
|
|
3640
|
-
* @param data - The binary data to upload.
|
|
3641
|
-
* @param filename - Optional filename for the binary.
|
|
3642
|
-
* @param contentType - Content type for the binary.
|
|
3643
|
-
* @param onProgress - Optional callback for progress events. **NOTE:** only `options.signal` is respected when `onProgress` is also provided.
|
|
3644
|
-
* @param options - Optional fetch options. **NOTE:** only `options.signal` is respected when `onProgress` is also provided.
|
|
3645
|
-
* @returns The result of the create operation.
|
|
3646
|
-
* @deprecated Use `createBinary` with `CreateBinaryOptions` instead. To be removed in Medplum 4.0.
|
|
3647
|
-
*/
|
|
3648
|
-
createBinary(data: BinarySource, filename: string | undefined, contentType: string, onProgress?: (e: ProgressEvent) => void, options?: MedplumRequestOptions): Promise<Binary>;
|
|
3540
|
+
createBinary(createBinaryOptions: CreateBinaryOptions, requestOptions?: MedplumRequestOptions): Promise<WithId<Binary>>;
|
|
3649
3541
|
uploadwithProgress(url: URL, data: BinarySource, contentType: string, onProgress: (e: ProgressEvent) => void, options?: MedplumRequestOptions): Promise<any>;
|
|
3650
3542
|
/**
|
|
3651
3543
|
* Creates a PDF as a FHIR `Binary` resource based on pdfmake document definition.
|
|
@@ -3670,17 +3562,7 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
|
|
|
3670
3562
|
* @param requestOptions - Optional fetch options.
|
|
3671
3563
|
* @returns The result of the create operation.
|
|
3672
3564
|
*/
|
|
3673
|
-
createPdf(createPdfOptions: CreatePdfOptions, requestOptions?: MedplumRequestOptions): Promise<Binary
|
|
3674
|
-
/**
|
|
3675
|
-
* @category Media
|
|
3676
|
-
* @param docDefinition - The PDF document definition.
|
|
3677
|
-
* @param filename - Optional filename for the PDF binary resource.
|
|
3678
|
-
* @param tableLayouts - Optional pdfmake custom table layout.
|
|
3679
|
-
* @param fonts - Optional pdfmake custom font dictionary.
|
|
3680
|
-
* @returns The result of the create operation.
|
|
3681
|
-
* @deprecated Use `createPdf` with `CreatePdfOptions` instead. To be removed in Medplum 4.0.
|
|
3682
|
-
*/
|
|
3683
|
-
createPdf(docDefinition: TDocumentDefinitions, filename: string | undefined, tableLayouts?: Record<string, CustomTableLayout>, fonts?: TFontDictionary): Promise<Binary>;
|
|
3565
|
+
createPdf(createPdfOptions: CreatePdfOptions, requestOptions?: MedplumRequestOptions): Promise<WithId<Binary>>;
|
|
3684
3566
|
/**
|
|
3685
3567
|
* Creates a FHIR `Communication` resource with the provided data content.
|
|
3686
3568
|
*
|
|
@@ -3691,7 +3573,7 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
|
|
|
3691
3573
|
* @param options - Optional fetch options.
|
|
3692
3574
|
* @returns The result of the create operation.
|
|
3693
3575
|
*/
|
|
3694
|
-
createComment(resource: Resource, text: string, options?: MedplumRequestOptions): Promise<Communication
|
|
3576
|
+
createComment(resource: Resource, text: string, options?: MedplumRequestOptions): Promise<WithId<Communication>>;
|
|
3695
3577
|
/**
|
|
3696
3578
|
* Updates a FHIR resource.
|
|
3697
3579
|
*
|
|
@@ -3718,7 +3600,7 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
|
|
|
3718
3600
|
* @param options - Optional fetch options.
|
|
3719
3601
|
* @returns The result of the update operation.
|
|
3720
3602
|
*/
|
|
3721
|
-
updateResource<T extends Resource>(resource: T, options?: MedplumRequestOptions): Promise<T
|
|
3603
|
+
updateResource<T extends Resource>(resource: T, options?: MedplumRequestOptions): Promise<WithId<T>>;
|
|
3722
3604
|
/**
|
|
3723
3605
|
* Updates a FHIR resource using JSONPatch operations.
|
|
3724
3606
|
*
|
|
@@ -3744,7 +3626,7 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
|
|
|
3744
3626
|
* @param options - Optional fetch options.
|
|
3745
3627
|
* @returns The result of the patch operations.
|
|
3746
3628
|
*/
|
|
3747
|
-
patchResource<
|
|
3629
|
+
patchResource<RT extends ResourceType>(resourceType: RT, id: string, operations: PatchOperation[], options?: MedplumRequestOptions): Promise<WithId<ExtractResource<RT>>>;
|
|
3748
3630
|
/**
|
|
3749
3631
|
* Deletes a FHIR resource by resource type and ID.
|
|
3750
3632
|
*
|
|
@@ -3942,7 +3824,7 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
|
|
|
3942
3824
|
* @param options - Optional fetch options.
|
|
3943
3825
|
* @returns A Bundle
|
|
3944
3826
|
*/
|
|
3945
|
-
readResourceGraph
|
|
3827
|
+
readResourceGraph(resourceType: ResourceType, id: string, graphName: string, options?: MedplumRequestOptions): ReadablePromise<Bundle>;
|
|
3946
3828
|
/**
|
|
3947
3829
|
* Pushes a message to an agent.
|
|
3948
3830
|
*
|
|
@@ -4038,13 +3920,13 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
|
|
|
4038
3920
|
* @returns The current user profile resource.
|
|
4039
3921
|
* @category User Profile
|
|
4040
3922
|
*/
|
|
4041
|
-
getProfileAsync(): Promise<ProfileResource | undefined>;
|
|
3923
|
+
getProfileAsync(): Promise<WithId<ProfileResource> | undefined>;
|
|
4042
3924
|
/**
|
|
4043
3925
|
* Returns the current user configuration if available.
|
|
4044
3926
|
* @returns The current user configuration if available.
|
|
4045
3927
|
* @category User Profile
|
|
4046
3928
|
*/
|
|
4047
|
-
getUserConfiguration(): UserConfiguration | undefined;
|
|
3929
|
+
getUserConfiguration(): WithId<UserConfiguration> | undefined;
|
|
4048
3930
|
/**
|
|
4049
3931
|
* Returns the current user access policy if available.
|
|
4050
3932
|
* @returns The current user access policy if available.
|
|
@@ -4068,17 +3950,6 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
|
|
|
4068
3950
|
* @returns The new media resource.
|
|
4069
3951
|
*/
|
|
4070
3952
|
createMedia(createMediaOptions: CreateMediaOptions, requestOptions?: MedplumRequestOptions): Promise<Media>;
|
|
4071
|
-
/**
|
|
4072
|
-
* Upload media to the server and create a Media instance for the uploaded content.
|
|
4073
|
-
* @param contents - The contents of the media file, as a string, Uint8Array, File, or Blob.
|
|
4074
|
-
* @param contentType - The media type of the content.
|
|
4075
|
-
* @param filename - Optional filename for the binary, or extended upload options (see `BinaryUploadOptions`).
|
|
4076
|
-
* @param additionalFields - Additional fields for Media.
|
|
4077
|
-
* @param options - Optional fetch options.
|
|
4078
|
-
* @returns Promise that resolves to the created Media
|
|
4079
|
-
* @deprecated Use `createMedia` with `CreateMediaOptions` instead. To be removed in Medplum 4.0.
|
|
4080
|
-
*/
|
|
4081
|
-
uploadMedia(contents: string | Uint8Array | File | Blob, contentType: string, filename: string | undefined, additionalFields?: Partial<Media>, options?: MedplumRequestOptions): Promise<Media>;
|
|
4082
3953
|
/**
|
|
4083
3954
|
* 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
|
|
4084
3955
|
* @param exportLevel - Optional export level. Defaults to system level export. 'Group/:id' - Group of Patients, 'Patient' - All Patients.
|
|
@@ -5172,15 +5043,6 @@ export declare class OrAtom extends BooleanInfixOperatorAtom {
|
|
|
5172
5043
|
*/
|
|
5173
5044
|
export declare type OutputRow = Record<string, any>;
|
|
5174
5045
|
|
|
5175
|
-
/**
|
|
5176
|
-
* Parses a FHIR criteria string into a SearchRequest.
|
|
5177
|
-
* FHIR criteria strings are found on resources such as Subscription.
|
|
5178
|
-
* @param criteria - The FHIR criteria string.
|
|
5179
|
-
* @returns Parsed search definition.
|
|
5180
|
-
* @deprecated Use parseSearchRequest instead.
|
|
5181
|
-
*/
|
|
5182
|
-
export declare function parseCriteriaAsSearchRequest<T extends Resource = Resource>(criteria: string): SearchRequest<T>;
|
|
5183
|
-
|
|
5184
5046
|
/**
|
|
5185
5047
|
* Parses a FHIRPath expression into an AST.
|
|
5186
5048
|
* The result can be used to evaluate the expression against a resource or other object.
|
|
@@ -5262,14 +5124,6 @@ export declare class ParserBuilder {
|
|
|
5262
5124
|
*/
|
|
5263
5125
|
export declare function parseReference<T extends Resource>(reference: Reference<T> | undefined): [T['resourceType'], string];
|
|
5264
5126
|
|
|
5265
|
-
/**
|
|
5266
|
-
* Parses a URL string into a SearchRequest.
|
|
5267
|
-
* @param url - The URL to parse.
|
|
5268
|
-
* @returns Parsed search definition.
|
|
5269
|
-
* @deprecated Use parseSearchRequest instead.
|
|
5270
|
-
*/
|
|
5271
|
-
export declare function parseSearchDefinition<T extends Resource = Resource>(url: string): SearchRequest<T>;
|
|
5272
|
-
|
|
5273
5127
|
/**
|
|
5274
5128
|
* Parses a search URL into a search request.
|
|
5275
5129
|
* @param url - The original search URL or the FHIR resource type.
|
|
@@ -5278,14 +5132,6 @@ export declare function parseSearchDefinition<T extends Resource = Resource>(url
|
|
|
5278
5132
|
*/
|
|
5279
5133
|
export declare function parseSearchRequest<T extends Resource = Resource>(url: T['resourceType'] | URL | string, query?: Record<string, string[] | string | undefined>): SearchRequest<T>;
|
|
5280
5134
|
|
|
5281
|
-
/**
|
|
5282
|
-
* Parses a search URL into a search request.
|
|
5283
|
-
* @param url - The search URL.
|
|
5284
|
-
* @returns A parsed SearchRequest.
|
|
5285
|
-
* @deprecated Use parseSearchRequest instead.
|
|
5286
|
-
*/
|
|
5287
|
-
export declare function parseSearchUrl<T extends Resource = Resource>(url: URL): SearchRequest<T>;
|
|
5288
|
-
|
|
5289
5135
|
/**
|
|
5290
5136
|
* Parses a StructureDefinition resource into an internal schema better suited for
|
|
5291
5137
|
* programmatic validation and usage in internal systems
|
|
@@ -5710,9 +5556,6 @@ export declare type ResourceArray<T extends Resource = Resource> = T[] & {
|
|
|
5710
5556
|
bundle: Bundle<T>;
|
|
5711
5557
|
};
|
|
5712
5558
|
|
|
5713
|
-
/** @deprecated - Use CrawlerOptions instead */
|
|
5714
|
-
export declare type ResourceCrawlerOptions = CrawlerOptions;
|
|
5715
|
-
|
|
5716
5559
|
export declare type ResourceMatchesSubscriptionCriteria = {
|
|
5717
5560
|
resource: Resource;
|
|
5718
5561
|
subscription: Subscription;
|
|
@@ -5723,9 +5566,6 @@ export declare type ResourceMatchesSubscriptionCriteria = {
|
|
|
5723
5566
|
|
|
5724
5567
|
export declare function resourceMatchesSubscriptionCriteria({ resource, subscription, context, getPreviousResource, logger, }: ResourceMatchesSubscriptionCriteria): Promise<boolean>;
|
|
5725
5568
|
|
|
5726
|
-
/** @deprecated - Use CrawlerVisitor instead */
|
|
5727
|
-
export declare type ResourceVisitor = CrawlerVisitor;
|
|
5728
|
-
|
|
5729
5569
|
export declare type ResourceWithCode = Resource & Code;
|
|
5730
5570
|
|
|
5731
5571
|
export declare const RXNORM = "http://www.nlm.nih.gov/research/umls/rxnorm";
|
|
@@ -6335,6 +6175,10 @@ declare type WebSocketEventMap_2 = {
|
|
|
6335
6175
|
};
|
|
6336
6176
|
export { WebSocketEventMap_2 as WebSocketEventMap }
|
|
6337
6177
|
|
|
6178
|
+
export declare type WithId<T> = T & {
|
|
6179
|
+
id: string;
|
|
6180
|
+
};
|
|
6181
|
+
|
|
6338
6182
|
/**
|
|
6339
6183
|
* Returns a word-wrapped string.
|
|
6340
6184
|
* Based on: https://stackoverflow.com/a/38709683
|