etl-to-omop-cdm
Skill này làm gì
Skill này ánh xạ các phát hiện đã mã hóa từ ghi chú lâm sàng, như bệnh, thuốc và kết quả xét nghiệm, vào các bảng OMOP CDM để phân tích OHDSI. Dành cho các nhóm dữ liệu xây cơ sở dữ liệu nghiên cứu từ văn bản lâm sàng.
Khi nào nên dùng
- ✓Khi bạn muốn nạp bệnh, thuốc hoặc xét nghiệm lấy từ ghi chú vào cơ sở dữ liệu OMOP.
- ✓Khi các phát hiện từ ghi chú phải được chuẩn hóa thành khái niệm OMOP để phân tích trong ATLAS.
- ✓Khi bạn cần các bản ghi sự kiện lâm sàng OMOP được tạo từ mã nguồn đã được ánh xạ sẵn.
Liên kết skill
https://github.com/maziyarpanahi/openmed/blob/master/skills/etl-to-omop-cdm/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Hãy nạp các chẩn đoán và thuốc tôi đã trích xuất từ các ghi chú này vào bảng condition và drug exposure của OMOP.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent lấy các thực thể đã được mã hóa theo từ điển nguồn, ánh xạ chúng sang khái niệm OMOP chuẩn, rồi ghi thành bản ghi trong các bảng lâm sàng tương ứng.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
ETL to OMOP CDM
The OMOP Common Data Model (CDM) is the OHDSI standard for observational health
data. This skill maps OpenMed-derived clinical facts — entities from
analyze_text that you have already linked to a source terminology — into the
OMOP clinical event tables condition_occurrence, drug_exposure, and
measurement. The NLP runs on-device; OMOP loading is a downstream,
deterministic transform.
When to use this skill
After you have (a) extracted entities with OpenMed and (b) coded them to a source vocabulary (ICD-10-CM / SNOMED for conditions, RxNorm for drugs, LOINC for labs — see the linking skills). Use this skill to turn those coded facts into OMOP rows. It is not a clinical NER skill and not a code-linking skill; it assumes both are done.
Quick start
import openmed
note = "Assessment: type 2 diabetes mellitus. Started metformin 500 mg PO BID. HbA1c 8.2%."
result = openmed.analyze_text(note, output_format="dict")
# result["entities"] -> [{text,label,confidence,start,end}, ...]
# You then code each entity to a SOURCE concept using the OHDSI vocabulary you
# downloaded (see linking-umls-concepts / normalizing-rxnorm / mapping-loinc),
# and map SOURCE -> STANDARD via CONCEPT_RELATIONSHIP ('Maps to').
fact = {
"person_id": 1001,
"domain": "Condition",
"source_code": "E11.9", # ICD-10-CM, from your coding step
"source_vocabulary": "ICD10CM",
"source_concept_id": 45533010, # OHDSI CONCEPT for E11.9 (lookup)
"standard_concept_id": 201826, # 'Maps to' -> SNOMED 'Type 2 diabetes mellitus'
"start_date": "2024-03-12", # from building-patient-timelines
"char_span": (fact_start, fact_end),
}
OpenMed never ships UMLS/SNOMED/RxNorm/LOINC content. You supply the OHDSI vocabulary bundle (Athena download) and do the lookups under your own license. OpenMed provides the spans and labels.
The source → standard pattern (the heart of OMOP)
Every clinical event row carries two concept ids:
*_source_concept_id— the OHDSI CONCEPT for your original code (e.g. the ICD-10-CM or RxNorm code your linking step produced).*_concept_id— the standard concept, obtained by followingCONCEPT_RELATIONSHIP.relationship_id = 'Maps to'from the source concept. Conditions standardize to SNOMED, drugs to RxNorm, measurements to LOINC. If no mapping exists, set the standard id to0.
Domain → table → fields
See references/omop_cdm_v5_4_fields.md for the full per-table field list. Core
mapping by OpenMed entity domain:
| OpenMed entity domain | OMOP table | Standard vocab | Key date / value fields |
|---|---|---|---|
| Disease / Condition | condition_occurrence |
SNOMED | condition_start_date, optional condition_end_date |
| Drug / Medication | drug_exposure |
RxNorm | drug_exposure_start_date, drug_exposure_end_date, quantity, sig |
| Lab / Measurement | measurement |
LOINC | measurement_date, value_as_number, unit_concept_id, value_as_concept_id |
Type concepts: mark rows as NLP-derived
Every event row needs a *_type_concept_id recording provenance. For facts
derived from clinical text, OHDSI uses the type concept 32831 "EHR episode
record" / "Note" family — specifically prefer a "...from note" /
"NLP"-flavored standard type concept from the Type Concept vocabulary in
your bundle. Do not invent ids; resolve the type concept against the vocabulary
you loaded so cohort builders can filter NLP-derived rows.
Workflow
- Extract & code.
analyze_text→ entities; link each to a source code (linking skills). Resolvesource_concept_idand the'Maps to'standard concept from your Athena vocabulary. - Resolve dates. Attach start (and end, where known) dates per
building-patient-timelines. OMOP date fields areDATE; keep the matching*_datetimeonly if you truly have a time. - Assign
person_id. Join to yourpersontable by an internal key — not by any PHI string. De-identify upstream. - Build rows with required keys, the source+standard concept pair, the
NLP type concept, and a unique surrogate
*_occurrence_id/*_exposure_id/measurement_id. - Stage
*_source_value(the raw surface string, after de-id) for QA traceability — but never put raw PHI there. - Conform & validate. Run OHDSI Achilles/DataQualityDashboard on the loaded CDM before analytics.
Câu hỏi thường gặp
Skill này có trích xuất thực thể không?
Không. Trích xuất và mã hóa diễn ra ở các bước trước, còn skill này bao quát việc ánh xạ OMOP theo sau.
Nó hỗ trợ phiên bản OMOP nào?
Skill nhắm tới OMOP CDM phiên bản 5.4.
Nó ghi vào những bảng nào?
Nó bao quát các bảng condition occurrence, drug exposure và measurement.
Chi tiết
Mô tả gốc của tác giả
Map OpenMed-extracted, terminology-coded conditions, drugs, and measurements into OMOP CDM v5.4 clinical tables (condition_occurrence, drug_exposure, measurement) for OHDSI/ATLAS analytics. Use when the user wants to load NLP-derived facts into an OMOP database, build an OHDSI ETL from clinical notes, populate condition_occurrence or drug_exposure from text, or standardize note-derived findings to OMOP standard concepts. Covers the source-to-standard concept mapping pattern, required vs optional CDM fields, type concepts for NLP-derived rows, and the user-supplied OHDSI vocabulary (CONCEPT/CON
repo: maziyarpanahi/openmed
Độ phổ biến
- Sao GitHub
- 5.8k
- Vị trí xếp hạng
- #14694
- Giấy phép
- Apache-2.0
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
annotating-variants
5.8kGiúp agent dự đoán tác động của biến thể di truyền, đổi tên HGVS sang vị trí bộ gen và gắn tần suất quần thể bằng công cụ chú giải miễn phí.
ask-openmed
5.8kGiúp agent chọn đúng quy trình OpenMed cho yêu cầu về văn bản lâm sàng, luôn kiểm tra quyền riêng tư trước khi có thể có dữ liệu bệnh nhân.
assembling-fhir-bundles
5.8kGói nhiều bản ghi y tế FHIR thành một Bundle giao dịch để gửi tới EHR, với các tham chiếu nội bộ được liên kết đúng.
auditing-deid-leakage
5.8kQuét văn bản lâm sàng đã khử nhận dạng để tìm định danh còn sót như SSN, số thẻ, email và ngày tháng, và chặn phát hành nếu còn sót.
Skill tương tự
discrawl
394kCho phép agent của bạn tìm kiếm và tóm tắt kho lưu trữ tin nhắn Discord trên máy, kiểm tra độ mới của dữ liệu và đọc tin nhắn trực tiếp.
clickhouse-io
280kGiúp agent của bạn tối ưu truy vấn và schema trong ClickHouse theo thực hành tốt nhất cho phân tích dữ liệu hiệu năng cao khi truy vấn chậm.
scientific-db-pubmed-database
280kGiúp agent của bạn tìm bài báo khoa học trong lĩnh vực y sinh. Hữu ích cho nghiên cứu cần thông tin y khoa cụ thể.