Skip to content

Commit

Permalink
feat(#685): add MedlinePlus link to settings and more page
Browse files Browse the repository at this point in the history
  • Loading branch information
tamslo committed Feb 14, 2024
1 parent eff061b commit 96984e6
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 18 deletions.
56 changes: 45 additions & 11 deletions app/lib/faq/constants.dart
Original file line number Diff line number Diff line change
@@ -1,61 +1,95 @@
class Question {
import '../common/module.dart';

abstract class Question {
const Question({
required this.question,
required this.answer,
});

final String question;
final String answer;
final dynamic answer;
}

class TextAnswerQuestion extends Question {
const TextAnswerQuestion({
required super.question,
required String super.answer,
});
}

class WidgetAnswerQuestion extends Question {
const WidgetAnswerQuestion({
required super.question,
required Widget super.answer,
});
}

final Map<String, List<Question>> faqList = {
'Pharmacogenetics (PGx)': [
Question(
TextAnswerQuestion(
question: 'What is pharmacogenetics?',
answer:
'Pharmacogenetics (PGx) is the study of how your genes (DNA) affect your response to drugs.',
),
Question(
TextAnswerQuestion(
question: 'Why is pharmacogenetics important?',
answer:
'Pharmacogenetics is important because it helps to predict those who will respond well to drugs and those who may have side effects. With this information we can better select the right drug and dose to avoid side effects.',
),
Question(
TextAnswerQuestion(
question: 'Which drugs are affected?',
answer:
'Examples of affected drug classes include anti-clotting medications (like clopidogrel and warfarin), antidepressants (like sertraline, citalopram, and paroxetine), anti-cholesterol drugs (like simvastatin and atorvastatin), acid reducers (like pantoprazole and omeprazole), pain killers (like codeine, tramadol, and ibuprofen), antifungals (like voriconazole), drugs that suppress the immune system (like tacrolimus), and anti-cancer drugs (like fluorouracil and irinotecan). You can find out whether a certain drug is affected in the Search tab.',
),
Question(
TextAnswerQuestion(
question: 'Will my results affect my family members?',
answer:
'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.',
),
Question(
TextAnswerQuestion(
question: 'Who can I share my results with?',
answer:
'We recommend that you share your results with your pharmacists, doctors, and close family members such as parents, siblings, and children.',
),
WidgetAnswerQuestion(
question: 'Where can I find out more about genetics?',
answer: RichText(text: TextSpan(
// context.l10n.genetic_information_text_part_1
text: 'If you would like to learn more about genetics, you can visit ',
style: PharMeTheme.textTheme.titleMedium,
children: [
linkTextSpan(
text: 'MedlinePlus', // context.l10n.genetic_information_source
onTap: openFurtherGeneticInformation,
),
TextSpan(
// context.l10n.genetic_information_text_part_2
text: ', a service of the National Library of Medicine.',
),
],
)),
)
],
'PharMe App': [
Question(
TextAnswerQuestion(
question: 'What does PharMe do?',
answer:
'PharMe provides user-friendly information on how your body reacts to drugs based on your genes. This enables you to better understand which drugs may be ineffective for you or could have potential side effects. We recommend that you share consult your health care team before making any changes to your treatments.',
),
Question(
TextAnswerQuestion(
question:
'Can I use PharMe\'s results without consulting a medical professional?',
answer:
'No. Whether a drug is a good choice for you depends on a lot of other factors such as age, weight, or pre-existing conditions. We highly recommend that you talk to your health care team (e.g., pharmacist and doctors) before taking, stopping or adjusting the dose of any drug.',
),
Question(
TextAnswerQuestion(
question: 'Where does PharMe get its data from?',
answer:
"PharMe is showing pharmacogenomic guidelines from the Clinical Pharmacogenetics Implementation Consortium (CPIC®) and the U.S. Food and Drug Administration (FDA). Our PGx experts adapted the language from the guidelines to make them more user-friendly and easier to understand; please note that this does only affect the guidelines' presentation, not affect the guidelines' statements.",
),
],
'Data security': [
Question(
TextAnswerQuestion(
question: 'How is the security of my genetic data ensured?',
answer:
'Once securely imported from the lab, your genetic data is re-encrypted, saved and never sent anywhere else. All computation is done on your phone. When fetching data from external resources, PharMe always uses generalized requests and only personalizes information locally on your phone. No personal data is sent to third parties. This provides the highest level of security for your personal information.',
Expand Down
4 changes: 3 additions & 1 deletion app/lib/faq/pages/faq.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ class FaqPage extends StatelessWidget {
right: PharMeTheme.mediumSpace,
bottom: PharMeTheme.smallSpace,
),
title: Text(question.answer),
title: question is TextAnswerQuestion
? Text(question.answer)
: question.answer,
),
],
),
Expand Down
8 changes: 5 additions & 3 deletions app/lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
"auth_sign_in": "Get data",
"auth_success": "Successfully imported data",

"genetic_information_text_part_1": "If you would like to learn more about genetics, you can visit ",
"genetic_information_text_part_2": ", a service of the National Library of Medicine.",
"genetic_information_source": "MedlinePlus",

"drug_selection_header": "Select active drugs",
"drug_selection_onboarding_description": "Please update which drugs you are currently taking below. You can always change the status for a drug later on a drug page or in the settings.",
"drug_selection_no_drugs_loaded": "No drugs loaded",
Expand Down Expand Up @@ -206,9 +210,6 @@
"drugs_page_recommendation_warfarin": "Consult your pharmacist or doctor for more information.",

"report_content_explanation": "Here is your PGx report. Tap on a gene name for more details on your results and a list of implicated drugs.",
"report_genetic_information_part_1": "If you would like to learn more about genetics, please visit ",
"report_genetic_information_part_2": ", a service of the National Library of Medicine.",
"genetic_information_source": "MedlinePlus",
"report_page_indicator_explanation": "Phenotypes followed by an {indicatorName} ({indicator}) might be influenced by drugs you are currently taking",
"@report_page_indicator_explanation": {
"placeholders": {
Expand Down Expand Up @@ -361,6 +362,7 @@
"settings_page_terms_and_conditions": "Terms of use",
"settings_page_terms_and_conditions_text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
"settings_page_help_and_feedback": "Help & Feedback",
"settings_page_genetic_information": "Learn about genetics (MedlinePlus)",
"settings_page_contact_us": "Contact us",

"comprehension_intro_text": "Would you like to participate in a survey aiming to measure user comprehension of content in the app? This would help us make PharMe more understandable for everyone!",
Expand Down
3 changes: 3 additions & 0 deletions app/lib/more/pages/more.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ class MorePage extends StatelessWidget {
text: context.l10n.settings_page_help_and_feedback,
useLine: false,
),
_buildSettingsItem(
title: context.l10n.settings_page_genetic_information,
onTap: openFurtherGeneticInformation),
_buildSettingsItem(
title: context.l10n.settings_page_contact_us,
onTap: sendEmail)
Expand Down
6 changes: 3 additions & 3 deletions app/lib/report/pages/report.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,19 @@ class ReportPage extends StatelessWidget {
PageDescriptionText(context.l10n.report_content_explanation),
SizedBox(height: PharMeTheme.smallSpace),
RichText(text: TextSpan(
text: context.l10n.report_genetic_information_part_1,
text: context.l10n.genetic_information_text_part_1,
style: pageDescriptionTextStyle,
children: [
linkTextSpan(
text: context.l10n.genetic_information_source,
onTap: openFurtherGeneticInformation,
),
TextSpan(
text: context.l10n.report_genetic_information_part_2,
text: context.l10n.genetic_information_text_part_2,
style: pageDescriptionTextStyle,
),
],
))
)),
])),
scrollList(
userGenotypes.map((genotypeResult) => GeneCard(
Expand Down

0 comments on commit 96984e6

Please sign in to comment.