본문으로 건너뛰기
Skillpedia
데이터베이스5.8k · #14694

etl-to-omop-cdm

하는 일

이 스킬은 노트에서 얻은 코드화된 소견, 예를 들어 질환, 약물, 임상 검사 값을 OHDSI 분석용 OMOP CDM 테이블에 매핑합니다. 임상 텍스트로 연구 데이터베이스를 만드는 데이터 팀을 위한 스킬입니다.

사용하는 경우

  • ✓노트에서 나온 질환, 약물, 검사 값을 OMOP 데이터베이스에 넣고 싶을 때.
  • ✓노트의 소견을 ATLAS 분석용으로 표준 OMOP 개념에 맞춰야 할 때.
  • ✓이미 원천 코드로 매핑된 정보로 OMOP 임상 사건 기록을 만들어야 할 때.

스킬 링크

https://github.com/maziyarpanahi/openmed/blob/master/skills/etl-to-omop-cdm/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/maziyarpanahi/openmed/blob/master/skills/etl-to-omop-cdm/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“제가 이 노트에서 추출한 진단과 약물을 OMOP 질환 테이블과 약물 노출 테이블에 넣어 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 원천 어휘로 이미 코드화된 개체를 가져와 표준 OMOP 개념에 매핑하고, 맞는 임상 테이블에 기록으로 씁니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

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:

  1. *_source_concept_id — the OHDSI CONCEPT for your original code (e.g. the ICD-10-CM or RxNorm code your linking step produced).
  2. *_concept_id — the standard concept, obtained by following CONCEPT_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 to 0.

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

  1. Extract & code. analyze_text → entities; link each to a source code (linking skills). Resolve source_concept_id and the 'Maps to' standard concept from your Athena vocabulary.
  2. Resolve dates. Attach start (and end, where known) dates per building-patient-timelines. OMOP date fields are DATE; keep the matching *_datetime only if you truly have a time.
  3. Assign person_id. Join to your person table by an internal key — not by any PHI string. De-identify upstream.
  4. Build rows with required keys, the source+standard concept pair, the NLP type concept, and a unique surrogate *_occurrence_id / *_exposure_id / measurement_id.
  5. Stage *_source_value (the raw surface string, after de-id) for QA traceability — but never put raw PHI there.
  6. Conform & validate. Run OHDSI Achilles/DataQualityDashboard on the loaded CDM before analytics.

자주 묻는 질문

이 스킬이 개체를 추출하나요?

아니요. 추출과 코드화는 앞 단계에서 이루어지며, 이 스킬은 그 뒤에 이어지는 OMOP 매핑을 다룹니다.

어떤 OMOP 버전을 지원하나요?

OMOP CDM 5.4 버전을 대상으로 합니다.

어떤 테이블에 쓰나요?

질환 발생(condition occurrence), 약물 노출, 측정 테이블을 다룹니다.

상세 정보

작성자의 원본 설명

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

인기도

GitHub 스타
5.8k
순위
#14694
라이선스
Apache-2.0
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬