Skip to content

Commit

Permalink
feat(#666): show phenotype as 'Not tested' if missing in diplotypes
Browse files Browse the repository at this point in the history
  • Loading branch information
tamslo committed Oct 17, 2023
1 parent f0b0c67 commit 1bc95ea
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 11 deletions.
8 changes: 5 additions & 3 deletions app/lib/common/models/userdata/userdata.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ const _boxName = 'userdata';

class PhenotypeInformation {
PhenotypeInformation({
this.phenotype,
required this.phenotype,
this.adaptionText,
this.overwrittenPhenotype,
});

String? phenotype;
String phenotype;
String? adaptionText;
String? overwrittenPhenotype;
}
Expand Down Expand Up @@ -58,7 +58,9 @@ class UserData {
) {
final originalPhenotype = UserData.instance.diplotypes?[gene]?.phenotype;
if (originalPhenotype == null) {
return PhenotypeInformation();
return PhenotypeInformation(
phenotype: context.l10n.general_not_tested,
);
}
final activeInhibitors = UserData.activeInhibitorsFor(gene, drug: drug);
if (activeInhibitors.isEmpty) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,7 @@ class GuidelineAnnotationCard extends StatelessWidget {
context,
drug: drug?.name,
);
var description =
'$geneSymbol: ${
phenotypeInformation.phenotype ??
context.l10n.drugs_page_cast_indeterminate
}';
var description = '$geneSymbol: ${phenotypeInformation.phenotype}';
if (phenotypeInformation.adaptionText.isNotNullOrBlank) {
description = '$description (${phenotypeInformation.adaptionText})';
}
Expand Down
2 changes: 1 addition & 1 deletion app/lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"general_and": "and",
"general_poor_metabolizer": "Poor Metabolizer",
"general_the_user": "the user",
"general_not_tested": "Not tested",

"search_page_tooltip_search": "Search for drugs by their name, brand name or class.",
"search_page_filter_inactive": "Show currently not taken drugs",
Expand Down Expand Up @@ -187,7 +188,6 @@
}
},
"drugs_page_tooltip_guideline": "Clinical guidelines help understand how drug therapy can be optimized for one's genetics. They put specific genes in relation with a drug.",
"drugs_page_cast_indeterminate": "Indeterminate",

"report_page_indicator_explanation": "Phenotypes followed by an {indicatorName} ({indicator}) might be influenced by drugs you are currently taking",
"@report_page_indicator_explanation": {
Expand Down
2 changes: 1 addition & 1 deletion app/lib/report/pages/gene.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class GenePage extends HookWidget {
UserData.phenotypeFor(
phenotype.geneSymbol,
context,
).phenotype!,
).phenotype,
tooltip:
context.l10n.gene_page_phenotype_tooltip
),
Expand Down
2 changes: 1 addition & 1 deletion app/lib/report/pages/report.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class GeneCard extends StatelessWidget {
context,
);
final phenotypeText = phenotypeInformation.adaptionText.isNullOrBlank
? phenotypeInformation.phenotype!
? phenotypeInformation.phenotype
: '${phenotypeInformation.phenotype}$drugInteractionIndicator';
return RoundedCard(
onTap: () => context.router.push(GeneRoute(phenotype: phenotype)),
Expand Down

0 comments on commit 1bc95ea

Please sign in to comment.