From 08388d8b21d4a7dcd74eed1a9d24f8211d0043b6 Mon Sep 17 00:00:00 2001 From: NImeson Date: Wed, 18 Mar 2026 17:04:32 +0000 Subject: [PATCH 01/10] Added variables for missing test scope assignment --- .../sheffield/sheffield_handler_colorectal.rb | 15 +++++++++ .../colorectal/providers/rcu/constants.rb | 33 ++++++++++++++----- 2 files changed, 39 insertions(+), 9 deletions(-) diff --git a/lib/import/colorectal/providers/sheffield/sheffield_handler_colorectal.rb b/lib/import/colorectal/providers/sheffield/sheffield_handler_colorectal.rb index 1deaecbd..9f872559 100644 --- a/lib/import/colorectal/providers/sheffield/sheffield_handler_colorectal.rb +++ b/lib/import/colorectal/providers/sheffield/sheffield_handler_colorectal.rb @@ -76,6 +76,11 @@ def process_scope_r209(karyo, genocolorectal, _moleculartestingtype) end def process_scope_r210(karyo, genocolorectal, moleculartestingtype) + if karyo.downcase.match(/r240.1\s::\sdiagnostic\sfamilial/) + karyo='R240.1 :: Diagnostic familial' + elsif karyo.downcase.match(/r242.1\s::\spredictive\stesting/) + karyo='R242.1 :: Predictive testing' + end if R210_PANEL_GENE_MAPPING_FS.keys.include? karyo @logger.debug "ADDED FULL_SCREEN TEST for: #{karyo}" genocolorectal.add_test_scope(:full_screen) @@ -123,6 +128,16 @@ def process_scope_r414(karyo, genocolorectal, moleculartestingtype) end end + def process_scope_r216(karyo, genocolorectal, moleculartestingtype) + if R216_PANEL_GENE_MAPPING_FS.keys.include? karyo + @logger.debug "ADDED FULL_SCREEN TEST for: #{karyo}" + genocolorectal.add_test_scope(:full_screen) + @genes_set = R216_PANEL_GENE_MAPPING_FS[karyo] + else + genocolorectal.add_test_scope(:no_genetictestscope) + end + end + def process_scope_fap_familial(karyo, genocolorectal, _moleculartestingtype) if FAP_FAM_PANEL_GENE_MAPPING_TAR.keys.include? karyo @logger.debug "ADDED TARGETED TEST for: #{karyo}" diff --git a/lib/import/helpers/colorectal/providers/rcu/constants.rb b/lib/import/helpers/colorectal/providers/rcu/constants.rb index b2877619..508f3702 100644 --- a/lib/import/helpers/colorectal/providers/rcu/constants.rb +++ b/lib/import/helpers/colorectal/providers/rcu/constants.rb @@ -57,14 +57,17 @@ module Constants 'r209 :: inherited colorectal cancer '\ '(with or without polyposis)' => :process_scope_r209, 'r210 :: inherited mmr deficiency (lynch syndrome)' => :process_scope_r210, + 'r210' => :process_scope_r210, 'r211 :: inherited polyposis - germline test' => :process_scope_r211, + 'r211' => :process_scope_r211, 'fap' => :process_scope_fap, 'fap familial mutation' => :process_scope_fap_familial, 'hnpcc' => :process_scope_hnpcc, 'myh' => :process_scope_myh, 'breast ovarian & colorectal cancer panel' => :process_scope_colo_ovarian_panel, 'r211 :: inherited polyposis and early onset colorectal cancer, germline testing'=> :process_scope_r211, - 'r414 :: apc associated polyposis'=> :process_scope_r414 + 'r414 :: apc associated polyposis'=> :process_scope_r414, + 'R216 :: Li Fraumeni Syndrome - SDGS' => :process_scope_r216 }.freeze COLO_PANEL_GENE_MAPPING_FS = { @@ -117,18 +120,22 @@ module Constants 'R210.2 :: Small panel in Leeds' => %w[MLH1 MSH2 MSH6 PMS2 EPCAM], 'R210.2 :: Unknown mutation(s) by Small panel' => %w[MLH1 MSH2 MSH6 PMS2 EPCAM], 'R210.5 :: Unknown mutation(s) by MLPA or equivalent' => %w[MLH1 MSH2 EPCAM], - 'R210.1 :: Unknown mutation(s) by Microsatellite instability'=> %w[MLH1 MSH2 MSH6 PMS2 EPCAM], - 'R210.2 :: Small panel in Leeds - Send DNA'=> %w[MLH1 MSH2 MSH6 PMS2 EPCAM] + 'R210.1 :: Unknown mutation(s) by Microsatellite instability' => %w[MLH1 MSH2 MSH6 PMS2 EPCAM], + 'R210.2 :: Small panel in Leeds - Send DNA' => %w[MLH1 MSH2 MSH6 PMS2 EPCAM], + 'R210.2 :: Small panel in Leeds - DNA in Newcastle' => %w[MLH1 MSH2 MSH6 PMS2 EPCAM] }.freeze R210_PANEL_GENE_MAPPING_TAR = { 'R240.1 :: Diagnostic familial' => %w[MLH1 MSH2 MSH6 PMS2 EPCAM], 'R242.1 :: Predictive MLPA' => %w[MLH1 MSH2 EPCAM], 'R242.1 :: Predictive testing' => %w[MLH1 MSH2 MSH6 PMS2 EPCAM], - 'R242.1 :: Predictive testing - MLPA in Leeds - Send Blood'=> %w[MLH1 MSH2 MSH6 PMS2 EPCAM], - 'R242.1 :: Predictive testing - MLPA in Leeds - Send DNA'=> %w[MLH1 MSH2 MSH6 PMS2 EPCAM], - 'R242.1 :: Predictive testing - Seq in Leeds - Send Blood'=> %w[MLH1 MSH2 MSH6 PMS2 EPCAM], - 'R242.1 :: Predictive testing - Seq in Leeds - Send DNA'=> %w[MLH1 MSH2 MSH6 PMS2 EPCAM] + #'R242.1 :: Predictive testing - MLPA in Leeds - Send Blood'=> %w[MLH1 MSH2 MSH6 PMS2 EPCAM], + #'R242.1 :: Predictive testing - MLPA in Leeds - Send DNA'=> %w[MLH1 MSH2 MSH6 PMS2 EPCAM], + #'R242.1 :: Predictive testing - Seq in Leeds - Send Blood'=> %w[MLH1 MSH2 MSH6 PMS2 EPCAM], + #'R242.1 :: Predictive testing - Seq in Leeds - Send DNA'=> %w[MLH1 MSH2 MSH6 PMS2 EPCAM], + 'R240 :: Diagnostic testing for known pathogenic variant(s) - Hereditary Cancers' => %w[MLH1 MSH2 MSH6 PMS2 EPCAM], + 'R242 :: Predictive testing for known familial pathogenic variant(s) - Hereditary Cancers' => %w[MLH1 MSH2 MSH6 PMS2 EPCAM], + 'R448.1 :: Sequence analysis - Sanger in Newcastle' => %w[MLH1 MSH2 MSH6 PMS2 EPCAM] }.freeze R210_PANEL_GENE_MAPPING_MOL = { @@ -140,7 +147,8 @@ module Constants 'R211.1 :: Small Panel in Leeds' => %w[APC BMPR1A EPCAM MLH1 MSH2 MSH6 MUTYH NTHL1 PMS2 POLD1 POLE PTEN RNF43 SMAD4 STK11], 'R211.1 :: Small panel in Leeds - send DNA sample'=> %w[APC BMPR1A EPCAM MLH1 MSH2 MSH6 MUTYH NTHL1 PMS2 POLD1 POLE PTEN RNF43 SMAD4 STK11], 'R211.1 :: APC and MUTYH genes in Leeds' => %w[APC MUTYH], - 'R211.2 :: Unknown mutation(s) by MLPA or equivalent' => %w[APC MUTYH] + 'R211.2 :: Unknown mutation(s) by MLPA or equivalent' => %w[APC MUTYH], + 'R246.1 :: Small panel Carrier testing of partners at population risk' => %w[], }.freeze R211_PANEL_GENE_MAPPING_TAR = { @@ -149,7 +157,9 @@ module Constants 'R242.1 :: Predictive testing' => %w[APC BMPR1A EPCAM MLH1 MSH2 MSH6 MUTYH NTHL1 PMS2 POLD1 POLE PTEN RNF43 SMAD4 STK11], 'R242.1 :: Predictive testing - Seq in Leeds - Send Blood' => %w[APC BMPR1A EPCAM MLH1 MSH2 MSH6 MUTYH NTHL1 PMS2 POLD1 POLE PTEN RNF43 SMAD4 STK11], 'R242.1 :: Predictive testing - Seq in Leeds - Analysis only'=> %w[APC BMPR1A EPCAM MLH1 MSH2 MSH6 MUTYH NTHL1 PMS2 POLD1 POLE PTEN RNF43 SMAD4 STK11], - 'R242.1 :: Predictive testing - Seq in Leeds - Send DNA'=> %w[APC BMPR1A EPCAM MLH1 MSH2 MSH6 MUTYH NTHL1 PMS2 POLD1 POLE PTEN RNF43 SMAD4 STK11] + 'R242.1 :: Predictive testing - Seq in Leeds - Send DNA'=> %w[APC BMPR1A EPCAM MLH1 MSH2 MSH6 MUTYH NTHL1 PMS2 POLD1 POLE PTEN RNF43 SMAD4 STK11], + 'R242.1 :: Predictive testing - Seq in Leeds' => %w[APC BMPR1A EPCAM MLH1 MSH2 MSH6 MUTYH NTHL1 PMS2 POLD1 POLE PTEN RNF43 SMAD4 STK11], + 'R242 :: Predictive testing for known familial pathogenic variant(s) - Hereditary Cancers' => %w[APC BMPR1A EPCAM MLH1 MSH2 MSH6 MUTYH NTHL1 PMS2 POLD1 POLE PTEN RNF43 SMAD4 STK11] }.freeze R211_PANEL_GENE_MAPPING_MOL = { @@ -157,6 +167,10 @@ module Constants 'R244.1 :: Carrier testing' => %w[MUTYH] }.freeze + R216_PANEL_GENE_MAPPING_FS = { + 'R216.1 :: TP53 NGS in Leeds Analysis only' => %w[TP53] + } + FAP_PANEL_GENE_MAPPING_MOL = { 'APC gene MLPA' => %w[APC], 'APC gene sequencing' => %w[APC], @@ -192,6 +206,7 @@ module Constants PTEN RAD51C RAD51D STK11 TP53 PMS2] }.freeze + MOLECULAR_SCOPE_MAPPING = { 'carrier testing' => :no_genetictestscope, 'confirmation of familial mutation' => :targeted_mutation, From 6e4cd7fbacb8f3eaee6116006f5f4d424ef581cf Mon Sep 17 00:00:00 2001 From: NImeson Date: Wed, 18 Mar 2026 17:21:06 +0000 Subject: [PATCH 02/10] added new logic for assigning mtesttype from r code --- .../sheffield/sheffield_handler_colorectal.rb | 29 +++++++++++++++++-- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/lib/import/colorectal/providers/sheffield/sheffield_handler_colorectal.rb b/lib/import/colorectal/providers/sheffield/sheffield_handler_colorectal.rb index 9f872559..de59e42a 100644 --- a/lib/import/colorectal/providers/sheffield/sheffield_handler_colorectal.rb +++ b/lib/import/colorectal/providers/sheffield/sheffield_handler_colorectal.rb @@ -198,10 +198,33 @@ def process_scope_colo_ovarian_panel(karyo, genocolorectal, _moleculartestingtyp end def add_test_type(genocolorectal, record) - moltestingtype = record.raw_fields['moleculartestingtype'] + karyo = record.raw_fields['karyotypingmethod'].strip + moleculartestingtype = record.raw_fields['moleculartestingtype'].strip + + test_type = determine_test_type(moleculartestingtype, karyo) + genocolorectal.add_molecular_testing_type_strict(test_type) if test_type + end - genocolorectal.add_molecular_testing_type_strict(TEST_TYPE_MAPPING_COLO[moltestingtype. - downcase]) + def determine_test_type(moleculartestingtype, karyo) + # First priority: moleculartestingtype + return TEST_TYPE_MAPPING_COLO[moleculartestingtype] if TEST_TYPE_MAPPING_COLO.key?(moleculartestingtype) + return :predictive if moleculartestingtype.match?(/unaffected/i) + + # Second priority: karyo R-number patterns + test_type_from_karyo(karyo) + end + + def test_type_from_karyo(karyo) + case karyo + when /^R(240|205|206|207|208|209|210|211|430|444|216|414|370)/ + :diagnostic + when /^R242/ + :predictive + when /^R(244|246)/ + :carrier + when /^R448/ + :prenatal + end end def process_variants_from_record(genocolorectal, record) From 08b5621225266dde1b238cc3f2dd3b7ea9ad2214 Mon Sep 17 00:00:00 2001 From: NImeson Date: Thu, 19 Mar 2026 13:05:32 +0000 Subject: [PATCH 03/10] added tests for new moleculartestingtype logic --- .../sheffield/sheffield_handler_colorectal.rb | 2 +- .../sheffield_handler_colorectal_test.rb | 40 +++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/lib/import/colorectal/providers/sheffield/sheffield_handler_colorectal.rb b/lib/import/colorectal/providers/sheffield/sheffield_handler_colorectal.rb index de59e42a..910469fb 100644 --- a/lib/import/colorectal/providers/sheffield/sheffield_handler_colorectal.rb +++ b/lib/import/colorectal/providers/sheffield/sheffield_handler_colorectal.rb @@ -199,7 +199,7 @@ def process_scope_colo_ovarian_panel(karyo, genocolorectal, _moleculartestingtyp def add_test_type(genocolorectal, record) karyo = record.raw_fields['karyotypingmethod'].strip - moleculartestingtype = record.raw_fields['moleculartestingtype'].strip + moleculartestingtype = record.raw_fields['moleculartestingtype'].strip.downcase test_type = determine_test_type(moleculartestingtype, karyo) genocolorectal.add_molecular_testing_type_strict(test_type) if test_type diff --git a/test/lib/import/colorectal/providers/sheffield/sheffield_handler_colorectal_test.rb b/test/lib/import/colorectal/providers/sheffield/sheffield_handler_colorectal_test.rb index 64e07720..86bc1a5c 100644 --- a/test/lib/import/colorectal/providers/sheffield/sheffield_handler_colorectal_test.rb +++ b/test/lib/import/colorectal/providers/sheffield/sheffield_handler_colorectal_test.rb @@ -31,6 +31,46 @@ def setup assert_equal 'Unable to assign Colorectal Lynch or MMR genetictestscope', @genotype.attribute_map['genetictestscope'] end + test 'add_moltestingtype_from_mapping' do + diagnostic_record = build_raw_record('pseudo_id1' => 'bob') + diagnostic_record.raw_fields['moleculartestingtype'] = 'Confirmation of Familial Mutation' + @handler.add_test_type(@genotype, diagnostic_record) + assert_equal 1, @genotype.attribute_map['moleculartestingtype'] #diagnostic + predictive_record = build_raw_record('pseudo_id1' => 'bob') + predictive_record.raw_fields['moleculartestingtype'] = 'Family Studies' + @handler.add_test_type(@genotype, predictive_record) + assert_equal 2, @genotype.attribute_map['moleculartestingtype'] #predictive + end + + test 'add_moltestingtype_from_karyo' do + diagnostic_record = build_raw_record('pseudo_id1' => 'bob') + diagnostic_record.raw_fields['moleculartestingtype'] = 'cabbage' + diagnostic_record.raw_fields['karyotypingmethod'] = 'R210.2 :: Small panel in Leeds' + @handler.add_test_type(@genotype, diagnostic_record) + assert_equal 1, @genotype.attribute_map['moleculartestingtype'] #diagnostic + predictive_record = build_raw_record('pseudo_id1' => 'bob') + predictive_record.raw_fields['moleculartestingtype'] = 'cabbage' + predictive_record.raw_fields['karyotypingmethod'] = 'R242 :: Predictive testing for known familial pathogenic variant(s) - Hereditary Cancers' + @handler.add_test_type(@genotype, predictive_record) + assert_equal 2, @genotype.attribute_map['moleculartestingtype'] #predictive + carrier_record = build_raw_record('pseudo_id1' => 'bob') + carrier_record.raw_fields['moleculartestingtype'] = 'cabbage' + carrier_record.raw_fields['karyotypingmethod'] = 'R246.1 :: Small panel Carrier testing of partners at population risk' + @handler.add_test_type(@genotype, carrier_record) + assert_equal 3, @genotype.attribute_map['moleculartestingtype'] #carrier + end + + test 'add_moletestingtype_from_mapping_as_priority' do + #priority should be given to moleculartestingtype field over karyotypingmethod field + diagnostic_record = build_raw_record('pseudo_id1' => 'bob') + diagnostic_record.raw_fields['moleculartestingtype'] = 'Diagnostic testing for known mutation' + diagnostic_record.raw_fields['karyotypingmethod'] = 'R242 :: Predictive testing for known familial pathogenic variant(s) - Hereditary Cancers' + @handler.add_test_type(@genotype, diagnostic_record) + assert_equal 1, @genotype.attribute_map['moleculartestingtype'] + end + + + test 'add_colorectal_from_raw_test_full_screen' do @handler.add_test_scope_from_geno_karyo(@genotype, @record) raw_test = @handler.process_variants_from_record(@genotype, @record) From 00aafd84291089e7cddf17022fcf4e5f642d9c63 Mon Sep 17 00:00:00 2001 From: NImeson Date: Fri, 20 Mar 2026 10:08:05 +0000 Subject: [PATCH 04/10] added tests for R240 and R242 wildcard entries --- .../sheffield_handler_colorectal_test.rb | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/test/lib/import/colorectal/providers/sheffield/sheffield_handler_colorectal_test.rb b/test/lib/import/colorectal/providers/sheffield/sheffield_handler_colorectal_test.rb index 86bc1a5c..f5cf7f22 100644 --- a/test/lib/import/colorectal/providers/sheffield/sheffield_handler_colorectal_test.rb +++ b/test/lib/import/colorectal/providers/sheffield/sheffield_handler_colorectal_test.rb @@ -249,6 +249,42 @@ def setup assert_equal 2804, genocolorectals[0].attribute_map['gene'] end + test 'process_targeted_diagnostic_familial_r240' do + diag_fam_record = build_raw_record('pseudo_id1' => 'bob') + diag_fam_record.raw_fields['genetictestscope'] = 'R210' + diag_fam_record.raw_fields['karyotypingmethod'] = 'R240.1 :: Diagnostic familial - MLPA in Leeds - Send Blood' + diag_fam_record.raw_fields['genotype'] = 'MSH2-c.1234_5678del-p.(Gln321fs)-Heterozygous-UV5' + @handler.add_test_scope_from_geno_karyo(@genotype, diag_fam_record) + @handler.add_test_type(@genotype, diag_fam_record) + genocolorectals = @handler.process_variants_from_record(@genotype, diag_fam_record) + assert_equal 1, genocolorectals.size + assert_equal 'Targeted Colorectal Lynch or MMR', @genotype.attribute_map['genetictestscope'] + assert_equal 1, @genotype.attribute_map['moleculartestingtype'] + assert_equal 2, genocolorectals[0].attribute_map['teststatus'] + assert_equal 2804, genocolorectals[0].attribute_map['gene'] + assert_equal 'p.Gln321fs', genocolorectals[0].attribute_map['proteinimpact'] + assert_equal 'c.1234_5678del', genocolorectals[0].attribute_map['codingdnasequencechange'] + end + + test 'process_targeted_predictive_testing_r242' do + predictive_record = build_raw_record('pseudo_id1' => 'bob') + predictive_record.raw_fields['genetictestscope'] = 'R210' + predictive_record.raw_fields['karyotypingmethod'] = 'R242 :: Predictive testing for known familial pathogenic variant(s) - Hereditary Cancers' + predictive_record.raw_fields['genotype'] = 'MSH2-c.1234_5678del-p.(Gln321fs)-Heterozygous-UV5' + predictive_record.raw_fields['moleculartestingtype'] = 'cabbage' + @handler.add_test_scope_from_geno_karyo(@genotype, predictive_record) + #get moleculartestingtype from karyo (priority 2) + @handler.add_test_type(@genotype, predictive_record) + genocolorectals = @handler.process_variants_from_record(@genotype, predictive_record) + assert_equal 1, genocolorectals.size + assert_equal 'Targeted Colorectal Lynch or MMR', @genotype.attribute_map['genetictestscope'] + assert_equal 2, @genotype.attribute_map['moleculartestingtype'] + assert_equal 2, genocolorectals[0].attribute_map['teststatus'] + assert_equal 2804, genocolorectals[0].attribute_map['gene'] + assert_equal 'p.Gln321fs', genocolorectals[0].attribute_map['proteinimpact'] + assert_equal 'c.1234_5678del', genocolorectals[0].attribute_map['codingdnasequencechange'] + end + test 'process_cdna_change' do @logger.expects(:debug).with('SUCCESSFUL cdna change parse for: 1653dup') @handler.process_cdna_change(@genotype, @record.raw_fields['genotype']) From f2d58c1041c1b3e0a37fcf3bee3326768d74e4f1 Mon Sep 17 00:00:00 2001 From: NImeson Date: Fri, 20 Mar 2026 10:24:10 +0000 Subject: [PATCH 05/10] rubocop whitespace/convention improvements --- .../sheffield/sheffield_handler_colorectal.rb | 30 +++++++-------- .../colorectal/providers/rcu/constants.rb | 17 +++++---- .../sheffield_handler_colorectal_test.rb | 38 +++++++++---------- 3 files changed, 41 insertions(+), 44 deletions(-) diff --git a/lib/import/colorectal/providers/sheffield/sheffield_handler_colorectal.rb b/lib/import/colorectal/providers/sheffield/sheffield_handler_colorectal.rb index 910469fb..2077ff99 100644 --- a/lib/import/colorectal/providers/sheffield/sheffield_handler_colorectal.rb +++ b/lib/import/colorectal/providers/sheffield/sheffield_handler_colorectal.rb @@ -33,7 +33,7 @@ def add_test_scope_from_geno_karyo(genocolorectal, record) karyo = record.raw_fields['karyotypingmethod'].strip moleculartestingtype = record.raw_fields['moleculartestingtype'].strip if genotype_str.downcase.match(/r211\s::\sinherited\spolyposis\sand\searly\sonset\scolorectal\scancer/) - genotype_str="r211 :: inherited polyposis and early onset colorectal cancer, germline testing" + genotype_str = 'r211 :: inherited polyposis and early onset colorectal cancer, germline testing' end process_method = GENETICTESTSCOPE_METHOD_MAPPING[genotype_str.downcase] if process_method @@ -77,9 +77,9 @@ def process_scope_r209(karyo, genocolorectal, _moleculartestingtype) def process_scope_r210(karyo, genocolorectal, moleculartestingtype) if karyo.downcase.match(/r240.1\s::\sdiagnostic\sfamilial/) - karyo='R240.1 :: Diagnostic familial' + karyo = 'R240.1 :: Diagnostic familial' elsif karyo.downcase.match(/r242.1\s::\spredictive\stesting/) - karyo='R242.1 :: Predictive testing' + karyo = 'R242.1 :: Predictive testing' end if R210_PANEL_GENE_MAPPING_FS.keys.include? karyo @logger.debug "ADDED FULL_SCREEN TEST for: #{karyo}" @@ -99,7 +99,7 @@ def process_scope_r210(karyo, genocolorectal, moleculartestingtype) def process_scope_r211(karyo, genocolorectal, moleculartestingtype) if karyo.downcase.match(/r211.1\s::\ssmall\spanel\sin\sleeds.*send\sdna\ssample/) - karyo='R211.1 :: Small panel in Leeds - send DNA sample' + karyo = 'R211.1 :: Small panel in Leeds - send DNA sample' end if R211_PANEL_GENE_MAPPING_FS.keys.include? karyo @logger.debug "ADDED FULL_SCREEN TEST for: #{karyo}" @@ -117,8 +117,7 @@ def process_scope_r211(karyo, genocolorectal, moleculartestingtype) end end - - def process_scope_r414(karyo, genocolorectal, moleculartestingtype) + def process_scope_r414(karyo, genocolorectal, _moleculartestingtype) if R414_PANEL_GENE_MAPPING_FS.keys.include? karyo @logger.debug "ADDED FULL_SCREEN TEST for: #{karyo}" genocolorectal.add_test_scope(:full_screen) @@ -128,7 +127,7 @@ def process_scope_r414(karyo, genocolorectal, moleculartestingtype) end end - def process_scope_r216(karyo, genocolorectal, moleculartestingtype) + def process_scope_r216(karyo, genocolorectal, _moleculartestingtype) if R216_PANEL_GENE_MAPPING_FS.keys.include? karyo @logger.debug "ADDED FULL_SCREEN TEST for: #{karyo}" genocolorectal.add_test_scope(:full_screen) @@ -276,7 +275,7 @@ def process_fullscreen_records(genocolorectal, record, genocolorectals) def process_targeted_no_scope_records(genocolorectal, record, genocolorectals) genotype_str = record.raw_fields['genotype'] if genotype_str.scan(/fail/i).size.positive? - gene=get_gene(record) + get_gene(record) genocolorectal.add_status(9) genocolorectals.append(genocolorectal) elsif normal?(genotype_str) @@ -286,11 +285,11 @@ def process_targeted_no_scope_records(genocolorectal, record, genocolorectals) elsif only_protein_impact?(genotype_str) process_only_protein_rec(genocolorectal, record, genocolorectals) elsif genotype_str.scan(/^pathogenic\smutation\sdetected/).size.positive? - gene = get_gene(record) + get_gene(record) genocolorectal.add_status(2) genocolorectals.append(genocolorectal) else - gene=get_gene(record) + get_gene(record) genocolorectal.add_status(4) genocolorectals.append(genocolorectal) @@ -312,13 +311,12 @@ def process_normal_targeted(genocolorectal, record, genocolorectals) def process_normal_full_screen(genocolorectal, genocolorectals) negative_genes = @genes_set - if !negative_genes.empty? - add_other_genes_with_status(negative_genes, genocolorectal, genocolorectals, 1) - else + if negative_genes.empty? genocolorectals.append(genocolorectal) + else + add_other_genes_with_status(negative_genes, genocolorectal, genocolorectals, 1) end - - + genocolorectals end @@ -332,7 +330,7 @@ def add_other_genes_with_status(other_genes, genocolorectal, genocolorectals, st genotype_othr.add_gene_location(nil) genocolorectals.append(genotype_othr) end - end + end def positive_cdna?(genotype_string) genotype_string.scan(CDNA_REGEX).size.positive? diff --git a/lib/import/helpers/colorectal/providers/rcu/constants.rb b/lib/import/helpers/colorectal/providers/rcu/constants.rb index 508f3702..c82ed82e 100644 --- a/lib/import/helpers/colorectal/providers/rcu/constants.rb +++ b/lib/import/helpers/colorectal/providers/rcu/constants.rb @@ -54,7 +54,7 @@ module Constants GENETICTESTSCOPE_METHOD_MAPPING = { 'colorectal cancer panel' => :process_scope_colorectal_panel, - 'r209 :: inherited colorectal cancer '\ + 'r209 :: inherited colorectal cancer ' \ '(with or without polyposis)' => :process_scope_r209, 'r210 :: inherited mmr deficiency (lynch syndrome)' => :process_scope_r210, 'r210' => :process_scope_r210, @@ -129,10 +129,10 @@ module Constants 'R240.1 :: Diagnostic familial' => %w[MLH1 MSH2 MSH6 PMS2 EPCAM], 'R242.1 :: Predictive MLPA' => %w[MLH1 MSH2 EPCAM], 'R242.1 :: Predictive testing' => %w[MLH1 MSH2 MSH6 PMS2 EPCAM], - #'R242.1 :: Predictive testing - MLPA in Leeds - Send Blood'=> %w[MLH1 MSH2 MSH6 PMS2 EPCAM], - #'R242.1 :: Predictive testing - MLPA in Leeds - Send DNA'=> %w[MLH1 MSH2 MSH6 PMS2 EPCAM], - #'R242.1 :: Predictive testing - Seq in Leeds - Send Blood'=> %w[MLH1 MSH2 MSH6 PMS2 EPCAM], - #'R242.1 :: Predictive testing - Seq in Leeds - Send DNA'=> %w[MLH1 MSH2 MSH6 PMS2 EPCAM], + # 'R242.1 :: Predictive testing - MLPA in Leeds - Send Blood'=> %w[MLH1 MSH2 MSH6 PMS2 EPCAM], + # 'R242.1 :: Predictive testing - MLPA in Leeds - Send DNA'=> %w[MLH1 MSH2 MSH6 PMS2 EPCAM], + # 'R242.1 :: Predictive testing - Seq in Leeds - Send Blood'=> %w[MLH1 MSH2 MSH6 PMS2 EPCAM], + # 'R242.1 :: Predictive testing - Seq in Leeds - Send DNA'=> %w[MLH1 MSH2 MSH6 PMS2 EPCAM], 'R240 :: Diagnostic testing for known pathogenic variant(s) - Hereditary Cancers' => %w[MLH1 MSH2 MSH6 PMS2 EPCAM], 'R242 :: Predictive testing for known familial pathogenic variant(s) - Hereditary Cancers' => %w[MLH1 MSH2 MSH6 PMS2 EPCAM], 'R448.1 :: Sequence analysis - Sanger in Newcastle' => %w[MLH1 MSH2 MSH6 PMS2 EPCAM] @@ -148,7 +148,7 @@ module Constants 'R211.1 :: Small panel in Leeds - send DNA sample'=> %w[APC BMPR1A EPCAM MLH1 MSH2 MSH6 MUTYH NTHL1 PMS2 POLD1 POLE PTEN RNF43 SMAD4 STK11], 'R211.1 :: APC and MUTYH genes in Leeds' => %w[APC MUTYH], 'R211.2 :: Unknown mutation(s) by MLPA or equivalent' => %w[APC MUTYH], - 'R246.1 :: Small panel Carrier testing of partners at population risk' => %w[], + 'R246.1 :: Small panel Carrier testing of partners at population risk' => %w[] }.freeze R211_PANEL_GENE_MAPPING_TAR = { @@ -159,7 +159,8 @@ module Constants 'R242.1 :: Predictive testing - Seq in Leeds - Analysis only'=> %w[APC BMPR1A EPCAM MLH1 MSH2 MSH6 MUTYH NTHL1 PMS2 POLD1 POLE PTEN RNF43 SMAD4 STK11], 'R242.1 :: Predictive testing - Seq in Leeds - Send DNA'=> %w[APC BMPR1A EPCAM MLH1 MSH2 MSH6 MUTYH NTHL1 PMS2 POLD1 POLE PTEN RNF43 SMAD4 STK11], 'R242.1 :: Predictive testing - Seq in Leeds' => %w[APC BMPR1A EPCAM MLH1 MSH2 MSH6 MUTYH NTHL1 PMS2 POLD1 POLE PTEN RNF43 SMAD4 STK11], - 'R242 :: Predictive testing for known familial pathogenic variant(s) - Hereditary Cancers' => %w[APC BMPR1A EPCAM MLH1 MSH2 MSH6 MUTYH NTHL1 PMS2 POLD1 POLE PTEN RNF43 SMAD4 STK11] + 'R242 :: Predictive testing for known familial pathogenic variant(s) - Hereditary Cancers' => %w[APC BMPR1A EPCAM MLH1 MSH2 MSH6 MUTYH NTHL1 + PMS2 POLD1 POLE PTEN RNF43 SMAD4 STK11] }.freeze R211_PANEL_GENE_MAPPING_MOL = { @@ -169,7 +170,7 @@ module Constants R216_PANEL_GENE_MAPPING_FS = { 'R216.1 :: TP53 NGS in Leeds Analysis only' => %w[TP53] - } + }.freeze FAP_PANEL_GENE_MAPPING_MOL = { 'APC gene MLPA' => %w[APC], diff --git a/test/lib/import/colorectal/providers/sheffield/sheffield_handler_colorectal_test.rb b/test/lib/import/colorectal/providers/sheffield/sheffield_handler_colorectal_test.rb index f5cf7f22..faeb23fd 100644 --- a/test/lib/import/colorectal/providers/sheffield/sheffield_handler_colorectal_test.rb +++ b/test/lib/import/colorectal/providers/sheffield/sheffield_handler_colorectal_test.rb @@ -31,45 +31,43 @@ def setup assert_equal 'Unable to assign Colorectal Lynch or MMR genetictestscope', @genotype.attribute_map['genetictestscope'] end - test 'add_moltestingtype_from_mapping' do + test 'add_moltestingtype_from_mapping' do diagnostic_record = build_raw_record('pseudo_id1' => 'bob') diagnostic_record.raw_fields['moleculartestingtype'] = 'Confirmation of Familial Mutation' @handler.add_test_type(@genotype, diagnostic_record) - assert_equal 1, @genotype.attribute_map['moleculartestingtype'] #diagnostic + assert_equal 1, @genotype.attribute_map['moleculartestingtype'] predictive_record = build_raw_record('pseudo_id1' => 'bob') predictive_record.raw_fields['moleculartestingtype'] = 'Family Studies' @handler.add_test_type(@genotype, predictive_record) - assert_equal 2, @genotype.attribute_map['moleculartestingtype'] #predictive - end + assert_equal 2, @genotype.attribute_map['moleculartestingtype'] + end test 'add_moltestingtype_from_karyo' do diagnostic_record = build_raw_record('pseudo_id1' => 'bob') diagnostic_record.raw_fields['moleculartestingtype'] = 'cabbage' diagnostic_record.raw_fields['karyotypingmethod'] = 'R210.2 :: Small panel in Leeds' @handler.add_test_type(@genotype, diagnostic_record) - assert_equal 1, @genotype.attribute_map['moleculartestingtype'] #diagnostic + assert_equal 1, @genotype.attribute_map['moleculartestingtype'] predictive_record = build_raw_record('pseudo_id1' => 'bob') predictive_record.raw_fields['moleculartestingtype'] = 'cabbage' predictive_record.raw_fields['karyotypingmethod'] = 'R242 :: Predictive testing for known familial pathogenic variant(s) - Hereditary Cancers' @handler.add_test_type(@genotype, predictive_record) - assert_equal 2, @genotype.attribute_map['moleculartestingtype'] #predictive + assert_equal 2, @genotype.attribute_map['moleculartestingtype'] carrier_record = build_raw_record('pseudo_id1' => 'bob') carrier_record.raw_fields['moleculartestingtype'] = 'cabbage' carrier_record.raw_fields['karyotypingmethod'] = 'R246.1 :: Small panel Carrier testing of partners at population risk' @handler.add_test_type(@genotype, carrier_record) - assert_equal 3, @genotype.attribute_map['moleculartestingtype'] #carrier - end + assert_equal 3, @genotype.attribute_map['moleculartestingtype'] + end test 'add_moletestingtype_from_mapping_as_priority' do - #priority should be given to moleculartestingtype field over karyotypingmethod field + # priority should be given to moleculartestingtype field over karyotypingmethod field diagnostic_record = build_raw_record('pseudo_id1' => 'bob') diagnostic_record.raw_fields['moleculartestingtype'] = 'Diagnostic testing for known mutation' diagnostic_record.raw_fields['karyotypingmethod'] = 'R242 :: Predictive testing for known familial pathogenic variant(s) - Hereditary Cancers' @handler.add_test_type(@genotype, diagnostic_record) assert_equal 1, @genotype.attribute_map['moleculartestingtype'] - end - - + end test 'add_colorectal_from_raw_test_full_screen' do @handler.add_test_scope_from_geno_karyo(@genotype, @record) @@ -203,7 +201,7 @@ def setup assert_nil genocolorectals[0].attribute_map['gene'] end - test 'process_targeted_no_scope_failure' do + test 'process_targeted_no_scope_failure' do exon_record = build_raw_record('pseudo_id1' => 'bob') exon_record.raw_fields['genetictestscope'] = 'efgh' exon_record.raw_fields['karyotypingmethod'] = 'abcd' @@ -217,7 +215,7 @@ def setup assert_equal 9, genocolorectals[0].attribute_map['teststatus'] end - test 'process_targeted_no_scope_normal' do + test 'process_targeted_no_scope_normal' do exon_record = build_raw_record('pseudo_id1' => 'bob') exon_record.raw_fields['genetictestscope'] = 'efgh' exon_record.raw_fields['karyotypingmethod'] = 'abcd' @@ -233,7 +231,7 @@ def setup assert_nil genocolorectals[0].attribute_map['gene'] end - test 'process_targeted_no_scope_abnormal' do + test 'process_targeted_no_scope_abnormal' do exon_record = build_raw_record('pseudo_id1' => 'bob') exon_record.raw_fields['genetictestscope'] = 'efgh' exon_record.raw_fields['karyotypingmethod'] = 'abcd' @@ -249,7 +247,7 @@ def setup assert_equal 2804, genocolorectals[0].attribute_map['gene'] end - test 'process_targeted_diagnostic_familial_r240' do + test 'process_targeted_diagnostic_familial_r240' do diag_fam_record = build_raw_record('pseudo_id1' => 'bob') diag_fam_record.raw_fields['genetictestscope'] = 'R210' diag_fam_record.raw_fields['karyotypingmethod'] = 'R240.1 :: Diagnostic familial - MLPA in Leeds - Send Blood' @@ -266,14 +264,14 @@ def setup assert_equal 'c.1234_5678del', genocolorectals[0].attribute_map['codingdnasequencechange'] end - test 'process_targeted_predictive_testing_r242' do + test 'process_targeted_predictive_testing_r242' do predictive_record = build_raw_record('pseudo_id1' => 'bob') predictive_record.raw_fields['genetictestscope'] = 'R210' predictive_record.raw_fields['karyotypingmethod'] = 'R242 :: Predictive testing for known familial pathogenic variant(s) - Hereditary Cancers' predictive_record.raw_fields['genotype'] = 'MSH2-c.1234_5678del-p.(Gln321fs)-Heterozygous-UV5' - predictive_record.raw_fields['moleculartestingtype'] = 'cabbage' + predictive_record.raw_fields['moleculartestingtype'] = 'cabbage' @handler.add_test_scope_from_geno_karyo(@genotype, predictive_record) - #get moleculartestingtype from karyo (priority 2) + # get moleculartestingtype from karyo (priority 2) @handler.add_test_type(@genotype, predictive_record) genocolorectals = @handler.process_variants_from_record(@genotype, predictive_record) assert_equal 1, genocolorectals.size @@ -283,7 +281,7 @@ def setup assert_equal 2804, genocolorectals[0].attribute_map['gene'] assert_equal 'p.Gln321fs', genocolorectals[0].attribute_map['proteinimpact'] assert_equal 'c.1234_5678del', genocolorectals[0].attribute_map['codingdnasequencechange'] - end + end test 'process_cdna_change' do @logger.expects(:debug).with('SUCCESSFUL cdna change parse for: 1653dup') From a38c24fe363b5787c936c9ac50dd929356a76e11 Mon Sep 17 00:00:00 2001 From: NImeson Date: Fri, 20 Mar 2026 11:06:03 +0000 Subject: [PATCH 06/10] Revert "rubocop whitespace/convention improvements" This reverts commit f2d58c1041c1b3e0a37fcf3bee3326768d74e4f1. --- .../sheffield/sheffield_handler_colorectal.rb | 30 ++++++++------- .../colorectal/providers/rcu/constants.rb | 17 ++++----- .../sheffield_handler_colorectal_test.rb | 38 ++++++++++--------- 3 files changed, 44 insertions(+), 41 deletions(-) diff --git a/lib/import/colorectal/providers/sheffield/sheffield_handler_colorectal.rb b/lib/import/colorectal/providers/sheffield/sheffield_handler_colorectal.rb index 2077ff99..910469fb 100644 --- a/lib/import/colorectal/providers/sheffield/sheffield_handler_colorectal.rb +++ b/lib/import/colorectal/providers/sheffield/sheffield_handler_colorectal.rb @@ -33,7 +33,7 @@ def add_test_scope_from_geno_karyo(genocolorectal, record) karyo = record.raw_fields['karyotypingmethod'].strip moleculartestingtype = record.raw_fields['moleculartestingtype'].strip if genotype_str.downcase.match(/r211\s::\sinherited\spolyposis\sand\searly\sonset\scolorectal\scancer/) - genotype_str = 'r211 :: inherited polyposis and early onset colorectal cancer, germline testing' + genotype_str="r211 :: inherited polyposis and early onset colorectal cancer, germline testing" end process_method = GENETICTESTSCOPE_METHOD_MAPPING[genotype_str.downcase] if process_method @@ -77,9 +77,9 @@ def process_scope_r209(karyo, genocolorectal, _moleculartestingtype) def process_scope_r210(karyo, genocolorectal, moleculartestingtype) if karyo.downcase.match(/r240.1\s::\sdiagnostic\sfamilial/) - karyo = 'R240.1 :: Diagnostic familial' + karyo='R240.1 :: Diagnostic familial' elsif karyo.downcase.match(/r242.1\s::\spredictive\stesting/) - karyo = 'R242.1 :: Predictive testing' + karyo='R242.1 :: Predictive testing' end if R210_PANEL_GENE_MAPPING_FS.keys.include? karyo @logger.debug "ADDED FULL_SCREEN TEST for: #{karyo}" @@ -99,7 +99,7 @@ def process_scope_r210(karyo, genocolorectal, moleculartestingtype) def process_scope_r211(karyo, genocolorectal, moleculartestingtype) if karyo.downcase.match(/r211.1\s::\ssmall\spanel\sin\sleeds.*send\sdna\ssample/) - karyo = 'R211.1 :: Small panel in Leeds - send DNA sample' + karyo='R211.1 :: Small panel in Leeds - send DNA sample' end if R211_PANEL_GENE_MAPPING_FS.keys.include? karyo @logger.debug "ADDED FULL_SCREEN TEST for: #{karyo}" @@ -117,7 +117,8 @@ def process_scope_r211(karyo, genocolorectal, moleculartestingtype) end end - def process_scope_r414(karyo, genocolorectal, _moleculartestingtype) + + def process_scope_r414(karyo, genocolorectal, moleculartestingtype) if R414_PANEL_GENE_MAPPING_FS.keys.include? karyo @logger.debug "ADDED FULL_SCREEN TEST for: #{karyo}" genocolorectal.add_test_scope(:full_screen) @@ -127,7 +128,7 @@ def process_scope_r414(karyo, genocolorectal, _moleculartestingtype) end end - def process_scope_r216(karyo, genocolorectal, _moleculartestingtype) + def process_scope_r216(karyo, genocolorectal, moleculartestingtype) if R216_PANEL_GENE_MAPPING_FS.keys.include? karyo @logger.debug "ADDED FULL_SCREEN TEST for: #{karyo}" genocolorectal.add_test_scope(:full_screen) @@ -275,7 +276,7 @@ def process_fullscreen_records(genocolorectal, record, genocolorectals) def process_targeted_no_scope_records(genocolorectal, record, genocolorectals) genotype_str = record.raw_fields['genotype'] if genotype_str.scan(/fail/i).size.positive? - get_gene(record) + gene=get_gene(record) genocolorectal.add_status(9) genocolorectals.append(genocolorectal) elsif normal?(genotype_str) @@ -285,11 +286,11 @@ def process_targeted_no_scope_records(genocolorectal, record, genocolorectals) elsif only_protein_impact?(genotype_str) process_only_protein_rec(genocolorectal, record, genocolorectals) elsif genotype_str.scan(/^pathogenic\smutation\sdetected/).size.positive? - get_gene(record) + gene = get_gene(record) genocolorectal.add_status(2) genocolorectals.append(genocolorectal) else - get_gene(record) + gene=get_gene(record) genocolorectal.add_status(4) genocolorectals.append(genocolorectal) @@ -311,12 +312,13 @@ def process_normal_targeted(genocolorectal, record, genocolorectals) def process_normal_full_screen(genocolorectal, genocolorectals) negative_genes = @genes_set - if negative_genes.empty? - genocolorectals.append(genocolorectal) - else + if !negative_genes.empty? add_other_genes_with_status(negative_genes, genocolorectal, genocolorectals, 1) + else + genocolorectals.append(genocolorectal) end - + + genocolorectals end @@ -330,7 +332,7 @@ def add_other_genes_with_status(other_genes, genocolorectal, genocolorectals, st genotype_othr.add_gene_location(nil) genocolorectals.append(genotype_othr) end - end + end def positive_cdna?(genotype_string) genotype_string.scan(CDNA_REGEX).size.positive? diff --git a/lib/import/helpers/colorectal/providers/rcu/constants.rb b/lib/import/helpers/colorectal/providers/rcu/constants.rb index c82ed82e..508f3702 100644 --- a/lib/import/helpers/colorectal/providers/rcu/constants.rb +++ b/lib/import/helpers/colorectal/providers/rcu/constants.rb @@ -54,7 +54,7 @@ module Constants GENETICTESTSCOPE_METHOD_MAPPING = { 'colorectal cancer panel' => :process_scope_colorectal_panel, - 'r209 :: inherited colorectal cancer ' \ + 'r209 :: inherited colorectal cancer '\ '(with or without polyposis)' => :process_scope_r209, 'r210 :: inherited mmr deficiency (lynch syndrome)' => :process_scope_r210, 'r210' => :process_scope_r210, @@ -129,10 +129,10 @@ module Constants 'R240.1 :: Diagnostic familial' => %w[MLH1 MSH2 MSH6 PMS2 EPCAM], 'R242.1 :: Predictive MLPA' => %w[MLH1 MSH2 EPCAM], 'R242.1 :: Predictive testing' => %w[MLH1 MSH2 MSH6 PMS2 EPCAM], - # 'R242.1 :: Predictive testing - MLPA in Leeds - Send Blood'=> %w[MLH1 MSH2 MSH6 PMS2 EPCAM], - # 'R242.1 :: Predictive testing - MLPA in Leeds - Send DNA'=> %w[MLH1 MSH2 MSH6 PMS2 EPCAM], - # 'R242.1 :: Predictive testing - Seq in Leeds - Send Blood'=> %w[MLH1 MSH2 MSH6 PMS2 EPCAM], - # 'R242.1 :: Predictive testing - Seq in Leeds - Send DNA'=> %w[MLH1 MSH2 MSH6 PMS2 EPCAM], + #'R242.1 :: Predictive testing - MLPA in Leeds - Send Blood'=> %w[MLH1 MSH2 MSH6 PMS2 EPCAM], + #'R242.1 :: Predictive testing - MLPA in Leeds - Send DNA'=> %w[MLH1 MSH2 MSH6 PMS2 EPCAM], + #'R242.1 :: Predictive testing - Seq in Leeds - Send Blood'=> %w[MLH1 MSH2 MSH6 PMS2 EPCAM], + #'R242.1 :: Predictive testing - Seq in Leeds - Send DNA'=> %w[MLH1 MSH2 MSH6 PMS2 EPCAM], 'R240 :: Diagnostic testing for known pathogenic variant(s) - Hereditary Cancers' => %w[MLH1 MSH2 MSH6 PMS2 EPCAM], 'R242 :: Predictive testing for known familial pathogenic variant(s) - Hereditary Cancers' => %w[MLH1 MSH2 MSH6 PMS2 EPCAM], 'R448.1 :: Sequence analysis - Sanger in Newcastle' => %w[MLH1 MSH2 MSH6 PMS2 EPCAM] @@ -148,7 +148,7 @@ module Constants 'R211.1 :: Small panel in Leeds - send DNA sample'=> %w[APC BMPR1A EPCAM MLH1 MSH2 MSH6 MUTYH NTHL1 PMS2 POLD1 POLE PTEN RNF43 SMAD4 STK11], 'R211.1 :: APC and MUTYH genes in Leeds' => %w[APC MUTYH], 'R211.2 :: Unknown mutation(s) by MLPA or equivalent' => %w[APC MUTYH], - 'R246.1 :: Small panel Carrier testing of partners at population risk' => %w[] + 'R246.1 :: Small panel Carrier testing of partners at population risk' => %w[], }.freeze R211_PANEL_GENE_MAPPING_TAR = { @@ -159,8 +159,7 @@ module Constants 'R242.1 :: Predictive testing - Seq in Leeds - Analysis only'=> %w[APC BMPR1A EPCAM MLH1 MSH2 MSH6 MUTYH NTHL1 PMS2 POLD1 POLE PTEN RNF43 SMAD4 STK11], 'R242.1 :: Predictive testing - Seq in Leeds - Send DNA'=> %w[APC BMPR1A EPCAM MLH1 MSH2 MSH6 MUTYH NTHL1 PMS2 POLD1 POLE PTEN RNF43 SMAD4 STK11], 'R242.1 :: Predictive testing - Seq in Leeds' => %w[APC BMPR1A EPCAM MLH1 MSH2 MSH6 MUTYH NTHL1 PMS2 POLD1 POLE PTEN RNF43 SMAD4 STK11], - 'R242 :: Predictive testing for known familial pathogenic variant(s) - Hereditary Cancers' => %w[APC BMPR1A EPCAM MLH1 MSH2 MSH6 MUTYH NTHL1 - PMS2 POLD1 POLE PTEN RNF43 SMAD4 STK11] + 'R242 :: Predictive testing for known familial pathogenic variant(s) - Hereditary Cancers' => %w[APC BMPR1A EPCAM MLH1 MSH2 MSH6 MUTYH NTHL1 PMS2 POLD1 POLE PTEN RNF43 SMAD4 STK11] }.freeze R211_PANEL_GENE_MAPPING_MOL = { @@ -170,7 +169,7 @@ module Constants R216_PANEL_GENE_MAPPING_FS = { 'R216.1 :: TP53 NGS in Leeds Analysis only' => %w[TP53] - }.freeze + } FAP_PANEL_GENE_MAPPING_MOL = { 'APC gene MLPA' => %w[APC], diff --git a/test/lib/import/colorectal/providers/sheffield/sheffield_handler_colorectal_test.rb b/test/lib/import/colorectal/providers/sheffield/sheffield_handler_colorectal_test.rb index faeb23fd..f5cf7f22 100644 --- a/test/lib/import/colorectal/providers/sheffield/sheffield_handler_colorectal_test.rb +++ b/test/lib/import/colorectal/providers/sheffield/sheffield_handler_colorectal_test.rb @@ -31,43 +31,45 @@ def setup assert_equal 'Unable to assign Colorectal Lynch or MMR genetictestscope', @genotype.attribute_map['genetictestscope'] end - test 'add_moltestingtype_from_mapping' do + test 'add_moltestingtype_from_mapping' do diagnostic_record = build_raw_record('pseudo_id1' => 'bob') diagnostic_record.raw_fields['moleculartestingtype'] = 'Confirmation of Familial Mutation' @handler.add_test_type(@genotype, diagnostic_record) - assert_equal 1, @genotype.attribute_map['moleculartestingtype'] + assert_equal 1, @genotype.attribute_map['moleculartestingtype'] #diagnostic predictive_record = build_raw_record('pseudo_id1' => 'bob') predictive_record.raw_fields['moleculartestingtype'] = 'Family Studies' @handler.add_test_type(@genotype, predictive_record) - assert_equal 2, @genotype.attribute_map['moleculartestingtype'] - end + assert_equal 2, @genotype.attribute_map['moleculartestingtype'] #predictive + end test 'add_moltestingtype_from_karyo' do diagnostic_record = build_raw_record('pseudo_id1' => 'bob') diagnostic_record.raw_fields['moleculartestingtype'] = 'cabbage' diagnostic_record.raw_fields['karyotypingmethod'] = 'R210.2 :: Small panel in Leeds' @handler.add_test_type(@genotype, diagnostic_record) - assert_equal 1, @genotype.attribute_map['moleculartestingtype'] + assert_equal 1, @genotype.attribute_map['moleculartestingtype'] #diagnostic predictive_record = build_raw_record('pseudo_id1' => 'bob') predictive_record.raw_fields['moleculartestingtype'] = 'cabbage' predictive_record.raw_fields['karyotypingmethod'] = 'R242 :: Predictive testing for known familial pathogenic variant(s) - Hereditary Cancers' @handler.add_test_type(@genotype, predictive_record) - assert_equal 2, @genotype.attribute_map['moleculartestingtype'] + assert_equal 2, @genotype.attribute_map['moleculartestingtype'] #predictive carrier_record = build_raw_record('pseudo_id1' => 'bob') carrier_record.raw_fields['moleculartestingtype'] = 'cabbage' carrier_record.raw_fields['karyotypingmethod'] = 'R246.1 :: Small panel Carrier testing of partners at population risk' @handler.add_test_type(@genotype, carrier_record) - assert_equal 3, @genotype.attribute_map['moleculartestingtype'] - end + assert_equal 3, @genotype.attribute_map['moleculartestingtype'] #carrier + end test 'add_moletestingtype_from_mapping_as_priority' do - # priority should be given to moleculartestingtype field over karyotypingmethod field + #priority should be given to moleculartestingtype field over karyotypingmethod field diagnostic_record = build_raw_record('pseudo_id1' => 'bob') diagnostic_record.raw_fields['moleculartestingtype'] = 'Diagnostic testing for known mutation' diagnostic_record.raw_fields['karyotypingmethod'] = 'R242 :: Predictive testing for known familial pathogenic variant(s) - Hereditary Cancers' @handler.add_test_type(@genotype, diagnostic_record) assert_equal 1, @genotype.attribute_map['moleculartestingtype'] - end + end + + test 'add_colorectal_from_raw_test_full_screen' do @handler.add_test_scope_from_geno_karyo(@genotype, @record) @@ -201,7 +203,7 @@ def setup assert_nil genocolorectals[0].attribute_map['gene'] end - test 'process_targeted_no_scope_failure' do + test 'process_targeted_no_scope_failure' do exon_record = build_raw_record('pseudo_id1' => 'bob') exon_record.raw_fields['genetictestscope'] = 'efgh' exon_record.raw_fields['karyotypingmethod'] = 'abcd' @@ -215,7 +217,7 @@ def setup assert_equal 9, genocolorectals[0].attribute_map['teststatus'] end - test 'process_targeted_no_scope_normal' do + test 'process_targeted_no_scope_normal' do exon_record = build_raw_record('pseudo_id1' => 'bob') exon_record.raw_fields['genetictestscope'] = 'efgh' exon_record.raw_fields['karyotypingmethod'] = 'abcd' @@ -231,7 +233,7 @@ def setup assert_nil genocolorectals[0].attribute_map['gene'] end - test 'process_targeted_no_scope_abnormal' do + test 'process_targeted_no_scope_abnormal' do exon_record = build_raw_record('pseudo_id1' => 'bob') exon_record.raw_fields['genetictestscope'] = 'efgh' exon_record.raw_fields['karyotypingmethod'] = 'abcd' @@ -247,7 +249,7 @@ def setup assert_equal 2804, genocolorectals[0].attribute_map['gene'] end - test 'process_targeted_diagnostic_familial_r240' do + test 'process_targeted_diagnostic_familial_r240' do diag_fam_record = build_raw_record('pseudo_id1' => 'bob') diag_fam_record.raw_fields['genetictestscope'] = 'R210' diag_fam_record.raw_fields['karyotypingmethod'] = 'R240.1 :: Diagnostic familial - MLPA in Leeds - Send Blood' @@ -264,14 +266,14 @@ def setup assert_equal 'c.1234_5678del', genocolorectals[0].attribute_map['codingdnasequencechange'] end - test 'process_targeted_predictive_testing_r242' do + test 'process_targeted_predictive_testing_r242' do predictive_record = build_raw_record('pseudo_id1' => 'bob') predictive_record.raw_fields['genetictestscope'] = 'R210' predictive_record.raw_fields['karyotypingmethod'] = 'R242 :: Predictive testing for known familial pathogenic variant(s) - Hereditary Cancers' predictive_record.raw_fields['genotype'] = 'MSH2-c.1234_5678del-p.(Gln321fs)-Heterozygous-UV5' - predictive_record.raw_fields['moleculartestingtype'] = 'cabbage' + predictive_record.raw_fields['moleculartestingtype'] = 'cabbage' @handler.add_test_scope_from_geno_karyo(@genotype, predictive_record) - # get moleculartestingtype from karyo (priority 2) + #get moleculartestingtype from karyo (priority 2) @handler.add_test_type(@genotype, predictive_record) genocolorectals = @handler.process_variants_from_record(@genotype, predictive_record) assert_equal 1, genocolorectals.size @@ -281,7 +283,7 @@ def setup assert_equal 2804, genocolorectals[0].attribute_map['gene'] assert_equal 'p.Gln321fs', genocolorectals[0].attribute_map['proteinimpact'] assert_equal 'c.1234_5678del', genocolorectals[0].attribute_map['codingdnasequencechange'] - end + end test 'process_cdna_change' do @logger.expects(:debug).with('SUCCESSFUL cdna change parse for: 1653dup') From f433287f4064ce307136b7566374a266545fa020 Mon Sep 17 00:00:00 2001 From: NImeson Date: Fri, 20 Mar 2026 11:14:50 +0000 Subject: [PATCH 07/10] rolled back some erroneous rubocop changes --- .../sheffield/sheffield_handler_colorectal.rb | 5 +-- .../colorectal/providers/rcu/constants.rb | 11 ++---- .../sheffield_handler_colorectal_test.rb | 38 +++++++++---------- 3 files changed, 24 insertions(+), 30 deletions(-) diff --git a/lib/import/colorectal/providers/sheffield/sheffield_handler_colorectal.rb b/lib/import/colorectal/providers/sheffield/sheffield_handler_colorectal.rb index 910469fb..9e587fe9 100644 --- a/lib/import/colorectal/providers/sheffield/sheffield_handler_colorectal.rb +++ b/lib/import/colorectal/providers/sheffield/sheffield_handler_colorectal.rb @@ -314,11 +314,10 @@ def process_normal_full_screen(genocolorectal, genocolorectals) negative_genes = @genes_set if !negative_genes.empty? add_other_genes_with_status(negative_genes, genocolorectal, genocolorectals, 1) - else + else genocolorectals.append(genocolorectal) end - - + genocolorectals end diff --git a/lib/import/helpers/colorectal/providers/rcu/constants.rb b/lib/import/helpers/colorectal/providers/rcu/constants.rb index 508f3702..714efa67 100644 --- a/lib/import/helpers/colorectal/providers/rcu/constants.rb +++ b/lib/import/helpers/colorectal/providers/rcu/constants.rb @@ -129,10 +129,6 @@ module Constants 'R240.1 :: Diagnostic familial' => %w[MLH1 MSH2 MSH6 PMS2 EPCAM], 'R242.1 :: Predictive MLPA' => %w[MLH1 MSH2 EPCAM], 'R242.1 :: Predictive testing' => %w[MLH1 MSH2 MSH6 PMS2 EPCAM], - #'R242.1 :: Predictive testing - MLPA in Leeds - Send Blood'=> %w[MLH1 MSH2 MSH6 PMS2 EPCAM], - #'R242.1 :: Predictive testing - MLPA in Leeds - Send DNA'=> %w[MLH1 MSH2 MSH6 PMS2 EPCAM], - #'R242.1 :: Predictive testing - Seq in Leeds - Send Blood'=> %w[MLH1 MSH2 MSH6 PMS2 EPCAM], - #'R242.1 :: Predictive testing - Seq in Leeds - Send DNA'=> %w[MLH1 MSH2 MSH6 PMS2 EPCAM], 'R240 :: Diagnostic testing for known pathogenic variant(s) - Hereditary Cancers' => %w[MLH1 MSH2 MSH6 PMS2 EPCAM], 'R242 :: Predictive testing for known familial pathogenic variant(s) - Hereditary Cancers' => %w[MLH1 MSH2 MSH6 PMS2 EPCAM], 'R448.1 :: Sequence analysis - Sanger in Newcastle' => %w[MLH1 MSH2 MSH6 PMS2 EPCAM] @@ -148,7 +144,7 @@ module Constants 'R211.1 :: Small panel in Leeds - send DNA sample'=> %w[APC BMPR1A EPCAM MLH1 MSH2 MSH6 MUTYH NTHL1 PMS2 POLD1 POLE PTEN RNF43 SMAD4 STK11], 'R211.1 :: APC and MUTYH genes in Leeds' => %w[APC MUTYH], 'R211.2 :: Unknown mutation(s) by MLPA or equivalent' => %w[APC MUTYH], - 'R246.1 :: Small panel Carrier testing of partners at population risk' => %w[], + 'R246.1 :: Small panel Carrier testing of partners at population risk' => %w[] }.freeze R211_PANEL_GENE_MAPPING_TAR = { @@ -159,7 +155,8 @@ module Constants 'R242.1 :: Predictive testing - Seq in Leeds - Analysis only'=> %w[APC BMPR1A EPCAM MLH1 MSH2 MSH6 MUTYH NTHL1 PMS2 POLD1 POLE PTEN RNF43 SMAD4 STK11], 'R242.1 :: Predictive testing - Seq in Leeds - Send DNA'=> %w[APC BMPR1A EPCAM MLH1 MSH2 MSH6 MUTYH NTHL1 PMS2 POLD1 POLE PTEN RNF43 SMAD4 STK11], 'R242.1 :: Predictive testing - Seq in Leeds' => %w[APC BMPR1A EPCAM MLH1 MSH2 MSH6 MUTYH NTHL1 PMS2 POLD1 POLE PTEN RNF43 SMAD4 STK11], - 'R242 :: Predictive testing for known familial pathogenic variant(s) - Hereditary Cancers' => %w[APC BMPR1A EPCAM MLH1 MSH2 MSH6 MUTYH NTHL1 PMS2 POLD1 POLE PTEN RNF43 SMAD4 STK11] + 'R242 :: Predictive testing for known familial pathogenic variant(s) - Hereditary Cancers' => %w[APC BMPR1A EPCAM MLH1 MSH2 MSH6 MUTYH NTHL1 + PMS2 POLD1 POLE PTEN RNF43 SMAD4 STK11] }.freeze R211_PANEL_GENE_MAPPING_MOL = { @@ -169,7 +166,7 @@ module Constants R216_PANEL_GENE_MAPPING_FS = { 'R216.1 :: TP53 NGS in Leeds Analysis only' => %w[TP53] - } + }.freeze FAP_PANEL_GENE_MAPPING_MOL = { 'APC gene MLPA' => %w[APC], diff --git a/test/lib/import/colorectal/providers/sheffield/sheffield_handler_colorectal_test.rb b/test/lib/import/colorectal/providers/sheffield/sheffield_handler_colorectal_test.rb index f5cf7f22..faeb23fd 100644 --- a/test/lib/import/colorectal/providers/sheffield/sheffield_handler_colorectal_test.rb +++ b/test/lib/import/colorectal/providers/sheffield/sheffield_handler_colorectal_test.rb @@ -31,45 +31,43 @@ def setup assert_equal 'Unable to assign Colorectal Lynch or MMR genetictestscope', @genotype.attribute_map['genetictestscope'] end - test 'add_moltestingtype_from_mapping' do + test 'add_moltestingtype_from_mapping' do diagnostic_record = build_raw_record('pseudo_id1' => 'bob') diagnostic_record.raw_fields['moleculartestingtype'] = 'Confirmation of Familial Mutation' @handler.add_test_type(@genotype, diagnostic_record) - assert_equal 1, @genotype.attribute_map['moleculartestingtype'] #diagnostic + assert_equal 1, @genotype.attribute_map['moleculartestingtype'] predictive_record = build_raw_record('pseudo_id1' => 'bob') predictive_record.raw_fields['moleculartestingtype'] = 'Family Studies' @handler.add_test_type(@genotype, predictive_record) - assert_equal 2, @genotype.attribute_map['moleculartestingtype'] #predictive - end + assert_equal 2, @genotype.attribute_map['moleculartestingtype'] + end test 'add_moltestingtype_from_karyo' do diagnostic_record = build_raw_record('pseudo_id1' => 'bob') diagnostic_record.raw_fields['moleculartestingtype'] = 'cabbage' diagnostic_record.raw_fields['karyotypingmethod'] = 'R210.2 :: Small panel in Leeds' @handler.add_test_type(@genotype, diagnostic_record) - assert_equal 1, @genotype.attribute_map['moleculartestingtype'] #diagnostic + assert_equal 1, @genotype.attribute_map['moleculartestingtype'] predictive_record = build_raw_record('pseudo_id1' => 'bob') predictive_record.raw_fields['moleculartestingtype'] = 'cabbage' predictive_record.raw_fields['karyotypingmethod'] = 'R242 :: Predictive testing for known familial pathogenic variant(s) - Hereditary Cancers' @handler.add_test_type(@genotype, predictive_record) - assert_equal 2, @genotype.attribute_map['moleculartestingtype'] #predictive + assert_equal 2, @genotype.attribute_map['moleculartestingtype'] carrier_record = build_raw_record('pseudo_id1' => 'bob') carrier_record.raw_fields['moleculartestingtype'] = 'cabbage' carrier_record.raw_fields['karyotypingmethod'] = 'R246.1 :: Small panel Carrier testing of partners at population risk' @handler.add_test_type(@genotype, carrier_record) - assert_equal 3, @genotype.attribute_map['moleculartestingtype'] #carrier - end + assert_equal 3, @genotype.attribute_map['moleculartestingtype'] + end test 'add_moletestingtype_from_mapping_as_priority' do - #priority should be given to moleculartestingtype field over karyotypingmethod field + # priority should be given to moleculartestingtype field over karyotypingmethod field diagnostic_record = build_raw_record('pseudo_id1' => 'bob') diagnostic_record.raw_fields['moleculartestingtype'] = 'Diagnostic testing for known mutation' diagnostic_record.raw_fields['karyotypingmethod'] = 'R242 :: Predictive testing for known familial pathogenic variant(s) - Hereditary Cancers' @handler.add_test_type(@genotype, diagnostic_record) assert_equal 1, @genotype.attribute_map['moleculartestingtype'] - end - - + end test 'add_colorectal_from_raw_test_full_screen' do @handler.add_test_scope_from_geno_karyo(@genotype, @record) @@ -203,7 +201,7 @@ def setup assert_nil genocolorectals[0].attribute_map['gene'] end - test 'process_targeted_no_scope_failure' do + test 'process_targeted_no_scope_failure' do exon_record = build_raw_record('pseudo_id1' => 'bob') exon_record.raw_fields['genetictestscope'] = 'efgh' exon_record.raw_fields['karyotypingmethod'] = 'abcd' @@ -217,7 +215,7 @@ def setup assert_equal 9, genocolorectals[0].attribute_map['teststatus'] end - test 'process_targeted_no_scope_normal' do + test 'process_targeted_no_scope_normal' do exon_record = build_raw_record('pseudo_id1' => 'bob') exon_record.raw_fields['genetictestscope'] = 'efgh' exon_record.raw_fields['karyotypingmethod'] = 'abcd' @@ -233,7 +231,7 @@ def setup assert_nil genocolorectals[0].attribute_map['gene'] end - test 'process_targeted_no_scope_abnormal' do + test 'process_targeted_no_scope_abnormal' do exon_record = build_raw_record('pseudo_id1' => 'bob') exon_record.raw_fields['genetictestscope'] = 'efgh' exon_record.raw_fields['karyotypingmethod'] = 'abcd' @@ -249,7 +247,7 @@ def setup assert_equal 2804, genocolorectals[0].attribute_map['gene'] end - test 'process_targeted_diagnostic_familial_r240' do + test 'process_targeted_diagnostic_familial_r240' do diag_fam_record = build_raw_record('pseudo_id1' => 'bob') diag_fam_record.raw_fields['genetictestscope'] = 'R210' diag_fam_record.raw_fields['karyotypingmethod'] = 'R240.1 :: Diagnostic familial - MLPA in Leeds - Send Blood' @@ -266,14 +264,14 @@ def setup assert_equal 'c.1234_5678del', genocolorectals[0].attribute_map['codingdnasequencechange'] end - test 'process_targeted_predictive_testing_r242' do + test 'process_targeted_predictive_testing_r242' do predictive_record = build_raw_record('pseudo_id1' => 'bob') predictive_record.raw_fields['genetictestscope'] = 'R210' predictive_record.raw_fields['karyotypingmethod'] = 'R242 :: Predictive testing for known familial pathogenic variant(s) - Hereditary Cancers' predictive_record.raw_fields['genotype'] = 'MSH2-c.1234_5678del-p.(Gln321fs)-Heterozygous-UV5' - predictive_record.raw_fields['moleculartestingtype'] = 'cabbage' + predictive_record.raw_fields['moleculartestingtype'] = 'cabbage' @handler.add_test_scope_from_geno_karyo(@genotype, predictive_record) - #get moleculartestingtype from karyo (priority 2) + # get moleculartestingtype from karyo (priority 2) @handler.add_test_type(@genotype, predictive_record) genocolorectals = @handler.process_variants_from_record(@genotype, predictive_record) assert_equal 1, genocolorectals.size @@ -283,7 +281,7 @@ def setup assert_equal 2804, genocolorectals[0].attribute_map['gene'] assert_equal 'p.Gln321fs', genocolorectals[0].attribute_map['proteinimpact'] assert_equal 'c.1234_5678del', genocolorectals[0].attribute_map['codingdnasequencechange'] - end + end test 'process_cdna_change' do @logger.expects(:debug).with('SUCCESSFUL cdna change parse for: 1653dup') From 8e51594aacd26b56e69f76712e5210a47d001f4d Mon Sep 17 00:00:00 2001 From: NImeson Date: Fri, 20 Mar 2026 11:44:13 +0000 Subject: [PATCH 08/10] remoed R216 Li Fraumeni from non_crc_genetic_testscope --- lib/import/helpers/colorectal/providers/rcu/constants.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/import/helpers/colorectal/providers/rcu/constants.rb b/lib/import/helpers/colorectal/providers/rcu/constants.rb index 714efa67..d3e08956 100644 --- a/lib/import/helpers/colorectal/providers/rcu/constants.rb +++ b/lib/import/helpers/colorectal/providers/rcu/constants.rb @@ -48,8 +48,7 @@ module Constants 'r218 :: multiple endocrine neoplasia type 2', 'r365 :: fumarate hydratase-related tumour syndromes - sdgs', 'r240 - familial diagnostic testing - hered cancers', - 'r206 :: inherited breast cancer and ovarian cancer at high familial risk levels', - 'r216 :: li fraumeni syndrome - sdgs' + 'r206 :: inherited breast cancer and ovarian cancer at high familial risk levels' ].freeze GENETICTESTSCOPE_METHOD_MAPPING = { @@ -67,7 +66,7 @@ module Constants 'breast ovarian & colorectal cancer panel' => :process_scope_colo_ovarian_panel, 'r211 :: inherited polyposis and early onset colorectal cancer, germline testing'=> :process_scope_r211, 'r414 :: apc associated polyposis'=> :process_scope_r414, - 'R216 :: Li Fraumeni Syndrome - SDGS' => :process_scope_r216 + 'r216 :: Li Fraumeni Syndrome - SDGS' => :process_scope_r216 }.freeze COLO_PANEL_GENE_MAPPING_FS = { From 3e9ed10c9411a8152a713426a6c182af43d2f542 Mon Sep 17 00:00:00 2001 From: NImeson Date: Fri, 20 Mar 2026 12:15:13 +0000 Subject: [PATCH 09/10] corrected case on R216 --- lib/import/helpers/colorectal/providers/rcu/constants.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/import/helpers/colorectal/providers/rcu/constants.rb b/lib/import/helpers/colorectal/providers/rcu/constants.rb index d3e08956..78cd0e91 100644 --- a/lib/import/helpers/colorectal/providers/rcu/constants.rb +++ b/lib/import/helpers/colorectal/providers/rcu/constants.rb @@ -66,7 +66,7 @@ module Constants 'breast ovarian & colorectal cancer panel' => :process_scope_colo_ovarian_panel, 'r211 :: inherited polyposis and early onset colorectal cancer, germline testing'=> :process_scope_r211, 'r414 :: apc associated polyposis'=> :process_scope_r414, - 'r216 :: Li Fraumeni Syndrome - SDGS' => :process_scope_r216 + 'r216 :: li fraumeni syndrome - sdgs' => :process_scope_r216 }.freeze COLO_PANEL_GENE_MAPPING_FS = { From fd7f0458a44a18a0d34ea8af12d0fbbd6c20ff5d Mon Sep 17 00:00:00 2001 From: NImeson Date: Fri, 20 Mar 2026 15:04:55 +0000 Subject: [PATCH 10/10] Added scope assignment test for R211 an R216 --- .../sheffield_handler_colorectal_test.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/lib/import/colorectal/providers/sheffield/sheffield_handler_colorectal_test.rb b/test/lib/import/colorectal/providers/sheffield/sheffield_handler_colorectal_test.rb index faeb23fd..a5ee62e7 100644 --- a/test/lib/import/colorectal/providers/sheffield/sheffield_handler_colorectal_test.rb +++ b/test/lib/import/colorectal/providers/sheffield/sheffield_handler_colorectal_test.rb @@ -23,6 +23,22 @@ def setup assert_equal 'Targeted Colorectal Lynch or MMR', @genotype.attribute_map['genetictestscope'] end + test 'add_test_scope_from_fs_r211' do + r211_fs_record = build_raw_record('pseudo_id1' => 'bob') + r211_fs_record.raw_fields['genetictestscope'] = 'R211' + r211_fs_record.raw_fields['karyotypingmethod'] = 'R211.1 :: Small panel in Leeds - send DNA sample' + @handler.add_test_scope_from_geno_karyo(@genotype, r211_fs_record) + assert_equal 'Full screen Colorectal Lynch or MMR', @genotype.attribute_map['genetictestscope'] + end + + test 'add_test_scope_from_fs_r216' do + r216_fs_record = build_raw_record('pseudo_id1' => 'bob') + r216_fs_record.raw_fields['genetictestscope'] = 'R216 :: Li Fraumeni Syndrome - SDGS' + r216_fs_record.raw_fields['karyotypingmethod'] = 'R216.1 :: TP53 NGS in Leeds Analysis only' + @handler.add_test_scope_from_geno_karyo(@genotype, r216_fs_record) + assert_equal 'Full screen Colorectal Lynch or MMR', @genotype.attribute_map['genetictestscope'] + end + test 'add_no_scope_from_karyo_targeted' do no_scope_record = build_raw_record('pseudo_id1' => 'bob') no_scope_record.raw_fields['genetictestscope'] = 'XYZ'