Mirth Connect

Mirth Connect ist eine rund 20 Jahre alte, in Java geschriebene Schnittstellen-Engine, die hauptsächlich im Gesundheitswesen eingesetzt wird und den bidirektionalen Versand diverser Nachrichtentypen ermöglicht. Benötigt ein vorinstalliertes Java 9+.

Mirth Connect wendet auf Nachrichten folgende Operationen an:

  • Filterung

  • Umwandlung, beispielsweise HL7 nach XML

  • Pull aus und Push in Datenbanken

  • Weiterleitung

Links

Installation

Installation des Server-Teils. Zur Info: Mirth Connect ist 32-bittig.

VER=4.4.0.b2948

# "Connect" component, 260 MB
dnf -y localinstall https://s3.amazonaws.com/downloads.mirthcorp.com/connect/$VER/mirthconnect-$VER-linux.rpm
# contains some extra JVM options that allow Mirth Connect to run with Java 9 or greater without errors or warnings
cat /opt/mirthconnect/docs/mcservice-java9+.vmoptions >> /opt/mirthconnect/mcserver.vmoptions

# CLI component, 35 MB
cd /tmp
wget -O mirthconnectcli.tar.gz https://s3.amazonaws.com/downloads.mirthcorp.com/connect/$VER/mirthconnectcli-$VER-unix.tar.gz
tar xvzf mirthconnectcli.tar.gz
mv 'Mirth Connect CLI' /opt/mirthconnectcli
restorecon -Fvr /opt/mirthconnectcli

MariaDB-Server statt der integrierten Derby-Datenbank verwenden: Auf dem MariaDB-Server ein Schema namens „mirthconnect“ ohne besondere Optionen sowie einen dedizierten DB-Benutzer namens „mirthconnect“ mit allen Berechtigungen ausser GRANT auf das Schema anlegen. Dann auf dem Mirth Connect-Server:

/opt/mirthconnect/conf/mirth.properties
database = mysql
database.password = linuxfabrik
database.url = jdbc:mysql://192.2.0.26:3306/mirthconnect
database.username = mirthconnect

Host-Firewalls passend konfigurieren (Ports für MySQL, 8080 und 8443).

Testweise starten:

/opt/mirthconnect/mcservice start; tail -f /opt/mirthconnect/logs/mirth.log

Beim ersten Start werden alle notwendigen DB-Tabellen (Stand 2023-09-25 insgesamt 14 Stück) angelegt.

Status prüfen:

/opt/mirthconnect/mcservice status

Systemd-Service anlegen:

cat > /etc/systemd/system/mirthconnect.service << "EOF"
[Unit]
Description=MirthConnect
After=network.target

[Service]
Type=forking

User=root
Group=root
ExecStart=/opt/mirthconnect/mcservice start
ExecStop=/opt/mirthconnect/mcservice stop
ExecRestart=/opt/mirthconnect/mcservice restart
TimeoutSec=60

[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable --now mirthconnect

Port 8080 und 8443 öffnen.

Login auf https://mirth-connect:8443 mit admin/admin.

Administration per CLI

/opt/mirthconnectcli/mccommand -a https://localhost:8443 -u admin -p linuxfabrik

Default-Passwort von Mirth Connect ändern:

$user changepw admin "linuxfabrik"
User "admin" password updated.

Kommandos:

  • channel list: Lists all Channels

  • channel remove|enable|disable id|"name"|*: Remove, enable or disable specified channel

  • channel undeploy|deploy|start|stop|halt|pause|resume|stats id|"name"|*: Performs specified channel action

  • clearallmessages: Removes all messages from all Channels (running channels will be restarted)

  • codetemplate [library] import path [force]: Imports code templates or libraries (with the ‚library‘ option).

  • codetemplate export id|name path: Exports a single code template to <path>.

  • codetemplate library export id|name|* path: Exports all matched code template libraries to <path>.

  • codetemplate library list [includecodetemplates]: Lists all code template libraries. Optional ‚includecodetemplates‘ additionally lists the code templates within each library.

  • codetemplate library remove id|name|*: Removes all matched code template libraries.

  • codetemplate list: Lists all code templates.

  • codetemplate remove id|name: Removes a single code template.

  • deploy [timeout]: Deploys all Channels with optional timeout (in seconds)

  • dump stats|events "path": Dumps stats or events to specified file

  • export id|"name"|* "path": Exports the specified channel to <path>

  • exportalert id|"name"|* "path": Exports the specified alert to <path>

  • exportcfg "path": Exports the configuration to <path>

  • exportmap "path": Exports configuration map to <path>

  • exportmessages "path/file-pattern" id [xml|xml-attach|raw|processedraw|transformed|encoded|response] [pageSize]: Exports all messages for channel specified by <id> to <path>

  • exportscripts "path": Exports global script to <path>

  • import "path" [force]: Imports channel specified by <path>. Optional ‚force‘ overwrites existing channels.

  • importalert "path" [force]: Imports alert specified by <path>. Optional ‚force‘ overwrites existing alerts.

  • importcfg "path" [nodeploy] [overwriteconfigmap]: Imports configuration specified by <path>. Optional ‚nodeploy‘ stops channels from being deployed after importing. Optional ‚overwriteconfigmap‘ will overwrite the Configuration Map.

  • importmap "path": Imports configuration map specified by <path>

  • importmessages "path" id: Imports messages specified by <path> into the channel specified by <id>

  • importscripts "path": Imports global script specified by <path>

  • quit: Quits Mirth Connect Shell

  • resetstats [lifetime]: Removes all stats from all Channels. Optional ‚lifetime‘ includes resetting lifetime stats.

  • status: Returns status of deployed channels

  • user add username "password" "firstName" "lastName" "organization" "email": Adds the specified user

  • user changepw id|username "newpassword": Changes the specified user’s password

  • user list: Returns a list of the current users

  • user remove id|username: Removes the specified user

Log Level

Datei /opt/mirthconnect/conf/log4j2.properties anpassen. Verfügbare Debug-Level sind ERROR, WARN, INFO und DEBUG.

Client

Dedizierter Client „Administrator Launcher“ (400+ MB):

Built on 2024-04-18