Etl To Omop Cdm logo

Etl To Omop Cdm

CommunityPopular
maziyarpanahi
etl-to-omop-cdm

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.

Overview

Publishermaziyarpanahi
Repositoryopenmed
Skill nameetl-to-omop-cdm
Stars
5.3K
Forks
677
Bundled files
1
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by maziyarpanahi on GitHub. Read the source before you install it.

Installation

Install the Etl To Omop Cdm AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/maziyarpanahi/openmed.git /tmp/openmed
mkdir -p .claude/skills
cp -r /tmp/openmed/skills/etl-to-omop-cdm .claude/skills/etl-to-omop-cdm
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Etl To Omop Cdm in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Etl To Omop Cdm on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Etl To Omop Cdm is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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

python
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 domainOMOP tableStandard vocabKey date / value fields
Disease / Conditioncondition_occurrenceSNOMEDcondition_start_date, optional condition_end_date
Drug / Medicationdrug_exposureRxNormdrug_exposure_start_date, drug_exposure_end_date, quantity, sig
Lab / MeasurementmeasurementLOINCmeasurement_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.

Hand-off to / from OpenMed

  • From OpenMed: analyze_text entities (offsets + labels), deidentify upstream, and the per-domain linking skills (linking-umls-concepts, normalizing-rxnorm, mapping-loinc, mapping-to-snomed, coding-icd10).
  • To OHDSI: loaded condition_occurrence / drug_exposure / measurement rows are consumed by ATLAS, Achilles, and cohort definitions — and by computing-ecqms for measure denominators/numerators.

Edge cases & gotchas

  • No license bundling. OpenMed does not include SNOMED/RxNorm/LOINC/UMLS. Download the OHDSI vocabularies from Athena and run lookups under your own agreement. This is a hard rule.
  • Unmapped → standard concept 0. When 'Maps to' yields nothing, set *_concept_id = 0 and keep the source ids. Never fabricate a standard id.
  • Domain routing follows the standard concept's domain, not the source code's apparent type. An ICD-10 code can map to a SNOMED concept whose domain_id is Observation or Measurement — load it into the table the standard concept dictates.
  • NLP rows are lower-assurance. Tag them with the NLP/from note type concept and carry confidence (e.g. in a companion table) so analysts can threshold. Don't silently mix them with structured EHR rows.
  • Dates are required and must be valid. Undated note facts can't populate a *_start_date; route them to your "needs review" staging, not into the CDM with a placeholder date.
  • measurement units and values. Parse value_as_number + unit (mapped to a unit_concept_id); for qualitative results use value_as_concept_id.

Standards & references

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Etl To Omop Cdm AI skill do?

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/...

Why use Etl To Omop Cdm on TypingMind?

Because you install it once and use it with any model. Etl To Omop Cdm is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Etl To Omop Cdm in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/maziyarpanahi/openmed/tree/master/skills/etl-to-omop-cdm. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Etl To Omop Cdm?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Etl To Omop Cdm?

As many as you like. As long as a model supports skills, you can use Etl To Omop Cdm with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Etl To Omop Cdm AI skill free?

Yes. It is published on GitHub by maziyarpanahi under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇