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

Bài 12: DEVICE_EXPOSURE, SPECIMEN & NOTE

Ba bảng lâm sàng bổ sung: DEVICE_EXPOSURE cho thiết bị y tế (stent, pacemaker), SPECIMEN cho mẫu bệnh phẩm (máu, mô), NOTE và NOTE_NLP cho ghi chú lâm sàng và xử lý NLP.

🏗️ Kiến trúc — Bài 12 DEVICE_EXPOSURE, SPECIMEN & NOTE OMOP CDM 5.4 cho Người mới — Hiểu từ A đến Z Phần 4: Bảng lâm sàng mở rộng xdev.asia

Giới thiệu

Bài này giới thiệu ba bảng lâm sàng bổ sung: DEVICE_EXPOSURE (thiết bị y tế cấy/gắn trên bệnh nhân), SPECIMEN (mẫu bệnh phẩm dùng cho xét nghiệm), và NOTE / NOTE_NLP (ghi chú lâm sàng dạng văn bản tự do). Dù ít phổ biến hơn Condition/Drug/Procedure, chúng ngày càng quan trọng trong nghiên cứu.


1. DEVICE_EXPOSURE — Thiết bị y tế

1.1. Cấu trúc bảng

CộtKiểuBắt buộcMô tả
device_exposure_idINTEGER✅ PKID duy nhất
person_idINTEGER✅ FKBệnh nhân
device_concept_idINTEGER✅Standard Concept
device_exposure_start_dateDATE✅Ngày bắt đầu
device_exposure_start_datetimeDATETIME
device_exposure_end_dateDATENgày tháo/hết hạn
device_exposure_end_datetimeDATETIME
device_type_concept_idINTEGER✅Nguồn dữ liệu
unique_device_idVARCHAR(255)Unique Device Identifier (UDI)
production_idVARCHAR(255)⭐ CDM 5.4 mới
quantityINTEGERSố lượng
provider_idINTEGERFKBác sĩ
visit_occurrence_idINTEGERFKVisit
visit_detail_idINTEGERFK
device_source_valueVARCHAR(50)
device_source_concept_idINTEGER
unit_concept_idINTEGER⭐ CDM 5.4 mới
unit_source_valueVARCHAR(50)⭐ CDM 5.4 mới
unit_source_concept_idINTEGER⭐ CDM 5.4 mới

1.2. Ví dụ

Thiết bịConceptVí dụ
Stent mạch vành4138390Đặt stent sau can thiệp
Pacemaker4051938Máy tạo nhịp tim
Ống nội khí quản4097216Đặt NKQ khi phẫu thuật
Kính đeo mắt4175440Kê đơn kính
Máy trợ thính4023396Cấp máy trợ thính
Kim châm cứu0Thiết bị đông y (chưa có mapping)
-- Đặt stent mạch vành
INSERT INTO device_exposure (
    device_exposure_id, person_id, device_concept_id,
    device_exposure_start_date,
    device_type_concept_id,
    unique_device_id, quantity,
    provider_id, visit_occurrence_id,
    device_source_value
) VALUES (
    140001, 100001, 4138390,
    '2024-06-15',
    32817,
    '(01)00844588003288(17)141120(10)A213B1',
    2,                            -- 2 stent
    5001, 50001,
    'STENT_CORONARY'
);

1.3. CDM 5.4 — production_id

Mới trong 5.4: production_id tách biệt với unique_device_id, dùng cho production identifier (serial number, lot number).


2. SPECIMEN — Mẫu bệnh phẩm

2.1. Cấu trúc bảng

CộtKiểuBắt buộcMô tả
specimen_idINTEGER✅ PKID duy nhất
person_idINTEGER✅ FKBệnh nhân
specimen_concept_idINTEGER✅Loại mẫu (SNOMED)
specimen_type_concept_idINTEGER✅Nguồn dữ liệu
specimen_dateDATE✅Ngày lấy mẫu
specimen_datetimeDATETIME
quantityFLOATLượng mẫu
unit_concept_idINTEGERĐơn vị (mL, g...)
anatomic_site_concept_idINTEGERVị trí lấy mẫu
disease_status_concept_idINTEGERTình trạng bệnh lý
specimen_source_idVARCHAR(50)Mã barcode gốc
specimen_source_valueVARCHAR(50)Loại mẫu gốc
unit_source_valueVARCHAR(50)Đơn vị gốc
anatomic_site_source_valueVARCHAR(50)Vị trí gốc
disease_status_source_valueVARCHAR(50)Trạng thái gốc

2.2. Loại mẫu phổ biến

specimen_concept_idLoại mẫuTiếng Việt
4045667Blood specimenMẫu máu
4048506Urine specimenNước tiểu
4002890Serum specimenHuyết thanh
4219166Tissue specimenMẫu mô
4045666Sputum specimenĐàm
4260640Cerebrospinal fluidDịch não tủy
4000626Bone marrowTủy xương

2.3. Liên kết Specimen → Measurement

-- Mẫu máu lấy ngày 15/6
INSERT INTO specimen VALUES (
    150001, 100001, 4045667,      -- Blood specimen
    32817, '2024-06-15', NULL,
    5, 8587,                      -- 5 mL
    4236402,                      -- Antecubital vein
    NULL, 'BARCODE_123456',
    'MAU_MAU', 'mL', 'tinh_mach_khuu_tay', NULL
);

-- Xét nghiệm Glucose từ mẫu máu này
-- (liên kết qua person_id + measurement_date + logic ETL)

Lưu ý: SPECIMEN không có FK trực tiếp đến MEASUREMENT trong CDM 5.4. Liên kết thường qua person_id + date hoặc thông qua FACT_RELATIONSHIP.


3. NOTE — Ghi chú lâm sàng

3.1. Cấu trúc bảng NOTE

CộtKiểuBắt buộcMô tả
note_idINTEGER✅ PKID duy nhất
person_idINTEGER✅ FKBệnh nhân
note_dateDATE✅Ngày ghi chú
note_datetimeDATETIME
note_type_concept_idINTEGER✅Loại ghi chú
note_class_concept_idINTEGER✅Phân loại
note_titleVARCHAR(250)Tiêu đề
note_textCLOB✅Nội dung
encoding_concept_idINTEGER✅Encoding (UTF-8)
language_concept_idINTEGER✅Ngôn ngữ
provider_idINTEGERFKBác sĩ viết
visit_occurrence_idINTEGERFKVisit
visit_detail_idINTEGERFK
note_source_valueVARCHAR(50)
note_event_idBIGINT⭐ CDM 5.4
note_event_field_concept_idINTEGER⭐ CDM 5.4

3.2. note_class_concept_id phổ biến

Concept IDNote ClassTiếng Việt
44814637Discharge summaryTóm tắt xuất viện
44814638Emergency department noteGhi chú cấp cứu
44814639Inpatient noteGhi chú nội trú
44814640Outpatient noteGhi chú ngoại trú
44814641Pathology reportKết quả giải phẫu bệnh
44814642Radiology reportKết quả X-quang/CT
44814643Surgical noteBiên bản phẫu thuật

3.3. Ví dụ

-- Tóm tắt xuất viện
INSERT INTO note (
    note_id, person_id, note_date,
    note_type_concept_id, note_class_concept_id,
    note_title, note_text,
    encoding_concept_id, language_concept_id,
    provider_id, visit_occurrence_id
) VALUES (
    160001, 100001, '2024-06-20',
    32817,                            -- EHR
    44814637,                         -- Discharge summary
    'TÓM TẮT XUẤT VIỆN',
    'Bệnh nhân nam, 55 tuổi, nhập viện vì đau ngực. '
    || 'Chẩn đoán: Nhồi máu cơ tim cấp. '
    || 'Đã can thiệp mạch vành, đặt 2 stent. '
    || 'Xuất viện ngày 20/06/2024 với đơn thuốc: '
    || 'Aspirin 81mg, Clopidogrel 75mg, Atorvastatin 40mg. '
    || 'Tái khám sau 1 tháng.',
    32678,                            -- UTF-8
    4181730,                          -- Vietnamese
    5001, 50001
);

4. NOTE_NLP — Kết quả xử lý NLP

CộtKiểuBắt buộcMô tả
note_nlp_idBIGINT✅ PKID
note_idINTEGER✅ FKNote gốc
section_concept_idINTEGERSection (HPI, Assessment...)
snippetVARCHAR(250)Đoạn text trích
offsetVARCHAR(50)Vị trí trong note
lexical_variantVARCHAR(250)✅Từ/cụm từ gốc
note_nlp_concept_idINTEGER✅Concept phát hiện
note_nlp_source_concept_idINTEGER
nlp_systemVARCHAR(250)Tên NLP tool
nlp_dateDATE✅Ngày chạy NLP
nlp_datetimeDATETIME
term_existsVARCHAR(1)Y/N — khẳng định hay phủ định
term_temporalVARCHAR(50)Past/Present/Future
term_modifiersVARCHAR(2000)Modifier (negation, family...)
-- NLP phát hiện "Nhồi máu cơ tim" từ tóm tắt xuất viện
INSERT INTO note_nlp (
    note_nlp_id, note_id,
    snippet, offset, lexical_variant,
    note_nlp_concept_id,
    nlp_system, nlp_date,
    term_exists, term_temporal
) VALUES (
    170001, 160001,
    'Chẩn đoán: Nhồi máu cơ tim cấp',
    '120-153',
    'nhồi máu cơ tim cấp',
    4329847,                          -- SNOMED: AMI
    'cTAKES-VN', '2024-07-01',
    'Y',                              -- Có (không phải negation)
    'Present'                         -- Hiện tại
);

5. Khi nào dùng bảng nào?

  Dữ liệu gốc
       │
       ├── Thiết bị gắn/cấy trên BN ──→ DEVICE_EXPOSURE
       │   (stent, pacemaker, kính)
       │
       ├── Mẫu bệnh phẩm ──────────→ SPECIMEN
       │   (máu, nước tiểu, mô)
       │
       ├── Văn bản tự do ───────────→ NOTE
       │   (tóm tắt xuất viện,
       │    biên bản phẫu thuật)
       │
       └── Kết quả NLP từ NOTE ─────→ NOTE_NLP
           (concepts phát hiện tự động)

Tổng kết

  1. DEVICE_EXPOSURE: thiết bị y tế cấy/gắn, dùng UDI để truy vết
  2. SPECIMEN: mẫu bệnh phẩm, liên kết gián tiếp với MEASUREMENT
  3. NOTE: ghi chú lâm sàng dạng văn bản tự do, hỗ trợ tiếng Việt
  4. NOTE_NLP: kết quả phân tích NLP, phát hiện concept tự động
  5. CDM 5.4 thêm production_id (Device), note_event_id (Note)

Bài tiếp theo: DEATH, EPISODE & EPISODE_EVENT — các sự kiện đặc biệt.


Tài liệu tham khảo