Skip to contents

[Deprecated]

Usage

addRoute(drugTable)

Arguments

drugTable

Table in the cdm that must contain drug_concept_id

Value

It adds route to the current table

Examples

# \donttest{
library(DrugUtilisation)
library(dplyr)

cdm <- mockDrugUtilisation()
#> Warning: ! 6 column in person do not match expected column type:
#>  `gender_concept_id` is numeric but expected integer
#>  `race_concept_id` is numeric but expected integer
#>  `ethnicity_concept_id` is numeric but expected integer
#>  `location_id` is numeric but expected integer
#>  `provider_id` is numeric but expected integer
#>  `care_site_id` is numeric but expected integer
#> Warning: ! 1 column in observation_period do not match expected column type:
#>  `period_type_concept_id` is numeric but expected integer
#> Warning: ! 2 column in visit_occurrence do not match expected column type:
#>  `visit_concept_id` is numeric but expected integer
#>  `visit_type_concept_id` is numeric but expected integer
#> Warning: ! 10 column in condition_occurrence do not match expected column type:
#>  `condition_concept_id` is numeric but expected integer
#>  `condition_type_concept_id` is numeric but expected integer
#>  `condition_status_concept_id` is numeric but expected integer
#>  `stop_reason` is logical but expected character
#>  `provider_id` is logical but expected integer
#>  `visit_occurrence_id` is logical but expected integer
#>  `visit_detail_id` is logical but expected integer
#>  `condition_source_value` is logical but expected character
#>  `condition_source_concept_id` is logical but expected integer
#>  `condition_status_source_value` is logical but expected character
#> Warning: ! 2 column in drug_exposure do not match expected column type:
#>  `drug_concept_id` is numeric but expected integer
#>  `drug_type_concept_id` is numeric but expected integer
#> Warning: ! 2 column in observation do not match expected column type:
#>  `observation_concept_id` is numeric but expected integer
#>  `observation_type_concept_id` is numeric but expected integer
#> Warning: ! 4 column in concept do not match expected column type:
#>  `concept_id` is numeric but expected integer
#>  `valid_start_date` is character but expected date
#>  `valid_end_date` is character but expected date
#>  `invalid_reason` is logical but expected character
#> Warning: ! 2 column in concept_relationship do not match expected column type:
#>  `concept_id_1` is numeric but expected integer
#>  `concept_id_2` is numeric but expected integer
#> Warning: ! 4 column in concept_ancestor do not match expected column type:
#>  `ancestor_concept_id` is numeric but expected integer
#>  `descendant_concept_id` is numeric but expected integer
#>  `min_levels_of_separation` is numeric but expected integer
#>  `max_levels_of_separation` is numeric but expected integer
#> Warning: ! 9 column in drug_strength do not match expected column type:
#>  `drug_concept_id` is numeric but expected integer
#>  `ingredient_concept_id` is numeric but expected integer
#>  `amount_unit_concept_id` is numeric but expected integer
#>  `numerator_unit_concept_id` is numeric but expected integer
#>  `denominator_unit_concept_id` is numeric but expected integer
#>  `box_size` is logical but expected integer
#>  `valid_start_date` is character but expected date
#>  `valid_end_date` is character but expected date
#>  `invalid_reason` is logical but expected character
#> Warning: ! 6 column in person do not match expected column type:
#>  `gender_concept_id` is numeric but expected integer
#>  `race_concept_id` is numeric but expected integer
#>  `ethnicity_concept_id` is numeric but expected integer
#>  `location_id` is numeric but expected integer
#>  `provider_id` is numeric but expected integer
#>  `care_site_id` is numeric but expected integer
#> Warning: ! 1 column in observation_period do not match expected column type:
#>  `period_type_concept_id` is numeric but expected integer

cdm[["drug_exposure"]] |>
  addRoute()
#> Warning: `addRoute()` was deprecated in DrugUtilisation 0.7.0.
#> # Source:   SQL [?? x 8]
#> # Database: DuckDB v1.1.2 [unknown@Linux 6.5.0-1025-azure:R 4.4.2/:memory:]
#>    drug_exposure_id person_id drug_concept_id drug_exposure_start_date
#>               <int>     <int>           <dbl> <date>                  
#>  1                8         7        43135274 2002-05-24              
#>  2               10         7         2905077 2013-05-13              
#>  3               14         9         1516978 1970-06-01              
#>  4                6         6         1516980 1989-01-29              
#>  5               15         9         1539463 1961-08-28              
#>  6               17        10         1539462 2005-08-23              
#>  7                3         4        43135274 1964-12-06              
#>  8                4         5         2905077 1977-03-24              
#>  9                7         6         1516978 1999-05-28              
#> 10                5         5         1516980 1979-01-17              
#> # ℹ more rows
#> # ℹ 4 more variables: drug_exposure_end_date <date>,
#> #   drug_type_concept_id <dbl>, quantity <dbl>, route <chr>
# }