General description
A more complete description of the classifier is found in Anders Aasted Isaksen’s PhD Thesis as well as the validation paper (1). The description of the algorithm below is a brief and concise version of those documents.
The overall output of this algorithm is first to classify those with diabetes, then to further classify and check if the individuals might have type 1 diabetes, otherwise classify as type 2 diabetes.
The initial diabetes classification is defined as the second occurrence of any of the listed inclusion events. Wherever possible, all available data for each event is used, except for the purchases of glucose-lowering drugs, since the data on obstetric diagnoses necessary to censor glucose-lowering drug purchases is only complete from 1997 onwards. Inclusion criteria are:
- HbA1c measurements of ≥48 mmol/mol.
- Hospital diagnoses of diabetes.
- Diabetes-specific services received at podiatrist.
- Purchase of glucose-lowering drugs.
Exclusions are:
- HbA1c samples:
- Samples taken during pregnancies, as that could be a potential gestational diabetes mellitus.
- Glucose-lowering drugs:
- Brand drugs for weight loss, e.g. Saxenda.
- Purchases during pregnancies, as that is a potential treatment for gestational diabetes mellitus.
- Metformin for women below age 40, as that could be a treatment for polycystic ovary syndrome.
Classifying type 1 diabetes
Diabetes type is classified as either T1D or T2D based on patterns of purchases of insulin drugs (including analogues) and hospital primary diagnoses of T1D and T2D.
Classification as T1D requires an individual to fulfill either of the following criteria:
- Must have purchased only insulin drugs and never any other type of glucose-lowering drugs, and have at least one diagnosis of T1D
- Must have a majority of T1D diagnoses from endocrinological departments (or from other medical departments, in the absence of contacts to endocrinological departments), and a purchase of insulin within 180 days after onset of diabetes, with insulin contributing at least two thirds of all defined daily doses of glucose-lowering drugs purchased.
In populations generated on a fixed index date (such as the cross-sectional studies associated with this dissertation), individuals classified as T1D cases must have purchased insulin drugs in the last year prior to the index date.
Detailed and technical description
Below are the technical, exact implementation of the above description. These are the logical conditions and exact variables and registers used that results in the classification of diabetes status and types. They are shown in the form of tables for each register with a table at the end showing the logic that is applied across registers.
lpr_diag
name | title | logic | comments |
---|---|---|---|
lpr2_is_needed_code | LPR2 codes used throughout the algorithm | c_diag =~ ‘^(DO0[0-6]|DO8[0-4]|DZ3[37]|DE1[0-4]|249|250)’ AND (c_diagtype == ‘A’ OR c_diagtype == ‘B’) | A c_diagtype of'A' means
primary diagnosis, while ‘B’ means secondary diagnosis. |
lpr2_is_diabetes_code | LPR2 diagnoses codes for any diabetes | c_diag =~ ‘^(DE1[0-4]|249|250)’ | |
lpr2_is_t1d_code | LPR2 diagnoses codes for T1D | c_diag =~ ‘^(DE10|249)’ | |
lpr2_is_t2d_code | LPR2 diagnoses codes for T2D | c_diag =~ ‘^(DE11|250)’ | |
lpr2_is_pregnancy_code | LPR2 diagnoses codes for pregnancy-related outcomes | c_diag =~ ‘^(DO0[0-6]|DO8[0-4]|DZ3[37])’ | These are recorded pregnancy endings like live births and miscarriages. |
lpr2_is_primary_dx | LPR2 primary diagnosis | c_diagtype == ‘A’ |
lpr_adm
name | title | logic | comments |
---|---|---|---|
lpr2_is_endocrinology_dept | LPR2 endocrinology department | c_spec == 8 |
TRUE when the department where the
recorded diagnosis was endocrinology. |
lpr2_is_medical_dept | LPR2 other medical department | c_spec %in% c(1:7, 9:30) |
TRUE when the diagnosis was recorded at a
medical department other than endocrinology. |
diagnoser
name | title | logic | comments |
---|---|---|---|
lpr3_is_needed_code | LPR3 codes used throughout the algorithm | diagnosekode =~ ‘^(DO0[0-6]|DO8[0-4]|DZ3[37]|DE1[0-4])’ AND (diagnosetype == ‘A’ OR diagnosetype == ‘B’) AND (senere_afkraeftet == ‘Nej’) |
A diagnosekode means primary
diagnosis and senere_afkraeftet means diagnosis was later
retracted. |
lpr3_is_primary_dx | LPR3 primary diagnosis | diagnosetype == ‘A’ | |
lpr3_is_t1d_code | LPR3 diagnoses codes for T1D | diagnosekode =~ ‘^(DE10)’ | |
lpr3_is_t2d_code | LPR3 diagnoses codes for T2D | diagnosekode =~ ‘^(DE11)’ | |
lpr3_is_diabetes_code | LPR3 diagnoses codes for diabetes | diagnosekode =~ ‘^DE1[0-4]’ | This is a general diabetes code, not specific to T1D or T2D. |
lpr3_is_pregnancy_code | ICD-10 diagnoses codes for pregnancy-related outcomes | diagnosekode =~ ‘^(DO0[0-6]|DO8[0-4]|DZ3[37])’ | These are recorded pregnancy endings like live births and miscarriages. |
kontakter
name | title | logic | comments |
---|---|---|---|
lpr3_is_endocrinology_dept | LPR3 endocrinology department | hovedspeciale_ans == ‘medicinsk endokrinologi’ |
TRUE when the department is
endocrinology. |
lpr3_is_medical_dept | LPR3 medical department | hovedspeciale_ans %in% c(‘blandet medicin og kirurgi’, ‘intern medicin’, ‘geriatri’, ‘hepatologi’, ‘hæmatologi’, ‘infektionsmedicin’, ‘kardiologi’, ‘medicinsk allergologi’, ‘medicinsk gastroenterologi’, ‘medicinsk lungesygdomme’, ‘nefrologi’, ‘reumatologi’, ‘palliativ medicin’, ‘akut medicin’, ‘dermato-venerologi’, ‘neurologi’, ‘onkologi’, ‘fysiurgi’, ‘tropemedicin’) |
TRUE when the department is other medical
departments (than endocrinology). |
lab_forsker
name | title | logic | comments |
---|---|---|---|
is_hba1c_over_threshold | HbA1c values over threshold | (analysiscode == ‘NPU27300’ AND value >= 48) OR (analysiscode == ‘NPU03835’ AND value >= 6.5) | Is the IFCC units for NPU27300 and DCCT units for NPU03835. |
lmdb
name | title | logic | comments |
---|---|---|---|
is_gld_code | ATC codes for glucose-lowering drugs (GLDs) | atc =~ ‘^A10’ AND NOT (atc =~ ‘^(A10BJ|A10BK01|A10BK03)’) | GLP-RAs or dapagliflozin/empagliflozin drugs are not kept. |
Across register logic
name | title | logic | comments |
---|---|---|---|
is_not_within_pregnancy_interval | Events that are not within a potential pregnancy interval | NOT (has_pregnancy_event AND date >= (pregnancy_event_date - weeks(40)) AND date <= (pregnancy_event_date + weeks(12))) OR is.na(pregnancy_event_date) | The potential pregnancy interval is defined as 40 weeks before and 12 weeks after the pregnancy event date. |
is_podiatrist_services | Podiatrist services | speciale =~ ‘^54’ AND barnmak == 0 | When barnmak == 0 , the PNR belongs to the
recipient of the service. When barnmak == 1 , the PNR
belongs to the child of the individual. |
is_not_metformin_for_pcos | Metformin purchases that aren’t potentially for the treatment of PCOS | NOT (koen == 2 AND atc =~ ‘^A10BA02$’ AND ((date - foed_dato) < years(40) OR indication_code %in% c(‘0000092’, ‘0000276’, ‘0000781’))) | Woman is defined as 2 in koen . |