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

Bài 3: Athena — Tra cứu & Quản lý Standardized Vocabularies

Sử dụng Athena để tra cứu Standard Concepts, hiểu Vocabulary hierarchy (ICD-10, SNOMED CT, RxNorm, LOINC, ATC), concept relationships, cách tải và import vocabularies vào OMOP CDM database, mapping giữa source concepts và standard concepts.

🏗️ Kiến trúc — Bài 3 Bài 3: Athena — Tra cứu & Quản lý Standardized Vocabularies

OHDSI & OMOP CDM — Phân tích Dữ liệu Y tế Toàn diện

Phần 1: Tổng quan OHDSI & OMOP CDM

xdev.asia

Bài 3: Athena — Standardized Vocabularies

Giới thiệu

Athena (https://athena.ohdsi.org) là cổng tra cứu và tải Standardized Vocabularies — bộ từ vựng chuẩn quốc tế cho toàn bộ hệ sinh thái OHDSI. Mọi concept trong OMOP CDM đều xuất phát từ đây.

Bài này hướng dẫn cách tra cứu concepts, hiểu các vocabulary phổ biến, concept relationships, và quy trình tải/import vocabularies vào database.


1. Athena — Giao diện tra cứu

1.1 Truy cập Athena

URL: https://athena.ohdsi.org
Đăng ký: Tạo tài khoản miễn phí (cần cho download vocabularies)

Giao diện chính:
┌─────────────────────────────────────────────────────────┐
│  ATHENA — OHDSI Standardized Vocabularies               │
│                                                         │
│  Search: [_____________________________________] [🔍]   │
│                                                         │
│  Filters:                                               │
│  ☑ Standard Concepts Only                               │
│  Domain: [All ▼]                                        │
│  Vocabulary: [All ▼]                                    │
│  Concept Class: [All ▼]                                 │
│  Invalid Reason: [Valid Only ▼]                          │
└─────────────────────────────────────────────────────────┘

1.2 Tra cứu cơ bản

Ví dụ: Tìm "Hypertension"

Kết quả:
┌────────────┬──────────────────────────────┬────────┬──────────┐
│ Concept ID │ Concept Name                  │ Domain │ Vocab    │
├────────────┼──────────────────────────────┼────────┼──────────┤
│ 320128     │ Essential hypertension        │ Condi  │ SNOMED   │ ★ Standard
│ 316866     │ Hypertensive disorder         │ Condi  │ SNOMED   │ ★ Standard
│ 45566052   │ Essential (primary) HTN       │ Condi  │ ICD10CM  │   Non-std
│ 4228112    │ Secondary hypertension        │ Condi  │ SNOMED   │ ★ Standard
└────────────┴──────────────────────────────┴────────┴──────────┘

Chú ý:
- ★ Standard = concept dùng cho phân tích (standard_concept = 'S')
- Non-std = concept nguồn, cần mapping sang standard

1.3 Chi tiết Concept

Concept ID: 320128
Name: Essential hypertension
Domain: Condition
Vocabulary: SNOMED
Concept Class: Clinical Finding
Concept Code: 59621000
Standard: Standard (S)

Relationships:
├── Maps to: Essential hypertension (320128) — chính nó
├── Is a:    Hypertensive disorder (316866) — parent
├── Has finding site: Vascular structure (4167085)
├── Mapped from:
│   ├── I10 — Essential (primary) hypertension (ICD-10-CM)
│   ├── 401.9 — Unspecified essential HTN (ICD-9-CM)
│   └── K86 — Uncomplicated hypertension (ICPC)

2. Vocabulary Chính trong OHDSI

2.1 Tổng quan

VocabularyDomainMô tảStandard?
SNOMED CTCondition, Procedure, ObservationThuật ngữ y khoa quốc tế✅ Standard
RxNormDrugThuốc (thị trường Mỹ)✅ Standard
RxNorm ExtensionDrugThuốc quốc tế (outside US)✅ Standard
LOINCMeasurementXét nghiệm, đo lường✅ Standard
ICD-10-CMConditionChẩn đoán (phổ biến VN)❌ Source
ICD-9-CMConditionChẩn đoán (legacy)❌ Source
ATCDrugPhân loại thuốc (WHO)❌ Classification
CPT4ProcedureThủ thuật (Mỹ)✅ Standard
HCPCSProcedure, DeviceDịch vụ y tế (Mỹ)✅ Standard
UCUMUnitĐơn vị đo lường✅ Standard
GenderGenderGiới tính✅ Standard
RaceRaceChủng tộc✅ Standard

2.2 SNOMED CT — Vocabulary quan trọng nhất

Hierarchy SNOMED CT:

Clinical Finding
├── Disease (bệnh)
│   ├── Disorder of cardiovascular system
│   │   ├── Hypertensive disorder (316866)
│   │   │   ├── Essential hypertension (320128)
│   │   │   ├── Malignant hypertension (4133004)
│   │   │   └── Secondary hypertension (4228112)
│   │   ├── Ischemic heart disease
│   │   │   ├── Acute myocardial infarction (4329847)
│   │   │   └── Chronic ischemic heart disease (318443)
│   │   └── Heart failure (316139)
│   └── Disorder of endocrine system
│       └── Diabetes mellitus (201820)

Procedure
├── Surgical procedure
│   ├── Coronary artery bypass (4336464)
│   └── Appendectomy (4239414)
└── Diagnostic procedure
    ├── Echocardiography (4055702)
    └── Colonoscopy (4249893)

2.3 RxNorm — Drug Hierarchy

RxNorm Concept Classes (từ tổng quát → chi tiết):

Ingredient (hoạt chất)
  └── Amlodipine (1332418)

Clinical Drug Component
  └── Amlodipine 5 MG

Clinical Drug Form
  └── Amlodipine Oral Tablet

Clinical Drug (thuốc cụ thể)
  └── Amlodipine 5 MG Oral Tablet (1332419) ← phổ biến nhất

Branded Drug
  └── Norvasc 5 MG Oral Tablet

Quantified Branded Drug
  └── Norvasc 5 MG Oral Tablet [Box of 30]

2.4 LOINC — Measurement Codes

LOINC cho xét nghiệm phổ biến:

LOINC Code  │ Concept Name                    │ Concept ID
────────────┼─────────────────────────────────┼───────────
2345-7      │ Glucose [Mass/volume] in Serum   │ 3004410
4548-4      │ Hemoglobin A1c                   │ 3004501
2160-0      │ Creatinine in Serum              │ 3016723
33914-3     │ eGFR                             │ 46236952
718-7       │ Hemoglobin                       │ 3000963
2093-3      │ Cholesterol Total                │ 3027114
6690-2      │ WBC count                        │ 3010813

3. Concept Relationships

3.1 Relationship Types quan trọng

-- Maps to: Source → Standard
-- ICD-10 "I10" → SNOMED "Essential hypertension"
SELECT *
FROM concept_relationship
WHERE concept_id_1 = 45566052    -- ICD-10 I10
  AND relationship_id = 'Maps to';
-- → concept_id_2 = 320128 (SNOMED Essential HTN)

-- Is a: Child → Parent (hierarchy)
SELECT *
FROM concept_relationship
WHERE concept_id_1 = 320128      -- Essential HTN
  AND relationship_id = 'Is a';
-- → concept_id_2 = 316866 (Hypertensive disorder)

-- Mapped from: Standard ← Source (reverse)
-- Subsumes: Parent ← Child (reverse of "Is a")

3.2 CONCEPT_ANCESTOR — Ancestor Tree

-- Tìm tất cả descendants của "Hypertensive disorder" (316866)
SELECT
  ca.descendant_concept_id,
  c.concept_name,
  ca.min_levels_of_separation,
  ca.max_levels_of_separation
FROM concept_ancestor ca
JOIN concept c ON ca.descendant_concept_id = c.concept_id
WHERE ca.ancestor_concept_id = 316866
  AND c.standard_concept = 'S'
ORDER BY ca.min_levels_of_separation;

-- Kết quả: Tất cả bệnh thuộc nhóm Hypertensive
-- → Essential HTN, Malignant HTN, Renovascular HTN, ...
-- → Rất hữu ích cho Cohort Definitions trong ATLAS!

4. Tải và Import Vocabularies

4.1 Download từ Athena

Bước 1: Đăng nhập athena.ohdsi.org
Bước 2: Chọn tab "Download"
Bước 3: Chọn vocabularies cần thiết

Vocabularies nên chọn (cho Việt Nam):
☑ SNOMED CT         ← Bắt buộc (Condition, Procedure standard)
☑ RxNorm            ← Bắt buộc (Drug standard)
☑ RxNorm Extension  ← Thuốc ngoài thị trường Mỹ
☑ LOINC             ← Xét nghiệm
☑ ICD-10-CM         ← Chẩn đoán (mapping source)
☑ ICD-10            ← WHO version
☑ ATC               ← Phân loại thuốc WHO
☑ UCUM              ← Đơn vị đo
☑ Gender            ← Giới tính
☑ Race              ← Chủng tộc
☑ Ethnicity         ← Dân tộc
☑ Visit             ← Loại visit
☑ Type Concept      ← Nguồn dữ liệu

Lưu ý: SNOMED CT yêu cầu license (miễn phí cho nghiên cứu)
        → Click "License required", trả lời form

Bước 4: Download → ZIP file ~2GB

4.2 Cấu trúc file download

vocabulary_download_xxxxx/
├── CONCEPT.csv             (~7M rows, ~1.5GB)
├── VOCABULARY.csv
├── DOMAIN.csv
├── CONCEPT_CLASS.csv
├── CONCEPT_RELATIONSHIP.csv (~50M rows, ~5GB)
├── RELATIONSHIP.csv
├── CONCEPT_SYNONYM.csv
├── CONCEPT_ANCESTOR.csv    (~80M rows, ~3GB)
├── DRUG_STRENGTH.csv
└── SOURCE_TO_CONCEPT_MAP.csv

4.3 Import vào PostgreSQL

# Script import vocabularies vào PostgreSQL
# Giả sử schema OMOP CDM đã được tạo

export PGHOST=localhost
export PGPORT=5432
export PGDATABASE=ohdsi
export PGUSER=ohdsi_admin
export VOCAB_DIR=/path/to/vocabulary_download

# Import từng file CSV
for table in CONCEPT VOCABULARY DOMAIN CONCEPT_CLASS \
             CONCEPT_RELATIONSHIP RELATIONSHIP \
             CONCEPT_SYNONYM CONCEPT_ANCESTOR \
             DRUG_STRENGTH SOURCE_TO_CONCEPT_MAP; do

  echo "Loading $table..."
  psql -c "\COPY ${table} FROM '${VOCAB_DIR}/${table}.csv' \
    WITH (FORMAT csv, HEADER true, DELIMITER E'\t', QUOTE E'\b')"

done

# Tạo indexes (rất quan trọng cho performance!)
echo "Creating indexes..."
psql -f /path/to/omop_cdm_indexes.sql

echo "Done! Vocabularies loaded."
-- omop_cdm_indexes.sql — Indexes quan trọng
CREATE INDEX idx_concept_concept_id ON concept (concept_id);
CREATE INDEX idx_concept_code ON concept (concept_code);
CREATE INDEX idx_concept_vocab ON concept (vocabulary_id);
CREATE INDEX idx_concept_domain ON concept (domain_id);
CREATE INDEX idx_concept_class ON concept (concept_class_id);

CREATE INDEX idx_cr_concept1 ON concept_relationship (concept_id_1);
CREATE INDEX idx_cr_concept2 ON concept_relationship (concept_id_2);
CREATE INDEX idx_cr_relationship ON concept_relationship (relationship_id);

CREATE INDEX idx_ca_ancestor ON concept_ancestor (ancestor_concept_id);
CREATE INDEX idx_ca_descendant ON concept_ancestor (descendant_concept_id);

5. SOURCE_TO_CONCEPT_MAP — Custom Mapping

Khi dữ liệu nguồn có mã riêng (không phải vocabulary chuẩn):

-- Ví dụ: Bệnh viện dùng mã nội bộ cho thuốc
-- "AMLO5" → Amlodipine 5mg Oral Tablet (RxNorm 1332419)

INSERT INTO source_to_concept_map (
  source_code,
  source_concept_id,
  source_vocabulary_id,
  target_concept_id,
  target_vocabulary_id,
  valid_start_date,
  valid_end_date
) VALUES (
  'AMLO5',
  0,                      -- Source concept chưa có trong vocabulary
  'MY_HOSPITAL_DRUG',     -- Vocabulary ID tự tạo
  1332419,                -- Amlodipine 5mg (RxNorm)
  'RxNorm',
  '2024-01-01',
  '2099-12-31'
);

6. Tips tra cứu Athena hiệu quả

1. Luôn filter "Standard Concepts Only" khi tìm concept cho phân tích
   → Non-standard concepts chỉ dùng trong ETL mapping

2. Dùng Concept ID thay vì tên khi viết SQL
   → Tên có thể thay đổi giữa các phiên bản vocabulary

3. Kiểm tra "Mapped from" để xác nhận mapping
   → ICD-10 "I10" maps to SNOMED "Essential HTN"?

4. Dùng Concept Ancestor cho cohort definitions
   → Chọn ancestor concept = tự động bao gồm descendants

5. Cập nhật vocabularies định kỳ (mỗi 6 tháng)
   → Vocabularies được update liên tục (concepts mới, mappings mới)

Tóm tắt

Khái niệmGiải thích
AthenaWeb portal tra cứu và tải Standardized Vocabularies
Standard ConceptConcept chuẩn dùng trong phân tích (SNOMED, RxNorm, LOINC)
Source ConceptConcept từ vocabulary gốc (ICD-10, mã nội bộ)
Maps toRelationship mapping source → standard concept
Concept AncestorBảng hierarchy cho tìm con/cháu của concept
SNOMED CTVocabulary chuẩn cho Condition & Procedure
RxNormVocabulary chuẩn cho Drug
LOINCVocabulary chuẩn cho Measurement (xét nghiệm)

Bài tiếp theo: WhiteRabbit & Rabbit-in-a-Hat — Khảo sát dữ liệu nguồn & Thiết kế ETL