OHDSI Standardized Vocabularies v5.0

repository·master·Indexed 42 days ago

https://github.com/ohdsi/vocabulary-v5.0

Build processes for the OHDSI Standardized Vocabularies as part of the ATHENA platform. Includes workflows for recreating vocabularies using the Automated Mapping Tool (AMT), AMIS upload/update, ATC refresh/deployment, and source data loading for BDPM, CAP, and CCAM.

Tokens
75.8K
Snippets
161
Records
285
Agent score
54%

What's inside OHDSI Standardized Vocabularies

  1. Overview of OHDSI Vocabulary SQL Packages

    master
    The working folder contains SQL scripts organized into functional packages. Each package is designed for a specific stage of the vocabulary processing lifecycle, from downloading and loading source data to advanced processing and quality assurance. For detailed instructions on a specific package, refer to the README.md file located within that package's specific folder.
  2. Overview of the dm+d load stage steps

    master

    The dm+d vocabulary refresh process follows these nine sequential steps:

    1. Data Extraction and Initial Correction: Initial retrieval and cleaning of raw data.
    2. Device Segregation: Separating device-related data.
    3. Ingredients Processing: Processing ingredient information.
    4. Prepare for drug_concept_stage Population: Preparing data structures for drug concepts.
    5. Populate drug_concept_stage: Filling the drug_concept_stage table.
    6. Populate pc_stage (pack content): Filling the pc_stage table.
    7. Populate internal_relationship_stage: Filling the internal_relationship_stage table.
    8. Prepare for ds_stage (drug strength) Population: Preparing data structures for drug strength.
    9. Populate ds_stage: Filling the ds_stage table.
  3. Understand the purpose of maps_for_load_stage.sql

    master

    The maps_for_load_stage.sql script is a critical component of the CIEL vocabulary load pipeline. Its primary purpose is to build the canonical CIEL to OMOP Standard mapping set, which is used to populate the concept_relationship_stage table.

    It processes raw mapping candidates from ciel_mapping_lookup, applies prioritization and QA rules, and assigns each mapping to a ranked bucket with an explicit rule_applied label. The final output is a single, consolidated staging table: maps_for_load_stage.

  4. Recommendations for relationship_ids in ICD CDE

    master

    When defining relationships between ICD codes and replacement concepts, follow these semantic rules for relationship_id usage:

    • "Maps to": Use exclusively for 1-to-1 FULL equivalent mappings.
    • "Maps to" + "Maps to value": Use for Observations and Measurements that include specific results.
    • "Is a": Use as a temporary relationship for validation checks. This is applicable for 1-to-1 PARTIAL equivalent mappings and 1-to-many mappings.

    Important Implementation Note: While you may maintain a manual table using 'Is a' relationships, you must convert 'Is a' to 'Maps to' during the insertion process into the concept_relationship_manual table (for example, by using a CASE WHEN statement in your SQL).

  5. Understand CDISC mapping tables for Metadata Vocabulary processing

    master

    The CDISC update process utilizes two specific tables for Metadata Vocabulary processing:

    • cdisc_mapped: A table created manually outside the Load Stage (LS) containing manual mapping results.
    • cdisc_automapped: A table created inside the Load Stage (LS) containing automated mapping results.
  6. Implementation patterns in maps_for_load_stage.sql

    master

    The maps_for_load_stage.sql script follows specific defensive programming patterns to ensure data integrity:

    • NULL Safety: Uses NOT EXISTS instead of NOT IN to avoid common SQL pitfalls associated with NULL values.
    • Error Mitigation: Employs explicit blacklists for known problematic CIEL codes and crosswalks.
    • Hierarchical Mapping: Separates direct mappings (Rank 1) from crosswalk-based inferences (Rank 2) to maintain a clear hierarchy of confidence.
  7. Target tables and jobs in APIgrabber

    master

    APIgrabber populates several target tables using specific jobs. Each job corresponds to a specific API endpoint and data type:

    Target TableJob NameSource API / Parameter
    ndc_historyGetAllNDChttps://rxnav.nlm.nih.gov/api-RxNorm.getNDCStatus.html (history=1)
    rxnorm2ndc_mappingsRxNorm2NDC_Mappingshttps://rxnav.nlm.nih.gov/api-RxNorm.getAllHistoricalNDCs.html (history=1)
    rxnorm2spl_mappingsRxNorm2SPL_Mappingshttps://rxnav.nlm.nih.gov/api-RxNorm.getRxProperty.html (propName=SPL_SET_ID)
  8. Understand relationship direction constraints

    master

    To ensure the logging of changes in manual tables functions correctly, each relationship can only be used in one specific direction. These valid directions are defined within the ProcessManualRelationships function.

    You can inspect the primary relationship IDs for existing relationships using the following SQL query:

    select devv5.GetPrimaryRelationshipID(r.relationship_id) correct_rel, r.relationship_id from devv5.relationship r;
  9. Understand the dm+d Load Stage Workflow

    master

    The dm+d vocabulary loading process follows a multi-step pipeline designed to transform raw XML source data into structured OMOP-compatible staging tables. The workflow is divided into several logical phases:

    1. Data Extraction & Correction: Extracting data from source XMLs into derived tables (e.g., vtms, vmps, amps) and applying initial corrections for systematic errors.
    2. Segregation & Processing: Filtering out devices from medicinal products, standardizing ingredient units to UCUM, and parsing multi-ingredient drugs.
    3. Staging Population: Populating core staging tables including drug_concept_stage (concepts), pc_stage (pack content), internal_relationship_stage (entity links), and ds_stage (drug strength).
    4. Manual Mapping & Refinement: Identifying entities (Ingredients, Units, Dose Forms, Brands, Suppliers) that require manual mapping and uploading them to relationship_to_concept.
    5. Final Integrity: Performing deduplication, cleaning up unused concepts, and ensuring relationship integrity before the final build.

    Once these steps are complete, the data is ready for the BuildRxE() process.

  10. Understand the dm+d concept classes

    master

    The NHS dm+d (dictionary of medicines and devices) vocabulary is structured into five distinct concept classes that allow for different levels of granularity. When implementing ETL or mapping to OMOP CDM, you must distinguish between these levels:

    • Virtual Therapeutic Moiety (VTM): Represents the active substance(s) of a medicinal product.
    • Virtual Medicinal Product (VMP): Represents a medicinal product as it is marketed, defined by its VTM(s), strength, and pharmaceutical form.
    • Virtual Medicinal Product Pack (VMPP): Represents a pack containing one or more AMPs, defined by the included AMPs and their quantities.
    • Actual Medicinal Product (AMP): Represents a specific presentation of a VMP, including pack size, route of administration, and manufacturer.
    • Actual Medicinal Product Pack (AMPP): Represents a specific, marketed pack of a medicinal product with a unique identifier, containing one or more AMPs from a specific manufacturer.