Skip to content

How to specify valueAsConcept in cohort definition (and valid death cohort) #121

@vojtechhuser

Description

@vojtechhuser

Great package. Thank you for developing it.

problem 1
how to specify valueAsConcept in measurement cohort?

(current error is)

Error in `purrr::map()`:
ℹ In index: 1.
Caused by error in `purrr::map_chr()`:
ℹ In index: 1.
ℹ With name: valueAsConcept.
Caused by error in `.x@name`:
! no applicable method for `@` applied to an object of class "integer"
Run `rlang::last_trace()` to see where the error occurred.

 ch_m2 <- cohort(
  entry = entry(
    measurement(cs_meas, valueAsConcept = 9191L) #9191 is concetp for positive (no using descendants, just one specific value (is not using conceptset an option here)
  ),
  exit = exit(
    endStrategy = observationExit()
  )
)

 cohortsToCreate<- bind_rows(cohortsToCreate, tibble::tibble(cohortId = 6,cohortName = "meas2",sql = CirceR::buildCohortQuery(
   expression = CirceR::cohortExpressionFromJson(ch_m2 |>toCirce()|>jsonlite::toJSON(pretty = TRUE, auto_unbox = TRUE) |>  as.character()),
   options = CirceR::createGenerateOptions(generateStats = FALSE))))

problem 2:
what is valid capr version of simplest cohort ever (death as entry event)

ch_d<-cohort(
  entry = entry(
    death()
  ))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions