Skip to content
Skillpedia
Databases5.8k Β· #14694

etl-to-omop-cdm

What it does

This skill maps coded findings from clinical notes, such as conditions, drugs and lab measurements, into OMOP CDM tables for OHDSI analytics. It is for data teams building research databases from clinical text.

When to use it

  • βœ“When you want to load note-derived conditions, drugs or measurements into an OMOP database.
  • βœ“When findings from notes must be standardized to OMOP concepts for ATLAS analysis.
  • βœ“When you need OMOP clinical event records built from source codes that have already been mapped.

Skill link

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

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

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.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute β†’

Example of what to ask your AI

β€œLoad the diagnoses and medications I extracted from these notes into the OMOP condition and drug exposure tables.”

5 new skills a week. 1 minute to read.

How it works

The agent takes entities that are already coded to a source vocabulary, maps them to standard OMOP concepts, and writes them as records in the matching clinical tables.

Technical content (original SKILL.md)

Original text by the author, straight from 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.

FAQ

Does this skill extract the entities?

No. Extraction and coding happen in earlier steps, and this skill covers the OMOP mapping that follows.

Which OMOP version is supported?

The skill targets OMOP CDM version 5.4.

Which tables does it write?

It covers the condition occurrence, drug exposure and measurement tables.

Details

Original description by the author

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

Popularity

GitHub stars
5.8k
Ranking position
#14694
License
Apache-2.0
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills