Skip to content

Commit

Permalink
cohort_codelist attribute (#412)
Browse files Browse the repository at this point in the history
include cohort_codelist attribute in generate concept cohort set
  • Loading branch information
edward-burn authored Mar 7, 2024
1 parent e3a9b99 commit c8fdedd
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions R/generateConceptCohortSet.R
Original file line number Diff line number Diff line change
Expand Up @@ -350,11 +350,28 @@ generateConceptCohortSet <- function(cdm,
excluded_records = 0,
excluded_subjects = 0)

if(utils::packageVersion("omopgenerics") < 0.1){
cdm[[name]] <- omopgenerics::newCohortTable(
table = cohortRef,
cohortSetRef = cohortSetRef,
cohortAttritionRef = cohortAttritionRef
)
} else {

cohortCodelistRef <-df %>%
dplyr::mutate(type = "index event") %>%
dplyr::select("cohort_definition_id",
"codelist_name" = "cohort_name",
"concept_id",
"type")

cdm[[name]] <- omopgenerics::newCohortTable(
table = cohortRef,
cohortSetRef = cohortSetRef,
cohortAttritionRef = cohortAttritionRef,
cohortCodelistRef = cohortCodelistRef
)
}

return(cdm)
}
Expand Down
2 changes: 1 addition & 1 deletion man/cdm_from_con.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c8fdedd

Please sign in to comment.