OHDSI / omock

https://ohdsi.github.io/omock/
Apache License 2.0
2 stars 1 forks source link

cast omop columns as omopgenerics specifies #103

Closed nmercadeb closed 3 weeks ago

nmercadeb commented 1 month ago

See below an example of casting warnings thrown by omopgenerics

cdm <- omock::mockCdmReference() |>
  omock::mockPerson() |>
  omock::mockObservationPeriod() 

cdm <- CDMConnector::copyCdmTo(
  con = DBI::dbConnect(duckdb::duckdb()), 
  cdm = cdm, 
  schema = "main", 
  overwrite = TRUE
)
#> Note: method with signature 'DBIConnection#Id' chosen for function 'dbExistsTable',
#>  target signature 'duckdb_connection#Id'.
#>  "duckdb_connection#ANY" would also be valid
#> Warning: ! 6 casted columns in person as do not match expected column type:
#> • `gender_concept_id` from numeric to integer
#> • `year_of_birth` from numeric to integer
#> • `month_of_birth` from numeric to integer
#> • `day_of_birth` from numeric to integer
#> • `race_concept_id` from logical to integer
#> • `ethnicity_concept_id` from logical to integer
#> Warning: ! 1 casted column in observation_period as do not match expected column type:
#> • `period_type_concept_id` from logical to integer
#> ■■■■■■■■■■■■■■■■■■■■■■ 69% | ETA: 1s
#> 

Created on 2024-08-14 with reprex v2.1.1