Skip to content

MIMIC Laboratory Gold Set

MIMIC-IV v3.1 is a strong source of real-world laboratory vocabulary, observed units, reference ranges, and values. It is not an automatic LOINC gold set for this project.

The v3.1 labevents table contains local itemid values and observations, while d_labitems supplies the local label, fluid, and category. The release removed the unreliable loinc_code column from labevents; therefore an expert must review each local item and select the correct LOINC code. The mapper must still validate the selected code against the local LOINC release.

MIMIC access is credentialed and governed by the PhysioNet data-use agreement. Do not commit downloaded MIMIC files, patient or encounter identifiers, or derived rows to this repository. The preparation command deliberately removes subject_id, hadm_id, specimen_id, timestamps, and provider identifiers from its candidate output.

Prepare Candidates

After obtaining credentialed MIMIC-IV v3.1 access, point the CLI at local CSV files:

$env:PYTHONPATH = "$PWD\src"
python -m loinc_mapper prepare-mimic `
  --labevents path/to/hosp/labevents.csv `
  --d-labitems path/to/hosp/d_labitems.csv `
  --output evaluation/mimic/mimic_lab_candidates.csv `
  --mapping-template evaluation/mimic/mimic_item_mapping_template.csv `
  --max-rows-per-item 25

The candidate file contains local names, values, units, reference ranges, and MIMIC item metadata. Every row starts with gold_status=unlabeled; it must not be passed to evaluate as a gold set.

The mapping template is one row per local MIMIC item. An expert should fill:

  • expected_loinc: the selected active LOINC code.
  • review_status: approved only after review, otherwise pending or reject.
  • reviewer: reviewer identity or controlled reviewer ID.
  • notes: axis, unit, specimen, method, and ambiguity rationale.

Build Reviewed Gold Set

Once the template has been reviewed:

python -m loinc_mapper build-mimic-gold `
  --candidates evaluation/mimic/mimic_lab_candidates.csv `
  --mapping evaluation/mimic/mimic_item_mapping_template.reviewed.csv `
  --catalog assets/loinc/2.82/catalog_v5.sqlite3 `
  --output evaluation/mimic/mimic_gold.csv

Only explicitly approved item mappings are emitted. The resulting file can be evaluated with the normal evaluate command, but performance must be reported by item, fluid, unit family, and review status. Split by MIMIC item and local label family, not randomly by individual lab rows, to prevent repeated item names from leaking between train and test sets.

MIMIC is especially useful for testing retrieval and unit/context handling. It does not reproduce fax OCR noise, laboratory-specific report layout, or the full outpatient population, so it should complement an expert fax-derived holdout rather than replace it.

Source: MIMIC-IV v3.1 on PhysioNet. Use the required PhysioNet citation and follow its rules for derived datasets and models.