Skip to content

Commit 8c0a35d

Browse files
authored
Edit line to not need safe navigation consideration (#171)
* amended safe navigation line to improved code - nil values are acceptable in ROA importer * edited additional lines to reflect same changes
1 parent edb8ba4 commit 8c0a35d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/import/colorectal/providers/manchester/manchester_handler_colorectal.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def extract_genes_from_raw_fields
139139
exon = raw_record['exon']
140140
genotype2 = raw_record['genotype2']
141141
next if MSH6_DOSAGE_MTYPE.include?(moltesttype) && !exon.scan(/MLPA/i).size.positive?
142-
next if moltesttype&.match?(/dosage/i) && !exon.match?(/MLPA|P003/i)
142+
next if /dosage/i.match?(moltesttype) && !/MLPA|P003/i.match?(exon)
143143

144144
genes_found << find_genes_genotype(exon, moltesttype, genotype, genotype2)
145145
end
@@ -150,9 +150,9 @@ def find_genes_genotype(exon, moltesttype, genotype, genotype2)
150150
exon_genes = exon&.scan(COLORECTAL_GENES_REGEX).to_a
151151
genotype_genes = genotype&.scan(COLORECTAL_GENES_REGEX).to_a
152152
genotype2_genes = genotype2&.scan(COLORECTAL_GENES_REGEX).to_a
153-
if exon.match?('NGS')
153+
if /NGS/.match?(exon)
154154
genotype == 'No pathogenic variant identified' ? exon_genes : genotype_genes
155-
elsif exon.match?(/P003/i) && moltesttype&.match?(/dosage/i)
155+
elsif /P003/i.match?(exon) && /dosage/i.match?(moltesttype)
156156
%w[MLH1 MSH2] + [genotype_genes + genotype2_genes]
157157
elsif exon == 'MLH1_MSH2_MSH6_NGS-POOL' &&
158158
genotype == 'No pathogenic variant identified'

0 commit comments

Comments
 (0)