-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathimagesFilters.js
More file actions
213 lines (208 loc) · 5.5 KB
/
Copy pathimagesFilters.js
File metadata and controls
213 lines (208 loc) · 5.5 KB
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
import constants from "../constants";
import diagnosisModel from "./diagnosis";
import state from "./state";
let filtersData;
const filtersIds = {
pinnedCollections: "collections",
lesionDiagnosis: "diagnosis",
approximateAge: "age_approx",
generalAnatomicSite: "anatom_site_general",
specialAnatomicSite: "anatom_site_special",
clinicalSize: "clin_size_long_diam_mm",
typeDiagnosis: "diagnosis_confirm_type",
familyHistoryMelanoma: "family_hx_mm",
melanomaClass: "mel_class",
melanomaMitoticIndex: "mel_mitotic_index",
melanomaThickness: "mel_thick_mm",
melanomaType: "mel_type",
melanomaUlceration: "mel_ulcer",
melanocytic: "melanocytic",
nevusType: "nevus_type",
personalHistoryMelanoma: "personal_hx_mm",
sex: "sex",
dermoscopicType: "dermoscopic_type",
tbpType: "tbp_tile_type",
imageManipulation: "image_manipulation",
imageType: "image_type",
colorTint: "color_tint",
license: "copyright_license",
fitzpatrickSkinType: "fitzpatrick_skin_type"
};
function getFiltersDataValues() {
const diagnosisData = diagnosisModel.getDiagnosisDataForFilters();
const filtersDataValues = [
{
label: "Diagnostic Attributes",
data: [
{
id: filtersIds.lesionDiagnosis,
name: "Lesion diagnosis",
type: constants.FILTER_ELEMENT_TYPE.TREE_CHECKBOX,
datatype: "string",
options: diagnosisData
},
{
id: filtersIds.typeDiagnosis,
name: "Type of Diagnosis",
type: "checkbox",
datatype: "string",
options: state.imagesTotalCounts[filtersIds.typeDiagnosis]
},
{
id: filtersIds.melanocytic,
name: "Melanocytic",
type: "checkbox",
datatype: "boolean",
options: state.imagesTotalCounts[filtersIds.melanocytic]
},
{
id: filtersIds.melanomaMitoticIndex,
name: "Melanoma Mitotic Index",
type: "checkbox",
datatype: "string",
options: state.imagesTotalCounts[filtersIds.melanomaMitoticIndex]
},
{
id: filtersIds.melanomaThickness,
name: "Melanoma Thickness (mm)",
type: "rangeCheckbox",
datatype: "number",
options: state.imagesTotalCounts[filtersIds.melanomaThickness]
},
{
id: filtersIds.melanomaUlceration,
name: "Melanoma Ulceration",
type: "checkbox",
datatype: "boolean",
options: state.imagesTotalCounts[filtersIds.melanomaUlceration]
},
]
},
{
label: "Clinical Attributes",
data: [
{
id: filtersIds.sex,
name: "Sex",
type: "checkbox",
datatype: "string",
options: state.imagesTotalCounts[filtersIds.sex]
},
{
id: filtersIds.approximateAge,
name: "Approximate Age",
type: "rangeCheckbox",
datatype: "number",
options: state.imagesTotalCounts[filtersIds.approximateAge]
},
{
id: filtersIds.generalAnatomicSite,
name: "General Anatomic Site",
type: "checkbox",
datatype: "string",
options: state.imagesTotalCounts[filtersIds.generalAnatomicSite]
},
{
id: filtersIds.specialAnatomicSite,
name: "Special Anatomic Site",
type: "checkbox",
datatype: "string",
options: state.imagesTotalCounts[filtersIds.specialAnatomicSite]
},
{
id: filtersIds.fitzpatrickSkinType,
name: "Fitzpatrick Skin Type",
type: "checkbox",
datatype: "string",
options: state.imagesTotalCounts[filtersIds.fitzpatrickSkinType]
},
{
id: filtersIds.clinicalSize,
name: "Clinical Size - Longest Diameter (mm)",
type: "rangeCheckbox",
datatype: "number",
options: state.imagesTotalCounts[filtersIds.clinicalSize]
},
{
id: filtersIds.familyHistoryMelanoma,
name: "Family History of Melanoma",
type: "checkbox",
datatype: "boolean",
options: state.imagesTotalCounts[filtersIds.familyHistoryMelanoma]
},
{
id: filtersIds.personalHistoryMelanoma,
name: "Personal History of Melanoma",
type: "checkbox",
datatype: "boolean",
options: state.imagesTotalCounts[filtersIds.personalHistoryMelanoma]
},
]
},
{
label: "Technological Attributes",
data: [
{
id: filtersIds.imageType,
name: "Image Type",
type: "checkbox",
datatype: "string",
options: state.imagesTotalCounts[filtersIds.imageType]
},
{
id: filtersIds.dermoscopicType,
name: "Dermoscopic Type",
type: "checkbox",
datatype: "string",
options: state.imagesTotalCounts[filtersIds.dermoscopicType]
},
{
id: filtersIds.tbpType,
name: "TBP Type",
type: "checkbox",
datatype: "string",
options: state.imagesTotalCounts[filtersIds.tbpType]
},
{
id: filtersIds.imageManipulation,
name: "Image Manipulation",
type: "checkbox",
datatype: "string",
options: state.imagesTotalCounts[filtersIds.imageManipulation]
},
]
},
{
label: "Other Attributes",
data: [
{
id: filtersIds.license,
name: "License",
type: "checkbox",
datatype: "string",
options: state.imagesTotalCounts[filtersIds.license]
},
{
id: filtersIds.pinnedCollections,
name: "Collection",
type: "checkbox",
datatype: "string",
options: state.imagesTotalCounts[filtersIds.pinnedCollections] ?? []
}
]
}
];
return filtersDataValues;
}
function getFiltersData(forceRebuild) {
return new Promise((resolve) => {
// we should rewrite the last item in filtersData (it is place for Database Attributes)
if (forceRebuild || !filtersData) {
filtersData = getFiltersDataValues();
}
resolve(filtersData);
});
}
export default {
getFiltersData
};