Skip to main content
Glama
NyxToolsDev

DICOM/HL7/FHIR Interoperability MCP Server

lookup_hl7_table

Retrieve HL7 table values and descriptions for healthcare data integration, such as administrative sex codes, to support interoperability workflows.

Instructions

Look up HL7 table values. Returns the table name and all defined values with descriptions. Example: Table 0001 = Administrative Sex.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
table_numberYesHL7 table number (e.g., '0001', '0004', '76'). Leading zeros optional.

Implementation Reference

  • The implementation of lookup_hl7_table, which takes a table_number, normalizes it, and returns the corresponding HL7 table information.
    def lookup_hl7_table(table_number: str) -> str:
        """Look up HL7 table values.
    
        Args:
            table_number: Table number (e.g., "0001", "0004", "76"). Leading zeros
                are optional.
    
        Returns:
            Table name and all defined values with descriptions.
        """
        # Normalize table number to 4-digit zero-padded string
        table_number = table_number.strip().lstrip("0") or "0"
        table_key = table_number.zfill(4)
    
        table_info = HL7_TABLES.get(table_key)
        if not table_info:
            # Try without padding
            for key in HL7_TABLES:
                if key.lstrip("0") == table_number.lstrip("0"):
                    table_info = HL7_TABLES[key]
                    table_key = key
                    break
    
        if not table_info:
            available = sorted(HL7_TABLES.keys())
            return (
                f"Table {table_key} not found in dictionary.\n\n"
                f"Available tables: {', '.join(available)}"
            )
    
        parts = [
            f"## HL7 Table {table_key} — {table_info['name']}",
            "",
            f"{'Value':<10} {'Description'}",
            f"{'-----':<10} {'-----------'}",
        ]

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/NyxToolsDev/dicom-hl7-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server