chariot 1.2.0.9000
  • Reference
  • Articles
    • Taxonomy and Relationships
    • Explore 'Maps to' Relationship
    • Explore Relationships and Ancestors
    • Explore Vocabulary Relationships and Ancestors
    • Harmonizing HemOnc Concepts
    • Mapping to HemOnc
    • Pivot Concept Ancestors and Descendants
    • Pivot Concept Relationships
    • Setup Drug Strength
    • String Manipulation
  • Changelog

Explore ‘Maps to’ Relationship

Source: vignettes/explore-maps-to-relationship.Rmd
explore-maps-to-relationship.Rmd
library(chariot)
#> Read GitHub Wiki <https://ohdsi.github.io/CommonDataModel/cdm60.html>

The ‘Maps to’ relationship and its inverse are explored for each of the standard controlled vocabularies that often serves as the target from source.

SELECT DISTINCT 
  cr.relationship_id,
  ca.min_levels_of_separation,
  ca.max_levels_of_separation   
FROM omop_vocabulary.concept c 
INNER JOIN omop_vocabulary.concept_relationship cr
ON cr.concept_id_1 = c.concept_id 
INNER JOIN omop_vocabulary.concept c2 
ON cr.concept_id_2 = c2.concept_id  
INNER JOIN omop_vocabulary.concept_ancestor ca 
ON ca.ancestor_concept_id = cr.concept_id_1
WHERE 
  c.vocabulary_id IN ('SNOMED') 
    AND c.invalid_reason IS NULL
    AND c2.vocabulary_id IN ('SNOMED') 
    AND c2.invalid_reason IS NULL
    AND cr.relationship_id = 'Maps to' 

Developed by Meera Patel, MD.

Site built with pkgdown 1.6.1.