Skip to main content

Get Mappings for a Concept

Find how a concept maps to other vocabularies:
result = client.mappings.get(201826)  # Type 2 diabetes mellitus
for mapping in result["mappings"]:
    print(f"{mapping['target_vocabulary_id']}: {mapping['target_concept_name']}")

Filter by Target Vocabulary

Get mappings to specific vocabularies only:
result = client.mappings.get(
    201826,
    target_vocabularies=["ICD10CM", "ICD9CM"],
)
for mapping in result["mappings"]:
    code = mapping["target_concept_code"]
    name = mapping["target_concept_name"]
    vocab = mapping["target_vocabulary_id"]
    print(f"[{vocab}] {code}: {name}")

Map Multiple Concepts

Map a batch of concept IDs to a target vocabulary:
result = client.mappings.map(
    source_concepts=[201826, 4329847],  # Diabetes, MI
    target_vocabulary="ICD10CM",
)
for mapping in result["mappings"]:
    source = mapping["source_concept_id"]
    target = mapping["target_concept_id"]
    print(f"{source} -> {target}")

With Mapping Quality

Include confidence scores and quality metrics:
result = client.mappings.get(
    201826,
    target_vocabularies=["ICD10CM"],
    include_mapping_quality=True,
)
for mapping in result["mappings"]:
    name = mapping["target_concept_name"]
    confidence = mapping.get("mapping_confidence", "N/A")
    print(f"{name} (confidence: {confidence})")

Mapping Options

result = client.mappings.get(
    201826,
    target_vocabularies=["ICD10CM", "Read"],
    direction="outgoing",        # "outgoing", "incoming", or "both"
    include_mapping_quality=True,
    include_context=True,
    standard_only=True,          # Only standard concepts
    page_size=50,
)

Common Use Case: SNOMED to ICD-10

Map SNOMED conditions to ICD-10-CM for billing:
# Get SNOMED concept
concept = client.concepts.get_by_code("SNOMED", "44054006")

# Find ICD-10-CM mappings
mappings = client.mappings.get(
    concept["concept_id"],
    target_vocabularies=["ICD10CM"],
)

print(f"Mapping {concept['concept_name']}:")
for m in mappings["mappings"]:
    print(f"  -> [{m['target_concept_code']}] {m['target_concept_name']}")