Skip to content

Commit

Permalink
Merge pull request #259 from OHDSI/issue258
Browse files Browse the repository at this point in the history
Update custom covariate builder vignette
  • Loading branch information
ginberg authored May 22, 2024
2 parents f2a850c + f68ebd7 commit 07d8514
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Binary file modified inst/doc/CreatingCustomCovariateBuilders.pdf
Binary file not shown.
5 changes: 4 additions & 1 deletion vignettes/CreatingCustomCovariateBuilders.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ The covariate construction function has to accept the following arguments:
* `rowIdField`: The name of the field in the cohort temp table that is to be used as the row_id field in the output table. This can be especially usefull if there is more than one period per person.
* `covariateSettings`: The object created in your covariate settings function.
* `aggregated`: Should covariates be constructed per-person, or aggregated across the cohort?
* `minCharacterizationMean`: The minimum mean value for characterization output. Values below this will be cut off from output. This will help reduce the file size of the characterization output, but will remove information on covariates that have very low values. The default is 0. Note: this parameter only works
when `aggregated` is set to TRUE. Since aggregation is not supported in this function, it doesn't actually filter the output. However, the `getDbCovariateData` function requires this parameter to be present.

The function can expect that a table exists with the name specified in the `cohortTable` argument. This table will identify the persons and the index dates for which we want to construct the covariates, and will have the following fields: `subject_id`, `cohort_start_date`, and `cohort_definition_id`. Because sometimes there can be more than one index date (i.e. `cohort_start_date`) per person, an additional field can be included with a unique identifier for each `subject_id` - `cohort_start_date` combination. The name of this field will be specified in the `rowIdField` argument

Expand All @@ -96,7 +98,8 @@ getDbLooCovariateData <- function(connection,
cohortIds = c(-1),
rowIdField = "subject_id",
covariateSettings,
aggregated = FALSE) {
aggregated = FALSE,
minCharacterizationMean = 0) {
writeLines("Constructing length of observation covariates")
if (covariateSettings$useLengthOfObs == FALSE) {
return(NULL)
Expand Down

0 comments on commit 07d8514

Please sign in to comment.