@xdev-asia/xdev-knowledge-mcp 1.0.55 → 1.0.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/content/series/architecture/omop-cdm-5-4-cho-nguoi-moi-bat-dau/chapters/01-phan-1-tong-quan-nen-tang/lessons/bai-1-omop-cdm-la-gi-tai-sao-can-chuan-hoa-du-lieu-y-te.md +339 -0
  2. package/content/series/architecture/omop-cdm-5-4-cho-nguoi-moi-bat-dau/chapters/01-phan-1-tong-quan-nen-tang/lessons/bai-2-kien-truc-tong-the-omop-cdm-5-4-nhom-bang-nguyen-ly-thiet-ke.md +440 -0
  3. package/content/series/architecture/omop-cdm-5-4-cho-nguoi-moi-bat-dau/chapters/01-phan-1-tong-quan-nen-tang/lessons/bai-3-hieu-concept-trai-tim-cua-omop-cdm.md +441 -0
  4. package/content/series/architecture/omop-cdm-5-4-cho-nguoi-moi-bat-dau/chapters/02-phan-2-person-visit-nen-tang/lessons/bai-4-bang-person-quan-ly-danh-tinh-benh-nhan.md +323 -0
  5. package/content/series/architecture/omop-cdm-5-4-cho-nguoi-moi-bat-dau/chapters/02-phan-2-person-visit-nen-tang/lessons/bai-5-observation-period-khoang-thoi-gian-theo-doi-benh-nhan.md +308 -0
  6. package/content/series/architecture/omop-cdm-5-4-cho-nguoi-moi-bat-dau/chapters/02-phan-2-person-visit-nen-tang/lessons/bai-6-visit-occurrence-visit-detail-luot-kham-chi-tiet.md +353 -0
  7. package/content/series/architecture/omop-cdm-5-4-cho-nguoi-moi-bat-dau/chapters/03-phan-3-su-kien-lam-sang-chinh/lessons/bai-10-measurement-xet-nghiem-do-luong.md +409 -0
  8. package/content/series/architecture/omop-cdm-5-4-cho-nguoi-moi-bat-dau/chapters/03-phan-3-su-kien-lam-sang-chinh/lessons/bai-7-condition-occurrence-chan-doan-benh-ly.md +285 -0
  9. package/content/series/architecture/omop-cdm-5-4-cho-nguoi-moi-bat-dau/chapters/03-phan-3-su-kien-lam-sang-chinh/lessons/bai-8-drug-exposure-thuoc-dieu-tri.md +354 -0
  10. package/content/series/architecture/omop-cdm-5-4-cho-nguoi-moi-bat-dau/chapters/03-phan-3-su-kien-lam-sang-chinh/lessons/bai-9-procedure-occurrence-thu-thuat-phau-thuat.md +291 -0
  11. package/content/series/architecture/omop-cdm-5-4-cho-nguoi-moi-bat-dau/chapters/04-phan-4-bang-lam-sang-mo-rong/lessons/bai-11-observation-su-kien-lam-sang-tong-hop.md +289 -0
  12. package/content/series/architecture/omop-cdm-5-4-cho-nguoi-moi-bat-dau/chapters/04-phan-4-bang-lam-sang-mo-rong/lessons/bai-12-device-exposure-specimen-note.md +313 -0
  13. package/content/series/architecture/omop-cdm-5-4-cho-nguoi-moi-bat-dau/chapters/04-phan-4-bang-lam-sang-mo-rong/lessons/bai-13-death-episode-episode-event.md +346 -0
  14. package/content/series/architecture/omop-cdm-5-4-cho-nguoi-moi-bat-dau/chapters/05-phan-5-standardized-vocabularies/lessons/bai-14-concept-vocabulary-nen-tang-tu-dien-chuan.md +298 -0
  15. package/content/series/architecture/omop-cdm-5-4-cho-nguoi-moi-bat-dau/chapters/05-phan-5-standardized-vocabularies/lessons/bai-15-concept-relationship-concept-ancestor.md +336 -0
  16. package/content/series/architecture/omop-cdm-5-4-cho-nguoi-moi-bat-dau/chapters/05-phan-5-standardized-vocabularies/lessons/bai-16-drug-strength-cac-bang-vocabulary-con-lai.md +295 -0
  17. package/content/series/architecture/omop-cdm-5-4-cho-nguoi-moi-bat-dau/chapters/06-phan-6-health-system-economics-derived/lessons/bai-17-location-care-site-provider.md +334 -0
  18. package/content/series/architecture/omop-cdm-5-4-cho-nguoi-moi-bat-dau/chapters/06-phan-6-health-system-economics-derived/lessons/bai-18-payer-plan-period-cost.md +343 -0
  19. package/content/series/architecture/omop-cdm-5-4-cho-nguoi-moi-bat-dau/chapters/06-phan-6-health-system-economics-derived/lessons/bai-19-condition-era-drug-era-dose-era.md +418 -0
  20. package/content/series/architecture/omop-cdm-5-4-cho-nguoi-moi-bat-dau/chapters/07-phan-7-metadata-cohort-tong-ket/lessons/bai-20-cdm-source-metadata-cohort-tong-ket.md +517 -0
  21. package/content/series/architecture/omop-cdm-5-4-cho-nguoi-moi-bat-dau/index.md +385 -0
  22. package/content/series/devsecops/vyos-tu-co-ban-den-nang-cao/chapters/01-vyos-tu-co-ban-den-nang-cao/lessons/01-bai-1-gioi-thieu-vyos-va-cai-dat.md +10 -1
  23. package/content/series/devsecops/vyos-tu-co-ban-den-nang-cao/chapters/01-vyos-tu-co-ban-den-nang-cao/lessons/02-bai-2-cau-hinh-interface-va-ip-co-ban.md +4 -3
  24. package/content/series/devsecops/vyos-tu-co-ban-den-nang-cao/chapters/01-vyos-tu-co-ban-den-nang-cao/lessons/03-bai-3-nat-source-nat-destination-nat-va-masquerade.md +1 -0
  25. package/content/series/devsecops/vyos-tu-co-ban-den-nang-cao/chapters/01-vyos-tu-co-ban-den-nang-cao/lessons/04-bai-4-firewall-co-ban-rules-chains-va-groups.md +2 -2
  26. package/content/series/devsecops/vyos-tu-co-ban-den-nang-cao/chapters/01-vyos-tu-co-ban-den-nang-cao/lessons/05-bai-5-zone-based-firewall.md +2 -2
  27. package/content/series/devsecops/vyos-tu-co-ban-den-nang-cao/chapters/01-vyos-tu-co-ban-den-nang-cao/lessons/06-bai-6-dhcp-server-dns-forwarding-va-ntp.md +4 -1
  28. package/content/series/devsecops/vyos-tu-co-ban-den-nang-cao/chapters/01-vyos-tu-co-ban-den-nang-cao/lessons/07-bai-7-vlans-bonding-va-bridge.md +2 -0
  29. package/content/series/devsecops/vyos-tu-co-ban-den-nang-cao/chapters/01-vyos-tu-co-ban-den-nang-cao/lessons/08-bai-8-static-routing-va-policy-based-routing.md +2 -0
  30. package/content/series/devsecops/vyos-tu-co-ban-den-nang-cao/chapters/01-vyos-tu-co-ban-den-nang-cao/lessons/09-bai-9-dynamic-routing-ospf.md +2 -0
  31. package/content/series/devsecops/vyos-tu-co-ban-den-nang-cao/chapters/01-vyos-tu-co-ban-den-nang-cao/lessons/10-bai-10-dynamic-routing-bgp.md +2 -0
  32. package/content/series/devsecops/vyos-tu-co-ban-den-nang-cao/chapters/01-vyos-tu-co-ban-den-nang-cao/lessons/11-bai-11-vpn-wireguard-va-openvpn.md +2 -0
  33. package/content/series/devsecops/vyos-tu-co-ban-den-nang-cao/chapters/01-vyos-tu-co-ban-den-nang-cao/lessons/12-bai-12-vpn-ipsec-site-to-site.md +2 -0
  34. package/content/series/devsecops/vyos-tu-co-ban-den-nang-cao/chapters/01-vyos-tu-co-ban-den-nang-cao/lessons/13-bai-13-high-availability-vrrp-va-conntrack-sync.md +2 -0
  35. package/content/series/devsecops/vyos-tu-co-ban-den-nang-cao/chapters/01-vyos-tu-co-ban-den-nang-cao/lessons/14-bai-14-wan-load-balancing-qos-va-monitoring.md +2 -0
  36. package/content/series/devsecops/vyos-tu-co-ban-den-nang-cao/chapters/01-vyos-tu-co-ban-den-nang-cao/lessons/15-bai-15-containers-automation-va-production-best-practices.md +2 -0
  37. package/package.json +1 -1
@@ -0,0 +1,289 @@
1
+ ---
2
+ id: 019f1a00-a111-7b01-e001-omopcdm54011
3
+ title: "Bài 11: OBSERVATION — Sự kiện lâm sàng tổng hợp"
4
+ slug: bai-11-observation-su-kien-lam-sang-tong-hop
5
+ description: >-
6
+ Bảng OBSERVATION ghi nhận sự kiện lâm sàng không thuộc
7
+ Condition, Drug, Procedure, hay Measurement. Tiền sử bệnh,
8
+ lối sống, dị ứng, tiền sử gia đình, observation_event_id
9
+ mới CDM 5.4.
10
+ duration_minutes: 55
11
+ is_free: true
12
+ video_url: null
13
+ sort_order: 11
14
+ section_title: "Phần 4: Bảng lâm sàng mở rộng"
15
+ course:
16
+ id: 019f1a00-a100-7b01-e001-omopcdm54001
17
+ title: "OMOP CDM 5.4 cho Người mới — Hiểu từ A đến Z"
18
+ slug: omop-cdm-5-4-cho-nguoi-moi-bat-dau
19
+ ---
20
+
21
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 340" style="max-width: 100%; height: auto; border-radius: 12px; margin-bottom: 1.5rem;">
22
+ <defs>
23
+ <linearGradient id="bg-omop11" x1="0%" y1="0%" x2="100%" y2="100%">
24
+ <stop offset="0%" style="stop-color:#0c1222"/>
25
+ <stop offset="100%" style="stop-color:#1e293b"/>
26
+ </linearGradient>
27
+ </defs>
28
+ <rect width="1200" height="340" rx="12" fill="url(#bg-omop11)"/>
29
+ <g>
30
+ <circle cx="690" cy="80" r="22" fill="#818cf8" opacity="0.11"/>
31
+ <circle cx="770" cy="120" r="30" fill="#818cf8" opacity="0.08"/>
32
+ <circle cx="860" cy="105" r="25" fill="#818cf8" opacity="0.07"/>
33
+ <line x1="630" y1="155" x2="1100" y2="235" stroke="#818cf8" stroke-width="0.5" opacity="0.1"/>
34
+ </g>
35
+ <rect x="60" y="50" width="4" height="60" rx="2" fill="#818cf8"/>
36
+ <rect x="80" y="50" width="130" height="28" rx="14" fill="#818cf8" opacity="0.15"/>
37
+ <text x="92" y="69" font-family="system-ui,-apple-system,sans-serif" font-size="13" font-weight="600" fill="#818cf8">🏗️ Kiến trúc — Bài 11</text>
38
+ <text x="60" y="140" font-family="system-ui,-apple-system,sans-serif" font-size="34" font-weight="700" fill="#f1f5f9">
39
+ <tspan x="60" dy="0">OBSERVATION</tspan>
40
+ <tspan x="60" dy="42">Sự kiện lâm sàng tổng hợp</tspan>
41
+ </text>
42
+ <text x="60" y="244" font-family="system-ui,-apple-system,sans-serif" font-size="15" fill="#94a3b8" opacity="0.8">OMOP CDM 5.4 cho Người mới — Hiểu từ A đến Z</text>
43
+ <text x="60" y="268" font-family="system-ui,-apple-system,sans-serif" font-size="13" fill="#64748b" opacity="0.6">Phần 4: Bảng lâm sàng mở rộng</text>
44
+ <text x="1140" y="320" font-family="system-ui,-apple-system,sans-serif" font-size="12" fill="#475569" text-anchor="end" opacity="0.4">xdev.asia</text>
45
+ </svg>
46
+
47
+ ## Giới thiệu
48
+
49
+ **OBSERVATION** là bảng "catch-all" — nơi lưu trữ mọi sự kiện lâm sàng không phù hợp với Condition, Drug, Procedure, hay Measurement. Tiền sử bệnh, lối sống (hút thuốc, uống rượu), dị ứng, tiền sử gia đình, tình trạng hôn nhân — tất cả đều nằm ở đây.
50
+
51
+ ---
52
+
53
+ ## 1. Cấu trúc bảng
54
+
55
+ | Cột | Kiểu | Bắt buộc | Mô tả |
56
+ |-----|------|----------|-------|
57
+ | `observation_id` | INTEGER | ✅ PK | ID duy nhất |
58
+ | `person_id` | INTEGER | ✅ FK | Bệnh nhân |
59
+ | `observation_concept_id` | INTEGER | ✅ | Standard Concept |
60
+ | `observation_date` | DATE | ✅ | Ngày ghi nhận |
61
+ | `observation_datetime` | DATETIME | | Ngày giờ |
62
+ | `observation_type_concept_id` | INTEGER | ✅ | Nguồn dữ liệu |
63
+ | `value_as_number` | FLOAT | | Giá trị số |
64
+ | `value_as_string` | VARCHAR(60) | | Giá trị text |
65
+ | `value_as_concept_id` | INTEGER | | Giá trị danh mục |
66
+ | `qualifier_concept_id` | INTEGER | | Bổ sung ngữ cảnh |
67
+ | `unit_concept_id` | INTEGER | | Đơn vị |
68
+ | `provider_id` | INTEGER | FK | Provider ghi nhận |
69
+ | `visit_occurrence_id` | INTEGER | FK | Visit liên quan |
70
+ | `visit_detail_id` | INTEGER | FK | Visit detail |
71
+ | `observation_source_value` | VARCHAR(50) | | Mã gốc |
72
+ | `observation_source_concept_id` | INTEGER | | Concept gốc |
73
+ | `unit_source_value` | VARCHAR(50) | | Đơn vị gốc |
74
+ | `qualifier_source_value` | VARCHAR(50) | | Qualifier gốc |
75
+ | `value_as_datetime` | DATETIME | | ⭐ CDM 5.4 |
76
+ | `observation_event_id` | BIGINT | | ⭐ CDM 5.4 |
77
+ | `obs_event_field_concept_id` | INTEGER | | ⭐ CDM 5.4 |
78
+
79
+ ---
80
+
81
+ ## 2. Lưu gì vào OBSERVATION?
82
+
83
+ ### 2.1. Danh sách use case
84
+
85
+ | Use case | observation_concept_id | value | Ví dụ |
86
+ |----------|----------------------|-------|-------|
87
+ | **Hút thuốc** | 4275495 (Tobacco smoking) | value_as_concept_id | 4298794 (Current smoker) |
88
+ | **Dị ứng** | 439224 (Allergy) | value_as_concept_id | Concept thuốc/thức ăn |
89
+ | **Tiền sử gia đình** | 4167217 (Family history of) | value_as_concept_id | Concept bệnh |
90
+ | **Tình trạng hôn nhân** | 4053609 (Marital status) | value_as_concept_id | 4338692 (Married) |
91
+ | **Nhóm máu** | 4041671 (Blood type) | value_as_concept_id | 36308332 (Type O) |
92
+ | **Tiền sử bệnh** | 4214956 (History of) + condition concept | value_as_concept_id | |
93
+ | **Thai kỳ** | 4299535 (Pregnancy) | value_as_concept_id | |
94
+ | **Nghề nghiệp** | 4019962 (Occupation) | value_as_string | "Giáo viên" |
95
+
96
+ ### 2.2. OBSERVATION vs CONDITION — Khi nào lưu ở đâu?
97
+
98
+ | Dữ liệu | Bảng | Giải thích |
99
+ |---------|------|-----------|
100
+ | "Bệnh nhân bị tiểu đường type 2" | **CONDITION** | Bệnh đang hoạt động |
101
+ | "Tiền sử tiểu đường gia đình" | **OBSERVATION** | Family history |
102
+ | "BN từng bị viêm gan B (đã khỏi)" | **OBSERVATION** | History of |
103
+ | "Dị ứng Penicillin" | **OBSERVATION** | Allergy |
104
+ | "BN hút thuốc 20 năm" | **OBSERVATION** | Lifestyle |
105
+ | "Sốt 38.5°C" | **MEASUREMENT** | Có giá trị đo |
106
+
107
+ ---
108
+
109
+ ## 3. Ví dụ chi tiết
110
+
111
+ ### 3.1. Hút thuốc
112
+
113
+ ```sql
114
+ INSERT INTO observation (
115
+ observation_id, person_id, observation_concept_id,
116
+ observation_date, observation_type_concept_id,
117
+ value_as_concept_id,
118
+ observation_source_value
119
+ ) VALUES (
120
+ 130001, 100001,
121
+ 4275495, -- Tobacco smoking behavior
122
+ '2024-06-15', 32817,
123
+ 4298794, -- Current every day smoker
124
+ 'SMOKING_STATUS'
125
+ );
126
+ ```
127
+
128
+ ### 3.2. Dị ứng thuốc
129
+
130
+ ```sql
131
+ -- Dị ứng Penicillin
132
+ INSERT INTO observation (
133
+ observation_id, person_id, observation_concept_id,
134
+ observation_date, observation_type_concept_id,
135
+ value_as_concept_id,
136
+ qualifier_concept_id,
137
+ observation_source_value
138
+ ) VALUES (
139
+ 130002, 100001,
140
+ 439224, -- Allergy to substance
141
+ '2024-06-15', 32817,
142
+ 1713332, -- Penicillin (RxNorm ingredient)
143
+ 4129512, -- Severe (qualifier)
144
+ 'ALLERGY_PENICILLIN'
145
+ );
146
+ ```
147
+
148
+ ### 3.3. Tiền sử gia đình
149
+
150
+ ```sql
151
+ -- Mẹ bị ung thư vú
152
+ INSERT INTO observation (
153
+ observation_id, person_id, observation_concept_id,
154
+ observation_date, observation_type_concept_id,
155
+ value_as_concept_id,
156
+ qualifier_concept_id,
157
+ observation_source_value
158
+ ) VALUES (
159
+ 130003, 100001,
160
+ 4167217, -- Family history of clinical finding
161
+ '2024-06-15', 32817,
162
+ 4112853, -- Malignant neoplasm of breast
163
+ 4166847, -- Mother (qualifier)
164
+ 'FHX_BREAST_CANCER_MOTHER'
165
+ );
166
+ ```
167
+
168
+ ---
169
+
170
+ ## 4. observation_event_id — CDM 5.4
171
+
172
+ Tương tự measurement_event_id, cho phép liên kết observation với event khác.
173
+
174
+ ```sql
175
+ -- Ghi nhận: "Lý do nhập viện: Đau ngực"
176
+ -- Liên kết với visit_occurrence_id = 50001
177
+ INSERT INTO observation (
178
+ observation_id, person_id, observation_concept_id,
179
+ observation_date, observation_type_concept_id,
180
+ value_as_concept_id,
181
+ observation_event_id,
182
+ obs_event_field_concept_id
183
+ ) VALUES (
184
+ 130004, 100001,
185
+ 4148832, -- Chief complaint
186
+ '2024-06-15', 32817,
187
+ 77670, -- Chest pain
188
+ 50001, -- visit_occurrence_id
189
+ 1147082 -- Field = visit_occurrence.visit_occurrence_id
190
+ );
191
+ ```
192
+
193
+ ---
194
+
195
+ ## 5. qualifier_concept_id — Bổ sung ngữ cảnh
196
+
197
+ | Concept ID | Qualifier | Dùng cho |
198
+ |-----------|-----------|---------|
199
+ | 4129512 | Severe | Mức độ nặng |
200
+ | 4148136 | Mild | Mức độ nhẹ |
201
+ | 4129511 | Moderate | Mức độ vừa |
202
+ | 4166847 | Mother | Mối quan hệ gia đình |
203
+ | 4166848 | Father | Mối quan hệ gia đình |
204
+ | 4192403 | Sibling | Anh/chị/em |
205
+ | 4167233 | First degree relative | Họ hàng bậc 1 |
206
+
207
+ ---
208
+
209
+ ## 6. ETL dữ liệu VN
210
+
211
+ ```sql
212
+ -- Tiền sử từ HIS
213
+ SELECT
214
+ ROW_NUMBER() OVER() AS observation_id,
215
+ pm.person_id,
216
+ COALESCE(stcm.target_concept_id, 0) AS observation_concept_id,
217
+ ts.ngay_ghinhan AS observation_date,
218
+ 32817 AS observation_type_concept_id,
219
+ -- Map giá trị
220
+ CASE ts.loai_tiensu
221
+ WHEN 'HUT_THUOC' THEN
222
+ CASE ts.gia_tri
223
+ WHEN 'CO' THEN 4298794 -- Current smoker
224
+ WHEN 'DA_BO' THEN 4144272 -- Former smoker
225
+ WHEN 'KHONG' THEN 4144273 -- Never smoker
226
+ END
227
+ WHEN 'DI_UNG' THEN
228
+ COALESCE(stcm_drug.target_concept_id, 0)
229
+ END AS value_as_concept_id,
230
+ ts.mo_ta AS value_as_string,
231
+ ts.ma_tiensu AS observation_source_value
232
+ FROM tiensu_his ts
233
+ JOIN person_mapping pm ON ts.ma_bn = pm.source_id
234
+ LEFT JOIN source_to_concept_map stcm
235
+ ON ts.loai_tiensu = stcm.source_code
236
+ AND stcm.source_vocabulary_id = 'VN_OBS_TYPE'
237
+ LEFT JOIN source_to_concept_map stcm_drug
238
+ ON ts.gia_tri = stcm_drug.source_code
239
+ AND stcm_drug.source_vocabulary_id = 'VN_DRUG';
240
+ ```
241
+
242
+ ---
243
+
244
+ ## 7. SQL phân tích
245
+
246
+ ```sql
247
+ -- Tỉ lệ hút thuốc theo giới tính
248
+ SELECT
249
+ g.concept_name AS gender,
250
+ s.concept_name AS smoking_status,
251
+ COUNT(DISTINCT o.person_id) AS patients
252
+ FROM observation o
253
+ JOIN person p ON o.person_id = p.person_id
254
+ JOIN concept g ON p.gender_concept_id = g.concept_id
255
+ JOIN concept s ON o.value_as_concept_id = s.concept_id
256
+ WHERE o.observation_concept_id = 4275495 -- Tobacco smoking
257
+ GROUP BY g.concept_name, s.concept_name
258
+ ORDER BY g.concept_name, patients DESC;
259
+
260
+ -- Top dị ứng thuốc
261
+ SELECT
262
+ c.concept_name AS allergen,
263
+ COUNT(DISTINCT o.person_id) AS patients
264
+ FROM observation o
265
+ JOIN concept c ON o.value_as_concept_id = c.concept_id
266
+ WHERE o.observation_concept_id = 439224 -- Allergy
267
+ GROUP BY c.concept_name
268
+ ORDER BY patients DESC
269
+ LIMIT 10;
270
+ ```
271
+
272
+ ---
273
+
274
+ ## Tổng kết
275
+
276
+ 1. **OBSERVATION** = bảng "catch-all" cho dữ liệu không thuộc bảng chuyên biệt
277
+ 2. Use case chính: hút thuốc, dị ứng, tiền sử gia đình, lối sống, hôn nhân
278
+ 3. **qualifier_concept_id** thêm ngữ cảnh (mức độ, mối quan hệ)
279
+ 4. CDM 5.4: **observation_event_id** liên kết với event khác
280
+ 5. **Domain routing** quyết định Observation vs Condition vs Measurement
281
+
282
+ **Bài tiếp theo:** DEVICE_EXPOSURE, SPECIMEN & NOTE — thiết bị y tế, mẫu bệnh phẩm, và ghi chú lâm sàng.
283
+
284
+ ---
285
+
286
+ ## Tài liệu tham khảo
287
+
288
+ - [OMOP CDM 5.4 — OBSERVATION](https://ohdsi.github.io/CommonDataModel/cdm54.html#OBSERVATION)
289
+ - [Athena — Observation Domain](https://athena.ohdsi.org/)
@@ -0,0 +1,313 @@
1
+ ---
2
+ id: 019f1a00-a112-7b01-e001-omopcdm54012
3
+ title: "Bài 12: DEVICE_EXPOSURE, SPECIMEN & NOTE"
4
+ slug: bai-12-device-exposure-specimen-note
5
+ description: >-
6
+ Ba bảng lâm sàng bổ sung: DEVICE_EXPOSURE cho thiết bị y tế
7
+ (stent, pacemaker), SPECIMEN cho mẫu bệnh phẩm (máu, mô),
8
+ NOTE và NOTE_NLP cho ghi chú lâm sàng và xử lý NLP.
9
+ duration_minutes: 50
10
+ is_free: true
11
+ video_url: null
12
+ sort_order: 12
13
+ section_title: "Phần 4: Bảng lâm sàng mở rộng"
14
+ course:
15
+ id: 019f1a00-a100-7b01-e001-omopcdm54001
16
+ title: "OMOP CDM 5.4 cho Người mới — Hiểu từ A đến Z"
17
+ slug: omop-cdm-5-4-cho-nguoi-moi-bat-dau
18
+ ---
19
+
20
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 340" style="max-width: 100%; height: auto; border-radius: 12px; margin-bottom: 1.5rem;">
21
+ <defs>
22
+ <linearGradient id="bg-omop12" x1="0%" y1="0%" x2="100%" y2="100%">
23
+ <stop offset="0%" style="stop-color:#0c1222"/>
24
+ <stop offset="100%" style="stop-color:#1e293b"/>
25
+ </linearGradient>
26
+ </defs>
27
+ <rect width="1200" height="340" rx="12" fill="url(#bg-omop12)"/>
28
+ <g>
29
+ <circle cx="680" cy="90" r="24" fill="#818cf8" opacity="0.12"/>
30
+ <circle cx="760" cy="110" r="18" fill="#818cf8" opacity="0.09"/>
31
+ <circle cx="840" cy="130" r="32" fill="#818cf8" opacity="0.06"/>
32
+ <line x1="620" y1="160" x2="1100" y2="240" stroke="#818cf8" stroke-width="0.5" opacity="0.1"/>
33
+ </g>
34
+ <rect x="60" y="50" width="4" height="60" rx="2" fill="#818cf8"/>
35
+ <rect x="80" y="50" width="130" height="28" rx="14" fill="#818cf8" opacity="0.15"/>
36
+ <text x="92" y="69" font-family="system-ui,-apple-system,sans-serif" font-size="13" font-weight="600" fill="#818cf8">🏗️ Kiến trúc — Bài 12</text>
37
+ <text x="60" y="140" font-family="system-ui,-apple-system,sans-serif" font-size="34" font-weight="700" fill="#f1f5f9">
38
+ <tspan x="60" dy="0">DEVICE_EXPOSURE,</tspan>
39
+ <tspan x="60" dy="42">SPECIMEN &amp; NOTE</tspan>
40
+ </text>
41
+ <text x="60" y="244" font-family="system-ui,-apple-system,sans-serif" font-size="15" fill="#94a3b8" opacity="0.8">OMOP CDM 5.4 cho Người mới — Hiểu từ A đến Z</text>
42
+ <text x="60" y="268" font-family="system-ui,-apple-system,sans-serif" font-size="13" fill="#64748b" opacity="0.6">Phần 4: Bảng lâm sàng mở rộng</text>
43
+ <text x="1140" y="320" font-family="system-ui,-apple-system,sans-serif" font-size="12" fill="#475569" text-anchor="end" opacity="0.4">xdev.asia</text>
44
+ </svg>
45
+
46
+ ## Giới thiệu
47
+
48
+ 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.
49
+
50
+ ---
51
+
52
+ ## 1. DEVICE_EXPOSURE — Thiết bị y tế
53
+
54
+ ### 1.1. Cấu trúc bảng
55
+
56
+ | Cột | Kiểu | Bắt buộc | Mô tả |
57
+ |-----|------|----------|-------|
58
+ | `device_exposure_id` | INTEGER | ✅ PK | ID duy nhất |
59
+ | `person_id` | INTEGER | ✅ FK | Bệnh nhân |
60
+ | `device_concept_id` | INTEGER | ✅ | Standard Concept |
61
+ | `device_exposure_start_date` | DATE | ✅ | Ngày bắt đầu |
62
+ | `device_exposure_start_datetime` | DATETIME | | |
63
+ | `device_exposure_end_date` | DATE | | Ngày tháo/hết hạn |
64
+ | `device_exposure_end_datetime` | DATETIME | | |
65
+ | `device_type_concept_id` | INTEGER | ✅ | Nguồn dữ liệu |
66
+ | `unique_device_id` | VARCHAR(255) | | Unique Device Identifier (UDI) |
67
+ | `production_id` | VARCHAR(255) | | ⭐ CDM 5.4 mới |
68
+ | `quantity` | INTEGER | | Số lượng |
69
+ | `provider_id` | INTEGER | FK | Bác sĩ |
70
+ | `visit_occurrence_id` | INTEGER | FK | Visit |
71
+ | `visit_detail_id` | INTEGER | FK | |
72
+ | `device_source_value` | VARCHAR(50) | | |
73
+ | `device_source_concept_id` | INTEGER | | |
74
+ | `unit_concept_id` | INTEGER | | ⭐ CDM 5.4 mới |
75
+ | `unit_source_value` | VARCHAR(50) | | ⭐ CDM 5.4 mới |
76
+ | `unit_source_concept_id` | INTEGER | | ⭐ CDM 5.4 mới |
77
+
78
+ ### 1.2. Ví dụ
79
+
80
+ | Thiết bị | Concept | Ví dụ |
81
+ |---------|---------|-------|
82
+ | Stent mạch vành | 4138390 | Đặt stent sau can thiệp |
83
+ | Pacemaker | 4051938 | Máy tạo nhịp tim |
84
+ | Ống nội khí quản | 4097216 | Đặt NKQ khi phẫu thuật |
85
+ | Kính đeo mắt | 4175440 | Kê đơn kính |
86
+ | Máy trợ thính | 4023396 | Cấp máy trợ thính |
87
+ | Kim châm cứu | 0 | Thiết bị đông y (chưa có mapping) |
88
+
89
+ ```sql
90
+ -- Đặt stent mạch vành
91
+ INSERT INTO device_exposure (
92
+ device_exposure_id, person_id, device_concept_id,
93
+ device_exposure_start_date,
94
+ device_type_concept_id,
95
+ unique_device_id, quantity,
96
+ provider_id, visit_occurrence_id,
97
+ device_source_value
98
+ ) VALUES (
99
+ 140001, 100001, 4138390,
100
+ '2024-06-15',
101
+ 32817,
102
+ '(01)00844588003288(17)141120(10)A213B1',
103
+ 2, -- 2 stent
104
+ 5001, 50001,
105
+ 'STENT_CORONARY'
106
+ );
107
+ ```
108
+
109
+ ### 1.3. CDM 5.4 — production_id
110
+
111
+ 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).
112
+
113
+ ---
114
+
115
+ ## 2. SPECIMEN — Mẫu bệnh phẩm
116
+
117
+ ### 2.1. Cấu trúc bảng
118
+
119
+ | Cột | Kiểu | Bắt buộc | Mô tả |
120
+ |-----|------|----------|-------|
121
+ | `specimen_id` | INTEGER | ✅ PK | ID duy nhất |
122
+ | `person_id` | INTEGER | ✅ FK | Bệnh nhân |
123
+ | `specimen_concept_id` | INTEGER | ✅ | Loại mẫu (SNOMED) |
124
+ | `specimen_type_concept_id` | INTEGER | ✅ | Nguồn dữ liệu |
125
+ | `specimen_date` | DATE | ✅ | Ngày lấy mẫu |
126
+ | `specimen_datetime` | DATETIME | | |
127
+ | `quantity` | FLOAT | | Lượng mẫu |
128
+ | `unit_concept_id` | INTEGER | | Đơn vị (mL, g...) |
129
+ | `anatomic_site_concept_id` | INTEGER | | Vị trí lấy mẫu |
130
+ | `disease_status_concept_id` | INTEGER | | Tình trạng bệnh lý |
131
+ | `specimen_source_id` | VARCHAR(50) | | Mã barcode gốc |
132
+ | `specimen_source_value` | VARCHAR(50) | | Loại mẫu gốc |
133
+ | `unit_source_value` | VARCHAR(50) | | Đơn vị gốc |
134
+ | `anatomic_site_source_value` | VARCHAR(50) | | Vị trí gốc |
135
+ | `disease_status_source_value` | VARCHAR(50) | | Trạng thái gốc |
136
+
137
+ ### 2.2. Loại mẫu phổ biến
138
+
139
+ | specimen_concept_id | Loại mẫu | Tiếng Việt |
140
+ |--------------------|----------|-----------|
141
+ | 4045667 | Blood specimen | Mẫu máu |
142
+ | 4048506 | Urine specimen | Nước tiểu |
143
+ | 4002890 | Serum specimen | Huyết thanh |
144
+ | 4219166 | Tissue specimen | Mẫu mô |
145
+ | 4045666 | Sputum specimen | Đàm |
146
+ | 4260640 | Cerebrospinal fluid | Dịch não tủy |
147
+ | 4000626 | Bone marrow | Tủy xương |
148
+
149
+ ### 2.3. Liên kết Specimen → Measurement
150
+
151
+ ```sql
152
+ -- Mẫu máu lấy ngày 15/6
153
+ INSERT INTO specimen VALUES (
154
+ 150001, 100001, 4045667, -- Blood specimen
155
+ 32817, '2024-06-15', NULL,
156
+ 5, 8587, -- 5 mL
157
+ 4236402, -- Antecubital vein
158
+ NULL, 'BARCODE_123456',
159
+ 'MAU_MAU', 'mL', 'tinh_mach_khuu_tay', NULL
160
+ );
161
+
162
+ -- Xét nghiệm Glucose từ mẫu máu này
163
+ -- (liên kết qua person_id + measurement_date + logic ETL)
164
+ ```
165
+
166
+ > **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.
167
+
168
+ ---
169
+
170
+ ## 3. NOTE — Ghi chú lâm sàng
171
+
172
+ ### 3.1. Cấu trúc bảng NOTE
173
+
174
+ | Cột | Kiểu | Bắt buộc | Mô tả |
175
+ |-----|------|----------|-------|
176
+ | `note_id` | INTEGER | ✅ PK | ID duy nhất |
177
+ | `person_id` | INTEGER | ✅ FK | Bệnh nhân |
178
+ | `note_date` | DATE | ✅ | Ngày ghi chú |
179
+ | `note_datetime` | DATETIME | | |
180
+ | `note_type_concept_id` | INTEGER | ✅ | Loại ghi chú |
181
+ | `note_class_concept_id` | INTEGER | ✅ | Phân loại |
182
+ | `note_title` | VARCHAR(250) | | Tiêu đề |
183
+ | `note_text` | CLOB | ✅ | Nội dung |
184
+ | `encoding_concept_id` | INTEGER | ✅ | Encoding (UTF-8) |
185
+ | `language_concept_id` | INTEGER | ✅ | Ngôn ngữ |
186
+ | `provider_id` | INTEGER | FK | Bác sĩ viết |
187
+ | `visit_occurrence_id` | INTEGER | FK | Visit |
188
+ | `visit_detail_id` | INTEGER | FK | |
189
+ | `note_source_value` | VARCHAR(50) | | |
190
+ | `note_event_id` | BIGINT | | ⭐ CDM 5.4 |
191
+ | `note_event_field_concept_id` | INTEGER | | ⭐ CDM 5.4 |
192
+
193
+ ### 3.2. note_class_concept_id phổ biến
194
+
195
+ | Concept ID | Note Class | Tiếng Việt |
196
+ |-----------|-----------|-----------|
197
+ | 44814637 | Discharge summary | Tóm tắt xuất viện |
198
+ | 44814638 | Emergency department note | Ghi chú cấp cứu |
199
+ | 44814639 | Inpatient note | Ghi chú nội trú |
200
+ | 44814640 | Outpatient note | Ghi chú ngoại trú |
201
+ | 44814641 | Pathology report | Kết quả giải phẫu bệnh |
202
+ | 44814642 | Radiology report | Kết quả X-quang/CT |
203
+ | 44814643 | Surgical note | Biên bản phẫu thuật |
204
+
205
+ ### 3.3. Ví dụ
206
+
207
+ ```sql
208
+ -- Tóm tắt xuất viện
209
+ INSERT INTO note (
210
+ note_id, person_id, note_date,
211
+ note_type_concept_id, note_class_concept_id,
212
+ note_title, note_text,
213
+ encoding_concept_id, language_concept_id,
214
+ provider_id, visit_occurrence_id
215
+ ) VALUES (
216
+ 160001, 100001, '2024-06-20',
217
+ 32817, -- EHR
218
+ 44814637, -- Discharge summary
219
+ 'TÓM TẮT XUẤT VIỆN',
220
+ 'Bệnh nhân nam, 55 tuổi, nhập viện vì đau ngực. '
221
+ || 'Chẩn đoán: Nhồi máu cơ tim cấp. '
222
+ || 'Đã can thiệp mạch vành, đặt 2 stent. '
223
+ || 'Xuất viện ngày 20/06/2024 với đơn thuốc: '
224
+ || 'Aspirin 81mg, Clopidogrel 75mg, Atorvastatin 40mg. '
225
+ || 'Tái khám sau 1 tháng.',
226
+ 32678, -- UTF-8
227
+ 4181730, -- Vietnamese
228
+ 5001, 50001
229
+ );
230
+ ```
231
+
232
+ ---
233
+
234
+ ## 4. NOTE_NLP — Kết quả xử lý NLP
235
+
236
+ | Cột | Kiểu | Bắt buộc | Mô tả |
237
+ |-----|------|----------|-------|
238
+ | `note_nlp_id` | BIGINT | ✅ PK | ID |
239
+ | `note_id` | INTEGER | ✅ FK | Note gốc |
240
+ | `section_concept_id` | INTEGER | | Section (HPI, Assessment...) |
241
+ | `snippet` | VARCHAR(250) | | Đoạn text trích |
242
+ | `offset` | VARCHAR(50) | | Vị trí trong note |
243
+ | `lexical_variant` | VARCHAR(250) | ✅ | Từ/cụm từ gốc |
244
+ | `note_nlp_concept_id` | INTEGER | ✅ | Concept phát hiện |
245
+ | `note_nlp_source_concept_id` | INTEGER | | |
246
+ | `nlp_system` | VARCHAR(250) | | Tên NLP tool |
247
+ | `nlp_date` | DATE | ✅ | Ngày chạy NLP |
248
+ | `nlp_datetime` | DATETIME | | |
249
+ | `term_exists` | VARCHAR(1) | | Y/N — khẳng định hay phủ định |
250
+ | `term_temporal` | VARCHAR(50) | | Past/Present/Future |
251
+ | `term_modifiers` | VARCHAR(2000) | | Modifier (negation, family...) |
252
+
253
+ ```sql
254
+ -- NLP phát hiện "Nhồi máu cơ tim" từ tóm tắt xuất viện
255
+ INSERT INTO note_nlp (
256
+ note_nlp_id, note_id,
257
+ snippet, offset, lexical_variant,
258
+ note_nlp_concept_id,
259
+ nlp_system, nlp_date,
260
+ term_exists, term_temporal
261
+ ) VALUES (
262
+ 170001, 160001,
263
+ 'Chẩn đoán: Nhồi máu cơ tim cấp',
264
+ '120-153',
265
+ 'nhồi máu cơ tim cấp',
266
+ 4329847, -- SNOMED: AMI
267
+ 'cTAKES-VN', '2024-07-01',
268
+ 'Y', -- Có (không phải negation)
269
+ 'Present' -- Hiện tại
270
+ );
271
+ ```
272
+
273
+ ---
274
+
275
+ ## 5. Khi nào dùng bảng nào?
276
+
277
+ ```
278
+ Dữ liệu gốc
279
+
280
+ ├── Thiết bị gắn/cấy trên BN ──→ DEVICE_EXPOSURE
281
+ │ (stent, pacemaker, kính)
282
+
283
+ ├── Mẫu bệnh phẩm ──────────→ SPECIMEN
284
+ │ (máu, nước tiểu, mô)
285
+
286
+ ├── Văn bản tự do ───────────→ NOTE
287
+ │ (tóm tắt xuất viện,
288
+ │ biên bản phẫu thuật)
289
+
290
+ └── Kết quả NLP từ NOTE ─────→ NOTE_NLP
291
+ (concepts phát hiện tự động)
292
+ ```
293
+
294
+ ---
295
+
296
+ ## Tổng kết
297
+
298
+ 1. **DEVICE_EXPOSURE**: thiết bị y tế cấy/gắn, dùng UDI để truy vết
299
+ 2. **SPECIMEN**: mẫu bệnh phẩm, liên kết gián tiếp với MEASUREMENT
300
+ 3. **NOTE**: ghi chú lâm sàng dạng văn bản tự do, hỗ trợ tiếng Việt
301
+ 4. **NOTE_NLP**: kết quả phân tích NLP, phát hiện concept tự động
302
+ 5. CDM 5.4 thêm `production_id` (Device), `note_event_id` (Note)
303
+
304
+ **Bài tiếp theo:** DEATH, EPISODE & EPISODE_EVENT — các sự kiện đặc biệt.
305
+
306
+ ---
307
+
308
+ ## Tài liệu tham khảo
309
+
310
+ - [OMOP CDM 5.4 — DEVICE_EXPOSURE](https://ohdsi.github.io/CommonDataModel/cdm54.html#DEVICE_EXPOSURE)
311
+ - [OMOP CDM 5.4 — SPECIMEN](https://ohdsi.github.io/CommonDataModel/cdm54.html#SPECIMEN)
312
+ - [OMOP CDM 5.4 — NOTE](https://ohdsi.github.io/CommonDataModel/cdm54.html#NOTE)
313
+ - [OMOP CDM 5.4 — NOTE_NLP](https://ohdsi.github.io/CommonDataModel/cdm54.html#NOTE_NLP)