Skip to content

LOINC code mapping for biomarkers #98

@elkimek

Description

@elkimek

Summary

Add optional LOINC (Logical Observation Identifiers Names and Codes) codes as metadata on biomarkers. LOINC is the universal standard for identifying lab tests — like ISBN for books but for biomarkers. 71,000+ codes maintained by the Regenstrief Institute (nonprofit, free to use).

Suggested by @fpietrosanti in #57.

Why

  • FHIR import: Pull lab results from Apple Health, Epic MyChart, or any EHR that exports FHIR — tests are identified by LOINC codes
  • FHIR export: A getbased export with LOINC codes could be imported by other health tools
  • Interoperability: Standard way to identify tests across systems, languages, and labs
  • AI parsing: Could use LOINC as an additional signal for unambiguous marker identification

Implementation

  1. Add optional loinc field to MARKER_SCHEMA entries (e.g., { key: 'glucose', loinc: '2345-7', ... })
  2. Build a lookup table mapping ~200 existing category.markerKey → LOINC codes
  3. Include LOINC codes in JSON export
  4. Future: FHIR R4 Observation import/export module

Examples

Marker Key LOINC
Glucose biochemistry.glucose 2345-7
Hemoglobin hematology.hemoglobin 718-7
Total Cholesterol lipids.totalCholesterol 2093-3
Testosterone hormones.testosterone 2986-8
TSH thyroid.tsh 3016-3

Notes

  • Non-breaking: loinc field is optional, doesn't affect existing functionality
  • Specialty labs (OAT, fatty acids) may not have LOINC codes — custom markers stay as-is
  • Main effort is the mapping work (~200 standard markers)
  • LOINC is free to use but the full database requires a free license from loinc.org

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions