darwin-eu-dev / PatientProfiles

https://darwin-eu-dev.github.io/PatientProfiles/
Apache License 2.0
6 stars 5 forks source link

addCohortIntersect removes prior and future observation output due to addInObservation #592

Closed catalamarti closed 5 months ago

catalamarti commented 5 months ago
library(PatientProfiles)
#> Warning: package 'PatientProfiles' was built under R version 4.2.3
cdm <- mockPatientProfiles()
cdm$cohort1 |> 
  addFutureObservation() |> 
  addInObservation()
#> Warning: The following columns will be overwritten: future_observation
#> # Source:   table<og_003_1712057465> [2 x 5]
#> # Database: DuckDB v0.10.0 [martics@Windows 10 x64:R 4.2.1/:memory:]
#>   cohort_definition_id subject_id cohort_start_date cohort_end_date
#>                  <dbl>      <dbl> <date>            <date>         
#> 1                    1          1 2020-01-01        2020-04-01     
#> 2                    1          1 2020-06-01        2020-08-01     
#> # ℹ 1 more variable: in_observation <dbl>

Created on 2024-04-02 with reprex v2.0.2