Feature/36213/st georges crc importer new#81
Conversation
There was a problem hiding this comment.
I don't think this is needed?
There was a problem hiding this comment.
I can't see any test coverage for process_fields?
There was a problem hiding this comment.
I don't think you need to reassign genotype here, it's being mutated in the assign_test_scope method.
There was a problem hiding this comment.
You won't need to return the genotype here if process_fields doesn't reassign genotype.
There was a problem hiding this comment.
You could assign DateTime.parse('18/07/2022') to a variable, rather than repeating the code snippet on L125.
The logic could be simplified, something like:
date = DateTime.parse(record.raw_fields['authoriseddate'])
panel_change_date = DateTime.parse('18/07/2022')
genes = %w[APC BMPR1A EPCAM MLH1 MSH2 MSH6 MUTYH NTHL1 PMS2 POLD1 POLE PTEN SMAD4 STK11]
date < panel_change_date ? genes : genes + %w[GREM1 RNF43]
There was a problem hiding this comment.
I think this could be simplified a little, something like:
columns = if genotype.targeted?
['gene', 'gene (other)', 'variant_dna', 'variant protein', 'test/panel']
elsif genotype.full_screen?
['gene', 'gene (other)', 'variant_dna', 'test/panel']
end
duplicate_genotype(columns, genotype, genes, record) if columns.present?
There was a problem hiding this comment.
Could the class name match the file name please? e.g. StGeorgeHandlerColorectalTest
|
#77 (comment) - Take note of this comment for addition to CRC importer as well Added logging method in CRC importer - should be ther in 075175e |
a52f508 to
2e492af
Compare
There was a problem hiding this comment.
Instead of assigning no genetic test scope, get it to give an error message, so we can flag if this ever happens and set new rules(see comment on code review for #77)
There was a problem hiding this comment.
Added logging method in CRC importer - should be there in 075175e
| process_fields_wrecord = build_raw_record('pseudo_id1' => 'bob') | ||
| process_fields_wrecord.raw_fields['servicereportidentifier'] = 'W1234567' | ||
| @handler.process_fields(process_fields_wrecord) | ||
| assert_not_equal 'W1234567', @genotype.attribute_map['servicereportidentifier'] |
There was a problem hiding this comment.
I think this would not be equal to the SRI even it was starting with 'V' , as process fields creates a new genotype
| def interrogate_variant_protein_fullscreen(record, genotype, column) | ||
| if record.raw_fields['variant protein'].blank? | ||
| genotype.add_status(1) | ||
| elsif record.raw_fields['variant protein'].match(/fail/ix) |
There was a problem hiding this comment.
These are in a different order to the rules- can you check this?
|
|
||
| def handle_test_status(record, genotype, genes) | ||
| columns = if genotype.targeted? | ||
| ['gene', 'gene (other)', 'variant_dna', 'variant protein', 'test/panel'] |
There was a problem hiding this comment.
I don't think you need all these columns here? Probably a good idea to check these alongside the comment from @shilpigoeldev at line 70
|
@NImeson , I don't think colorectal script to run 'RJ7' has been added yet , can you please commit that as well. |
Which file do you mean @shilpigoeldev ? the entry should be there in the bash script @NImeson , Sorry , I missed that earlier..yes its present so nothing needed for this. |
| gene_list.each do |gene| | ||
| CRC_GENE_MAP[gene]&.each do |gene_value| | ||
| genes.append(gene_value) | ||
| end |
There was a problem hiding this comment.
There is no need of CRC_GENE_MAP I suppose as we don't have any mapping being done here . In BRCA it was needed as BR1 -> BRCA1 but nothing needed here , so should get rid of it.
There was a problem hiding this comment.
There is a common typo for MSH2 (MHS2) which is mapped back to MSH2, I think this is why I included it
| # extracts panels tested from record | ||
| # map panels to list of genes in FULL_SCREEN_TESTS_MAP | ||
| # return list of genes tested in panel | ||
| panel_genes_list = FULL_SCREEN_TESTS_MAP[record.raw_fields['test/panel']] |
There was a problem hiding this comment.
Can you make this lookup as case insensitive like using downcase on record.raw_fields['test/panel'], as being done for adding scope?
There was a problem hiding this comment.
This is mapping the test panels (e.g. R209 etc) - should this be the same for BRCA also then? I think it is not lower case for BRCA
What?
A new St Georges importer has been written to account for a new data format (see planio ticket 36213).
Why?
A new importer had to be created to be able to parse St Georges colorectal data.
How?
The importer was written based on the rules sent by Fiona.
Testing?
Unittests have been written. A QA of the variant counts has also been completed and signed off by Fiona.
Note: git commit history for the work can be found in branch feature/36213/st_georges_crc_importer, this original branch was created from the 'main' branch in error, instead of the 'develop' branch. Code has been copied across to this new branch forked from 'develop'.