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

Lesson 12: DEVICE_EXPOSURE, SPECIMEN & NOTE

Three additional clinical tables: DEVICE_EXPOSURE for medical devices (stent, pacemaker), SPECIMEN for specimens (blood, tissue), NOTE and NOTE_NLP for clinical notes and NLP processing.

🏗️ Architecture — Lesson 12 DEVICE_EXPOSURE, SPECIMEN & NOTES OMOP CDM 5.4 for Beginners — Understand A to Z Part 4: Expanded clinical table xdev.asia

Introduction

This article introduces three additional clinical tables: DEVICE_EXPOSURE (implantable/patient-mounted medical device), SPECIMEN (specimen used for testing), and NOTE / NOTE_NLP (free-text clinical notes). Although less common than Condition/Drug/Procedure, they are increasingly important in research.


1. DEVICE_EXPOSURE — Medical equipment

1.1. Table structure

ColumnTypeRequiredDescription
device_exposure_idINTEGER✅ PKUnique ID
person_idINTEGER✅ FKPatients
device_concept_idINTEGER✅Standard Concept
device_exposure_start_dateDATE✅Start date
device_exposure_start_datetimeDATETIME
device_exposure_end_dateDATEExpiration/removal date
device_exposure_end_datetimeDATETIME
device_type_concept_idINTEGER✅Data source
unique_device_idVARCHAR(255)Unique Device Identifier (UDI)
production_idVARCHAR(255)⭐ New CDM 5.4
quantityINTEGERQuantity
provider_idINTEGERFKDoctor
visit_occurrence_idINTEGERFKVisit
visit_detail_idINTEGERFK
device_source_valueVARCHAR(50)
device_source_concept_idINTEGER
unit_concept_idINTEGER⭐ New CDM 5.4
unit_source_valueVARCHAR(50)⭐ New CDM 5.4
unit_source_concept_idINTEGER⭐ New CDM 5.4

1.2. For example

EquipmentConceptsExample
Coronary stent4138390Stent placement after intervention
Pacemaker4051938Pacemaker
Endotracheal tube4097216Intubation during surgery
Eyeglasses4175440Prescribing glasses
Hearing aids4023396Hearing aid level
Acupuncture needles0Oriental medicine equipment (no mapping yet)
-- Đặ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

New in 5.4: production_id separate from unique_device_id, used for production identifier (serial number, lot number).


2. SPECIMEN — Patient sample

2.1. Table structure

ColumnTypeRequiredDescription
specimen_idINTEGER✅ PKUnique ID
person_idINTEGER✅ FKPatients
specimen_concept_idINTEGER✅Sample type (SNOMED)
specimen_type_concept_idINTEGER✅Data source
specimen_dateDATE✅Sampling date
specimen_datetimeDATETIME
quantityFLOATSample quantity
unit_concept_idINTEGERUnit (mL, g...)
anatomic_site_concept_idINTEGERSampling location
disease_status_concept_idINTEGERMedical condition
specimen_source_idVARCHAR(50)Original barcode
specimen_source_valueVARCHAR(50)Original model type
unit_source_valueVARCHAR(50)Original unit
anatomic_site_source_valueVARCHAR(50)Original location
disease_status_source_valueVARCHAR(50)Original state

2.2. Popular model type

specimen_concept_idSample TypeVietnamese
4045667Blood specimensBlood sample
4048506Urine specimenUrine
4002890Serum specimensSerum
4219166Tissue specimensTissue samples
4045666Sputum specimensDam
4260640Cerebrospinal fluidCerebrospinal fluid
4000626Bone marrowBone marrow

2.3. Specimen → Measurement link

-- 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)

Note: SPECIMEN does not have a direct FK to MEASUREMENT in CDM 5.4. Links are usually via person_id + date or via FACT_RELATIONSHIP.


3. NOTE — Clinical notes

3.1. NOTE table structure

ColumnTypeRequiredDescription
note_idINTEGER✅ PKUnique ID
person_idINTEGER✅ FKPatients
note_dateDATE✅Date of note
note_datetimeDATETIME
note_type_concept_idINTEGER✅Note type
note_class_concept_idINTEGER✅Classification
note_titleVARCHAR(250)Title
note_textCLOB✅Content
encoding_concept_idINTEGER✅Encoding (UTF-8)
language_concept_idINTEGER✅Language
provider_idINTEGERFKDoctor writes
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. common note_class_concept_id

Concept IDNote ClassVietnamese
44814637Discharge summaryDischarge Summary
44814638Emergency department noteEmergency notes
44814639Inpatient noteBoarding Notes
44814640Outpatient noteOutpatient Notes
44814641Pathology reportPathological results
44814642Radiology reportX-ray/CT results
44814643Surgical notesSurgical records

3.3. For example

-- 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 — NLP processing results

ColumnTypeRequiredDescription
note_nlp_idBIGINT✅ PKID
note_idINTEGER✅ FKOriginal Note
section_concept_idINTEGERSection (HPI, Assessment...)
snippetVARCHAR(250)Excerpted text
offsetVARCHAR(50)Location in note
lexical_variantVARCHAR(250)✅Root word/phrase
note_nlp_concept_idINTEGER✅Concept discovery
note_nlp_source_concept_idINTEGER
nlp_systemVARCHAR(250)Name NLP tool
nlp_dateDATE✅NLP Run Day
nlp_datetimeDATETIME
term_existsVARCHAR(1)Y/N — confirm or deny
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. When to use which table?

  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)

Summary

  1. DEVICE_EXPOSURE: implanted/attached medical device, uses UDI for tracing
  2. SPECIMEN: patient sample, indirectly linked to MEASUREMENT
  3. NOTE: free text clinical notes, Vietnamese language support
  4. NOTE_NLP: NLP analysis results, automatic concept detection
  5. CDM 5.4 added production_id (Device), note_event_id (Note)

Next article: DEATH, EPISODE & EPISODE_EVENT — special events.


References