forked from HL7/fhirpath.js
/
index.d.ts
97 lines (88 loc) · 2.04 KB
/
index.d.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
declare module "fhirpath" {
export function compile(
path: string | Path,
model?: Model,
options?: {
resolveInternalTypes?: boolean
traceFn?: (value: any, label: string) => void,
userInvocationTable?: UserInvocationTable
}
): Compile;
export function evaluate(
fhirData: any,
path: string | Path,
context?: Context,
model?: Model,
options?: {
resolveInternalTypes?: boolean,
traceFn?: (value: any, label: string) => void,
userInvocationTable?: UserInvocationTable
}
): any[];
export function resolveInternalTypes(value: any): any;
export function types(value: any): string[];
export function parse(expression: string): any;
export const version :string;
}
declare module "fhirpath/fhir-context/dstu2" {
export const {
choiceTypePaths,
pathsDefinedElsewhere,
type2Parent,
path2Type
}: Model;
}
declare module "fhirpath/fhir-context/r5" {
export const {
choiceTypePaths,
pathsDefinedElsewhere,
type2Parent,
path2Type
}: Model;
}
declare module "fhirpath/fhir-context/r4" {
export const {
choiceTypePaths,
pathsDefinedElsewhere,
type2Parent,
path2Type
}: Model;
}
declare module "fhirpath/fhir-context/stu3" {
export const {
choiceTypePaths,
pathsDefinedElsewhere,
type2Parent,
path2Type
}: Model;
}
interface Path {
base: string;
expression: string;
}
interface Model {
choiceTypePaths: {
[path: string]: string[];
};
pathsDefinedElsewhere: {
[path: string]: string;
};
type2Parent: {
[path: string]: string;
};
path2Type: {
[path: string]: string;
};
}
type Compile = (resource: any, context?: Context) => any[];
type Context = void | Record<string, any>;
type UserInvocationTable = {
[name: string]: {
fn: Function,
arity: {
[numberOfParams: number]: Array<'Expr' | 'AnyAtRoot' | 'Identifier' | 'TypeSpecifier' | 'Any' | 'Integer' | 'Boolean' | 'Number' | 'String'>
},
nullable?: boolean,
internalStructures?: boolean
}
};