Skip to main content

Code Lookup

Look up a code to get its display name, properties, and patient-friendly name.

Quick example

import medterm4ds as mt

terms = mt.connect("/path/to/umls.duckdb")

# Exact lookup
info = terms.lookup("SNOMEDCT_US", "44054006")
print(info.name) # "Type 2 diabetes mellitus"

# Patient-friendly name
result = terms.patient_friendly("SNOMEDCT_US", "44054006")
print(result.name) # "Diabetes Type 2"

What you get

FieldDescriptionExample
codeThe code"44054006"
nameCanonical display"Type 2 diabetes mellitus"
friendly_sourceWhere the friendly name came from"MEDLINEPLUS"
match_typeHow it was resolved"exact", "broader", "same_cui"
cuiUMLS Concept ID"C0011860"

Batch lookup

# Batch: preserves input order, returns None for missing codes
infos = terms.lookup_batch([
("ICD10CM", "E11.9"),
("SNOMEDCT_US", "44054006"),
("RXNORM", "860975"),
])

# DataFrame-friendly
df = terms.lookup_df("ICD10CM", ["E11.9", "E11.40", "I10"])

Supported sources

SourceCodesTTY filter
SNOMED CT US386,110All active
ICD-10-CM98,506All
ICD-10-PCS192,560All
RxNorm124,919IN, MIN, SCD, SBD, SCDG, etc.
LOINC301,558LN only
CPT15,468All
HCPCS7,685All
CVX288All

See also

  • Patient-Friendly Names — full details on the friendly-name resolver, provenance, and resolution strategies