Skip to content

Add concept map Postgres load scripts for MIMIC-IV and NW. #2000

Open
danamouk wants to merge 5 commits intoMIT-LCP:mainfrom
danamouk:load_concept_map
Open

Add concept map Postgres load scripts for MIMIC-IV and NW. #2000
danamouk wants to merge 5 commits intoMIT-LCP:mainfrom
danamouk:load_concept_map

Conversation

@danamouk
Copy link
Copy Markdown
Contributor

@danamouk danamouk commented May 2, 2026

This pull request adds PostgreSQL scripts for loading concept map data into both MIMIC-IV and NW databases.

For each database (mimic-iv/concepts_postgres/concept_map/ and nw/concepts_postgres/concept_map/), it adds 5 SQL scripts and a README:

  • create.sql — Creates the mimiciv_concept_map / nw_concept_map schema with 8 tables:
    labevents_to_loinc, labevents_to_omop,
    prescriptions_to_rxnorm, prescriptions_to_omop,
    chartevents_to_loinc, chartevents_to_omop,
    procedureevents_to_snomed, procedureevents_to_omop

  • load.sql — Loads mapping CSVs from concepts/concept_map/hosp/ and icu/ into the tables

  • constraint.sql — Adds primary keys on subject_id to enforce uniqueness and ensure data integrity.
    Prescriptions tables are excluded because different drug names share the same NDC code, so subject_id is not unique.

  • index.sql — Creates indexes on subject_id and object_id to speed up lookups and joins against the mapping tables

  • validate.sql — Checks row counts against expected values

  • README.md — Quickstart and step-by-step setup guide

These concept maps provide mappings from local hospital codes to standard terminologies (LOINC, OMOP, RxNorm, SNOMED) using the SSSOM format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant