OHDSI / CohortConstructor

https://ohdsi.github.io/CohortConstructor/
Apache License 2.0
1 stars 0 forks source link

Support Inf as upper age #358

Closed edward-burn closed 1 month ago

edward-burn commented 1 month ago
library(omock)
#> Warning: package 'omock' was built under R version 4.4.1
library(CohortConstructor)
cdm <- mockCdmReference() |>
  mockPerson(nPerson = 100) |>
  mockObservationPeriod() |>
  mockCohort(
    name = "cohort",
    numberCohorts = 1
  )
cdm$cohort <- cdm$cohort |> 
  requireAge(c(0, Inf)) 
#> Warning: There was 1 warning in `dplyr::mutate()`.
#> ℹ In argument: `max_age = as.integer(sub(".*_", "", .data$age_range))`.
#> Caused by warning:
#> ! NAs introduced by coercion to integer range
#> Error in `dplyr::mutate()`:
#> ℹ In argument: `age = as.integer(...)`.
#> Caused by error in `CDMConnector::dbms()`:
#> ! Assertion on 'con' failed: Must inherit from class 'DBIConnection', but has class 'NULL'.

Created on 2024-10-17 with reprex v2.1.0