diff --git a/lib/import/colorectal/providers/manchester/manchester_handler_colorectal.rb b/lib/import/colorectal/providers/manchester/manchester_handler_colorectal.rb index b6778a79..68f48d32 100644 --- a/lib/import/colorectal/providers/manchester/manchester_handler_colorectal.rb +++ b/lib/import/colorectal/providers/manchester/manchester_handler_colorectal.rb @@ -139,7 +139,7 @@ def extract_genes_from_raw_fields exon = raw_record['exon'] genotype2 = raw_record['genotype2'] next if MSH6_DOSAGE_MTYPE.include?(moltesttype) && !exon.scan(/MLPA/i).size.positive? - next if moltesttype.match?(/dosage/i) && !exon.match?(/MLPA|P003/i) + next if moltesttype&.match?(/dosage/i) && !exon.match?(/MLPA|P003/i) genes_found << find_genes_genotype(exon, moltesttype, genotype, genotype2) end @@ -152,7 +152,7 @@ def find_genes_genotype(exon, moltesttype, genotype, genotype2) genotype2_genes = genotype2&.scan(COLORECTAL_GENES_REGEX).to_a if exon.match?('NGS') genotype == 'No pathogenic variant identified' ? exon_genes : genotype_genes - elsif exon.match?(/P003/i) && moltesttype.match?(/dosage/i) + elsif exon.match?(/P003/i) && moltesttype&.match?(/dosage/i) %w[MLH1 MSH2] + [genotype_genes + genotype2_genes] elsif exon == 'MLH1_MSH2_MSH6_NGS-POOL' && genotype == 'No pathogenic variant identified'