diff --git a/lib/import/colorectal/providers/royal_marsden/royal_marsden_handler_colorectal.rb b/lib/import/colorectal/providers/royal_marsden/royal_marsden_handler_colorectal.rb index 79a9fd41..0cf0406b 100644 --- a/lib/import/colorectal/providers/royal_marsden/royal_marsden_handler_colorectal.rb +++ b/lib/import/colorectal/providers/royal_marsden/royal_marsden_handler_colorectal.rb @@ -97,26 +97,32 @@ def process_varpathclass(genocolorectal, record) genocolorectal.add_variant_class(VARIANT_PATH_CLASS_COLO[varpathclass.downcase]) else @logger.debug 'NO VARIANTPATHCLASS DETECTED' + check_for_non_path_variant(genocolorectal, record) end end + def check_for_non_path_variant(genocolorectal, record) + if /non-pathogenic\svariant\sdetected/i.match(record.raw_fields['teststatus']) + genocolorectal.add_variant_class(6) #Ad-hoc variant path class for when we know it is class1/2 but can't distinguish. + end + end + def process_teststatus(genocolorectal, record) teststatus = record.raw_fields['teststatus'] unless record.raw_fields['teststatus'].nil? - if /NO PATHOGENIC (VARIANT|DEL\/DUP) IDENTIFIED/.match(teststatus) || - /non-pathogenic variant detected/.match(teststatus) || - /No mutation detected/.match(teststatus) + case teststatus + when /NO PATHOGENIC (VARIANT|DEL\/DUP) IDENTIFIED/ || /No mutation detected/ genocolorectal.add_status(1) - elsif /Fail/i.match(teststatus) + when /non-pathogenic\svariant\sdetected/i + genocolorectal.add_status(10) + when /Fail/i genocolorectal.add_status(9) - elsif /c\..+/.match(teststatus) || - /Deletion*/.match(teststatus) || - /Duplication*/.match(teststatus) || - /Exon*/i.match(teststatus) - genocolorectal.add_status(2) - else + when /c\..+/ || /Deletion*/ || /Duplication*/ || /Exon*/i + genocolorectal.add_status(2) + else @logger.debug 'UNABLE TO DETERMINE TESTSTATUS' end - end + end + def process_variant(genocolorectal, record) variant = record.raw_fields['teststatus'] unless record.raw_fields['teststatus'].nil?