@medplum/core 2.0.29 → 2.0.30
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/esm/index.mjs +4 -4
- package/dist/esm/index.mjs.map +3 -3
- package/dist/types/client.d.ts +16 -5
- package/dist/types/outcomes.d.ts +4 -0
- package/dist/types/schema.d.ts +0 -1
- package/dist/types/search/search.d.ts +1 -0
- package/dist/types/typeschema/types.d.ts +12 -1
- package/dist/types/utils.d.ts +8 -1
- package/package.json +1 -1
package/dist/types/client.d.ts
CHANGED
|
@@ -301,6 +301,10 @@ export interface PatchOperation {
|
|
|
301
301
|
readonly path: string;
|
|
302
302
|
readonly value?: any;
|
|
303
303
|
}
|
|
304
|
+
/**
|
|
305
|
+
* Source for a FHIR Binary.
|
|
306
|
+
*/
|
|
307
|
+
export type BinarySource = string | File | Blob | Uint8Array;
|
|
304
308
|
/**
|
|
305
309
|
* Email address definition.
|
|
306
310
|
* Compatible with nodemailer Mail.Address.
|
|
@@ -1029,7 +1033,7 @@ export declare class MedplumClient extends EventTarget {
|
|
|
1029
1033
|
* @param onProgress Optional callback for progress events.
|
|
1030
1034
|
* @returns The result of the create operation.
|
|
1031
1035
|
*/
|
|
1032
|
-
createAttachment(data:
|
|
1036
|
+
createAttachment(data: BinarySource, filename: string | undefined, contentType: string, onProgress?: (e: ProgressEvent) => void): Promise<Attachment>;
|
|
1033
1037
|
/**
|
|
1034
1038
|
* Creates a FHIR `Binary` resource with the provided data content.
|
|
1035
1039
|
*
|
|
@@ -1054,8 +1058,8 @@ export declare class MedplumClient extends EventTarget {
|
|
|
1054
1058
|
* @param onProgress Optional callback for progress events.
|
|
1055
1059
|
* @returns The result of the create operation.
|
|
1056
1060
|
*/
|
|
1057
|
-
createBinary(data:
|
|
1058
|
-
uploadwithProgress(url: URL, data:
|
|
1061
|
+
createBinary(data: BinarySource, filename: string | undefined, contentType: string, onProgress?: (e: ProgressEvent) => void): Promise<Binary>;
|
|
1062
|
+
uploadwithProgress(url: URL, data: BinarySource, contentType: string, onProgress: (e: ProgressEvent) => void): Promise<any>;
|
|
1059
1063
|
/**
|
|
1060
1064
|
* Creates a PDF as a FHIR `Binary` resource based on pdfmake document definition.
|
|
1061
1065
|
*
|
|
@@ -1424,9 +1428,16 @@ export declare class MedplumClient extends EventTarget {
|
|
|
1424
1428
|
*/
|
|
1425
1429
|
getAccessPolicy(): AccessPolicy | undefined;
|
|
1426
1430
|
/**
|
|
1427
|
-
*
|
|
1431
|
+
* Translates/normalizes a URL so that it can be directly used with `MedplumClient.fetch`.
|
|
1432
|
+
* Especially useful for translating `Binary/{id}` URLs to FHIR paths.
|
|
1433
|
+
* @param url A valid URL within the `MedplumClient` context.
|
|
1434
|
+
* @returns URL as a string that can be used with `MedplumClient.fetch`
|
|
1435
|
+
*/
|
|
1436
|
+
normalizeFetchUrl(url: URL | string): string;
|
|
1437
|
+
/**
|
|
1438
|
+
* Downloads the URL as a blob. Can accept binary URLs in the form of `Binary/{id}` as well.
|
|
1428
1439
|
* @category Read
|
|
1429
|
-
* @param url The URL to request.
|
|
1440
|
+
* @param url The URL to request. Can be a standard URL or one in the form of `Binary/{id}`.
|
|
1430
1441
|
* @param options Optional fetch request init options.
|
|
1431
1442
|
* @returns Promise to the response body as a blob.
|
|
1432
1443
|
*/
|
package/dist/types/outcomes.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { OperationOutcome, OperationOutcomeIssue } from '@medplum/fhirtypes';
|
|
2
|
+
import { Constraint } from './typeschema/types';
|
|
2
3
|
export declare const allOk: OperationOutcome;
|
|
3
4
|
export declare const created: OperationOutcome;
|
|
4
5
|
export declare const notModified: OperationOutcome;
|
|
@@ -51,3 +52,6 @@ export declare function operationOutcomeToString(outcome: OperationOutcome): str
|
|
|
51
52
|
* @returns The string representation of the operation outcome issue.
|
|
52
53
|
*/
|
|
53
54
|
export declare function operationOutcomeIssueToString(issue: OperationOutcomeIssue): string;
|
|
55
|
+
export declare function createStructureIssue(expression: string, details: string): OperationOutcomeIssue;
|
|
56
|
+
export declare function createConstraintIssue(expression: string, constraint: Constraint): OperationOutcomeIssue;
|
|
57
|
+
export declare function createProcessingIssue(expression: string, message: string, err: Error, data?: Record<string, any>): OperationOutcomeIssue;
|
package/dist/types/schema.d.ts
CHANGED
|
@@ -144,4 +144,3 @@ export declare class FhirSchemaValidator<T extends Resource> {
|
|
|
144
144
|
* @param issues Output list of issues.
|
|
145
145
|
*/
|
|
146
146
|
export declare function checkForNull(value: unknown, path: string, issues: OperationOutcomeIssue[]): void;
|
|
147
|
-
export declare function createStructureIssue(expression: string, details: string): OperationOutcomeIssue;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Bundle, StructureDefinition } from '@medplum/fhirtypes';
|
|
1
|
+
import { Bundle, StructureDefinition, Resource } from '@medplum/fhirtypes';
|
|
2
2
|
import { TypedValue } from '../types';
|
|
3
3
|
/**
|
|
4
4
|
* Internal representation of a non-primitive FHIR type, suitable for use in resource validation
|
|
@@ -8,6 +8,8 @@ export interface InternalTypeSchema {
|
|
|
8
8
|
fields: Record<string, ElementValidator>;
|
|
9
9
|
constraints: Constraint[];
|
|
10
10
|
innerTypes: InternalTypeSchema[];
|
|
11
|
+
summaryProperties?: Set<string>;
|
|
12
|
+
mandatoryProperties?: Set<string>;
|
|
11
13
|
}
|
|
12
14
|
export interface ElementValidator {
|
|
13
15
|
min: number;
|
|
@@ -56,3 +58,12 @@ export interface SliceDiscriminator {
|
|
|
56
58
|
export declare function parseStructureDefinition(sd: StructureDefinition): InternalTypeSchema;
|
|
57
59
|
export declare function loadDataTypes(bundle: Bundle<StructureDefinition>): void;
|
|
58
60
|
export declare function getDataType(type: string): InternalTypeSchema;
|
|
61
|
+
/**
|
|
62
|
+
* Construct the subset of a resource containing a minimum set of fields. The returned resource is not guaranteed
|
|
63
|
+
* to contain only the provided properties, and may contain others (e.g. `resourceType` and `id`)
|
|
64
|
+
*
|
|
65
|
+
* @param resource The resource to subset
|
|
66
|
+
* @param properties The minimum properties to include in the subset
|
|
67
|
+
* @returns The modified resource, containing the listed properties and possibly other mandatory ones
|
|
68
|
+
*/
|
|
69
|
+
export declare function subsetResource<T extends Resource>(resource: T | undefined, properties: string[]): T | undefined;
|
package/dist/types/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CodeableConcept, Extension, ObservationDefinition, ObservationDefinitionQualifiedInterval, Patient, Practitioner, QuestionnaireResponse, QuestionnaireResponseItemAnswer, Range, Reference, RelatedPerson, Resource } from '@medplum/fhirtypes';
|
|
1
|
+
import { CodeableConcept, Extension, ObservationDefinition, ObservationDefinitionQualifiedInterval, Patient, Practitioner, QuestionnaireResponse, QuestionnaireResponseItemAnswer, Range, Reference, RelatedPerson, Resource, ResourceType } from '@medplum/fhirtypes';
|
|
2
2
|
/**
|
|
3
3
|
* @internal
|
|
4
4
|
*/
|
|
@@ -28,6 +28,13 @@ export declare function getReferenceString(resource: Resource): string;
|
|
|
28
28
|
* @returns The ID portion of a reference.
|
|
29
29
|
*/
|
|
30
30
|
export declare function resolveId(reference: Reference | undefined): string | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Parses a reference and returns a tuple of [ResourceType, ID].
|
|
33
|
+
* @param reference A reference to a FHIR resource.
|
|
34
|
+
* @returns A tuple containing the `ResourceType` and the ID of the resource or `undefined` when `undefined` or an invalid reference is passed.
|
|
35
|
+
*/
|
|
36
|
+
export declare function parseReference(reference: Reference): [ResourceType, string] | undefined;
|
|
37
|
+
export declare function parseReference(reference: undefined): undefined;
|
|
31
38
|
/**
|
|
32
39
|
* Returns true if the resource is a "ProfileResource".
|
|
33
40
|
* @param resource The FHIR resource.
|