While converting all our ICD9 codes to SNOMED codes using the query:
select source.concept_id as source_concept_id, source.concept_code as
source_concept_code, source.concept_name as source_concept_name,
target.concept_id as target_concept_id, target.concept_name as
target_concept_name, target.domain_id as target_domain_id
from
(
select concept_id, concept_name, concept_code
from concept
where vocabulary_id = ‘ICD9CM’ OR vocabulary_id = ‘ICD9Proc’
) source
inner join
concept_relationship
on source.concept_id = concept_relationship.concept_id_1
and concept_relationship.relationship_id = ‘Maps to’
inner join
concept target
on concept_relationship.concept_id_2 = target.concept_id
and target.standard_concept = ‘S’;
(provided to me here ICD9/CPT mappings to SNOMED for condition_occurrence table)
Produces incorrect mappings for ICD9 codes that are procedures as the ‘Maps to’ relationship is circular for many (possibly all of them) for example for ICD9 codes 15, 21 etc. Should this be the case? can we have ICD9Proc stuff in the Procedures table?
Looking into the relationship table I find: ICD9P - SNOMED eq which apparently does the correct mapping. Should I modify this query to use this relationship instead?
select source.concept_id as source_concept_id, source.concept_code as
source_concept_code, source.concept_name as source_concept_name,
target.concept_id as target_concept_id, target.concept_name as
target_concept_name, target.domain_id as target_domain_id, target.vocabulary_id as target_vocabulary_id
from
(
select concept_id, concept_name, concept_code
from concept
where vocabulary_id = ‘ICD9CM’ OR vocabulary_id = ‘ICD9Proc’
) source
inner join
concept_relationship
on source.concept_id = concept_relationship.concept_id_1
and concept_relationship.relationship_id = ‘ICD9P - SNOMED eq’
inner join
concept target
on concept_relationship.concept_id_2 = target.concept_id
and target.standard_concept = 'S;
This one seems to get all the procedures in SNOMED concept_id’s.
Thanks in advance @Christian_Reich, @Patrick_Ryan!