@medplum/core 3.0.11 → 3.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +5 -5
- package/dist/cjs/index.cjs.map +3 -3
- package/dist/cjs/index.d.ts +103 -3
- package/dist/esm/index.d.ts +103 -3
- package/dist/esm/index.mjs +5 -5
- package/dist/esm/index.mjs.map +3 -3
- package/package.json +3 -3
package/dist/cjs/index.d.ts
CHANGED
|
@@ -482,6 +482,32 @@ export declare const CPT = "http://www.ama-assn.org/go/cpt";
|
|
|
482
482
|
|
|
483
483
|
export declare function crawlResource(resource: Resource, visitor: ResourceVisitor, schema?: InternalTypeSchema, initialPath?: string): void;
|
|
484
484
|
|
|
485
|
+
/**
|
|
486
|
+
* Binary upload options.
|
|
487
|
+
*/
|
|
488
|
+
export declare interface CreateBinaryOptions {
|
|
489
|
+
/**
|
|
490
|
+
* The binary data to upload.
|
|
491
|
+
*/
|
|
492
|
+
readonly data: BinarySource;
|
|
493
|
+
/**
|
|
494
|
+
* Content type for the binary.
|
|
495
|
+
*/
|
|
496
|
+
readonly contentType: string;
|
|
497
|
+
/**
|
|
498
|
+
* Optional filename for the binary.
|
|
499
|
+
*/
|
|
500
|
+
readonly filename?: string;
|
|
501
|
+
/**
|
|
502
|
+
* Optional security context for the binary.
|
|
503
|
+
*/
|
|
504
|
+
readonly securityContext?: Reference;
|
|
505
|
+
/**
|
|
506
|
+
* Optional fetch options. **NOTE:** only `requestOptions.signal` is respected when `onProgress` is also provided.
|
|
507
|
+
*/
|
|
508
|
+
readonly onProgress?: (e: ProgressEvent) => void;
|
|
509
|
+
}
|
|
510
|
+
|
|
485
511
|
export declare function createConstraintIssue(expression: string, constraint: Constraint): OperationOutcomeIssue;
|
|
486
512
|
|
|
487
513
|
export declare const created: OperationOutcome;
|
|
@@ -499,12 +525,37 @@ export declare function createFhircastMessagePayload<EventName extends FhircastE
|
|
|
499
525
|
|
|
500
526
|
export declare function createFhircastMessagePayload<EventName extends FhircastEventVersionRequired>(topic: string, event: EventName, context: FhircastValidContextForEvent<EventName> | FhircastValidContextForEvent<EventName>[], versionId: string): FhircastMessagePayload<EventName>;
|
|
501
527
|
|
|
528
|
+
export declare interface CreateMediaOptions extends CreateBinaryOptions {
|
|
529
|
+
/**
|
|
530
|
+
* Optional additional fields for the Media resource.
|
|
531
|
+
*/
|
|
532
|
+
readonly additionalFields?: Partial<Media>;
|
|
533
|
+
}
|
|
534
|
+
|
|
502
535
|
export declare function createOperationOutcomeIssue(severity: IssueSeverity, code: IssueType, message: string, path: string, data?: Record<string, any>): OperationOutcomeIssue;
|
|
503
536
|
|
|
504
537
|
export declare interface CreatePdfFunction {
|
|
505
538
|
(docDefinition: TDocumentDefinitions, tableLayouts?: Record<string, CustomTableLayout> | undefined, fonts?: TFontDictionary | undefined): Promise<any>;
|
|
506
539
|
}
|
|
507
540
|
|
|
541
|
+
/**
|
|
542
|
+
* PDF upload options.
|
|
543
|
+
*/
|
|
544
|
+
export declare interface CreatePdfOptions extends Omit<CreateBinaryOptions, 'data' | 'contentType'> {
|
|
545
|
+
/**
|
|
546
|
+
* The PDF document definition. See https://pdfmake.github.io/docs/0.1/document-definition-object/
|
|
547
|
+
*/
|
|
548
|
+
readonly docDefinition: TDocumentDefinitions;
|
|
549
|
+
/**
|
|
550
|
+
* Optional pdfmake custom table layout.
|
|
551
|
+
*/
|
|
552
|
+
readonly tableLayouts?: Record<string, CustomTableLayout>;
|
|
553
|
+
/**
|
|
554
|
+
* Optional pdfmake custom font dictionary.
|
|
555
|
+
*/
|
|
556
|
+
readonly fonts?: TFontDictionary;
|
|
557
|
+
}
|
|
558
|
+
|
|
508
559
|
export declare function createProcessingIssue(expression: string, message: string, err: Error, data?: Record<string, any>): OperationOutcomeIssue;
|
|
509
560
|
|
|
510
561
|
/**
|
|
@@ -2290,6 +2341,8 @@ export declare function matchesRange(value: number, range: Range_2, precision?:
|
|
|
2290
2341
|
*/
|
|
2291
2342
|
export declare function matchesSearchRequest(resource: Resource, searchRequest: SearchRequest): boolean;
|
|
2292
2343
|
|
|
2344
|
+
export declare const MEDPLUM_CLI_CLIENT_ID = "medplum-cli";
|
|
2345
|
+
|
|
2293
2346
|
export declare const MEDPLUM_VERSION: any;
|
|
2294
2347
|
|
|
2295
2348
|
/**
|
|
@@ -2997,6 +3050,13 @@ export declare class MedplumClient extends EventTarget_2 {
|
|
|
2997
3050
|
* ```
|
|
2998
3051
|
*
|
|
2999
3052
|
* See the FHIR "create" operation for full details: https://www.hl7.org/fhir/http.html#create
|
|
3053
|
+
* @category Create
|
|
3054
|
+
* @param createBinaryOptions -The binary options. See `CreateBinaryOptions` for full details.
|
|
3055
|
+
* @param requestOptions - Optional fetch options. **NOTE:** only `options.signal` is respected when `onProgress` is also provided.
|
|
3056
|
+
* @returns The result of the create operation.
|
|
3057
|
+
*/
|
|
3058
|
+
createAttachment(createBinaryOptions: CreateBinaryOptions, requestOptions?: MedplumRequestOptions): Promise<Attachment>;
|
|
3059
|
+
/**
|
|
3000
3060
|
* @category Create
|
|
3001
3061
|
* @param data - The binary data to upload.
|
|
3002
3062
|
* @param filename - Optional filename for the binary.
|
|
@@ -3004,6 +3064,7 @@ export declare class MedplumClient extends EventTarget_2 {
|
|
|
3004
3064
|
* @param onProgress - Optional callback for progress events. **NOTE:** only `options.signal` is respected when `onProgress` is also provided.
|
|
3005
3065
|
* @param options - Optional fetch options. **NOTE:** only `options.signal` is respected when `onProgress` is also provided.
|
|
3006
3066
|
* @returns The result of the create operation.
|
|
3067
|
+
* @deprecated Use `createAttachment` with `CreateBinaryOptions` instead. To be removed in Medplum 4.0.
|
|
3007
3068
|
*/
|
|
3008
3069
|
createAttachment(data: BinarySource, filename: string | undefined, contentType: string, onProgress?: (e: ProgressEvent) => void, options?: MedplumRequestOptions): Promise<Attachment>;
|
|
3009
3070
|
/**
|
|
@@ -3024,6 +3085,14 @@ export declare class MedplumClient extends EventTarget_2 {
|
|
|
3024
3085
|
* ```
|
|
3025
3086
|
*
|
|
3026
3087
|
* See the FHIR "create" operation for full details: https://www.hl7.org/fhir/http.html#create
|
|
3088
|
+
*
|
|
3089
|
+
* @category Create
|
|
3090
|
+
* @param createBinaryOptions -The binary options. See `CreateBinaryOptions` for full details.
|
|
3091
|
+
* @param requestOptions - Optional fetch options. **NOTE:** only `options.signal` is respected when `onProgress` is also provided.
|
|
3092
|
+
* @returns The result of the create operation.
|
|
3093
|
+
*/
|
|
3094
|
+
createBinary(createBinaryOptions: CreateBinaryOptions, requestOptions?: MedplumRequestOptions): Promise<Binary>;
|
|
3095
|
+
/**
|
|
3027
3096
|
* @category Create
|
|
3028
3097
|
* @param data - The binary data to upload.
|
|
3029
3098
|
* @param filename - Optional filename for the binary.
|
|
@@ -3031,6 +3100,7 @@ export declare class MedplumClient extends EventTarget_2 {
|
|
|
3031
3100
|
* @param onProgress - Optional callback for progress events. **NOTE:** only `options.signal` is respected when `onProgress` is also provided.
|
|
3032
3101
|
* @param options - Optional fetch options. **NOTE:** only `options.signal` is respected when `onProgress` is also provided.
|
|
3033
3102
|
* @returns The result of the create operation.
|
|
3103
|
+
* @deprecated Use `createBinary` with `CreateBinaryOptions` instead. To be removed in Medplum 4.0.
|
|
3034
3104
|
*/
|
|
3035
3105
|
createBinary(data: BinarySource, filename: string | undefined, contentType: string, onProgress?: (e: ProgressEvent) => void, options?: MedplumRequestOptions): Promise<Binary>;
|
|
3036
3106
|
uploadwithProgress(url: URL, data: BinarySource, contentType: string, onProgress: (e: ProgressEvent) => void, options?: MedplumRequestOptions): Promise<any>;
|
|
@@ -3052,14 +3122,22 @@ export declare class MedplumClient extends EventTarget_2 {
|
|
|
3052
3122
|
* ```
|
|
3053
3123
|
*
|
|
3054
3124
|
* See the pdfmake document definition for full details: https://pdfmake.github.io/docs/0.1/document-definition-object/
|
|
3125
|
+
* @category Media
|
|
3126
|
+
* @param createPdfOptions - The PDF creation options. See `CreatePdfOptions` for full details.
|
|
3127
|
+
* @param requestOptions - Optional fetch options.
|
|
3128
|
+
* @returns The result of the create operation.
|
|
3129
|
+
*/
|
|
3130
|
+
createPdf(createPdfOptions: CreatePdfOptions, requestOptions?: MedplumRequestOptions): Promise<Binary>;
|
|
3131
|
+
/**
|
|
3055
3132
|
* @category Media
|
|
3056
3133
|
* @param docDefinition - The PDF document definition.
|
|
3057
3134
|
* @param filename - Optional filename for the PDF binary resource.
|
|
3058
3135
|
* @param tableLayouts - Optional pdfmake custom table layout.
|
|
3059
3136
|
* @param fonts - Optional pdfmake custom font dictionary.
|
|
3060
3137
|
* @returns The result of the create operation.
|
|
3138
|
+
* @deprecated Use `createPdf` with `CreatePdfOptions` instead. To be removed in Medplum 4.0.
|
|
3061
3139
|
*/
|
|
3062
|
-
createPdf(docDefinition: TDocumentDefinitions, filename
|
|
3140
|
+
createPdf(docDefinition: TDocumentDefinitions, filename: string | undefined, tableLayouts?: Record<string, CustomTableLayout>, fonts?: TFontDictionary): Promise<Binary>;
|
|
3063
3141
|
/**
|
|
3064
3142
|
* Creates a FHIR `Communication` resource with the provided data content.
|
|
3065
3143
|
*
|
|
@@ -3430,14 +3508,24 @@ export declare class MedplumClient extends EventTarget_2 {
|
|
|
3430
3508
|
* @returns Promise to the response body as a blob.
|
|
3431
3509
|
*/
|
|
3432
3510
|
download(url: URL | string, options?: MedplumRequestOptions): Promise<Blob>;
|
|
3511
|
+
/**
|
|
3512
|
+
* Creates a FHIR Media resource with the provided data content.
|
|
3513
|
+
*
|
|
3514
|
+
* @category Create
|
|
3515
|
+
* @param createMediaOptions - The media creation options. See `CreateMediaOptions` for full details.
|
|
3516
|
+
* @param requestOptions - Optional fetch options.
|
|
3517
|
+
* @returns The new media resource.
|
|
3518
|
+
*/
|
|
3519
|
+
createMedia(createMediaOptions: CreateMediaOptions, requestOptions?: MedplumRequestOptions): Promise<Media>;
|
|
3433
3520
|
/**
|
|
3434
3521
|
* Upload media to the server and create a Media instance for the uploaded content.
|
|
3435
3522
|
* @param contents - The contents of the media file, as a string, Uint8Array, File, or Blob.
|
|
3436
3523
|
* @param contentType - The media type of the content.
|
|
3437
|
-
* @param filename -
|
|
3524
|
+
* @param filename - Optional filename for the binary, or extended upload options (see `BinaryUploadOptions`).
|
|
3438
3525
|
* @param additionalFields - Additional fields for Media.
|
|
3439
3526
|
* @param options - Optional fetch options.
|
|
3440
3527
|
* @returns Promise that resolves to the created Media
|
|
3528
|
+
* @deprecated Use `createMedia` with `CreateMediaOptions` instead. To be removed in Medplum 4.0.
|
|
3441
3529
|
*/
|
|
3442
3530
|
uploadMedia(contents: string | Uint8Array | File | Blob, contentType: string, filename: string | undefined, additionalFields?: Partial<Media>, options?: MedplumRequestOptions): Promise<Media>;
|
|
3443
3531
|
/**
|
|
@@ -3516,6 +3604,14 @@ export declare class MedplumClient extends EventTarget_2 {
|
|
|
3516
3604
|
* @param contentType - The new content type to set.
|
|
3517
3605
|
*/
|
|
3518
3606
|
private setRequestContentType;
|
|
3607
|
+
/**
|
|
3608
|
+
* Sets a header on fetch options.
|
|
3609
|
+
* @param options - The fetch options.
|
|
3610
|
+
* @param key - The header key.
|
|
3611
|
+
* @param value - The header value.
|
|
3612
|
+
* @param ifNoneExist - Optional flag to only set the header if it doesn't already exist.
|
|
3613
|
+
*/
|
|
3614
|
+
private setRequestHeader;
|
|
3519
3615
|
/**
|
|
3520
3616
|
* Sets the body on fetch options.
|
|
3521
3617
|
* @param options - The fetch options.
|
|
@@ -4208,6 +4304,10 @@ export declare interface NewUserRequest {
|
|
|
4208
4304
|
readonly clientId?: string;
|
|
4209
4305
|
}
|
|
4210
4306
|
|
|
4307
|
+
export declare function normalizeCreateBinaryOptions(arg1: BinarySource | CreateBinaryOptions, arg2: string | undefined | MedplumRequestOptions, arg3?: string, arg4?: (e: ProgressEvent) => void): CreateBinaryOptions;
|
|
4308
|
+
|
|
4309
|
+
export declare function normalizeCreatePdfOptions(arg1: TDocumentDefinitions | CreatePdfOptions, arg2: string | undefined | MedplumRequestOptions, arg3: Record<string, CustomTableLayout> | undefined, arg4: TFontDictionary | undefined): CreatePdfOptions;
|
|
4310
|
+
|
|
4211
4311
|
/**
|
|
4212
4312
|
* Normalizes an error object into a displayable error string.
|
|
4213
4313
|
* @param error - The error value which could be a string, Error, OperationOutcome, or other unknown type.
|
|
@@ -4473,7 +4573,7 @@ export declare class ParserBuilder {
|
|
|
4473
4573
|
* @param reference - A reference to a FHIR resource.
|
|
4474
4574
|
* @returns A tuple containing the `ResourceType` and the ID of the resource or `undefined` when `undefined` or an invalid reference is passed.
|
|
4475
4575
|
*/
|
|
4476
|
-
export declare function parseReference(reference: Reference | undefined): [
|
|
4576
|
+
export declare function parseReference<T extends Resource>(reference: Reference<T> | undefined): [T['resourceType'], string];
|
|
4477
4577
|
|
|
4478
4578
|
/**
|
|
4479
4579
|
* Parses a URL string into a SearchRequest.
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -482,6 +482,32 @@ export declare const CPT = "http://www.ama-assn.org/go/cpt";
|
|
|
482
482
|
|
|
483
483
|
export declare function crawlResource(resource: Resource, visitor: ResourceVisitor, schema?: InternalTypeSchema, initialPath?: string): void;
|
|
484
484
|
|
|
485
|
+
/**
|
|
486
|
+
* Binary upload options.
|
|
487
|
+
*/
|
|
488
|
+
export declare interface CreateBinaryOptions {
|
|
489
|
+
/**
|
|
490
|
+
* The binary data to upload.
|
|
491
|
+
*/
|
|
492
|
+
readonly data: BinarySource;
|
|
493
|
+
/**
|
|
494
|
+
* Content type for the binary.
|
|
495
|
+
*/
|
|
496
|
+
readonly contentType: string;
|
|
497
|
+
/**
|
|
498
|
+
* Optional filename for the binary.
|
|
499
|
+
*/
|
|
500
|
+
readonly filename?: string;
|
|
501
|
+
/**
|
|
502
|
+
* Optional security context for the binary.
|
|
503
|
+
*/
|
|
504
|
+
readonly securityContext?: Reference;
|
|
505
|
+
/**
|
|
506
|
+
* Optional fetch options. **NOTE:** only `requestOptions.signal` is respected when `onProgress` is also provided.
|
|
507
|
+
*/
|
|
508
|
+
readonly onProgress?: (e: ProgressEvent) => void;
|
|
509
|
+
}
|
|
510
|
+
|
|
485
511
|
export declare function createConstraintIssue(expression: string, constraint: Constraint): OperationOutcomeIssue;
|
|
486
512
|
|
|
487
513
|
export declare const created: OperationOutcome;
|
|
@@ -499,12 +525,37 @@ export declare function createFhircastMessagePayload<EventName extends FhircastE
|
|
|
499
525
|
|
|
500
526
|
export declare function createFhircastMessagePayload<EventName extends FhircastEventVersionRequired>(topic: string, event: EventName, context: FhircastValidContextForEvent<EventName> | FhircastValidContextForEvent<EventName>[], versionId: string): FhircastMessagePayload<EventName>;
|
|
501
527
|
|
|
528
|
+
export declare interface CreateMediaOptions extends CreateBinaryOptions {
|
|
529
|
+
/**
|
|
530
|
+
* Optional additional fields for the Media resource.
|
|
531
|
+
*/
|
|
532
|
+
readonly additionalFields?: Partial<Media>;
|
|
533
|
+
}
|
|
534
|
+
|
|
502
535
|
export declare function createOperationOutcomeIssue(severity: IssueSeverity, code: IssueType, message: string, path: string, data?: Record<string, any>): OperationOutcomeIssue;
|
|
503
536
|
|
|
504
537
|
export declare interface CreatePdfFunction {
|
|
505
538
|
(docDefinition: TDocumentDefinitions, tableLayouts?: Record<string, CustomTableLayout> | undefined, fonts?: TFontDictionary | undefined): Promise<any>;
|
|
506
539
|
}
|
|
507
540
|
|
|
541
|
+
/**
|
|
542
|
+
* PDF upload options.
|
|
543
|
+
*/
|
|
544
|
+
export declare interface CreatePdfOptions extends Omit<CreateBinaryOptions, 'data' | 'contentType'> {
|
|
545
|
+
/**
|
|
546
|
+
* The PDF document definition. See https://pdfmake.github.io/docs/0.1/document-definition-object/
|
|
547
|
+
*/
|
|
548
|
+
readonly docDefinition: TDocumentDefinitions;
|
|
549
|
+
/**
|
|
550
|
+
* Optional pdfmake custom table layout.
|
|
551
|
+
*/
|
|
552
|
+
readonly tableLayouts?: Record<string, CustomTableLayout>;
|
|
553
|
+
/**
|
|
554
|
+
* Optional pdfmake custom font dictionary.
|
|
555
|
+
*/
|
|
556
|
+
readonly fonts?: TFontDictionary;
|
|
557
|
+
}
|
|
558
|
+
|
|
508
559
|
export declare function createProcessingIssue(expression: string, message: string, err: Error, data?: Record<string, any>): OperationOutcomeIssue;
|
|
509
560
|
|
|
510
561
|
/**
|
|
@@ -2290,6 +2341,8 @@ export declare function matchesRange(value: number, range: Range_2, precision?:
|
|
|
2290
2341
|
*/
|
|
2291
2342
|
export declare function matchesSearchRequest(resource: Resource, searchRequest: SearchRequest): boolean;
|
|
2292
2343
|
|
|
2344
|
+
export declare const MEDPLUM_CLI_CLIENT_ID = "medplum-cli";
|
|
2345
|
+
|
|
2293
2346
|
export declare const MEDPLUM_VERSION: any;
|
|
2294
2347
|
|
|
2295
2348
|
/**
|
|
@@ -2997,6 +3050,13 @@ export declare class MedplumClient extends EventTarget_2 {
|
|
|
2997
3050
|
* ```
|
|
2998
3051
|
*
|
|
2999
3052
|
* See the FHIR "create" operation for full details: https://www.hl7.org/fhir/http.html#create
|
|
3053
|
+
* @category Create
|
|
3054
|
+
* @param createBinaryOptions -The binary options. See `CreateBinaryOptions` for full details.
|
|
3055
|
+
* @param requestOptions - Optional fetch options. **NOTE:** only `options.signal` is respected when `onProgress` is also provided.
|
|
3056
|
+
* @returns The result of the create operation.
|
|
3057
|
+
*/
|
|
3058
|
+
createAttachment(createBinaryOptions: CreateBinaryOptions, requestOptions?: MedplumRequestOptions): Promise<Attachment>;
|
|
3059
|
+
/**
|
|
3000
3060
|
* @category Create
|
|
3001
3061
|
* @param data - The binary data to upload.
|
|
3002
3062
|
* @param filename - Optional filename for the binary.
|
|
@@ -3004,6 +3064,7 @@ export declare class MedplumClient extends EventTarget_2 {
|
|
|
3004
3064
|
* @param onProgress - Optional callback for progress events. **NOTE:** only `options.signal` is respected when `onProgress` is also provided.
|
|
3005
3065
|
* @param options - Optional fetch options. **NOTE:** only `options.signal` is respected when `onProgress` is also provided.
|
|
3006
3066
|
* @returns The result of the create operation.
|
|
3067
|
+
* @deprecated Use `createAttachment` with `CreateBinaryOptions` instead. To be removed in Medplum 4.0.
|
|
3007
3068
|
*/
|
|
3008
3069
|
createAttachment(data: BinarySource, filename: string | undefined, contentType: string, onProgress?: (e: ProgressEvent) => void, options?: MedplumRequestOptions): Promise<Attachment>;
|
|
3009
3070
|
/**
|
|
@@ -3024,6 +3085,14 @@ export declare class MedplumClient extends EventTarget_2 {
|
|
|
3024
3085
|
* ```
|
|
3025
3086
|
*
|
|
3026
3087
|
* See the FHIR "create" operation for full details: https://www.hl7.org/fhir/http.html#create
|
|
3088
|
+
*
|
|
3089
|
+
* @category Create
|
|
3090
|
+
* @param createBinaryOptions -The binary options. See `CreateBinaryOptions` for full details.
|
|
3091
|
+
* @param requestOptions - Optional fetch options. **NOTE:** only `options.signal` is respected when `onProgress` is also provided.
|
|
3092
|
+
* @returns The result of the create operation.
|
|
3093
|
+
*/
|
|
3094
|
+
createBinary(createBinaryOptions: CreateBinaryOptions, requestOptions?: MedplumRequestOptions): Promise<Binary>;
|
|
3095
|
+
/**
|
|
3027
3096
|
* @category Create
|
|
3028
3097
|
* @param data - The binary data to upload.
|
|
3029
3098
|
* @param filename - Optional filename for the binary.
|
|
@@ -3031,6 +3100,7 @@ export declare class MedplumClient extends EventTarget_2 {
|
|
|
3031
3100
|
* @param onProgress - Optional callback for progress events. **NOTE:** only `options.signal` is respected when `onProgress` is also provided.
|
|
3032
3101
|
* @param options - Optional fetch options. **NOTE:** only `options.signal` is respected when `onProgress` is also provided.
|
|
3033
3102
|
* @returns The result of the create operation.
|
|
3103
|
+
* @deprecated Use `createBinary` with `CreateBinaryOptions` instead. To be removed in Medplum 4.0.
|
|
3034
3104
|
*/
|
|
3035
3105
|
createBinary(data: BinarySource, filename: string | undefined, contentType: string, onProgress?: (e: ProgressEvent) => void, options?: MedplumRequestOptions): Promise<Binary>;
|
|
3036
3106
|
uploadwithProgress(url: URL, data: BinarySource, contentType: string, onProgress: (e: ProgressEvent) => void, options?: MedplumRequestOptions): Promise<any>;
|
|
@@ -3052,14 +3122,22 @@ export declare class MedplumClient extends EventTarget_2 {
|
|
|
3052
3122
|
* ```
|
|
3053
3123
|
*
|
|
3054
3124
|
* See the pdfmake document definition for full details: https://pdfmake.github.io/docs/0.1/document-definition-object/
|
|
3125
|
+
* @category Media
|
|
3126
|
+
* @param createPdfOptions - The PDF creation options. See `CreatePdfOptions` for full details.
|
|
3127
|
+
* @param requestOptions - Optional fetch options.
|
|
3128
|
+
* @returns The result of the create operation.
|
|
3129
|
+
*/
|
|
3130
|
+
createPdf(createPdfOptions: CreatePdfOptions, requestOptions?: MedplumRequestOptions): Promise<Binary>;
|
|
3131
|
+
/**
|
|
3055
3132
|
* @category Media
|
|
3056
3133
|
* @param docDefinition - The PDF document definition.
|
|
3057
3134
|
* @param filename - Optional filename for the PDF binary resource.
|
|
3058
3135
|
* @param tableLayouts - Optional pdfmake custom table layout.
|
|
3059
3136
|
* @param fonts - Optional pdfmake custom font dictionary.
|
|
3060
3137
|
* @returns The result of the create operation.
|
|
3138
|
+
* @deprecated Use `createPdf` with `CreatePdfOptions` instead. To be removed in Medplum 4.0.
|
|
3061
3139
|
*/
|
|
3062
|
-
createPdf(docDefinition: TDocumentDefinitions, filename
|
|
3140
|
+
createPdf(docDefinition: TDocumentDefinitions, filename: string | undefined, tableLayouts?: Record<string, CustomTableLayout>, fonts?: TFontDictionary): Promise<Binary>;
|
|
3063
3141
|
/**
|
|
3064
3142
|
* Creates a FHIR `Communication` resource with the provided data content.
|
|
3065
3143
|
*
|
|
@@ -3430,14 +3508,24 @@ export declare class MedplumClient extends EventTarget_2 {
|
|
|
3430
3508
|
* @returns Promise to the response body as a blob.
|
|
3431
3509
|
*/
|
|
3432
3510
|
download(url: URL | string, options?: MedplumRequestOptions): Promise<Blob>;
|
|
3511
|
+
/**
|
|
3512
|
+
* Creates a FHIR Media resource with the provided data content.
|
|
3513
|
+
*
|
|
3514
|
+
* @category Create
|
|
3515
|
+
* @param createMediaOptions - The media creation options. See `CreateMediaOptions` for full details.
|
|
3516
|
+
* @param requestOptions - Optional fetch options.
|
|
3517
|
+
* @returns The new media resource.
|
|
3518
|
+
*/
|
|
3519
|
+
createMedia(createMediaOptions: CreateMediaOptions, requestOptions?: MedplumRequestOptions): Promise<Media>;
|
|
3433
3520
|
/**
|
|
3434
3521
|
* Upload media to the server and create a Media instance for the uploaded content.
|
|
3435
3522
|
* @param contents - The contents of the media file, as a string, Uint8Array, File, or Blob.
|
|
3436
3523
|
* @param contentType - The media type of the content.
|
|
3437
|
-
* @param filename -
|
|
3524
|
+
* @param filename - Optional filename for the binary, or extended upload options (see `BinaryUploadOptions`).
|
|
3438
3525
|
* @param additionalFields - Additional fields for Media.
|
|
3439
3526
|
* @param options - Optional fetch options.
|
|
3440
3527
|
* @returns Promise that resolves to the created Media
|
|
3528
|
+
* @deprecated Use `createMedia` with `CreateMediaOptions` instead. To be removed in Medplum 4.0.
|
|
3441
3529
|
*/
|
|
3442
3530
|
uploadMedia(contents: string | Uint8Array | File | Blob, contentType: string, filename: string | undefined, additionalFields?: Partial<Media>, options?: MedplumRequestOptions): Promise<Media>;
|
|
3443
3531
|
/**
|
|
@@ -3516,6 +3604,14 @@ export declare class MedplumClient extends EventTarget_2 {
|
|
|
3516
3604
|
* @param contentType - The new content type to set.
|
|
3517
3605
|
*/
|
|
3518
3606
|
private setRequestContentType;
|
|
3607
|
+
/**
|
|
3608
|
+
* Sets a header on fetch options.
|
|
3609
|
+
* @param options - The fetch options.
|
|
3610
|
+
* @param key - The header key.
|
|
3611
|
+
* @param value - The header value.
|
|
3612
|
+
* @param ifNoneExist - Optional flag to only set the header if it doesn't already exist.
|
|
3613
|
+
*/
|
|
3614
|
+
private setRequestHeader;
|
|
3519
3615
|
/**
|
|
3520
3616
|
* Sets the body on fetch options.
|
|
3521
3617
|
* @param options - The fetch options.
|
|
@@ -4208,6 +4304,10 @@ export declare interface NewUserRequest {
|
|
|
4208
4304
|
readonly clientId?: string;
|
|
4209
4305
|
}
|
|
4210
4306
|
|
|
4307
|
+
export declare function normalizeCreateBinaryOptions(arg1: BinarySource | CreateBinaryOptions, arg2: string | undefined | MedplumRequestOptions, arg3?: string, arg4?: (e: ProgressEvent) => void): CreateBinaryOptions;
|
|
4308
|
+
|
|
4309
|
+
export declare function normalizeCreatePdfOptions(arg1: TDocumentDefinitions | CreatePdfOptions, arg2: string | undefined | MedplumRequestOptions, arg3: Record<string, CustomTableLayout> | undefined, arg4: TFontDictionary | undefined): CreatePdfOptions;
|
|
4310
|
+
|
|
4211
4311
|
/**
|
|
4212
4312
|
* Normalizes an error object into a displayable error string.
|
|
4213
4313
|
* @param error - The error value which could be a string, Error, OperationOutcome, or other unknown type.
|
|
@@ -4473,7 +4573,7 @@ export declare class ParserBuilder {
|
|
|
4473
4573
|
* @param reference - A reference to a FHIR resource.
|
|
4474
4574
|
* @returns A tuple containing the `ResourceType` and the ID of the resource or `undefined` when `undefined` or an invalid reference is passed.
|
|
4475
4575
|
*/
|
|
4476
|
-
export declare function parseReference(reference: Reference | undefined): [
|
|
4576
|
+
export declare function parseReference<T extends Resource>(reference: Reference<T> | undefined): [T['resourceType'], string];
|
|
4477
4577
|
|
|
4478
4578
|
/**
|
|
4479
4579
|
* Parses a URL string into a SearchRequest.
|