Skip to the content.

CrosswalkAPI Usage Guide

The CrosswalkAPI in the UMLS Python Client enables users to map concepts from one source terminology to another, which is essential for cross-referencing different medical coding systems. This guide provides an overview of how to use the CrosswalkAPI class effectively.

Prerequisites

Before using the API, ensure you have your API key to interact with the UMLS database. If you don’t have an API key, you can obtain one from the UMLS User Authentication page.

Setting Up

Here’s how to set up the CrosswalkAPI:

import os
from umls_python_client import UMLSClient

# Set the API KEY
API_KEY = "YOUR_API_KEY_HERE"

# Folder path to save files
PATH = r"C:\path\to\your\output\directory"

# Initialize the CrosswalkAPI class with your API key
crosswalk_api = UMLSClient(api_key=API_KEY).crosswalkAPI

Replace C:\path\to\your\output\directory with the path where you want to save the output files.

CrosswalkAPI Method: Retrieve Crosswalk Data

This method allows you to retrieve crosswalk data that maps a source concept identifier to target source vocabularies.

Example Usage

# Retrieve crosswalk data for a source and code
crosswalk_data = crosswalk_api.get_crosswalk(
    source="HPO",
    id="HP:0001947",
    target_source="SNOMEDCT_US",
    include_obsolete=False,
    page_number=1,
    page_size=10,
    return_indented=True,
    format="rdf",
    save_to_file=True,
    file_path=PATH
)
print(crosswalk_data)

In the above example:

Arguments Overview

format

return_indented

save_to_file

file_path

Notes