Skip to content

Commit

Permalink
feat(#706): only show text on gene page if patient is on relevant med…
Browse files Browse the repository at this point in the history
…ication
  • Loading branch information
tamslo committed Sep 4, 2024
1 parent 073cfa8 commit cea0f29
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
5 changes: 0 additions & 5 deletions app/lib/common/models/drug/drug_inhibitors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,3 @@ List<String> inhibitedGenes(Drug drug) {
List<String> inhibitorsFor(String gene) {
return _drugInhibitorsPerGene[gene] ?? [];
}

bool canBeInhibited(GenotypeResult genotypeResult) {
return inhibitableGenes.contains(genotypeResult.gene) &&
genotypeResult.lookupkey != '0.0';
}
11 changes: 10 additions & 1 deletion app/lib/report/pages/gene.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<ActiveDrugs>(
Expand Down Expand Up @@ -61,7 +70,7 @@ class GenePage extends HookWidget {
_buildPhenotypeRow(context),
],
),
if (canBeInhibited(genotypeResult))
if (_isInhibited(context, genotypeResult))
...buildDrugInteractionInfo(
context,
genotypeResult,
Expand Down
4 changes: 4 additions & 0 deletions pharme.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,17 @@
"Hasso",
"horiz",
"ilike",
"inhibitable",
"irinotecan",
"Keycloak",
"lookupkey",
"lookupkeys",
"loopable",
"lorcaserin",
"LTRB",
"MedlinePlus",
"Metabolizer",
"mirabegron",
"mocktail",
"NSAID",
"omeprazole",
Expand All @@ -80,6 +83,7 @@
"sertraline",
"simvastatin",
"tacrolimus",
"terbinafine",
"tramadol",
"unscrollable",
"unstage",
Expand Down

0 comments on commit cea0f29

Please sign in to comment.