recalculate_age_tx_start: Adjust age to treatment episode

Description Usage Arguments Details Value

View source: R/recalculate_age_tx_start.R

Description

In the OCA EMR, age is recorded once when people are registered in the database. Over time, people may initiate treatment for different diseases at different time points. Since age at treatment initiation is often required, the recorded value must be adjusted to represent the age when treatment starts.

Usage

1
recalculate_age_tx_start(x, start_var, categorise = TRUE)

Arguments

x

data frame including age at registration, treatment initiation date and patient registration date

start_var

define variable representing treatment initiation date

categorise

logical argument to flag whether to add a categorised age variable to simplify reporting

Details

This function is designed to generate an additional variable, age_recalculated, by adding time from registration to treatment initiation to the recorded age.

Value

data frame with additional variable age_recalculated alongside recorded age


JayAchar/hisreportr documentation built on March 18, 2020, 5:57 a.m.