
Prepare and join the two LPR3 registers to extract diabetes and pregnancy diagnoses.
Source:R/prepare-lpr.R
prepare_lpr3.Rd
The output is used as inputs to include_diabetes_diagnoses()
and to
get_pregnancy_dates()
(see exclusion events).
Value
The same type as the input data, default as a tibble::tibble()
,
with the following columns:
pnr
: The personal identification variable.date
: The date of all the recorded diagnosis (renamed fromd_inddto
ordato_start
).is_primary_dx
: Whether the diagnosis was a primary diagnosis.is_diabetes_code
: Whether the diagnosis was any type of diabetes.is_t1d_code
: Whether the diagnosis was T1D-specific.is_t2d_code
: Whether the diagnosis was T2D-specific.is_pregnancy_code
: Whether the person has an event related to pregnancy like giving birth or having a miscarriage at the given date.is_endocrinology_dept
: Whether the diagnosis was made by an endocrinology medical department.is_medical_dept
: Whether the diagnosis was made by a non-endocrinology medical department.
See also
See the vignette("algorithm")
for the logic used to filter these
patients.
Examples
if (FALSE) { # \dontrun{
register_data <- simulate_registers(c("diagnoser", "kontakter"), 100000)
prepare_lpr3(register_data$diagnoser, register_data$kontakter)
} # }