From cea0f29cba2ec1437b3d46b5e8f35c7fc0f6bf9e Mon Sep 17 00:00:00 2001 From: Tamara Slosarek Date: Wed, 4 Sep 2024 15:45:13 +0200 Subject: [PATCH] feat(#706): only show text on gene page if patient is on relevant medication --- app/lib/common/models/drug/drug_inhibitors.dart | 5 ----- app/lib/report/pages/gene.dart | 11 ++++++++++- pharme.code-workspace | 4 ++++ 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/app/lib/common/models/drug/drug_inhibitors.dart b/app/lib/common/models/drug/drug_inhibitors.dart index cfd0b47e..b7f74a5c 100644 --- a/app/lib/common/models/drug/drug_inhibitors.dart +++ b/app/lib/common/models/drug/drug_inhibitors.dart @@ -82,8 +82,3 @@ List inhibitedGenes(Drug drug) { List inhibitorsFor(String gene) { return _drugInhibitorsPerGene[gene] ?? []; } - -bool canBeInhibited(GenotypeResult genotypeResult) { - return inhibitableGenes.contains(genotypeResult.gene) && - genotypeResult.lookupkey != '0.0'; -} diff --git a/app/lib/report/pages/gene.dart b/app/lib/report/pages/gene.dart index e5cb78c9..8b16b11b 100644 --- a/app/lib/report/pages/gene.dart +++ b/app/lib/report/pages/gene.dart @@ -14,6 +14,15 @@ class GenePage extends HookWidget { final GenotypeResult genotypeResult; final DrugListCubit cubit; + bool _isInhibited(BuildContext context, GenotypeResult genotypeResult) { + final phenotypeInformation = UserData.phenotypeInformationFor( + genotypeResult, + context, + ); + return phenotypeInformation.overwrittenPhenotypeText.isNotNullOrBlank; + } + + @override Widget build(BuildContext context) { return Consumer( @@ -61,7 +70,7 @@ class GenePage extends HookWidget { _buildPhenotypeRow(context), ], ), - if (canBeInhibited(genotypeResult)) + if (_isInhibited(context, genotypeResult)) ...buildDrugInteractionInfo( context, genotypeResult, diff --git a/pharme.code-workspace b/pharme.code-workspace index 81088473..014fb7a3 100644 --- a/pharme.code-workspace +++ b/pharme.code-workspace @@ -56,14 +56,17 @@ "Hasso", "horiz", "ilike", + "inhibitable", "irinotecan", "Keycloak", "lookupkey", "lookupkeys", "loopable", + "lorcaserin", "LTRB", "MedlinePlus", "Metabolizer", + "mirabegron", "mocktail", "NSAID", "omeprazole", @@ -80,6 +83,7 @@ "sertraline", "simvastatin", "tacrolimus", + "terbinafine", "tramadol", "unscrollable", "unstage",