Skip to content

Commit

Permalink
feat(app): adapt modulator content
Browse files Browse the repository at this point in the history
  • Loading branch information
tamslo committed Dec 10, 2024
1 parent b555af4 commit 8bbccf2
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 21 deletions.
2 changes: 1 addition & 1 deletion app/lib/common/widgets/annotation_table.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ TableRow _buildRow(
WidgetSpan(
child: TooltipIcon(tooltip!, size: tooltipSize),
),
WidgetSpan(child: SizedBox(height: tooltipSize)),
],
WidgetSpan(child: SizedBox(height: tooltipSize)),
],
style: textStyle,
),
Expand Down
5 changes: 4 additions & 1 deletion app/lib/common/widgets/drug_activity_selection.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
13 changes: 10 additions & 3 deletions app/lib/common/widgets/phenoconversion_explanation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
Expand Down Expand Up @@ -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}' : ''
Expand Down
3 changes: 1 addition & 2 deletions app/lib/drug/pages/drug.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
Expand Down
43 changes: 29 additions & 14 deletions app/lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
},
Expand All @@ -159,20 +155,24 @@
"@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",
"example": "your"
}
}
},
"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": {
Expand All @@ -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": {
Expand Down Expand Up @@ -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.",
Expand Down Expand Up @@ -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": {
Expand Down

0 comments on commit 8bbccf2

Please sign in to comment.