OHDSI / CohortGenerator

An R package for instantiating cohorts using data in the CDM.
https://ohdsi.github.io/CohortGenerator/
11 stars 10 forks source link

Cannot create limitSubset with priorTime and followUpTime #109

Closed gowthamrao closed 9 months ago

gowthamrao commented 1 year ago
  CohortGenerator::createLimitSubset(name = "365d prior obs time",
                                                             priorTime = 365,
                                                             followUpTime = 1)

complains as

Error in CohortGenerator::createLimitSubset(name = "365d prior obs time", : If specifying observation prior time, must specifcy follow up time

Maybe because of

  if ((is.null(limitTo) | limitTo == "") & (priorTime > 
        0 | followUpTime > 0)) {
        stop("If specifying observation prior time, must specifcy follow up time")
    }
anthonysena commented 10 months ago

When using the createLimitSubset you have to specify the limitTo parameter - there is no default which is where you are hitting this error. We should add a check to make sure you've specified limitTo and if not error at that point vs. the combination check you referenced in this issue.

anthonysena commented 9 months ago

Closing as this should be addressed via #112