
Include only those with HbA1c above the required threshold.
Source:R/include-hba1c.R
include_hba1c.Rd
In the lab_forsker
register, NPU27300 is HbA1c in the modern units (IFCC)
while NPU03835 is HbA1c in old units (DCCT). Multiple elevated results on the
same day within each individual are deduplicated, to account for the same
test result often being reported twice (one for IFCC, one for DCCT units).
Value
An object of the same input type, default as a tibble::tibble()
,
with three columns:
pnr
: Personal identification variable.dates
: The dates of all elevated HbA1c test results.has_elevated_hba1c
: A logical variable indicating that the HbA1c test was included. Used as an indicator and reminder in other internal functions.
Details
The output is passed to the exclude_pregnancy()
function for
filtering of elevated results due to potential gestational diabetes (see
below).
Examples
if (FALSE) { # \dontrun{
simulate_registers("lab_forsker", 100)[[1]] |> include_hba1c()
} # }