This function takes the combined outputs from
keep_pregnancy_dates(), keep_hba1c(), and
drop_pcos() and uses diagnoses from LPR2 or LPR3 to drop both
elevated HbA1c tests and GLD purchases during pregnancy, as these may be due
to gestational diabetes, rather than type 1 or type 2 diabetes. The aim is to
identify pregnancies based on diagnosis codes specific to pregnancy-ending
events (e.g. live births or miscarriages), and then use the dates of these
events to remove inclusion events in the preceding months that may be related
to gestational diabetes (e.g. elevated HbA1c tests or purchases of
glucose-lowering drugs during pregnancy).
After these drop functions have been applied, the output serves as
input to the add_insulin_purchases_cols() function.
Arguments
- dropped_pcos
Output from
drop_pcos().- pregnancy_dates
Output from
keep_pregnancy_dates().- included_hba1c
Output from
keep_hba1c().
Value
The same type as the input data, as a duckplyr::duckdb_tibble().
Has the same output data as the input drop_pcos(), except
for a helper logical variable no_pregnancy that is used in later
functions.
See also
See the vignette("algorithm") for the logic used to filter these
patients.
