diff --git a/app/integration_test/drugs_test.dart b/app/integration_test/drugs_test.dart index f17d760c..f3fc245c 100644 --- a/app/integration_test/drugs_test.dart +++ b/app/integration_test/drugs_test.dart @@ -50,7 +50,7 @@ void main() { ]); UserData.instance.lookups = { 'CYP2C9': CpicLookup( - geneSymbol: 'CYP2C9', + gene: 'CYP2C9', phenotype: 'Normal Metabolizer', genotype: '*1/*1', lookupkey: '2') diff --git a/app/lib/common/models/drug/drug_inhibitors.dart b/app/lib/common/models/drug/drug_inhibitors.dart index 9c3be21f..3f29b1d3 100644 --- a/app/lib/common/models/drug/drug_inhibitors.dart +++ b/app/lib/common/models/drug/drug_inhibitors.dart @@ -84,6 +84,6 @@ List inhibitorsFor(String geneSymbol) { } bool canBeInhibited(CpicLookup phenotype) { - return inhibitableGenes.contains(phenotype.geneSymbol) && + return inhibitableGenes.contains(phenotype.gene) && phenotype.lookupkey != '0.0'; } diff --git a/app/lib/common/models/userdata/cpic_lookup.dart b/app/lib/common/models/userdata/cpic_lookup.dart index ffcb36f8..6a95b391 100644 --- a/app/lib/common/models/userdata/cpic_lookup.dart +++ b/app/lib/common/models/userdata/cpic_lookup.dart @@ -7,7 +7,7 @@ part 'cpic_lookup.g.dart'; @JsonSerializable() class CpicLookup{ CpicLookup({ - required this.geneSymbol, + required this.gene, required this.phenotype, required this.genotype, required this.lookupkey, @@ -21,7 +21,7 @@ class CpicLookup{ @HiveField(0) @JsonKey(name: 'genesymbol') - String geneSymbol; + String gene; @HiveField(1) @JsonKey(name: 'diplotype') diff --git a/app/lib/report/pages/gene.dart b/app/lib/report/pages/gene.dart index 7a94826a..f226b0b0 100644 --- a/app/lib/report/pages/gene.dart +++ b/app/lib/report/pages/gene.dart @@ -7,7 +7,7 @@ import '../../drug/widgets/module.dart'; class GenePage extends HookWidget { GenePage(this.phenotype) : cubit = DrugListCubit( - initialFilter: FilterState.forGene(phenotype.geneSymbol), + initialFilter: FilterState.forGene(phenotype.gene), ); final CpicLookup phenotype; @@ -20,7 +20,7 @@ class GenePage extends HookWidget { create: (context) => cubit, child: BlocBuilder( builder: (context, state) => pageScaffold( - title: context.l10n.gene_page_headline(phenotype.geneSymbol), + title: context.l10n.gene_page_headline(phenotype.gene), body: [ Padding( padding: EdgeInsets.symmetric( @@ -31,9 +31,9 @@ class GenePage extends HookWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ SubHeader( - context.l10n.gene_page_your_variant(phenotype.geneSymbol), + context.l10n.gene_page_your_variant(phenotype.gene), tooltip: context.l10n - .gene_page_name_tooltip(phenotype.geneSymbol), + .gene_page_name_tooltip(phenotype.gene), ), SizedBox(height: PharMeTheme.smallToMediumSpace), RoundedCard( @@ -58,7 +58,7 @@ class GenePage extends HookWidget { if (canBeInhibited(phenotype)) ...buildDrugInteractionInfo( context, - phenotype.geneSymbol, + phenotype.gene, ), ], )), @@ -80,7 +80,7 @@ class GenePage extends HookWidget { TableRow _buildPhenotypeRow(BuildContext context) { final phenotypeInformation = UserData.phenotypeInformationFor( - phenotype.geneSymbol, + phenotype.gene, context, ); final phenotypeText = phenotypeInformation.adaptionText.isNotNullOrBlank diff --git a/app/lib/report/pages/report.dart b/app/lib/report/pages/report.dart index fe2e45be..9b040cde 100644 --- a/app/lib/report/pages/report.dart +++ b/app/lib/report/pages/report.dart @@ -19,7 +19,7 @@ class ReportPage extends StatelessWidget { (geneSymbol) => UserData.instance.lookups![geneSymbol] ?? // Add CpicLookup for unmatched lookup CpicLookup( - geneSymbol: geneSymbol, + gene: geneSymbol, // phenotype will be overwritten with phenotype from lab or inhibited // phenotype using PhenotypeInformation in GeneCard and GenePage phenotype: notTestedString, @@ -27,7 +27,7 @@ class ReportPage extends StatelessWidget { notTestedString, lookupkey: notTestedString ) - ).sortedBy((phenotype) => phenotype.geneSymbol); + ).sortedBy((phenotype) => phenotype.gene); return PopScope( canPop: false, child: unscrollablePageScaffold( @@ -38,7 +38,7 @@ class ReportPage extends StatelessWidget { scrollList( userPhenotypes.map((phenotype) => GeneCard( phenotype, - key: Key('gene-card-${phenotype.geneSymbol}') + key: Key('gene-card-${phenotype.gene}') )).toList(), ), if (hasActiveInhibitors) PageIndicatorExplanation( @@ -62,14 +62,14 @@ class GeneCard extends StatelessWidget { @override Widget build(BuildContext context) { final phenotypeInformation = UserData.phenotypeInformationFor( - phenotype.geneSymbol, + phenotype.gene, context, ); final phenotypeText = phenotypeInformation.adaptionText.isNullOrBlank ? phenotypeInformation.phenotype : '${phenotypeInformation.phenotype}$drugInteractionIndicator'; final affectedDrugs = CachedDrugs.instance.drugs?.filter( - (drug) => drug.guidelineGenes.contains(phenotype.geneSymbol) + (drug) => drug.guidelineGenes.contains(phenotype.gene) ) ?? []; final warningLevelIndicators = WarningLevel.values.map( (warningLevel) { @@ -106,7 +106,7 @@ class GeneCard extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - phenotype.geneSymbol, + phenotype.gene, style: PharMeTheme.textTheme.titleMedium ), SizedBox(height: 8),