@medplum/core 3.0.2 → 3.0.3
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 +4 -4
- package/dist/cjs/index.cjs.map +3 -3
- package/dist/cjs/index.d.ts +37 -11
- package/dist/esm/index.d.ts +37 -11
- package/dist/esm/index.mjs +4 -4
- package/dist/esm/index.mjs.map +3 -3
- package/package.json +1 -1
package/dist/cjs/index.d.ts
CHANGED
|
@@ -395,6 +395,7 @@ export declare const ContentType: {
|
|
|
395
395
|
readonly SVG: "image/svg+xml";
|
|
396
396
|
readonly TEXT: "text/plain";
|
|
397
397
|
readonly TYPESCRIPT: "text/typescript";
|
|
398
|
+
readonly PING: "x-application/ping";
|
|
398
399
|
};
|
|
399
400
|
|
|
400
401
|
/**
|
|
@@ -1197,9 +1198,10 @@ export declare function getDisplayString(resource: Resource): string;
|
|
|
1197
1198
|
* Returns an element definition by type and property name.
|
|
1198
1199
|
* @param typeName - The type name.
|
|
1199
1200
|
* @param propertyName - The property name.
|
|
1201
|
+
* @param profileUrl - (optional) The URL of the current resource profile
|
|
1200
1202
|
* @returns The element definition if found.
|
|
1201
1203
|
*/
|
|
1202
|
-
export declare function getElementDefinition(typeName: string, propertyName: string): InternalSchemaElement | undefined;
|
|
1204
|
+
export declare function getElementDefinition(typeName: string, propertyName: string, profileUrl?: string): InternalSchemaElement | undefined;
|
|
1203
1205
|
|
|
1204
1206
|
/**
|
|
1205
1207
|
* Returns an element definition from mapping of elements by property name.
|
|
@@ -1255,7 +1257,9 @@ export declare function getIdentifier(resource: Resource, system: string): strin
|
|
|
1255
1257
|
*/
|
|
1256
1258
|
export declare function getImageSrc(resource: Resource): string | undefined;
|
|
1257
1259
|
|
|
1258
|
-
export declare function getNestedProperty(value: TypedValue, key: string
|
|
1260
|
+
export declare function getNestedProperty(value: TypedValue, key: string, options?: {
|
|
1261
|
+
profileUrl?: string;
|
|
1262
|
+
}): (TypedValue | TypedValue[] | undefined)[];
|
|
1259
1263
|
|
|
1260
1264
|
/**
|
|
1261
1265
|
* Returns a human friendly display name for a FHIR element definition path.
|
|
@@ -1338,18 +1342,24 @@ export declare function getStatus(outcome: OperationOutcome): number;
|
|
|
1338
1342
|
* This function returns the value and the type.
|
|
1339
1343
|
* @param input - The base context (FHIR resource or backbone element).
|
|
1340
1344
|
* @param path - The property path.
|
|
1345
|
+
* @param options - (optional) Additional options
|
|
1341
1346
|
* @returns The value of the property and the property type.
|
|
1342
1347
|
*/
|
|
1343
|
-
export declare function getTypedPropertyValue(input: TypedValue, path: string): TypedValue[] | TypedValue | undefined;
|
|
1348
|
+
export declare function getTypedPropertyValue(input: TypedValue, path: string, options?: GetTypedPropertyValueOptions): TypedValue[] | TypedValue | undefined;
|
|
1349
|
+
|
|
1350
|
+
export declare interface GetTypedPropertyValueOptions {
|
|
1351
|
+
/** (optional) URL of a resource profile for type resolution */
|
|
1352
|
+
profileUrl?: string;
|
|
1353
|
+
}
|
|
1344
1354
|
|
|
1345
1355
|
/**
|
|
1346
1356
|
* Returns the value of the property and the property type using a type schema.
|
|
1347
|
-
* @param
|
|
1357
|
+
* @param typedValue - The base context (FHIR resource or backbone element).
|
|
1348
1358
|
* @param path - The property path.
|
|
1349
1359
|
* @param element - The property element definition.
|
|
1350
1360
|
* @returns The value of the property and the property type.
|
|
1351
1361
|
*/
|
|
1352
|
-
export declare function getTypedPropertyValueWithSchema(
|
|
1362
|
+
export declare function getTypedPropertyValueWithSchema(typedValue: TypedValue, path: string, element: InternalSchemaElement): TypedValue[] | TypedValue | undefined;
|
|
1353
1363
|
|
|
1354
1364
|
/**
|
|
1355
1365
|
* Global schema singleton.
|
|
@@ -2647,7 +2657,7 @@ export declare class MedplumClient extends EventTarget_2 {
|
|
|
2647
2657
|
* @param resourceType - The FHIR resource type.
|
|
2648
2658
|
* @param id - The resource ID.
|
|
2649
2659
|
* @param options - Optional fetch options.
|
|
2650
|
-
* @returns The resource if available
|
|
2660
|
+
* @returns The resource if available.
|
|
2651
2661
|
*/
|
|
2652
2662
|
readResource<K extends ResourceType>(resourceType: K, id: string, options?: RequestInit): ReadablePromise<ExtractResource<K>>;
|
|
2653
2663
|
/**
|
|
@@ -2668,7 +2678,7 @@ export declare class MedplumClient extends EventTarget_2 {
|
|
|
2668
2678
|
* @category Read
|
|
2669
2679
|
* @param reference - The FHIR reference object.
|
|
2670
2680
|
* @param options - Optional fetch options.
|
|
2671
|
-
* @returns The resource if available
|
|
2681
|
+
* @returns The resource if available.
|
|
2672
2682
|
*/
|
|
2673
2683
|
readReference<T extends Resource>(reference: Reference<T>, options?: RequestInit): ReadablePromise<T>;
|
|
2674
2684
|
/**
|
|
@@ -2684,9 +2694,10 @@ export declare class MedplumClient extends EventTarget_2 {
|
|
|
2684
2694
|
* If the schema is already cached, the promise is resolved immediately.
|
|
2685
2695
|
* @category Schema
|
|
2686
2696
|
* @param profileUrl - The FHIR URL of the profile
|
|
2687
|
-
* @
|
|
2697
|
+
* @param options - (optional) Additional options
|
|
2698
|
+
* @returns Promise with an array of URLs of the profile(s) loaded.
|
|
2688
2699
|
*/
|
|
2689
|
-
requestProfileSchema(profileUrl: string): Promise<
|
|
2700
|
+
requestProfileSchema(profileUrl: string, options?: RequestProfileSchemaOptions): Promise<string[]>;
|
|
2690
2701
|
/**
|
|
2691
2702
|
* Reads resource history by resource type and ID.
|
|
2692
2703
|
*
|
|
@@ -2725,7 +2736,7 @@ export declare class MedplumClient extends EventTarget_2 {
|
|
|
2725
2736
|
* @param id - The resource ID.
|
|
2726
2737
|
* @param vid - The version ID.
|
|
2727
2738
|
* @param options - Optional fetch options.
|
|
2728
|
-
* @returns The resource if available
|
|
2739
|
+
* @returns The resource if available.
|
|
2729
2740
|
*/
|
|
2730
2741
|
readVersion<K extends ResourceType>(resourceType: K, id: string, vid: string, options?: RequestInit): ReadablePromise<ExtractResource<K>>;
|
|
2731
2742
|
/**
|
|
@@ -3168,7 +3179,7 @@ export declare class MedplumClient extends EventTarget_2 {
|
|
|
3168
3179
|
* @param options - Optional fetch options.
|
|
3169
3180
|
* @returns Promise to the result. If waiting for response, the result is the response body. Otherwise, it is an operation outcome.
|
|
3170
3181
|
*/
|
|
3171
|
-
pushToAgent(agent: Agent | Reference<Agent>, destination: Device | Reference<Device
|
|
3182
|
+
pushToAgent(agent: Agent | Reference<Agent>, destination: Device | Reference<Device> | string, body: any, contentType?: string, waitForResponse?: boolean, options?: RequestInit): Promise<any>;
|
|
3172
3183
|
/**
|
|
3173
3184
|
* @category Authentication
|
|
3174
3185
|
* @returns The Login State
|
|
@@ -4474,6 +4485,11 @@ export declare function removeDuplicates(arr: TypedValue[]): TypedValue[];
|
|
|
4474
4485
|
*/
|
|
4475
4486
|
export declare function reorderBundle(bundle: Bundle): Bundle;
|
|
4476
4487
|
|
|
4488
|
+
export declare interface RequestProfileSchemaOptions {
|
|
4489
|
+
/** (optional) Whether to include nested profiles, e.g. from extensions. Defaults to false. */
|
|
4490
|
+
expandProfile?: boolean;
|
|
4491
|
+
}
|
|
4492
|
+
|
|
4477
4493
|
/**
|
|
4478
4494
|
* Returns the ID portion of a reference.
|
|
4479
4495
|
* @param input - A FHIR reference or resource.
|
|
@@ -4599,6 +4615,7 @@ export declare interface SliceDefinition {
|
|
|
4599
4615
|
elements: Record<string, InternalSchemaElement>;
|
|
4600
4616
|
min: number;
|
|
4601
4617
|
max: number;
|
|
4618
|
+
binding?: ElementDefinitionBinding;
|
|
4602
4619
|
}
|
|
4603
4620
|
|
|
4604
4621
|
export declare interface SliceDiscriminator {
|
|
@@ -4620,6 +4637,15 @@ export declare interface SortRule {
|
|
|
4620
4637
|
descending?: boolean;
|
|
4621
4638
|
}
|
|
4622
4639
|
|
|
4640
|
+
/**
|
|
4641
|
+
* Splits a string into an array of strings using the specified delimiter.
|
|
4642
|
+
* Unlike the built-in split function, this function will split the string into a maximum of exactly n parts.
|
|
4643
|
+
* Trailing empty strings are included in the result.
|
|
4644
|
+
* @param str - The string to split.
|
|
4645
|
+
* @param delim - The delimiter.
|
|
4646
|
+
* @param n - The maximum number of parts to split the string into.
|
|
4647
|
+
* @returns The resulting array of strings.
|
|
4648
|
+
*/
|
|
4623
4649
|
export declare function splitN(str: string, delim: string, n: number): string[];
|
|
4624
4650
|
|
|
4625
4651
|
/**
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -395,6 +395,7 @@ export declare const ContentType: {
|
|
|
395
395
|
readonly SVG: "image/svg+xml";
|
|
396
396
|
readonly TEXT: "text/plain";
|
|
397
397
|
readonly TYPESCRIPT: "text/typescript";
|
|
398
|
+
readonly PING: "x-application/ping";
|
|
398
399
|
};
|
|
399
400
|
|
|
400
401
|
/**
|
|
@@ -1197,9 +1198,10 @@ export declare function getDisplayString(resource: Resource): string;
|
|
|
1197
1198
|
* Returns an element definition by type and property name.
|
|
1198
1199
|
* @param typeName - The type name.
|
|
1199
1200
|
* @param propertyName - The property name.
|
|
1201
|
+
* @param profileUrl - (optional) The URL of the current resource profile
|
|
1200
1202
|
* @returns The element definition if found.
|
|
1201
1203
|
*/
|
|
1202
|
-
export declare function getElementDefinition(typeName: string, propertyName: string): InternalSchemaElement | undefined;
|
|
1204
|
+
export declare function getElementDefinition(typeName: string, propertyName: string, profileUrl?: string): InternalSchemaElement | undefined;
|
|
1203
1205
|
|
|
1204
1206
|
/**
|
|
1205
1207
|
* Returns an element definition from mapping of elements by property name.
|
|
@@ -1255,7 +1257,9 @@ export declare function getIdentifier(resource: Resource, system: string): strin
|
|
|
1255
1257
|
*/
|
|
1256
1258
|
export declare function getImageSrc(resource: Resource): string | undefined;
|
|
1257
1259
|
|
|
1258
|
-
export declare function getNestedProperty(value: TypedValue, key: string
|
|
1260
|
+
export declare function getNestedProperty(value: TypedValue, key: string, options?: {
|
|
1261
|
+
profileUrl?: string;
|
|
1262
|
+
}): (TypedValue | TypedValue[] | undefined)[];
|
|
1259
1263
|
|
|
1260
1264
|
/**
|
|
1261
1265
|
* Returns a human friendly display name for a FHIR element definition path.
|
|
@@ -1338,18 +1342,24 @@ export declare function getStatus(outcome: OperationOutcome): number;
|
|
|
1338
1342
|
* This function returns the value and the type.
|
|
1339
1343
|
* @param input - The base context (FHIR resource or backbone element).
|
|
1340
1344
|
* @param path - The property path.
|
|
1345
|
+
* @param options - (optional) Additional options
|
|
1341
1346
|
* @returns The value of the property and the property type.
|
|
1342
1347
|
*/
|
|
1343
|
-
export declare function getTypedPropertyValue(input: TypedValue, path: string): TypedValue[] | TypedValue | undefined;
|
|
1348
|
+
export declare function getTypedPropertyValue(input: TypedValue, path: string, options?: GetTypedPropertyValueOptions): TypedValue[] | TypedValue | undefined;
|
|
1349
|
+
|
|
1350
|
+
export declare interface GetTypedPropertyValueOptions {
|
|
1351
|
+
/** (optional) URL of a resource profile for type resolution */
|
|
1352
|
+
profileUrl?: string;
|
|
1353
|
+
}
|
|
1344
1354
|
|
|
1345
1355
|
/**
|
|
1346
1356
|
* Returns the value of the property and the property type using a type schema.
|
|
1347
|
-
* @param
|
|
1357
|
+
* @param typedValue - The base context (FHIR resource or backbone element).
|
|
1348
1358
|
* @param path - The property path.
|
|
1349
1359
|
* @param element - The property element definition.
|
|
1350
1360
|
* @returns The value of the property and the property type.
|
|
1351
1361
|
*/
|
|
1352
|
-
export declare function getTypedPropertyValueWithSchema(
|
|
1362
|
+
export declare function getTypedPropertyValueWithSchema(typedValue: TypedValue, path: string, element: InternalSchemaElement): TypedValue[] | TypedValue | undefined;
|
|
1353
1363
|
|
|
1354
1364
|
/**
|
|
1355
1365
|
* Global schema singleton.
|
|
@@ -2647,7 +2657,7 @@ export declare class MedplumClient extends EventTarget_2 {
|
|
|
2647
2657
|
* @param resourceType - The FHIR resource type.
|
|
2648
2658
|
* @param id - The resource ID.
|
|
2649
2659
|
* @param options - Optional fetch options.
|
|
2650
|
-
* @returns The resource if available
|
|
2660
|
+
* @returns The resource if available.
|
|
2651
2661
|
*/
|
|
2652
2662
|
readResource<K extends ResourceType>(resourceType: K, id: string, options?: RequestInit): ReadablePromise<ExtractResource<K>>;
|
|
2653
2663
|
/**
|
|
@@ -2668,7 +2678,7 @@ export declare class MedplumClient extends EventTarget_2 {
|
|
|
2668
2678
|
* @category Read
|
|
2669
2679
|
* @param reference - The FHIR reference object.
|
|
2670
2680
|
* @param options - Optional fetch options.
|
|
2671
|
-
* @returns The resource if available
|
|
2681
|
+
* @returns The resource if available.
|
|
2672
2682
|
*/
|
|
2673
2683
|
readReference<T extends Resource>(reference: Reference<T>, options?: RequestInit): ReadablePromise<T>;
|
|
2674
2684
|
/**
|
|
@@ -2684,9 +2694,10 @@ export declare class MedplumClient extends EventTarget_2 {
|
|
|
2684
2694
|
* If the schema is already cached, the promise is resolved immediately.
|
|
2685
2695
|
* @category Schema
|
|
2686
2696
|
* @param profileUrl - The FHIR URL of the profile
|
|
2687
|
-
* @
|
|
2697
|
+
* @param options - (optional) Additional options
|
|
2698
|
+
* @returns Promise with an array of URLs of the profile(s) loaded.
|
|
2688
2699
|
*/
|
|
2689
|
-
requestProfileSchema(profileUrl: string): Promise<
|
|
2700
|
+
requestProfileSchema(profileUrl: string, options?: RequestProfileSchemaOptions): Promise<string[]>;
|
|
2690
2701
|
/**
|
|
2691
2702
|
* Reads resource history by resource type and ID.
|
|
2692
2703
|
*
|
|
@@ -2725,7 +2736,7 @@ export declare class MedplumClient extends EventTarget_2 {
|
|
|
2725
2736
|
* @param id - The resource ID.
|
|
2726
2737
|
* @param vid - The version ID.
|
|
2727
2738
|
* @param options - Optional fetch options.
|
|
2728
|
-
* @returns The resource if available
|
|
2739
|
+
* @returns The resource if available.
|
|
2729
2740
|
*/
|
|
2730
2741
|
readVersion<K extends ResourceType>(resourceType: K, id: string, vid: string, options?: RequestInit): ReadablePromise<ExtractResource<K>>;
|
|
2731
2742
|
/**
|
|
@@ -3168,7 +3179,7 @@ export declare class MedplumClient extends EventTarget_2 {
|
|
|
3168
3179
|
* @param options - Optional fetch options.
|
|
3169
3180
|
* @returns Promise to the result. If waiting for response, the result is the response body. Otherwise, it is an operation outcome.
|
|
3170
3181
|
*/
|
|
3171
|
-
pushToAgent(agent: Agent | Reference<Agent>, destination: Device | Reference<Device
|
|
3182
|
+
pushToAgent(agent: Agent | Reference<Agent>, destination: Device | Reference<Device> | string, body: any, contentType?: string, waitForResponse?: boolean, options?: RequestInit): Promise<any>;
|
|
3172
3183
|
/**
|
|
3173
3184
|
* @category Authentication
|
|
3174
3185
|
* @returns The Login State
|
|
@@ -4474,6 +4485,11 @@ export declare function removeDuplicates(arr: TypedValue[]): TypedValue[];
|
|
|
4474
4485
|
*/
|
|
4475
4486
|
export declare function reorderBundle(bundle: Bundle): Bundle;
|
|
4476
4487
|
|
|
4488
|
+
export declare interface RequestProfileSchemaOptions {
|
|
4489
|
+
/** (optional) Whether to include nested profiles, e.g. from extensions. Defaults to false. */
|
|
4490
|
+
expandProfile?: boolean;
|
|
4491
|
+
}
|
|
4492
|
+
|
|
4477
4493
|
/**
|
|
4478
4494
|
* Returns the ID portion of a reference.
|
|
4479
4495
|
* @param input - A FHIR reference or resource.
|
|
@@ -4599,6 +4615,7 @@ export declare interface SliceDefinition {
|
|
|
4599
4615
|
elements: Record<string, InternalSchemaElement>;
|
|
4600
4616
|
min: number;
|
|
4601
4617
|
max: number;
|
|
4618
|
+
binding?: ElementDefinitionBinding;
|
|
4602
4619
|
}
|
|
4603
4620
|
|
|
4604
4621
|
export declare interface SliceDiscriminator {
|
|
@@ -4620,6 +4637,15 @@ export declare interface SortRule {
|
|
|
4620
4637
|
descending?: boolean;
|
|
4621
4638
|
}
|
|
4622
4639
|
|
|
4640
|
+
/**
|
|
4641
|
+
* Splits a string into an array of strings using the specified delimiter.
|
|
4642
|
+
* Unlike the built-in split function, this function will split the string into a maximum of exactly n parts.
|
|
4643
|
+
* Trailing empty strings are included in the result.
|
|
4644
|
+
* @param str - The string to split.
|
|
4645
|
+
* @param delim - The delimiter.
|
|
4646
|
+
* @param n - The maximum number of parts to split the string into.
|
|
4647
|
+
* @returns The resulting array of strings.
|
|
4648
|
+
*/
|
|
4623
4649
|
export declare function splitN(str: string, delim: string, n: number): string[];
|
|
4624
4650
|
|
|
4625
4651
|
/**
|