-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfhirschema.ts
59 lines (55 loc) · 1.32 KB
/
fhirschema.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
export interface FHIRSchemaBase {
required?: string[];
elements?: {
[key: string]: FHIRSchemaElement
}
}
export interface FHIRSchemaElement extends FHIRSchemaBase {
// TODO: deprecate
scalar?: boolean;
summary?: boolean;
type?: string;
array?: boolean;
modifier?: boolean;
refers?: string[];
binding?: {
valueSet: string;
strength: 'example' | 'extensible' | 'required' | 'preferred';
};
constraints?: {
[key: string]: {
human: string;
severity: 'error' | string;
expression: string;
}
};
choices?: string[];
choiceOf?: string;
required?: string[];
elementReference?: string[];
}
export type FHIRSchemaKind = 'resource' | 'complex-type' | 'primitive-type' | 'logical';
export interface FHIRSchema extends FHIRSchemaBase {
url: string;
constraints?: {
[key: string]: {
human: string;
severity: 'error' | string;
expression: string;
}
};
meta?: {
package: {
url: string;
version: string;
path?: string;
};
};
id?: string;
base?: string;
name: string;
kind: FHIRSchemaKind;
derivation?: 'specialization' | 'constraint';
type?: string;
version?: string;
}