Refreshed Date
2026-11-20
Files
1 Download↓
Tags
Level of Review
Data Model
Vocabularies
The codeset was generated to identify patients with hormonal contraceptives as an exclusion criterion for a cohort of female patients with Polyendocrine Metabolic Syndrome in a PEDSnet feasibility request.
Variable Status
Funder(s)
Provenance
The codeset was generated to identify patients with hormonal contraceptives as an exclusion criterion for a PEDSnet feasibility request on Polyendocrine Metabolic Syndrome.
Description
The codeset was generated to identify patients with hormonal contraceptives as an exclusion criterion for a PEDSnet feasibility request on Polyendocrine Metabolic Syndrome. RxNorm SCDF and SCDG codes for levonogestrel, ethinyl estradiol, progesterone, medroxyprogesterone acetate, etonogestrel, norethindrone, drospirenone, desogestrel, norgestimate, ethynodiol, and norgestrel were identified and descendant codes were included.
Medication Term Classes
Clinical Subjects Headings
Development Code
lev <- rxnorm_code_summary(drug_name_str='levonogestrel')
eth <- rxnorm_code_summary(drug_name_str='ethinyl estradiol')
pro <- rxnorm_code_summary(drug_name_str='progesterone')
med <- rxnorm_code_summary(drug_name_str='medroxyprogesterone acetate')
eto <- rxnorm_code_summary(drug_name_str='etonogestrel')
nor <- rxnorm_code_summary(drug_name_str='norethindrone')
dro <- rxnorm_code_summary(drug_name_str='drospirenone')
des <- rxnorm_code_summary(drug_name_str='desogestrel')
norgestimate <- rxnorm_code_summary(drug_name_str='norgestimate')
ethy <- rxnorm_code_summary(drug_name_str='ethynodiol')
norgestrel <- rxnorm_code_summary(drug_name_str='norgestrel')
rx_hormonal_birth_control <- lev$drug_concepts %>% distinct(concept_id) %>% mutate(drug_type = 'levonogestrel') %>%
full_join(eth$drug_concepts %>% distinct(concept_id) %>% mutate(drug_type = 'ethinyl_estradiol')) %>%
full_join(pro$drug_concepts %>% distinct(concept_id) %>% mutate(drug_type = 'progesterone')) %>%
full_join(med$drug_concepts %>% distinct(concept_id) %>% mutate(drug_type = 'medroxyprogesterone acetate')) %>%
full_join(eto$drug_concepts %>% distinct(concept_id) %>% mutate(drug_type = 'etonogestrel')) %>%
full_join(nor$drug_concepts %>% distinct(concept_id) %>% mutate(drug_type = 'norethindrone')) %>%
full_join(dro$drug_concepts %>% distinct(concept_id) %>% mutate(drug_type = 'drospirenone')) %>%
full_join(des$drug_concepts %>% distinct(concept_id) %>% mutate(drug_type = 'desogestrel')) %>%
full_join(norgestimate$drug_concepts %>% distinct(concept_id) %>% mutate(drug_type = 'norgestimate')) %>%
full_join(ethy$drug_concepts %>% distinct(concept_id) %>% mutate(drug_type = 'ethynodiol')) %>%
full_join(norgestrel$drug_concepts %>% distinct(concept_id) %>% mutate(drug_type = 'norgestrel')) %>%
distinct(concept_id, drug_type) %>%
left_join(vocabulary_tbl('concept'), by=c('concept_id'))
remove_ethinyl_estradiol_duplicates <- rx_hormonal_birth_control %>%
group_by(concept_id) %>%
mutate(n=n()) %>%
ungroup() %>%
filter(n>1L) %>%
filter(drug_type == 'ethinyl_estradiol') %>%
distinct(concept_id, drug_type)
rx_hormonal_birth_control_dedup <- rx_hormonal_birth_control %>%
anti_join(remove_ethinyl_estradiol_duplicates, by=c('concept_id','drug_type')) %>%
left_join(remove_ethinyl_estradiol_duplicates %>%
distinct(concept_id) %>%
mutate(ethinyl_estradiol = 1L), by=c('concept_id')) %>%
mutate(ethinyl_estradiol = case_when(ethinyl_estradiol==1L | drug_type=='ethinyl_estradiol' ~ 1L,
TRUE ~ 0L)) %>%
mutate(drug_cat = 'Hormonal_Birth_Control')
write_csv(rx_hormonal_birth_control_dedup %>%
select(drug_cat, drug_type, ethinyl_estradiol,
concept_id, concept_name, vocabulary_id, concept_code) %>%
arrange(drug_cat, drug_type, concept_name) %>%
as_data_frame(), 'specs/rx_hormonal_birth_control.csv')
output_tbl(rx_hormonal_birth_control_dedup, 'rx_hormonal_birth_control_dedup')
rx_hormonal_birth_control_dedup_full <-
get_rxnorm_descendants(codeset = results_tbl('rx_hormonal_birth_control_dedup'))
write_csv(rx_hormonal_birth_control_dedup_full %>%
as_data_frame(), 'specs/rx_hormonal_birth_control_full.csv')
output_tbl(rx_hormonal_birth_control_dedup_full, 'rx_hormonal_birth_control_full')Creative Commons license
Except where otherwised noted, this item's license is described as a CC-BY Attribution 4.0 license.

