Skip to content

Commit

Permalink
feat(app): add information about genetics resources
Browse files Browse the repository at this point in the history
  • Loading branch information
tamslo committed Feb 24, 2025
1 parent a4e06d4 commit 04150f6
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 18 deletions.
9 changes: 0 additions & 9 deletions app/lib/common/constants.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:url_launcher/url_launcher.dart';

import 'module.dart';

Expand All @@ -9,14 +8,6 @@ const genesIcon = FontAwesomeIcons.dna;
Uri anniUrl([String slug = '']) =>
Uri.http('hpi-annotation-service.duckdns.org', 'api/v1/$slug');

final geneticInformationUrl = Uri.https(
'medlineplus.gov',
'/genetics/understanding/',
);

Future<void> openFurtherGeneticInformation() async =>
launchUrl(geneticInformationUrl);

final cpicMaxCacheTime = Duration(days: 90);
const cpicLookupUrl =
'https://api.cpicpgx.org/v1/diplotype?select=genesymbol,diplotype,generesult,lookupkey';
Expand Down
8 changes: 7 additions & 1 deletion app/lib/common/routing/router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import '../../drug/module.dart';
import '../../drug_selection/module.dart';
import '../../error/module.dart';
import '../../faq/module.dart';
import '../../genetic_information/module.dart';
import '../../login/module.dart';
import '../../main/module.dart';
import '../../more/module.dart';
Expand All @@ -28,7 +29,12 @@ class AppRouter extends _$AppRouter {
searchRoute(children: [ drugRoute() ]),
faqRoute(),
moreRoute(
children: [ aboutRoute(), termsRoute(), privacyRoute() ],
children: [
geneticInformationRoute(),
aboutRoute(),
termsRoute(),
privacyRoute(),
],
),
],
),
Expand Down
8 changes: 7 additions & 1 deletion app/lib/common/widgets/large_markdown_body.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@ import 'package:flutter_markdown/flutter_markdown.dart';
import '../module.dart';

class LargeMarkdownBody extends StatelessWidget {
const LargeMarkdownBody({super.key, required this.data});
const LargeMarkdownBody({
super.key,
required this.data,
this.onTapLink,
});

final String data;
final void Function(String text, String? href, String title)? onTapLink;

@override
Widget build(BuildContext context) => MarkdownBody(
Expand All @@ -17,5 +22,6 @@ class LargeMarkdownBody extends StatelessWidget {
)
)
),
onTapLink: onTapLink,
);
}
9 changes: 9 additions & 0 deletions app/lib/genetic_information/module.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import '../common/module.dart';

// For generated routes
export 'pages/genetic_information.dart';

AutoRoute geneticInformationRoute() => AutoRoute(
path: 'genetic-information',
page: GeneticInformationRoute.page,
);
28 changes: 28 additions & 0 deletions app/lib/genetic_information/pages/genetic_information.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import 'package:url_launcher/url_launcher.dart';

import '../../common/module.dart';

@RoutePage()
class GeneticInformationPage extends HookWidget {
const GeneticInformationPage({super.key});

@override
Widget build(BuildContext context) {
return pageScaffold(
title: context.l10n.more_page_genetic_information,
body: [
Padding(
padding: const EdgeInsets.only(
left: PharMeTheme.smallSpace,
right: PharMeTheme.smallSpace,
bottom: PharMeTheme.smallSpace,
),
child: LargeMarkdownBody(
data: context.l10n.more_page_genetic_information_markdown,
onTapLink: (text, href, title) => launchUrl(Uri.parse(href!)),
),
),
]
);
}
}
4 changes: 3 additions & 1 deletion app/lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -648,8 +648,10 @@
"@more_page_terms_and_conditions_text": {},
"more_page_help_and_feedback": "Help & feedback",
"@more_page_help_and_feedback": {},
"more_page_genetic_information": "Learn about genetics (MedlinePlus)",
"more_page_genetic_information": "Learn about genetics",
"@more_page_genetic_information": {},
"more_page_genetic_information_markdown": "Please refer to the links below to learn more about PGx (pharmacogenomics) and genetics in general.\n\n_For more information on PGx:_\n\n- **Mount Sinai Introduction Video**: <https://www.youtube.com/watch?v=N6432xbpGOU>\n- **Information on MedlinePlus** (an online health information resource for patients and their families and friends of the National Library of Medicine): <https://medlineplus.gov/lab-tests/pharmacogenetic-tests>\n- **Information on KidsHealth** (educational resources by Nemours®): <https://kidshealth.org/en/parents/pharmacogenomics.html>\n\n_For more information on Genetics_:\n- **Genetics on OLogy** (a science website in easy language from the American Museum of Natural History): <https://www.amnh.org/explore/ology/genetics/what-is-genetics>\n- **Information from Genes and Health** (resources by the study team of one of the world’s largest community-based genetics studies): <https://www.genesandhealth.org/genes-your-health/genes-made-easy>",
"@more_page_genetic_information_markdown": {},
"more_page_contact_us": "Contact us",
"@more_page_contact_us": {},

Expand Down
5 changes: 4 additions & 1 deletion app/lib/more/pages/more.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ class MorePage extends StatelessWidget {
),
_buildSettingsItem(
title: context.l10n.more_page_genetic_information,
onTap: openFurtherGeneticInformation),
onTap: () => context.router.push(
GeneticInformationRoute(),
),
),
SubheaderDivider(
text: context.l10n.more_page_app_information,
useLine: false,
Expand Down
11 changes: 6 additions & 5 deletions docs/User-instructions.html
Original file line number Diff line number Diff line change
Expand Up @@ -596,18 +596,18 @@ <h2 id="learn-about-genetics">III. Learn About Genetics</h2>
You can also open the links from the App, under "More" > "Learn about genetics".
</p>

<p>For more information on PGx:</p>
<p style="font-style: italic">For more information on PGx:</p>
<ul>
<li><span style="font-weight: bold;">Mount Sinai Introduction Video</span>: <a href="https://www.youtube.com/watch?v=N6432xbpGOU">https://www.youtube.com/watch?v=N6432xbpGOU</a></li>
<li><span style="font-weight: bold;">Information on MedlinePlus</span> (an online health information resource for patients and their families and friends of the National Library of Medicine): <a href="https://medlineplus.gov/lab-tests/pharmacogenetic-tests">https://medlineplus.gov/lab-tests/pharmacogenetic-tests</a></li>
<li><span style="font-weight: bold;">Information on KidsHealth</span> (educational resources by Nemours®): <a href="https://kidshealth.org/en/parents/pharmacogenomics.html">https://kidshealth.org/en/parents/pharmacogenomics.html</a></li>
</ul>

<p>For more information on Genetics:</p>
<p style="font-style: italic">For more information on Genetics:</p>
<ul>
<!-- <li><span style="font-weight: bold;">Information from the CDC</span> (the U.S. Centers for Disease Control and Prevention): <a href="https://www.cdc.gov/genomics-and-health/about/index.html">https://www.cdc.gov/genomics-and-health/about/index.html</a></li> -->
<li><span style="font-weight: bold;">Genetics on OLogy</span> (a science website in easy language from the American Museum of Natural History): <a href="https://www.amnh.org/explore/ology/genetics/what-is-genetics">https://www.amnh.org/explore/ology/genetics/what-is-genetics</a></li>
<li><span style="font-weight: bold;">Information from Genes and Health</span> (resources by the study team of one of the world’s largest community-based genetics studies)<a href="https://www.genesandhealth.org/genes-your-health/genes-made-easy">https://www.genesandhealth.org/genes-your-health/genes-made-easy</a></li>
<li><span style="font-weight: bold;">Information from Genes and Health</span> (resources by the study team of one of the world’s largest community-based genetics studies): <a href="https://www.genesandhealth.org/genes-your-health/genes-made-easy">https://www.genesandhealth.org/genes-your-health/genes-made-easy</a></li>
</ul>

<h2 id="faq" style="margin-top: 0.6in; margin-bottom: 0.4in">IV. Frequently Asked Questions (FAQ)</h2>
Expand Down Expand Up @@ -823,8 +823,9 @@ <h4>2.7 Can other medications affect how my body processes medications?</h4>
of other medications.
Consult your pharmacist or doctor for more information in such cases.
</p>
<p>PharMe currently only includes strong and moderate inhibitors for the gene
<em>CYP2D6</em>:
<p>
PharMe currently only includes strong and moderate inhibitors for the gene
<span style="font-style: italic">CYP2D6</span>:
</p>
<p style="font-style: italic;">Strong inhibitors:</p>
<ul>
Expand Down

0 comments on commit 04150f6

Please sign in to comment.