Skip to content

Commit

Permalink
feat(app): adapt FAQ content
Browse files Browse the repository at this point in the history
  • Loading branch information
tamslo committed Dec 10, 2024
1 parent c2c32ed commit f3eb851
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 12 deletions.
27 changes: 24 additions & 3 deletions app/lib/faq/pages/content.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class FaqWidgetAnswerQuestion extends FaqQuestion {
});
}

final faqContent = <FaqSection>[
List<FaqSection> getFaqContent() => <FaqSection>[
FaqSection(
title: (context) => context.l10n.faq_section_title_pgx,
questions: [
Expand All @@ -45,6 +45,14 @@ final faqContent = <FaqSection>[
question: context.l10n.faq_question_pgx_why,
answer: context.l10n.faq_answer_pgx_why,
),
(context) => FaqTextAnswerQuestion(
question: context.l10n.faq_question_adr_factors,
answer: context.l10n.faq_answer_adr_factors,
),
(context) => FaqTextAnswerQuestion(
question: context.l10n.faq_question_guidelines_are_developing,
answer: context.l10n.faq_answer_guidelines_are_developing,
),
(context) => FaqWidgetAnswerQuestion(
question: context.l10n.faq_question_genetics_info,
answer: Column(
Expand All @@ -56,19 +64,32 @@ final faqContent = <FaqSection>[
text: geneticInformationUrl.toString(),
onTap: openFurtherGeneticInformation,
),
SizedBox(height: PharMeTheme.smallSpace * 0.5),
Text('\n${context.l10n.consult_text}'),
],
),
),
(context) => FaqTextAnswerQuestion(
(context) => FaqWidgetAnswerQuestion(
question: context.l10n.faq_question_which_medications,
answer: context.l10n.faq_answer_which_medications,
answer: Column(
children: [
Text(context.l10n.faq_answer_which_medications),
SizedBox(height: PharMeTheme.smallSpace * 0.5),
UnorderedList(
context.l10n.faq_answer_which_medications_examples
.split('; ')
.map((example) => example.capitalize()).toList(),
),
],
),
),
(context) => FaqWidgetAnswerQuestion(
question: context.l10n.faq_question_phenoconversion,
answer: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(context.l10n.faq_answer_phenoconversion),
SizedBox(height: PharMeTheme.smallSpace),
...inhibitableGenes.map(
(geneName) => GeneModulatorList(geneName: geneName).widget,
),
Expand Down
10 changes: 9 additions & 1 deletion app/lib/faq/pages/faq.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class FaqPage extends HookWidget {

@override
Widget build(BuildContext context) {
final faqContent = getFaqContent();
final expandedCards = useState<Map<String, GlobalKey>>({});
final expandQuestion = useState<String?>(null);
if (expandQuestion.value != null) {
Expand Down Expand Up @@ -38,7 +39,13 @@ class FaqPage extends HookWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
...faqContent.flatMap((faqSection) =>
_buildTopic(context, faqSection, expandedCards, expandQuestion)),
_buildTopic(
context,
faqSection,
expandedCards,
expandQuestion,
faqContent,
)),
..._buildTopicHeader(
context.l10n.more_page_contact_us,
addSpace: true,
Expand Down Expand Up @@ -74,6 +81,7 @@ class FaqPage extends HookWidget {
FaqSection faqSection,
ValueNotifier<Map<String, GlobalKey>> expandedCards,
ValueNotifier<String?> expandQuestion,
List<FaqSection> faqContent,
) {
final isFirst = faqContent.indexOf(faqSection) == 0;
return [
Expand Down
28 changes: 20 additions & 8 deletions app/lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -589,31 +589,43 @@
"@faq_section_title_pgx": {},
"faq_question_pgx_what": "What is pharmacogenomics?",
"@faq_question_pgx_what": {},
"faq_answer_pgx_what": "Pharmacogenomics (PGx) is the study of how your genes (DNA) affect your response to medications.",
"faq_answer_pgx_what": "Pharmacogenomics (PGx) is the study of how your genes (DNA) affect your response to medications.\n\nYour DNA is the blueprint that tells your body how to make different enzymes. These enzymes play an important role in how your body processes and responds to medications.\n\nSome enzymes help transport medications through your body, while others make medications more or less strong. Depending on the versions of the genes you have, you may make more or less of certain enzymes or they function more or less well.",
"@faq_answer_pgx_what": {},
"faq_question_pgx_why": "Why is pharmacogenomics important?",
"@faq_question_pgx_why": {},
"faq_answer_pgx_why": "Pharmacogenomics is important because it helps to predict those who will respond well to medications and those who may have side effects. With this information we can better select the right medication and dose to avoid side effects.",
"faq_answer_pgx_why": "Pharmacogenomics is important because it helps to predict those who will respond well to medications and those who may have side effects. With this information we can better select the right medication and dose to avoid side effects.\n\nHowever, this information ONLY is like one puzzle piece in the big picture of how well a medicine works for you.",
"@faq_answer_pgx_why": {},
"faq_question_genetics_info": "Where can I find out more about genetics in general?",
"faq_question_adr_factors": "Which factors can lead to adverse drug reactions?",
"@faq_question_adr_factors": {},
"faq_answer_adr_factors": "An adverse drug reaction is a harmful response to a medication.\n\nWhen your immune system mistakes a medication for a threat, it can trigger an allergic reaction, causing symptoms from stomach upset over hives to severe anaphylaxis.\n\nYour genes also play an important role in how your body processes and responds to medications.\n\nWhile some reactions are predictable, others are rare and unexpected. These rare reactions, called idiosyncratic reactions, are individual reactions with not (yet) understood mechanisms that usually do not occur in most patients.\n\nYou can also have multiple types of adverse reactions at the same time, for example a genetic difference that affects how your body processes a drug AND an allergic reaction.\n\nConsult your pharmacist or doctor for more information.",
"@faq_answer_adr_factors": {},
"faq_question_guidelines_are_developing": "Do my pharmacogenomic results cover all known pharmacogenomic causes of adverse reactions?",
"@faq_question_guidelines_are_developing": {},
"faq_answer_guidelines_are_developing": "No. Scientists are still discovering new genetic differences that affect medications.\n\nFurther, different labs might interpret genetic test results differently because this science is still developing.\n\nPharMe relies on well-established CPIC® and FDA guidelines to deliver standardized and up-to-date pharmacogenomic information to you.\n\nPlease also note that pharmacogenomics is only one factor that can cause adverse reactions, like like one puzzle piece in the big picture of how well a medicine works for you.",
"@faq_answer_guidelines_are_developing": {},
"faq_question_genetics_info": "I need help with understanding what my gene results mean.",
"@faq_question_genetics_info": {},
"faq_answer_genetics_info": "To learn more about genetics, we recommend MedlinePlus, a service of the National Library of Medicine:",
"faq_answer_genetics_info": "Your gene results consist of two types of information:\n\nThe genotype tells you about your DNA and which version of a gene you have. You carry two copies for one gene, called “alleles”, each inherited from one of your parents.\n\nThe phenotype explains how your DNA affects your body. In pharmacogenomics, it usually shows if a gene version might cause a bad reaction to a medicine or how fast your body processes a drug. Processing here means your body either breaks down the medicine into weaker forms or changes it into a stronger form.\n\nTo learn more about genetics, we recommend MedlinePlus, a service of the National Library of Medicine:",
"@faq_answer_genetics_info": {},
"faq_question_which_medications": "Which medications have known gene interactions?",
"faq_question_which_medications": "Which medications are included in PharMe?",
"@faq_question_which_medications": {},
"faq_answer_which_medications": "Examples of medication classes with known gene interactions include anti-clotting medications (like clopidogrel and warfarin), antidepressants (like sertraline, citalopram, and paroxetine), anti-cholesterol medications (like simvastatin and atorvastatin), acid reducers (like pantoprazole and omeprazole), pain killers (like codeine, tramadol, and ibuprofen), antifungals (like voriconazole), medications that suppress the immune system (like tacrolimus), and anti-cancer medications (like fluorouracil and irinotecan).\n\nSearch a medication in the Medications tab to find out whether it has known gene interactions according to CPIC® and FDA guidelines.",
"faq_answer_which_medications": "PharMe includes medications that are known to have meaningful interactions with genes. This knowledge is science-based, according to CPIC® and FDA guidelines.\n\nExamples of medication classes with known gene interactions include:",
"faq_answer_which_medications_examples": "anti-clotting medications (like clopidogrel and warfarin); antidepressants (like sertraline, citalopram, and paroxetine); anti-cholesterol medications (like simvastatin and atorvastatin), acid reducers (like pantoprazole and omeprazole); pain killers (like codeine, tramadol, and ibuprofen); antifungals (like voriconazole); medications that suppress the immune system (like tacrolimus); anti-cancer medications (like fluorouracil and irinotecan)",
"@faq_answer_which_medications_examples": {
"description": "A list separated by semicolon and space; this can be used to split the text in the code to format a list"
},
"@faq_answer_which_medications": {},
"faq_question_phenoconversion": "Why can my results change when I take certain medications?",
"@faq_question_phenoconversion": {},
"faq_answer_phenoconversion": "Certain medications can change your phenotype that describes how your body responds to medications. Typically, medications either inhibit or induce the activity of a gene. In PharMe, the following interactions are included:",
"faq_answer_phenoconversion": "Certain medications known as modulators can change how your body responds to medications. Typically, modulators function in two ways: they either slow down the activity of a gene (known as inhibitors) or speed up the activity of a gene (known as inducers).\n\nPharMe currently only supports changing your gene result if you are taking strong modulators. For moderate modulators, a warning is shown that the gene result may need to be adapted.\n\nThe following modulators are included:",
"@faq_answer_phenoconversion": {},
"faq_question_family": "Will my results affect my family members?",
"@faq_question_family": {},
"faq_answer_family": "Yes, since this is a genetic test, it is possible that your results were passed down to you and your siblings from your parents and you will also pass them down to your children.",
"@faq_answer_family": {},
"faq_question_share": "Who can I share my results with?",
"@faq_question_share": {},
"faq_answer_share": "We recommend that you share your results with your pharmacists, doctors, and close family members such as parents, siblings, and children.",
"faq_answer_share": "We recommend that you share your results with your pharmacists, doctors, and close family members such as parents, siblings, and children.\n\nTo create a PDF that you can share with a healthcare professional, go to a medication page and use the share button in the upper right corner.",
"@faq_answer_share": {},

"faq_section_title_pharme": "PharMe App",
Expand Down

0 comments on commit f3eb851

Please sign in to comment.