Skip to contents

The output is used as inputs to include_diabetes_diagnoses() and to get_pregnancy_dates() (see exclusion events).

Usage

prepare_lpr3(diagnoser, kontakter)

Arguments

diagnoser

The LPR3 register containing diabetes diagnoses.

kontakter

The LPR3 register containing hospital contacts/admissions.

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 from d_inddto or dato_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)
} # }