Skip to contents

Describe one study-design feature

Usage

study_feature(
  name,
  columns,
  compute,
  description = "",
  requires = character(),
  labels = character(),
  concept_ids = numeric(),
  params = list(),
  state = list()
)

Arguments

name

Feature name: letters, digits and underscores.

columns

Character vector of the numeric columns the feature produces.

compute

function(ctx, state, fit) returning a data frame with stay_id and exactly columns. ctx has ctx$con, ctx$stays and ctx$zip5() (one row per stay: person_id, stay_id, zip5, rule, cached). state is an environment for fitted state, filled only when fit is TRUE; the function must error when it needs state that is absent and fit is false.

description

Free text recorded in the manifest.

requires

Character vector of OMOP tables the feature reads.

labels

Named character vector of concept names, c(column = "label").

concept_ids

Named numeric vector pinning columns to site-defined concept ids; other columns are registered automatically on write_feature_set().

params

JSON-serialisable list of the settings that define the feature (recorded in the manifest).

state

Optional named list of fitted state to start from.

Value

An object of class study_feature.