diff --git a/app/routes/report/variants.js b/app/routes/report/variants.js index 46b6b73a1..6439dc30c 100644 --- a/app/routes/report/variants.js +++ b/app/routes/report/variants.js @@ -40,6 +40,15 @@ const therapeuticAssociationFilter = { {[Op.is]: literal('distinct from \'msi\'')}, {[Op.is]: literal('distinct from \'tmb\'')}, ]}, + [Op.or]: [ + { + relevance: 'resistance', + iprEvidenceLevel: 'IPR-A', + }, + { + relevance: 'sensitivity', + }, + ], // Regex filter for finding columns with 2 or more spaces that end with // mutation or mutations [Op.not]: {kbVariant: {[Op.regexp]: MUTATION_REGEX}}, diff --git a/test/routes/report/variants.test.js b/test/routes/report/variants.test.js index 72a47cb83..fa86eb8e1 100644 --- a/test/routes/report/variants.test.js +++ b/test/routes/report/variants.test.js @@ -42,7 +42,7 @@ const checkRapidReportMatches = ( } kbMatches.forEach((match) => { - if (!match.evidenceLevel === expectedTable) { + if (!(match.evidenceLevel === expectedTable)) { found = false; } }); @@ -57,7 +57,7 @@ const checkVariantsFilter = ( let found = true; variants.forEach((variant) => { - if (!variant.displayName === expectedTable) { + if (!(variant.displayName === expectedTable)) { found = false; } }); diff --git a/test/testData/mockRapidReportData.json b/test/testData/mockRapidReportData.json index 45a473daa..fffee74ff 100644 --- a/test/testData/mockRapidReportData.json +++ b/test/testData/mockRapidReportData.json @@ -10,6 +10,17 @@ "iprEvidenceLevel": "IPR-A", "kbVariant": "this should be in table 1", "matchedCancer": true, + "relevance": "sensitivity", + "evidenceLevel": "table 1" + }, + { + "category": "therapeutic", + "variantType": "cnv", + "variant": "TA", + "iprEvidenceLevel": "IPR-B", + "kbVariant": "this should be in table 1", + "matchedCancer": true, + "relevance": "resistance", "evidenceLevel": "table 1" }, { @@ -19,8 +30,38 @@ "iprEvidenceLevel": "IPR-B", "kbVariant": "thisshouldbeintable1", "matchedCancer": true, + "relevance": "sensitivity", "evidenceLevel": "table 1" }, + { + "category": "therapeutic", + "variantType": "cnv", + "variant": "TA", + "iprEvidenceLevel": "IPR-B", + "kbVariant": "thisshouldbeintable2", + "matchedCancer": true, + "relevance": "resistance", + "evidenceLevel": "table 2" + }, + { + "category": "therapeutic", + "variantType": "cnv", + "variant": "TA", + "iprEvidenceLevel": "IPR-A", + "kbVariant": "this should be in table 2", + "matchedCancer": true, + "relevance": "no sensitivity", + "evidenceLevel": "table 2" + }, + { + "category": "therapeutic", + "variantType": "cnv", + "variant": "TA", + "iprEvidenceLevel": "IPR-A", + "kbVariant": "this should be in table 2", + "matchedCancer": true, + "evidenceLevel": "table 2" + }, { "category": "unknown", "variantType": "cnv",