diff --git a/app/integration_test/drugs_test.dart b/app/integration_test/drugs_test.dart index f95b55c0..6d80a003 100644 --- a/app/integration_test/drugs_test.dart +++ b/app/integration_test/drugs_test.dart @@ -8,7 +8,7 @@ import 'package:mocktail/mocktail.dart'; import 'package:provider/provider.dart'; import 'fixtures/drugs/with_any_fallback_guideline.dart'; -import 'fixtures/drugs/with_multiple_any_other_fallback_guidelines.dart'; +import 'fixtures/drugs/with_multiple_any_not_handled_fallback_guidelines.dart'; import 'fixtures/drugs/with_proper_guideline.dart'; import 'fixtures/drugs/without_guidelines.dart'; import 'fixtures/set_user_data_for_drug.dart'; @@ -76,7 +76,7 @@ void main() { ); }); - testWidgets('test drug content with any other fallback guidelines', (tester) async { + testWidgets('test drug content with any not handled fallback guidelines', (tester) async { // Work in progress; this should fail! // Open TODOs: // 1. Start with easy case (not pazopanib, add fixture for FDA w/ HLA-B) @@ -97,7 +97,7 @@ void main() { } } // await testPerGuideline(drugWithAnyOtherFallbackGuideline); - await testPerGuideline(drugWithMultipleAnyOtherFallbackGuidelines); + await testPerGuideline(drugWithMultipleAnyNotHandledFallbackGuidelines); }); }); } diff --git a/app/integration_test/fixtures/drugs/drug.dart.template b/app/integration_test/fixtures/drugs/drug.dart.template new file mode 100644 index 00000000..f5bc838e --- /dev/null +++ b/app/integration_test/fixtures/drugs/drug.dart.template @@ -0,0 +1,41 @@ +import 'package:app/common/models/drug/drug.dart'; +import 'package:app/common/models/drug/guideline.dart'; +import 'package:app/common/models/drug/warning_level.dart'; + +final drugWithNonCompilingPlaceholders = Drug( + id: null, + version: null, + name: null, + rxNorm: null, + annotations: DrugAnnotations( + drugclass: null, + indication: null, + brandNames: [null], + ), + guidelines: [ + Guideline( + id: null, + version: null, + lookupkey: { + null: [null], + }, + externalData: [ + GuidelineExtData( + source: null, + guidelineName: null, + guidelineUrl: null, + implications: { + null: null, + }, + recommendation: null, + comments: null, + ), + ], + annotations: GuidelineAnnotations( + implication: null, + recommendation: null, + warningLevel: WarningLevel.null, + ), + ), + ], +); \ No newline at end of file diff --git a/app/integration_test/fixtures/drugs/with_any_not_handled_guideline.dart b/app/integration_test/fixtures/drugs/with_any_not_handled_guideline.dart new file mode 100644 index 00000000..ada8ea04 --- /dev/null +++ b/app/integration_test/fixtures/drugs/with_any_not_handled_guideline.dart @@ -0,0 +1,65 @@ +import 'package:app/common/models/drug/drug.dart'; +import 'package:app/common/models/drug/guideline.dart'; +import 'package:app/common/models/drug/warning_level.dart'; + +final drugWithAnyNotHandledFallbackGuideline = Drug( + id: '6492f8e9918ddcae7349c30c', + version: 1, + name: 'aripiprazole', + rxNorm: 'RxNorm:89013', + annotations: DrugAnnotations( + drugclass: 'Anti-psychotic', + indication: 'Aripiprazole is used to manage and treat schizophrenia, major depressive disorder, and other psychotic disorders.', + brandNames: ['Abilify'], + ), + guidelines: [ + Guideline( + id: '6492f8e9918ddcae7349c304', + version: 1, + lookupkey: { + 'CYP2D6': ['0.0'], + }, + externalData: [ + GuidelineExtData( + source: 'FDA', + guidelineName: 'Table of Pharmacogenetic Associations (Section 1)', + guidelineUrl: 'https://www.fda.gov/medical-devices/precision-medicine/table-pharmacogenetic-associations#section1', + implications: { + 'CYP2D6': 'Results in higher systemic concentrations and higher adverse reaction risk. Dosage adjustment is recommended. Refer to FDA labeling for specific dosing recommendations.', + }, + recommendation: 'Might be included in implication text (imported from FDA, source only states one text per guideline)', + comments: null, + ), + ], + annotations: GuidelineAnnotations( + implication: 'You break down aripiprazole slower than expected. You have an increased risk for side effects.', + recommendation: 'Aripiprazole may be used at a lower dose. Consult your pharmacist or doctor for more information.', + warningLevel: WarningLevel.yellow, + ), + ), + Guideline( + id: '66b50b2433cbe5c07ee311d7', + version: 1, + lookupkey: { + 'CYP2D6': ['~'], + }, + externalData: [ + GuidelineExtData( + source: 'FDA', + guidelineName: 'Table of Pharmacogenetic Associations (Section 1)', + guidelineUrl: 'https://www.fda.gov/medical-devices/precision-medicine/table-pharmacogenetic-associations#section1', + implications: { + 'CYP2D6': 'Standard procedure', + }, + recommendation: 'Might be included in implication text (imported from FDA, source only states one text per guideline)', + comments: null, + ), + ], + annotations: GuidelineAnnotations( + implication: 'Your phenotype does not have a clinically significant influence on aripiprazole.', + recommendation: 'You can use aripiprazole at standard dose. Consult your pharmacist or doctor for more information.', + warningLevel: WarningLevel.green, + ), + ), + ], +); \ No newline at end of file diff --git a/app/integration_test/fixtures/drugs/with_multiple_any_other_fallback_guidelines.dart b/app/integration_test/fixtures/drugs/with_multiple_any_not_handled_fallback_guidelines.dart similarity index 96% rename from app/integration_test/fixtures/drugs/with_multiple_any_other_fallback_guidelines.dart rename to app/integration_test/fixtures/drugs/with_multiple_any_not_handled_fallback_guidelines.dart index affa8d1a..f82c79e1 100644 --- a/app/integration_test/fixtures/drugs/with_multiple_any_other_fallback_guidelines.dart +++ b/app/integration_test/fixtures/drugs/with_multiple_any_not_handled_fallback_guidelines.dart @@ -2,7 +2,7 @@ import 'package:app/common/models/drug/drug.dart'; import 'package:app/common/models/drug/guideline.dart'; import 'package:app/common/models/drug/warning_level.dart'; -final drugWithMultipleAnyOtherFallbackGuidelines = Drug( +final drugWithMultipleAnyNotHandledFallbackGuidelines = Drug( id: '6686a865826414ec5b05c44e', version: 1, name: 'pazopanib', diff --git a/pharme.code-workspace b/pharme.code-workspace index b303f968..dacae2b3 100644 --- a/pharme.code-workspace +++ b/pharme.code-workspace @@ -32,6 +32,7 @@ "settings": { "typescript.preferences.importModuleSpecifier": "relative", "cSpell.words": [ + "Abilify", "abiraterone", "anni", "atorvastatin",