
Mapping Loinc
Maps laboratory and clinical observation names extracted by OpenMed to LOINC codes...
Install
npx skills add maziyarpanahi/openmed --skill mapping-loinc -g -a claude-code -y- Repository
- maziyarpanahi/openmed5.8k
- Category
- Testing
- Updated
- 4d ago
- License
- Apache-2.0
- Context cost
- Mediumabout 1,735 tokens
- Runs scripts
- No, instructions only
What it does
Maps laboratory and clinical observation names extracted by OpenMed to LOINC codes using the public Regenstrief LOINC and FHIR terminology APIs. Use when the user wants to code lab tests, vital signs, or observations to LOINC, resolve a test name plus specimen and method to the correct LOINC part-model code, attach UCUM units, or build a US Core Laboratory Result Observation. Trigger keywords: LOINC, lab coding, observation code, UCUM units, specimen, method, US Core lab, FHIR Observation, lab result mapping, panel vs analyte. Pairs after OpenMed NER: consume Disease/Chemical/lab-name entities from openmed.analyze_text and map each measurement to a LOINC code. LOINC is free to use under the Regenstrief license (registration/terms-of-use, no fee); UMLS/SNOMED stay user-supplied and out-of-process.
Mapping lab/observation names to LOINC
Ground free-text lab and observation names that OpenMed surfaces to LOINC (Logical Observation Identifiers Names and Codes), the universal standard for identifying what was measured. A LOINC code is a fully specified observation, not just an analyte but the full six-axis model: Component, Property, Time, System (specimen), Scale, Method.
LOINC is free to use. It is published by the Regenstrief Institute under the
LOINC license: you accept terms-of-use (and register to download the table), but
there is no fee and no per-use restriction. The standard, public path for
license-clean mapping is a FHIR terminology server exposing LOINC via
$lookup / $validate-code, or Regenstrief's hosted fhir.loinc.org.
When to use
- A note or report contains lab/observation names ("serum potassium", "hemoglobin A1c", "blood pressure") and you need a stable LOINC code each.
- You must disambiguate by specimen/system ("glucose in serum" vs "glucose in urine") or method ("HbA1c by HPLC").
- You need UCUM units to pair with the result value, or a US Core
Observation(Laboratory Result) coded with LOINC. - You are mapping a panel (e.g. CBC, BMP) vs its individual analytes.
For diagnoses/procedures use coding-icd10; for drugs use normalizing-rxnorm;
LOINC is for observations and measurements.
Quick start (real LOINC / FHIR terminology calls)
Regenstrief hosts a public FHIR terminology endpoint at https://fhir.loinc.org
(HTTP Basic auth with your free LOINC account). Many sites instead point at their
own server (HAPI, Ontoserver, Snowstorm-with-LOINC). The operations are the same.
import requests
from requests.auth import HTTPBasicAuth
FHIR = "https://fhir.loinc.org"
AUTH = HTTPBasicAuth("YOUR_LOINC_USER", "YOUR_LOINC_PASSWORD") # free account
LOINC_SYSTEM = "http://loinc.org"


