
Export Medication Class Crosswalk from OMOP Hierarchy
Source:R/medication_classes.R
export_medication_crosswalk.RdTraverses ATC classes and RxNorm ingredient hierarchies to extract descendant RxNorm concept codes, plus historical/retired concepts that map to them via OMOP 'Maps to' relationships.
Usage
export_medication_crosswalk(
con,
medication_specs,
output_path = NULL,
include_retired = TRUE,
exclude_forms = NULL,
must_contain = NULL,
vocab_schema = NULL,
vocab_db = NULL
)Arguments
- con
Active DuckDB DBI connection.
- medication_specs
Medication class specifications list.
- output_path
Optional file path to write exported CSV.
- include_retired
Whether to include older retired RxNorm codes mapped via 'Maps to' (default TRUE).
- exclude_forms
Optional vector of dosage form strings to exclude (e.g. 'Ophthalmic', 'Topical').
- must_contain
Optional vector of required RxNorm codes or source strings; throws error if missing.
- vocab_schema
Optional schema containing vocabulary tables.
- vocab_db
Optional attached database containing vocabulary tables.