Skip to content

Commit

Permalink
feat(#665): show all genes from annotations in report
Browse files Browse the repository at this point in the history
  • Loading branch information
tamslo committed Oct 19, 2023
1 parent eec57ad commit 68f548b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
11 changes: 11 additions & 0 deletions app/lib/common/utilities/guideline_utils.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
import '../models/drug/cached_drugs.dart';
import '../module.dart';

List<String> getGuidelineGenes() {
final genes = <String>{};
for (final drug in CachedDrugs.instance.drugs!) {
for (final guideline in drug.guidelines) {
guideline.lookupkey.keys.forEach(genes.add);
}
}
return List.from(genes);
}

WarningLevel getWarningLevel(Guideline? guideline) =>
guideline?.annotations.warningLevel ?? WarningLevel.none;
15 changes: 14 additions & 1 deletion app/lib/report/pages/report.dart
Original file line number Diff line number Diff line change
@@ -1,16 +1,29 @@
import '../../common/module.dart';
import '../../common/utilities/guideline_utils.dart';

class ReportPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
final hasActiveInhibitors = UserData.instance.activeDrugNames != null &&
UserData.instance.activeDrugNames!.any(isInhibitor);
final guidelineGenes = getGuidelineGenes();

final notTestedString = context.l10n.general_not_tested;
final userPhenotypes = guidelineGenes.map(
(geneSymbol) => UserData.instance.lookups![geneSymbol] ??
CpicPhenotype(
geneSymbol: geneSymbol,
phenotype: notTestedString,
genotype: notTestedString,
lookupkey: notTestedString
)
);
return unscrollablePageScaffold(
title: context.l10n.tab_report,
body: Column(
children: [
scrollList(
UserData.instance.lookups!.values.map((phenotype) =>
userPhenotypes.map((phenotype) =>
Column(children: [
GeneCard(phenotype),
SizedBox(height: 8)
Expand Down

0 comments on commit 68f548b

Please sign in to comment.