Skip to content

Concepts in concept_relationship table not present in the concept table when using cdm <- mockCdmReference() #257

@martaalcalde

Description

@martaalcalde
 library(omock)
 library(dplyr)
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union
 cdm <- mockCdmReference()
 cdm$concept_relationship |> 
   dplyr::rename(concept_id = concept_id_1) |>
   dplyr::anti_join(
     cdm$concept, by = "concept_id"
   ) |> 
     arrange(concept_id)
#> # A tibble: 50,928 × 6
#>    concept_id concept_id_2 relationship_id      valid_start_date valid_end_date
#>         <int>        <int> <chr>                <date>           <date>        
#>  1          2            7 Mapped from          NA               NA            
#>  2          3            6 Due to of            NA               NA            
#>  3          4            8 Mapped from          NA               NA            
#>  4         10           11 RxNorm has dose form NA               NA            
#>  5         13           14 RxNorm has dose form NA               NA            
#>  6         15           16 Subsumes             NA               NA            
#>  7         16           17 Subsumes             NA               NA            
#>  8         17           18 Subsumes             NA               NA            
#>  9         18            3 Maps to              NA               NA            
#> 10     432453      4268709 Subsumes             NA               NA            
#> # ℹ 50,918 more rows
#> # ℹ 1 more variable: invalid_reason <chr>

Created on 2025-12-10 with reprex v2.1.1

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions