This repository has been archived by the owner on Jul 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
glaucoma-risk-calculator-engine.d.ts
175 lines (159 loc) · 4.54 KB
/
glaucoma-risk-calculator-engine.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
/// <reference types="mathjs" />
export interface IDictOfStringArray {
[study: string]: string[];
}
export type Study =
'aboriginal'
| 'barbados'
| 'bmes'
| 'framingham'
| 'ghana'
| 'indian'
| 'japanese'
| 'korean'
| 'nepal'
| 'olmsted'
| 'singapore';
export type Gender = 'male' | 'female';
export interface IInput {
study: Study;
age: number;
gender?: Gender;
sibling?: boolean;
parent?: boolean;
_meta?: string[];
_extra?: any[];
}
export interface IRiskJson {
default_expr: {};
default_family_history: {
from_study: Study;
sibling_pc: number;
parents_pc: number;
ref: Array<{}>;
};
default_multiplicative_risks: {
myopia: {
existent: number
},
family_history: {
existent: number
},
diabetes: {
existent: number
},
age: {},
age_map: Map<string, number>,
ref: Array<{}>
};
global_notes: string[];
studies: {
olmsted: IOlmsted,
framingham: IFramingham,
barbados: IBarbados;
};
html_of_all_refs: string;
}
export interface IMultiplicativeRisks {
myopia: number | boolean;
family_history: number | boolean;
diabetes: number | boolean;
age: number;
}
interface IStudy {
n: number;
ethnicities: string[];
notes: string[];
expr: Array<{
key: string;
take: number;
type?: string;
filter?: string[];
extract?: string;
}>;
ref: Array<{}>;
}
export interface IOlmsted extends IStudy {
age: {[idx: string]: number};
agenda?: undefined;
}
export interface IFramingham extends IStudy {
age: {[idx: string]: number};
agenda: Array<{
gender: Gender,
age: string,
n: number,
oags: number,
meth2_prevalence: number;
meth3_prevalence: number;
}>;
}
export interface IBarbados extends IStudy {
normal_tension: boolean;
agenda: Array<{
gender: Gender;
age: string;
'n over n at Risk': string;
'Incidence, % (95% CI)': string;
max_incidence: number;
}>;
}
import { MathType } from 'mathjs';
export interface IObjectCtor extends ObjectConstructor {
assign(target: any, ...sources: any[]): any;
values<T>(o: {
[s: string]: T;
}): T[];
}
interface IRiskPerStudyStats {
_denominator?: 100;
age: string;
ci?: string;
gender?: Gender;
max_prevalence: number;
}
export interface IRelativeRisk {
age: number;
gender?: Gender;
study: Study;
rr: Array<{[study: /*Study*/ string]: number}>;
graphed_rr: ITreeMapData[];
risk_per_study: {
barbados: IRiskPerStudyStats,
framingham: {
age: string
gender: Gender
meth2_prevalence: number
meth3_prevalence: number
n: number
oags: number
},
ghana: IRiskPerStudyStats
olmsted: IRiskPerStudyStats
};
}
export interface ITreeMapData {
name: string;
value: number;
size?: number;
children?: ITreeMapData[];
}
export declare const ethnicities_pretty: (ethnicities: any) => any;
export declare const s_col_to_s: (s: string) => string;
export declare const in_range: (range: string, num: number) => boolean;
export declare const lowest_range: (ranges: string[]) => number;
export declare const uniq: (a: any[]) => any[];
export declare const uniq2: (arr: Array<{}>) => Array<{}>;
export declare const preprocess_studies: (risk_json: any) => any;
export declare const sort_ranges: (ranges: string[]) => string[];
export declare const risk_from_study: (risk_json: any, input: any) => number;
export declare const familial_risks_from_study: (risk_json: any, input: any, warn?: boolean) => number[];
export declare const combined_risk: (familial_risks_from_study_l: number[], risk_from_studies: number) => MathType;
export declare const risks_from_study: (risk_json: any, input: any) => number[];
export declare const place_in_array: (entry: any, a: any[]) => number;
export declare const pos_in_range: (ranges: string[], num: number) => number;
export declare const list_ethnicities: (risk_json: any) => any;
export declare const ethnicity2study: (risk_json: IRiskJson) => {};
export declare const calc_default_multiplicative_risks: (risk_json: IRiskJson,
user: IMultiplicativeRisks) => IMultiplicativeRisks;
export declare const calc_relative_risk: (risk_json: IRiskJson, input: IInput) => IRelativeRisk;