From 8bbccf28d1e6612a4a8ca8a099c30244ce8a1a02 Mon Sep 17 00:00:00 2001 From: tamslo Date: Tue, 10 Dec 2024 09:46:25 +0100 Subject: [PATCH] feat(app): adapt modulator content --- app/lib/common/widgets/annotation_table.dart | 2 +- .../widgets/drug_activity_selection.dart | 5 ++- .../widgets/phenoconversion_explanation.dart | 13 ++++-- app/lib/drug/pages/drug.dart | 3 +- app/lib/l10n/app_en.arb | 43 +++++++++++++------ 5 files changed, 45 insertions(+), 21 deletions(-) diff --git a/app/lib/common/widgets/annotation_table.dart b/app/lib/common/widgets/annotation_table.dart index b225c29c..ac344cf9 100644 --- a/app/lib/common/widgets/annotation_table.dart +++ b/app/lib/common/widgets/annotation_table.dart @@ -70,8 +70,8 @@ TableRow _buildRow( WidgetSpan( child: TooltipIcon(tooltip!, size: tooltipSize), ), + WidgetSpan(child: SizedBox(height: tooltipSize)), ], - WidgetSpan(child: SizedBox(height: tooltipSize)), ], style: textStyle, ), diff --git a/app/lib/common/widgets/drug_activity_selection.dart b/app/lib/common/widgets/drug_activity_selection.dart index 215736c1..bc8351a1 100644 --- a/app/lib/common/widgets/drug_activity_selection.dart +++ b/app/lib/common/widgets/drug_activity_selection.dart @@ -33,7 +33,10 @@ SwitchListTile buildDrugActivitySelection({ builder: (context) => DialogWrapper( title: context.l10n.drugs_page_active_warn_header, content: DialogContentText( - context.l10n.drugs_page_active_warn, + context.l10n.drugs_page_active_warn( + drug.name.capitalize(), + enumerationWithAnd(inhibitedGenes(drug), context), + ), ), actions: [ DialogAction( diff --git a/app/lib/common/widgets/phenoconversion_explanation.dart b/app/lib/common/widgets/phenoconversion_explanation.dart index d5c57f8d..f3f3f4c8 100644 --- a/app/lib/common/widgets/phenoconversion_explanation.dart +++ b/app/lib/common/widgets/phenoconversion_explanation.dart @@ -124,8 +124,14 @@ class PhenoconversionExplanation extends StatelessWidget { drugInteractionIndicator, context.l10n.inhibitor_message( displayConfig.userSalutation, + enumerationWithAnd( + inhibitedGenotypes.map( + (genotypeResult) => genotypeResult.gene + ).toList(), + context, + ), displayConfig.userGenitive, - ), + ).capitalize(), )], boldHeader: false, ), @@ -164,13 +170,14 @@ String _getPhenoconversionDetailText( ); final consequence = activeInhibitors.all(isModerateInhibitor) ? context.l10n.inhibitors_consequence_not_adapted( - genotypeResult.geneDisplayString, displayConfig.userGenitive, + genotypeResult.geneDisplayString, ).capitalize() : context.l10n.inhibitors_consequence_adapted( + displayConfig.userGenitive, genotypeResult.geneDisplayString, genotypeResult.phenotypeDisplayString(context), - displayConfig.userGenitive, + overwritePhenotype, ).capitalize(); return '$consequence${ displayConfig.useConsult ? ' ${context.l10n.consult_text}' : '' diff --git a/app/lib/drug/pages/drug.dart b/app/lib/drug/pages/drug.dart index 5cc9cc95..98942ba9 100644 --- a/app/lib/drug/pages/drug.dart +++ b/app/lib/drug/pages/drug.dart @@ -71,9 +71,8 @@ class DrugPage extends StatelessWidget { ), if (isInhibitor(drug.name)) PageIndicatorExplanation( context.l10n.drugs_page_is_inhibitor( - inhibitedGenes(drug).length, drug.name, - inhibitedGenes(drug).join(', '), + enumerationWithAnd(inhibitedGenes(drug), context), ), indicator: drugInteractionIndicator, ), diff --git a/app/lib/l10n/app_en.arb b/app/lib/l10n/app_en.arb index bc95ee26..19aaf547 100644 --- a/app/lib/l10n/app_en.arb +++ b/app/lib/l10n/app_en.arb @@ -133,20 +133,16 @@ "@drugs_page_main_disclaimer_text": {}, "drugs_page_puzzle_disclaimer_text": "The information from PharMe is like one puzzle piece in the big picture of how well a medicine works for you.\n\nThe information provided in this app is based ONLY on your DNA and certain medications that may interact with your genetic result. Other important factors like weight, age, pre-existing conditions, and further medication interactions are not considered.", "@drugs_page_puzzle_disclaimer_text": {}, - "drugs_page_is_inhibitor": "{geneNumber, plural, =1{Taking {drugName} can interact with your results for the following gene: {genes}} other{Taking {drugName} can interact with your results for the following genes: {genes}}}", + "drugs_page_is_inhibitor": "Taking {drugName} will slow down the activity of {genes}. This will affect how your body processes and responds to associated medications.", "@drugs_page_is_inhibitor": { "placeholders": { - "geneNumber": { - "type": "int", - "example": "1" - }, "drugName": { "type": "String", "example": "bupropion" }, "genes": { "type": "String", - "example": "CYP2D6, CYP2C19" + "example": "CYP2D6 and CYP2C19" } } }, @@ -159,12 +155,16 @@ "@inhibitor_third_person_salutation": {}, "inhibitor_third_person_salutation_genitive": "the user's", "@inhibitor_third_person_salutation_genitive": {}, - "inhibitor_message": "One or more of the medications {salutation} currently taking may interact with {salutationGenitive} genetic result", + "inhibitor_message": "{salutation} taking one or more medications that slow down the activity of {geneName}. This will affect how {salutationGenitive} body processes and responds to associated medications.", "@inhibitor_message": { "placeholders": { "salutation": { "type": "String", - "example": "you" + "example": "you are" + }, + "geneName": { + "type": "String", + "example": "CYP2D6" }, "salutationGenitive": { "type": "String", @@ -172,7 +172,7 @@ } } }, - "inhibitors_consequence_adapted": "{salutationGenitive} {geneName} phenotype was adapted from {originalPhenotype}.", + "inhibitors_consequence_adapted": "{salutationGenitive} {geneName} phenotype was changed from “{originalPhenotype}” to “{currentPhenotype}”; this is because you are currently taking one or more strong {geneName} inhibitors (see below).", "@inhibitors_consequence_adapted": { "placeholders": { "salutationGenitive": { @@ -186,10 +186,14 @@ "originalPhenotype": { "type": "String", "example": "Normal Metabolizer" + }, + "currentPhenotype": { + "type": "String", + "example": "Poor Metabolizer" } } }, - "inhibitors_consequence_not_adapted": "{salutationGenitive} {geneName} phenotype was not adapted but may need to be.", + "inhibitors_consequence_not_adapted": "{salutationGenitive} {geneName} phenotype was not adapted but may need to be; this is because your are currently taking one or more moderate {geneName} inhibitors (see below).", "@inhibitors_consequence_not_adapted": { "placeholders": { "salutationGenitive": { @@ -220,10 +224,21 @@ "@drugs_page_header_drug": {}, "drugs_page_text_active": "Current medication", "@drugs_page_text_active": {}, - "drugs_page_active_warn_header": "Are you sure you want to change the medication usage status?", + "drugs_page_active_warn_header": "Are you sure you want to change your current medications?", "@drugs_page_active_warn_header": {}, - "drugs_page_active_warn": "This can interact with your results for other medications.", - "@drugs_page_active_warn": {}, + "drugs_page_active_warn": "{drugName} will affect how your body processes and responds to medications associated with {geneName}.\n\nSee {geneName} under “Genes” for a list of all associated medications.", + "@drugs_page_active_warn": { + "placeholders": { + "drugName": { + "type": "String", + "example": "Mirabegron" + }, + "geneName": { + "type": "String", + "example": "CYP2D6" + } + } + }, "drugs_page_header_guideline": "DNA-based clinical guideline", "@drugs_page_header_guideline": {}, "drugs_page_no_guidelines_text": "No pharmacogenomic recommendation can be made at this time. Consult your pharmacist or doctor for more information.", @@ -257,7 +272,7 @@ "@report_content_explanation": {}, "report_page_faq_tooltip": "To learn more about genetics in general, please refer to the FAQ", "@report_page_faq_tooltip": {}, - "report_page_indicator_explanation": "Phenotypes followed by an {indicatorName} ({indicator}) might be adjusted based on interactions with medications you are currently taking", + "report_page_indicator_explanation": "Phenotypes followed by an {indicatorName} ({indicator}) might be adjusted based on interactions with medications you are currently taking.", "@report_page_indicator_explanation": { "placeholders": { "indicatorName": {