Hello, I’m James Cockayne, I’m the lead developer for our migration tool (GitHub - answerdigital/oxford-omop-data-mapper). I work with @Joe_Asher.
I just wanted to chime in and potentially clarify Joe’s original question a little.
We as a team value SNOMED and we think it is the correct clinical coding system, we want to use it.
Our query orientates around the more fundamental database design choice of inserting a record many times while enumerating each related item in the one to many relationship.
We think this could cause issues because
- A researcher would have no means to group the rows into a single event, if they wanted to count events for example
- If we needed to add row to table, that has a foreign key to table that has an “exploded” ICD10 code (many rows per event), we would have no clear row identity to refer to when forming a foreign key. (or would these records get inserted many times too?)
- The SNOMED codes that are inserted would be formed using a “snapshot” of the relationships between the ICD10 and SNOMED. If these relationships are improved the rows would need to be deleted and inserted again before the mappings could be available to researchers.
- I’m unsure if this could happen, but if a table happens to have more than one concept field that had to be mapped from a one to many code system (eg ICD10/OPCS4) then a user would need to insert a record for every permutation of SNOMED codes.
A proposal I would make to avoid all of these problems would be to record the concept as the origin code (eg ICD10) and then utilise the built in concept_relationship
table to find these records with the proper SNOMED codes. This could be in the form of a database view, or as an extension to the query.
For example, the ICD10 code M13.86 Other specified arthritis, lower leg
has two SNOMED codes 128137003 Disorder of lower leg
and 3723001 Arthritis
. If we wanted to search for the SNOMED code Disorder of lower leg
we could use the following query
select
*
from cdm.condition_occurrence co
inner join cdm.concept_relationship cr
on co.condition_concept_id = cr.concept_id_1
inner join cdm.concept c
on cr.concept_id_2 = c.concept_id
where c.concept_code = 128137003 -- Disorder of lower leg
and cr.invalid_reason is null;
Let me know what you think to this idea.
Thanks