Chuyển đến nội dung chính

Lesson 16: DRUG_STRENGTH & Remaining Vocabulary tables

DRUG_STRENGTH gives drug dosage information, CONCEPT_SYNONYM, RELATIONSHIP table, and a summary of all 12 Standardized Vocabularies tables.

🏗️ Architecture — Lesson 16 DRUG_STRENGTH & Tables Vocabulary remains OMOP CDM 5.4 for Beginners — Understand A to Z Part 5: Standardized Vocabularies xdev.asia

Introduction

The last article of the Vocabulary section covers the table DRUG_STRENGTH (dosage information extracted from RxNorm) and summarizes all 12 tables in the Standardized Vocabularies group. After this article you will have a complete picture of the OMOP dictionary system.


1. DRUG_STRENGTH — Drug dosage

1.1. Table structure

ColumnTypeDescription
drug_concept_idINTEGERFK → CONCEPT (drug)
ingredient_concept_idINTEGERFK → CONCEPT (active ingredient)
amount_valueFLOATContent (tablets, capsules)
amount_unit_concept_idINTEGERUnit (mg, g, IU)
numerator_valueFLOATNumerator (solution)
numerator_unit_concept_idINTEGERUnit numerator
denominator_valueFLOATModel No.
denominator_unit_concept_idINTEGERUnit denominator
box_sizeINTEGERNumber of pills/box
valid_start_dateDATE
valid_end_dateDATE
invalid_reasonVARCHAR(1)

1.2. Two types of dose representation

Type 1: Solid (tablets, capsules) → amount_value

-- Metformin 500mg Oral Tablet
SELECT
    c_drug.concept_name AS drug_name,
    c_ing.concept_name AS ingredient,
    ds.amount_value,
    c_unit.concept_name AS unit
FROM drug_strength ds
JOIN concept c_drug ON ds.drug_concept_id = c_drug.concept_id
JOIN concept c_ing ON ds.ingredient_concept_id = c_ing.concept_id
LEFT JOIN concept c_unit ON ds.amount_unit_concept_id = c_unit.concept_id
WHERE ds.drug_concept_id = 1503328;
-- Kết quả: Metformin | 500 | milligram

Type 2: Liquid (solution, injection) → numerator/denominator

-- Amoxicillin 250mg/5mL Oral Suspension
SELECT
    c_drug.concept_name,
    ds.numerator_value,
    c_num.concept_name AS num_unit,
    ds.denominator_value,
    c_den.concept_name AS den_unit
FROM drug_strength ds
JOIN concept c_drug ON ds.drug_concept_id = c_drug.concept_id
LEFT JOIN concept c_num ON ds.numerator_unit_concept_id = c_num.concept_id
LEFT JOIN concept c_den ON ds.denominator_unit_concept_id = c_den.concept_id
WHERE ds.drug_concept_id = 19077795;
-- Kết quả: 250 mg / 5 mL

1.3. Application: Calculate actual dose

-- Tính tổng mg Metformin BN đã dùng
SELECT
    de.person_id,
    SUM(
        de.quantity *
        COALESCE(ds.amount_value, ds.numerator_value)
    ) AS total_mg,
    SUM(de.days_supply) AS total_days
FROM drug_exposure de
JOIN drug_strength ds
    ON de.drug_concept_id = ds.drug_concept_id
WHERE ds.ingredient_concept_id = 1503297  -- Metformin ingredient
  AND de.person_id = 100001
GROUP BY de.person_id;

1.4. Find all formulations of an active ingredient

-- Tất cả dạng bào chế chứa Metformin
SELECT DISTINCT
    c_drug.concept_id,
    c_drug.concept_name,
    c_drug.concept_class_id,
    ds.amount_value,
    c_unit.concept_name AS unit
FROM drug_strength ds
JOIN concept c_drug ON ds.drug_concept_id = c_drug.concept_id
JOIN concept c_unit ON ds.amount_unit_concept_id = c_unit.concept_id
WHERE ds.ingredient_concept_id = 1503297  -- Metformin
  AND c_drug.standard_concept = 'S'
ORDER BY c_drug.concept_class_id, ds.amount_value;

2. Summary of 12 tables of Standardized Vocabularies

#TableRecords (~)Role
1CONCEPT~10MDictionary of all medical concepts
2VOCABULARY~70Vocabulary source list
3DOMAIN~50List of domains (Condition, Drug...)
4CONCEPT_CLASS~400Classification in vocabulary
5CONCEPT_RELATIONSHIP~60MRelationship between concepts
6RELATIONSHIP~600Definition of relationship type
7CONCEPT_SYNONYM~10MSynonym name
8CONCEPT_ANCESTOR~80MPre-computed hierarchy
9SOURCE_TO_CONCEPT_MAPCustomCustom Mapping
10DRUG_STRENGTH~1.5MDrug Dosage
11COHORT_DEFINITIONCustomDefinition of cohort
12ATTRIBUTE_DEFINITIONCustomAttribute definition (rarely used)

3. COHORT_DEFINITION

ColumnTypeDescription
cohort_definition_idINTEGERPK
cohort_definition_nameVARCHAR(255)Cohort name
cohort_definition_descriptionCLOBDetailed description
definition_type_concept_idINTEGERType definition
cohort_definition_syntaxCLOBJSON/SQL query creates cohort
subject_concept_idINTEGERSubject (usually = person)
cohort_initiation_dateDATECreated Date

Used in combination with COHORT table (in Derived Elements) — Lesson 20 will detail.


4. ER Diagram — Vocabularies

  ┌──────────┐     ┌──────────────────┐
  │ VOCABULARY│────→│     CONCEPT      │←─── DOMAIN
  └──────────┘     │                  │←─── CONCEPT_CLASS
                   │ concept_id (PK)  │
                   │ concept_name     │
                   │ domain_id        │
                   │ vocabulary_id    │
                   │ concept_class_id │
                   │ standard_concept │
                   └─────────┬────────┘
                             │
              ┌──────────────┼──────────────┐
              │              │              │
              ↓              ↓              ↓
  ┌────────────────┐ ┌──────────────┐ ┌──────────────┐
  │CONCEPT_        │ │CONCEPT_      │ │CONCEPT_      │
  │RELATIONSHIP    │ │ANCESTOR      │ │SYNONYM       │
  │                │ │              │ │              │
  │concept_id_1 →  │ │ancestor →    │ │concept_id →  │
  │concept_id_2 →  │ │descendant →  │ │synonym_name  │
  │relationship_id │ │min_levels    │ │language       │
  └────────────────┘ │max_levels    │ └──────────────┘
         │           └──────────────┘
         ↓
  ┌──────────────┐
  │ RELATIONSHIP │    ┌──────────────┐
  └──────────────┘    │DRUG_STRENGTH │
                      │              │
                      │drug_concept→ │
                      │ingredient → │
                      │amount_value  │
                      │numerator     │
                      │denominator   │
                      └──────────────┘
  ┌─────────────────────┐
  │SOURCE_TO_CONCEPT_MAP│  (custom mapping)
  │source_code          │
  │target_concept_id →  │
  └─────────────────────┘

5. Best practices for Vocabulary management

5.1. Update Vocabulary

  1. Download từ athena.ohdsi.org (CPT4 cần license)
  2. Load vào schema vocabulary riêng
  3. Chạy script consistency check
  4. KHÔNG tự modify bảng CONCEPT / CONCEPT_RELATIONSHIP
  5. Dùng SOURCE_TO_CONCEPT_MAP cho mã tùy chỉnh

5.2. Check Vocabulary quality

-- Kiểm tra concepts hết hạn đang được dùng
SELECT
    'condition_occurrence' AS source_table,
    COUNT(*) AS invalid_concept_count
FROM condition_occurrence co
JOIN concept c ON co.condition_concept_id = c.concept_id
WHERE c.invalid_reason IS NOT NULL

UNION ALL

SELECT 'drug_exposure', COUNT(*)
FROM drug_exposure de
JOIN concept c ON de.drug_concept_id = c.concept_id
WHERE c.invalid_reason IS NOT NULL;

-- Kiểm tra mapping completeness
SELECT
    c.vocabulary_id,
    COUNT(*) AS total_concepts,
    SUM(CASE WHEN cr.concept_id_2 IS NOT NULL THEN 1 ELSE 0 END) AS mapped,
    ROUND(
        SUM(CASE WHEN cr.concept_id_2 IS NOT NULL THEN 1 ELSE 0 END) * 100.0
        / COUNT(*), 1
    ) AS mapped_pct
FROM concept c
LEFT JOIN concept_relationship cr
    ON c.concept_id = cr.concept_id_1
    AND cr.relationship_id = 'Maps to'
    AND cr.invalid_reason IS NULL
WHERE c.vocabulary_id IN ('ICD10CM', 'ICD10', 'CPT4')
  AND c.invalid_reason IS NULL
GROUP BY c.vocabulary_id;

Summary

  1. DRUG_STRENGTH: solid (amount) and liquid (numerator/denominator) dosage
  2. 12 Vocabulary tables constitute a management system of ~10 million medical concepts
  3. SOURCE_TO_CONCEPT_MAP for VN internal code → Standard Concept
  4. Vocabulary needs periodic updates from Athena, NOT self-correction
  5. DRUG_STRENGTH combined with DRUG_EXPOSURE to calculate actual dose

Next article: Part 6 — LOCATION, CARE_SITE, PROVIDER and the Health System group.


References