diff --git a/lib/import/brca/providers/sheffield/sheffield_handler.rb b/lib/import/brca/providers/sheffield/sheffield_handler.rb index b408f748..b316f9c6 100644 --- a/lib/import/brca/providers/sheffield/sheffield_handler.rb +++ b/lib/import/brca/providers/sheffield/sheffield_handler.rb @@ -391,12 +391,12 @@ def process_fullscreen_records(genotype, record, genotypes) genotype_str = record.raw_fields['genotype'] if mlpa_fail?(record) process_mlpa_fail_full_screen(genotype, record, genotypes) + elsif positive_cdna?(genotype_str) || positive_exonvariant?(genotype_str) + process_variant_fs_records(genotype, record, genotypes) elsif normal?(record) process_normal_full_screen(genotype, record, genotypes) elsif failed_test?(record) process_failed_full_screen(genotype, record, genotypes) - elsif positive_cdna?(genotype_str) || positive_exonvariant?(genotype_str) - process_variant_fs_records(genotype, record, genotypes) else # else give a test status of 4 (unknown) add_other_genes_with_status(@genes_set, genotype, genotypes, 4) diff --git a/lib/import/helpers/brca/providers/rcu/rcu_constants.rb b/lib/import/helpers/brca/providers/rcu/rcu_constants.rb index 25c69325..a2ef1fc3 100644 --- a/lib/import/helpers/brca/providers/rcu/rcu_constants.rb +++ b/lib/import/helpers/brca/providers/rcu/rcu_constants.rb @@ -246,7 +246,7 @@ module RcuConstants ([a-z\s]+(?del(etion)?|duplicati?on|dup(licated)?))?/ix NORMAL_VAR_REGEX = %r{(?no|not)[a-z /]+ - (?detect|report|detet|mutation)+}ix + (?detect|report|detet|mutation|identified)+}ix # rubocop:enable Lint/MixedRegexpCaptureTypes end end diff --git a/test/lib/import/brca/providers/sheffield/sheffield_handler_test.rb b/test/lib/import/brca/providers/sheffield/sheffield_handler_test.rb index 3b554f81..8f875748 100644 --- a/test/lib/import/brca/providers/sheffield/sheffield_handler_test.rb +++ b/test/lib/import/brca/providers/sheffield/sheffield_handler_test.rb @@ -277,6 +277,24 @@ def setup assert_equal 'Targeted BRCA mutation test', genotypes[0].attribute_map['genetictestscope'] end + test 'normal_full_screen_not_identified_case' do + normal_fs_not_identfied_record = build_raw_record('pseudo_id1' => 'bob') + normal_fs_not_identfied_record.raw_fields['genetictestscope'] = 'R208 :: BRCA1 and BRCA2 testing at high familial risk' + normal_fs_not_identfied_record.raw_fields['karyotypingmethod'] = 'R208.1 :: NGS in Leeds' + normal_fs_not_identfied_record.raw_fields['genotype'] = 'A hereditary (germline) genetic cause for this individual’s cancer has not been identified;' + @handler.add_test_scope_from_geno_karyo(@genotype, normal_fs_not_identfied_record) + genotypes = @handler.process_variants_from_record(@genotype, normal_fs_not_identfied_record) + assert_equal 3, genotypes.size + assert_equal 1, genotypes[0].attribute_map['teststatus'] + assert_equal 1, genotypes[1].attribute_map['teststatus'] + assert_equal 1, genotypes[2].attribute_map['teststatus'] + assert_equal 7, genotypes[0].attribute_map['gene'] + assert_equal 8, genotypes[1].attribute_map['gene'] + assert_equal 3186, genotypes[2].attribute_map['gene'] + assert_nil genotypes[0].attribute_map['proteinimpact'] + assert_nil genotypes[1].attribute_map['codingdnasequencechange'] + end + private def clinical_json