From 0e8d30cbb1425725bb19a5cb55c74b58315bc7b8 Mon Sep 17 00:00:00 2001 From: tamslo Date: Thu, 23 Jan 2025 21:29:03 +0100 Subject: [PATCH] feat(app): add Indeterminate tooltip --- app/lib/common/constants.dart | 3 ++- app/lib/common/widgets/annotation_table.dart | 10 +++++++++- app/lib/l10n/app_en.arb | 10 ++++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/app/lib/common/constants.dart b/app/lib/common/constants.dart index 440446e6..5333f948 100644 --- a/app/lib/common/constants.dart +++ b/app/lib/common/constants.dart @@ -34,8 +34,9 @@ enum SpecialLookup { noResult, } +const indeterminateResult = 'Indeterminate'; List unknownPhenotypes(BuildContext context) => [ - 'Indeterminate', + indeterminateResult, context.l10n.general_not_tested, ]; diff --git a/app/lib/common/widgets/annotation_table.dart b/app/lib/common/widgets/annotation_table.dart index 5faa120e..0d482507 100644 --- a/app/lib/common/widgets/annotation_table.dart +++ b/app/lib/common/widgets/annotation_table.dart @@ -111,11 +111,13 @@ TableRowDefinition testResultTableRow( required String key, required String value, String? keyTooltip, + String? valueTooltip, } ) => TableRowDefinition( key, value, keyTooltip: keyTooltip, + valueTooltip: valueTooltip, italicValue: testResultIsUnknown(context, value), ); @@ -128,10 +130,16 @@ TableRowDefinition phenotypeTableRow( String? keyTooltip, } ) { + final value = possiblyAdaptedPhenotype(context, genotypeResult, drug: drug); return testResultTableRow( context, key: key, - value: possiblyAdaptedPhenotype(context, genotypeResult, drug: drug), + value: value, keyTooltip: keyTooltip, + valueTooltip: value == indeterminateResult + ? context.l10n.indeterminate_result_tooltip( + genotypeResult.geneDisplayString, + ) + : null, ); } \ No newline at end of file diff --git a/app/lib/l10n/app_en.arb b/app/lib/l10n/app_en.arb index b6ac5a00..cbeb36f9 100644 --- a/app/lib/l10n/app_en.arb +++ b/app/lib/l10n/app_en.arb @@ -92,6 +92,16 @@ "general_not_tested": "Not tested", "@general_not_tested": {}, + "indeterminate_result_tooltip": "This means that your gene test did not provide a meaningful outcome for {geneName}. This happens when the impact of your gene result on medications is uncertain.", + "@indeterminate_result_tooltip": { + "placeholders": { + "geneName": { + "type": "String", + "example": "CYP2C19" + } + } + }, + "warning_level_green": "Standard precautions", "@warning_level_green": {}, "warning_level_missing": "Standard precautions (incomplete data)",