Skip to contents

Renders the definition for a CodeSpec or CompositeCodeSpec to the console using cli formatting (bullets, inline code markup, etc.) and returns the raw definition invisibly for programmatic use. For a DrugSpec leaf, renders and returns its (typically internal sourcing note) defs text the same way. For a CompositeDrugSpec, returns the tibble of component name/label pairs from $get_meds_labels() instead (see that method, or get_hypertension_meds_labels() and friends) — composite drug specs don't carry a narrative definition the way condition specs do.

Usage

get_defs(spec, variable_type = c("condition", "outcome"))

Arguments

spec

A CodeSpec, CompositeCodeSpec, DrugSpec, or CompositeDrugSpec object.

variable_type

"condition" (default) or "outcome". Ignored for DrugSpec and CompositeDrugSpec objects.

Value

The raw definition (named character vector or NULL), invisibly, for CodeSpec/CompositeCodeSpec/DrugSpec. A tibble with columns name and label for CompositeDrugSpec.