diff --git a/src/main/java/org/pharmgkb/pharmcat/reporter/MessageHelper.java b/src/main/java/org/pharmgkb/pharmcat/reporter/MessageHelper.java index 63e965380..3a4146167 100644 --- a/src/main/java/org/pharmgkb/pharmcat/reporter/MessageHelper.java +++ b/src/main/java/org/pharmgkb/pharmcat/reporter/MessageHelper.java @@ -85,13 +85,19 @@ public MessageHelper() throws IOException { */ public void addMatchingMessagesTo(GeneReport report) { if (!report.isReportable()) { - // purposely don't apply any messages if the gene is not called + if (!report.isNoData()) { + // if not reportable but does have data apply only "non-match" rules + m_geneMap.get(report.getGene()).stream() + .filter(m -> m.getExceptionType().equalsIgnoreCase(MessageAnnotation.TYPE_NONMATCH) && matchesGeneReport(m, report)) + .forEach(report::addMessage); + } return; } if (report.getCallSource() != CallSource.MATCHER) { return; } m_geneMap.get(report.getGene()).stream() + .filter(m -> !m.getExceptionType().equalsIgnoreCase(MessageAnnotation.TYPE_NONMATCH)) .filter(m -> matchesGeneReport(m, report)) .forEach(report::addMessage); } diff --git a/src/main/java/org/pharmgkb/pharmcat/reporter/model/MessageAnnotation.java b/src/main/java/org/pharmgkb/pharmcat/reporter/model/MessageAnnotation.java index 296e3a168..bc8b7b917 100644 --- a/src/main/java/org/pharmgkb/pharmcat/reporter/model/MessageAnnotation.java +++ b/src/main/java/org/pharmgkb/pharmcat/reporter/model/MessageAnnotation.java @@ -27,6 +27,7 @@ public class MessageAnnotation implements Comparable { private static final String TYPE_FOOTNOTE = "footnote"; public static final String TYPE_NOTE = "note"; public static final String TYPE_REPORT_AS_GENOTYPE = "report-as-genotype"; + public static final String TYPE_NONMATCH = "non-match"; public static Predicate isFootnote = m -> m.getExceptionType().equals(TYPE_FOOTNOTE); public static Predicate isExtraPositionNote = m -> m.getExceptionType().equals(TYPE_EXTRA_POSITION); public static Predicate isMessage = m -> !m.getExceptionType().equals(TYPE_FOOTNOTE) && diff --git a/src/main/resources/org/pharmgkb/pharmcat/reporter/messages.json b/src/main/resources/org/pharmgkb/pharmcat/reporter/messages.json index 342f4be7e..bf8cd9f75 100644 --- a/src/main/resources/org/pharmgkb/pharmcat/reporter/messages.json +++ b/src/main/resources/org/pharmgkb/pharmcat/reporter/messages.json @@ -1538,8 +1538,8 @@ "succinylcholine" ] }, - "exception_type": "note", - "message": "If the RYR1 genotype is “not called”, please refer to the RYR1 gene table in section 3 for the variants included in the input VCF file. In case one or more variant(s) with “Malignant Hyperthermia associated” function are present, please refer to the guideline publication PMID:30499100 since halogenated volatile anesthetics or depolarizing muscle relaxants succinylcholine are relatively contraindicated in persons with Malignant Hyperthermia Susceptibility. " + "exception_type": "non-match", + "message": "If the RYR1 genotype is “not called” and the drug section reports RYR1:Unknown/Unknown, please refer to the RYR1 gene table in section III for the variants included in the input VCF file. In case one or more variant(s) with “Malignant Hyperthermia associated” function are present, please refer to the guideline publication PMID:30499100 since halogenated volatile anesthetics or depolarizing muscle relaxants succinylcholine are relatively contraindicated in persons with Malignant Hyperthermia Susceptibility. " }, { "rule_name": "pcat-dpyd-hapB3-exonic-only",