Mirth Connect Documentation

repository·development·Indexed 19 days ago

https://github.com/nextgenhealthcare/connect

A healthcare integration engine used to translate, filter, transform, and route medical message standards like HL7 between disparate systems. Documentation covers installation across Windows, Linux, and Mac OS X, directory layout, Administrator and CLI usage, Java 9+ configuration, and management of channels, users, scripts, and code templates.

Tokens
9.5K
Snippets
14
Records
41
Agent score
77%

What's inside Mirth Connect

  1. What is Mirth Connect?

    development

    Mirth Connect acts as an interpreter for healthcare message standards, facilitating integration through four primary capabilities:

    • Filtering: Reading message parameters to decide whether to pass a message to the transformation stage or stop it.
    • Transformation: Converting incoming message standards to different standards (e.g., HL7 to XML).
    • Extraction: Pulling data from or pushing data to a database.
    • Routing: Ensuring messages arrive at their assigned destinations.

    Users manage and develop channels (message pathways) using the Administrator interface.

  2. Access the Mirth Connect Administrator

    development

    You can launch the Mirth Connect Administrator in several ways:

    1. Windows Start Menu: Use the 'Mirth Connect Administrator' item.
    2. Web Launch Page: Navigate to http://[server address]:8080 (e.g., http://localhost:8080) and click the Launch Mirth Connect Administrator button. This connects to the server listening on https://[server address]:8443.

    Default Credentials:

    • Username: admin
    • Password: admin

    Note: Change these credentials immediately after installation for security. If launching for the first time, the Administrator may load libraries automatically to allow remote management without a local installation. You may see a browser security warning; click Run to continue.

  3. Launch the Mirth Connect Administrator

    development

    There are several ways to access the Mirth Connect Administrator:

    1. Windows Start Menu: Use the Mirth Connect Administrator item if available.
    2. Web Launch Page: Navigate to http://[server address]:8080 (default is http://localhost:8080).
    3. Administrator Launcher (Recommended): Use the Administrator Launcher to manage connections and configure settings like Java runtime and heap size. The server listens on https://[server address]:8443 (default is https://localhost:8443).

    Security Note:

    • Default Credentials: The default username and password is admin / admin. Change these immediately after installation.
    • SSL Certificates: By default, Mirth Connect uses a self-signed certificate. You may see a security warning in your browser; follow the User Guide to replace it with a valid certificate.
  4. Install and Upgrade Mirth Connect

    development

    Mirth Connect installers are available for various operating systems:

    • Windows: .exe or ZIP distributions.
    • Linux: .rpm, .sh, or tar.gz distributions.
    • Mac OS X: .dmg or tar.gz distributions.

    Upgrades: The installer supports automatic upgrades for previous Mirth Connect installations (version 1.5 and later).

    Optional Components:

    • Service: Option to install and start a background service.
    • Server Manager: Allows starting/stopping the service, changing properties and backend database settings, and viewing logs.
    • Command Line Interface (CLI): Allows connecting to a running server via command line for scripting and server tasks.
    • Administrator Launcher: Manages connections to multiple servers and configures Java runtime, max heap size, and security protocols.
  5. Run Mirth Connect in Java 9 or greater

    development

    To support Java 9 or higher, you must manually configure VM options:

    For the Mirth Connect Server

    1. Copy the options from docs/mcservice-java9+.vmoptions.
    2. Append these options to either mcserver.vmoptions or mcservice.vmoptions (depending on your deployment).
    3. Restart Mirth Connect.

    For the Command Line Interface (CLI)

    1. Create a new file named mccommand.vmoptions in the Mirth Connect root directory.
    2. Copy all options from docs/mcservice-java9+.vmoptions into this new file.
    3. Save the file before launching the CLI.
  6. Access Mirth Connect Servlet Interfaces

    development

    The Client class acts as a gateway to various functional areas of Mirth Connect via specialized servlet interfaces. You can retrieve a typed interface using the getServlet(Class<T> servletInterface) method. This method returns a proxy object that translates method calls into API requests.

    Supported interfaces include:

    • UserServletInterface: User management (login, logout, create/update users).
    • ConfigurationServletInterface: Server settings, configuration maps, and global scripts.
    • ChannelServletInterface: Channel management (create, list, retrieve channels).
    • ChannelGroupServletInterface: Management of channel groups.
    • MessageServletInterface: Message-related operations.
    • EngineServletInterface: Engine control.
    • AlertServletInterface: Alert management.
    • CodeTemplateServletInterface: Code template management.
    • DatabaseTaskServletInterface: Database task management.
    • ExtensionServletInterface: Extension management.
    • UsageServletInterface: Usage statistics.
    // Example: Accessing the User interface to login
    UserServletInterface userApi = client.getServlet(UserServletInterface.class);
    LoginStatus status = userApi.login("admin", "password");
  7. Initialize the Mirth Connect Client

    development

    To interact with a Mirth Connect server, instantiate the Client class. You must provide the server address. The client supports various constructor overloads to configure timeouts, HTTPS protocols, and cipher suites. By default, the timeout is infinite.

    Common constructor patterns:

    • Basic: new Client(address)
    • With Timeout: new Client(address, timeout, httpsProtocols, httpsCipherSuites)
    • With Custom API Providers: new Client(address, timeout, httpsProtocols, httpsCipherSuites, apiProviderClasses)
    import com.mirth.connect.client.core.Client;
    import java.net.URISyntaxException;
    
    // Basic initialization
    Client client = new Client("http://localhost:8483");
    
    // Initialization with specific timeout (in milliseconds)
    Client clientWithTimeout = new Client("https://mirth-server:8483", 5000, protocols, ciphers);
  8. Launch the Mirth Connect CLI

    development

    The Mirth Connect Command Line Interface (CLI) allows you to interact with a Mirth Connect server via a shell or by executing a script file. To launch the CLI, you must provide the server address, a username, and a password. You can also specify a configuration file for defaults or a script file to run automatically upon connection.

    Required Arguments/Options:

    • -a, --address: The server address.
    • -u, --user: The user login.
    • -p, --password: The user password.

    Optional Arguments/Options:

    • -s, --script: Path to a script file containing commands to execute.
    • -c, --config: Path to a default configuration file (defaults to conf/mirth-cli-config.properties).
    • -d, --debug: Enables debug mode to show stack traces on errors.
    • -v, --version: Displays the version.
    • -h, --help: Displays help information.
    # Example: Launching the interactive shell
    java -jar mirth-connect-cli.jar -a localhost -u admin -p admin
    
    # Example: Running a script file automatically
    java -jar mirth-connect-cli.jar -a localhost -u admin -p admin -s /path/to/my_commands.txt
    
    # Example: Using a custom config file
    java -jar mirth-connect-cli.jar -a localhost -u admin -p admin -c /custom/path/config.properties
  9. Import channels, scripts, and alerts

    development

    The CLI supports importing configuration components from XML files.

    Import Channels

    Imports a channel from an XML file.

    • If the channel ID or name already exists, the import will fail unless the --force flag is used.
    • When using --force, the existing channel's revision and ID are preserved to allow overwriting.
    • The process automatically handles channel dependencies.

    Import Global Scripts

    Imports a map of global scripts from an XML file.

    Import Alerts

    Imports a list of AlertModel objects from an XML file.

    • Similar to channels, if an alert name already exists, it will not be imported unless --force is used.
    • When using --force, the existing alert's ID is used to overwrite it.