
Prepare and join the two LPR2 registers to extract diabetes and pregnancy diagnoses.
Source:R/prepare-lpr.R
prepare_lpr2.RdThe output is used as inputs to keep_diabetes_diagnoses() and to
keep_pregnancy_dates().
Value
The same type as the input data, as a duckplyr::duckdb_tibble(),
with the following columns:
pnr: The personal identification variable.date: The date of all the recorded diagnosis (renamed fromd_inddtoordato_start).is_primary_diagnosis: 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.