Skip to content

Commit

Permalink
chore(app): remove resultType
Browse files Browse the repository at this point in the history
  • Loading branch information
tamslo committed Dec 29, 2023
1 parent c8c66f7 commit fa31a0f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 16 deletions.
1 change: 0 additions & 1 deletion app/integration_test/drugs_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ void main() {
UserData.instance.diplotypes = {
'CYP2C9': Diplotype(
gene: 'CYP2C9',
resultType: 'Diplotype',
phenotype: 'Normal Metabolizer',
genotype: '*1/*1',
allelesTested: '1')
Expand Down
16 changes: 2 additions & 14 deletions app/lib/common/models/userdata/diplotype.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ part 'diplotype.g.dart';
class Diplotype {
Diplotype({
required this.gene,
required this.resultType,
required this.genotype,
required this.phenotype,
required this.allelesTested,
Expand All @@ -24,26 +23,15 @@ class Diplotype {
String gene;

@HiveField(1)
String resultType;

@HiveField(2)
String genotype;

@HiveField(3)
@HiveField(2)
String phenotype;

@HiveField(4)
@HiveField(3)
String allelesTested;
}

extension ValidDiplotypes on List<Diplotype> {
List<Diplotype> filterValidDiplotypes() {
final acceptedResultTypes = ['Diplotype'];
return where((element) => acceptedResultTypes.contains(element.resultType))
.toList();
}
}

// assumes http reponse from lab server
List<Diplotype> diplotypesFromHTTPResponse(Response resp) {
final json = jsonDecode(resp.body)['diplotypes'] as List<dynamic>;
Expand Down
2 changes: 1 addition & 1 deletion app/lib/common/utilities/genome_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Future<void> _saveDiplotypeAndActiveDrugsResponse(
) async {
// parse response to list of user's diplotypes
final diplotypes =
diplotypesFromHTTPResponse(response).filterValidDiplotypes();
diplotypesFromHTTPResponse(response);
final activeDrugList = activeDrugsFromHTTPResponse(response);

UserData.instance.diplotypes = {
Expand Down

0 comments on commit fa31a0f

Please sign in to comment.