generate_mirth_channel
Create Mirth Connect channel XML configurations for healthcare data integration between formats like HL7v2, DICOM, and FHIR to enable interoperability.
Instructions
[Premium] Generate Mirth Connect channel configuration XML. Creates a channel skeleton with source/destination connectors, transformer steps, filter logic, and implementation notes.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source_type | Yes | Source data format: 'HL7v2', 'DICOM', 'FHIR', 'Database', or 'File'. | |
| destination_type | Yes | Destination data format: 'HL7v2', 'FHIR', 'Database', 'File', or 'HTTP'. | |
| use_case | Yes | Description of the integration use case (e.g., 'ADT feed from Epic to PACS'). |
Implementation Reference
- The `generate_mirth_channel` function implements the core tool logic, including type normalization, XML construction, and generating implementation notes.
def generate_mirth_channel( source_type: str, destination_type: str, use_case: str, ) -> str: """Generate a Mirth Connect channel configuration. Args: source_type: Source data format — "HL7v2", "DICOM", "FHIR", "Database", "File". destination_type: Destination data format — "HL7v2", "FHIR", "Database", "File", "HTTP". use_case: Description of the integration use case (e.g., "ADT feed from Epic to PACS", "Radiology report from RIS to EMR", "Lab order interface"). Returns: Mirth Connect channel XML skeleton with source/destination connectors, transformer steps, filter logic, and implementation notes. """ premium_check = require_premium("generate_mirth_channel") if premium_check: return premium_check source_type = source_type.strip().upper() destination_type = destination_type.strip().upper() use_case = use_case.strip() # Normalize types source_norm = _normalize_type(source_type) dest_norm = _normalize_type(destination_type) if source_norm is None: return f"Unsupported source type: '{source_type}'. Supported: HL7v2, DICOM, FHIR, Database, File." if dest_norm is None: return f"Unsupported destination type: '{destination_type}'. Supported: HL7v2, FHIR, Database, File, HTTP." # Generate channel name channel_name = _generate_channel_name(source_norm, dest_norm, use_case) # Build the channel XML xml = _build_channel_xml(channel_name, source_norm, dest_norm, use_case) # Build implementation notes notes = _build_implementation_notes(source_norm, dest_norm, use_case) return f"{xml}\n\n{notes}"