
Etl To Omop Cdm
Map OpenMed-extracted, terminology-coded conditions, drugs, and measurements into OMOP...
Install
npx skills add maziyarpanahi/openmed --skill etl-to-omop-cdm -g -a claude-code -y- Repository
- maziyarpanahi/openmed5.8k
- Category
- Data and ML
- Updated
- 4d ago
- License
- Apache-2.0
- Context cost
- Mediumabout 1,671 tokens
- Runs scripts
- No, instructions only
What it does
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/CONCEPT_RELATIONSHIP). Consumes coded OpenMed analyze_text output (after SNOMED/RxNorm/LOINC linking) and produces OMOP-conformant rows.
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.
