File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed
app/src/main/java/com/github/meafs/recover Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change 8
8
import androidx .appcompat .app .AppCompatActivity ;
9
9
10
10
import com .github .meafs .recover .R ;
11
+ import com .github .meafs .recover .models .Symptoms ;
11
12
import com .google .android .material .chip .Chip ;
12
13
import com .google .android .material .chip .ChipGroup ;
13
14
14
15
import java .util .ArrayList ;
16
+ import java .util .HashMap ;
17
+ import java .util .Map ;
15
18
16
19
public class DiseaseInference extends AppCompatActivity {
17
20
ArrayList <String > sympoms_selection = new ArrayList <String >();
@@ -59,4 +62,17 @@ public void onClick(View v) {
59
62
chipGroup .addView (chip );
60
63
}
61
64
}
65
+
66
+ private Map <String , String > getIDfromDiseaseName (ArrayList <String > sympoms_selection ) {
67
+ ArrayList <String > all_symptoms = Symptoms .getAll_symptoms ();
68
+ Map <String , String > selection_map = new HashMap <String , String >();
69
+ for (int i = 0 ; i < sympoms_selection .size ();i ++) {
70
+ String symptom = sympoms_selection .get (i ).toLowerCase ().replace (" " ,"_" );
71
+ int pos = all_symptoms .indexOf (symptom );
72
+ String symptom_id = all_symptoms .get (pos ).split ("\\ ." )[1 ] ;
73
+ selection_map .put (symptom , symptom_id );
74
+ }
75
+
76
+ return selection_map ;
77
+ }
62
78
}
Original file line number Diff line number Diff line change @@ -61,6 +61,21 @@ public class Symptoms {
61
61
"dizziness.64"
62
62
));
63
63
64
+
65
+ public static ArrayList <String > getAll_symptoms () {
66
+ ArrayList <String > all_symptoms = new ArrayList <>() ;
67
+ all_symptoms .addAll (throatAndChest );
68
+ all_symptoms .addAll (skinAndNails );
69
+ all_symptoms .addAll (stomachAndAppetite );
70
+ all_symptoms .addAll (face );
71
+ all_symptoms .addAll (muscleLimbsBonesVessels );
72
+ all_symptoms .addAll (excretion );
73
+ all_symptoms .addAll (mental );
74
+ all_symptoms .addAll (riskFactors );
75
+ all_symptoms .addAll (others );
76
+ return all_symptoms ;
77
+ }
78
+
64
79
public static ArrayList <String > getSkinAndNails () {
65
80
return skinAndNails ;
66
81
}
You can’t perform that action at this time.
0 commit comments