@medplum/core 2.1.4 → 2.1.6
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 +15 -6
- package/dist/cjs/index.cjs.map +4 -4
- package/dist/esm/index.mjs +15 -6
- package/dist/esm/index.mjs.map +4 -4
- package/dist/types/base-schema.d.ts +7 -0
- package/dist/types/client.d.ts +41 -13
- package/dist/types/eventtarget.d.ts +6 -0
- package/dist/types/fhircast/index.d.ts +115 -0
- package/dist/types/fhircast/test-utils.d.ts +2 -0
- package/dist/types/fhirmapper/tokenize.d.ts +1 -1
- package/dist/types/fhirpath/atoms.d.ts +1 -1
- package/dist/types/fhirpath/functions.d.ts +1 -1
- package/dist/types/fhirpath/parse.d.ts +1 -1
- package/dist/types/fhirpath/tokenize.d.ts +1 -1
- package/dist/types/filter/tokenize.d.ts +1 -1
- package/dist/types/index.d.ts +8 -4
- package/dist/types/outcomes.d.ts +1 -0
- package/dist/types/schema.d.ts +1 -104
- package/dist/types/search/details.d.ts +4 -3
- package/dist/types/types.d.ts +74 -92
- package/dist/types/typeschema/types.d.ts +32 -10
- package/dist/types/typeschema/validation.d.ts +1 -1
- package/package.json +3 -2
- package/dist/types/fhirlexer/index.d.ts +0 -2
- package/dist/types/fhirmapper/index.d.ts +0 -1
- package/dist/types/fhirpath/index.d.ts +0 -4
- package/dist/types/filter/index.d.ts +0 -2
|
@@ -1,30 +1,36 @@
|
|
|
1
|
-
import { Bundle, Resource, StructureDefinition } from '@medplum/fhirtypes';
|
|
1
|
+
import { Bundle, ElementDefinitionBinding, Resource, StructureDefinition } 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
|
|
5
5
|
*/
|
|
6
6
|
export interface InternalTypeSchema {
|
|
7
7
|
name: string;
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
url?: string;
|
|
9
|
+
kind?: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
elements: Record<string, InternalSchemaElement>;
|
|
12
|
+
constraints?: Constraint[];
|
|
13
|
+
parentType?: InternalTypeSchema;
|
|
10
14
|
innerTypes: InternalTypeSchema[];
|
|
11
15
|
summaryProperties?: Set<string>;
|
|
12
16
|
mandatoryProperties?: Set<string>;
|
|
13
17
|
}
|
|
14
|
-
export interface
|
|
18
|
+
export interface InternalSchemaElement {
|
|
19
|
+
description: string;
|
|
20
|
+
path: string;
|
|
15
21
|
min: number;
|
|
16
22
|
max: number;
|
|
17
|
-
isArray
|
|
18
|
-
constraints
|
|
23
|
+
isArray?: boolean;
|
|
24
|
+
constraints?: Constraint[];
|
|
19
25
|
type: ElementType[];
|
|
20
26
|
slicing?: SlicingRules;
|
|
21
27
|
fixed?: TypedValue;
|
|
22
28
|
pattern?: TypedValue;
|
|
23
|
-
binding?:
|
|
29
|
+
binding?: ElementDefinitionBinding;
|
|
24
30
|
}
|
|
25
31
|
export interface ElementType {
|
|
26
32
|
code: string;
|
|
27
|
-
targetProfile
|
|
33
|
+
targetProfile?: string[];
|
|
28
34
|
}
|
|
29
35
|
export interface Constraint {
|
|
30
36
|
key: string;
|
|
@@ -41,7 +47,7 @@ export interface SlicingRules {
|
|
|
41
47
|
export interface SliceDefinition {
|
|
42
48
|
name: string;
|
|
43
49
|
type?: ElementType[];
|
|
44
|
-
|
|
50
|
+
elements: Record<string, InternalSchemaElement>;
|
|
45
51
|
min: number;
|
|
46
52
|
max: number;
|
|
47
53
|
}
|
|
@@ -57,8 +63,24 @@ export interface SliceDiscriminator {
|
|
|
57
63
|
* @experimental
|
|
58
64
|
*/
|
|
59
65
|
export declare function parseStructureDefinition(sd: StructureDefinition): InternalTypeSchema;
|
|
60
|
-
export declare function
|
|
66
|
+
export declare function indexStructureDefinitionBundle(bundle: StructureDefinition[] | Bundle): void;
|
|
67
|
+
export declare function loadDataType(sd: StructureDefinition): void;
|
|
68
|
+
export declare function getAllDataTypes(): Record<string, InternalTypeSchema>;
|
|
69
|
+
export declare function isDataTypeLoaded(type: string): boolean;
|
|
70
|
+
export declare function tryGetDataType(type: string): InternalTypeSchema | undefined;
|
|
61
71
|
export declare function getDataType(type: string): InternalTypeSchema;
|
|
72
|
+
/**
|
|
73
|
+
* Returns true if the given string is a valid FHIR resource type.
|
|
74
|
+
*
|
|
75
|
+
* ```ts
|
|
76
|
+
* isResourceType('Patient'); // true
|
|
77
|
+
* isResourceType('XYZ'); // false
|
|
78
|
+
* ```
|
|
79
|
+
*
|
|
80
|
+
* @param resourceType The candidate resource type string.
|
|
81
|
+
* @returns True if the resource type is a valid FHIR resource type.
|
|
82
|
+
*/
|
|
83
|
+
export declare function isResourceType(resourceType: string): boolean;
|
|
62
84
|
/**
|
|
63
85
|
* Construct the subset of a resource containing a minimum set of fields. The returned resource is not guaranteed
|
|
64
86
|
* to contain only the provided properties, and may contain others (e.g. `resourceType` and `id`)
|
|
@@ -22,4 +22,4 @@ export declare const fhirTypeToJsType: {
|
|
|
22
22
|
readonly xhtml: "string";
|
|
23
23
|
readonly 'http://hl7.org/fhirpath/System.String': "string";
|
|
24
24
|
};
|
|
25
|
-
export declare function
|
|
25
|
+
export declare function validateResource(resource: Resource, profile?: StructureDefinition): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medplum/core",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.6",
|
|
4
4
|
"description": "Medplum TS/JS Library",
|
|
5
5
|
"author": "Medplum <hello@medplum.com>",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@medplum/definitions": "*",
|
|
23
|
-
"@medplum/fhirtypes": "*"
|
|
23
|
+
"@medplum/fhirtypes": "*",
|
|
24
|
+
"jest-websocket-mock": "2.5.0"
|
|
24
25
|
},
|
|
25
26
|
"peerDependencies": {
|
|
26
27
|
"pdfmake": "^0.2.5"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './parse';
|