Announcement

Collapse

Mirth Connect 3.12.0 Released!

Mirth Connect 3.12.0 is now available as an appliance update and on our GitHub page. This release includes database performance improvements, improves visual HL7 representation, message pruning, keystore handling, PDF generation, community contributions, and fixes several security vulnerabilities. This release also contains many improvements to commercial extensions. See the release notes for the list of fixes and updates.

Download | See What's New | Upgrade Guide | Release Notes

For discussion on this release, see this thread.
See more
See less

Read from file - Write to File

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Read from file - Write to File

    Hi...I'm new to Mirth but not to HL7 or software using HL7. I have worked a lot with Quovadx and HL7 Connect.

    Trying to figure out Mirth now. Doing a simple read a HL7 msg in, transform it, and write it out to a file. Can't get things to work.

    Anyone have a quick example on hand that shows the steps? I have it setup to listen for a file, have a couple steps created to transform the data but cannot get the transformed data to write out - all I get is the original HL7 data.

    Thanks,

    Rick

  • #2
    Re:Read from file - Write to File

    Did you take a look at the sample channels
    http://www.mirthproject.org/index.ph...d=19&Itemid=43

    Maybe you forgot to something in the destination template (e.g. ${message.rawData} )

    Below exported channels basically work

    Listner 2 File

    Code:
    <com.webreach.mirth.model.Channel>
      <id>c715b5d4-9803-4d8f-9b46-91d6618240a5</id>
      <name>FileWriter</name>
      <description></description>
      <enabled>true</enabled>
      <version>1.7.0.3185</version>
      <lastModified>
        <time>1199430314185</time>
        <timezone>Europe/Paris</timezone>
      </lastModified>
      <revision>2</revision>
      <sourceConnector>
        <name>sourceConnector</name>
        <properties>
          <property name="messageEnd">0x1C</property>
          <property name="ackCodeError">AE</property>
          <property name="messageStart">0x0B</property>
          <property name="ackMsgRejected">Message Rejected.</property>
          <property name="ackCodeRejected">AR</property>
          <property name="receiveTimeout">0</property>
          <property name="charEncoding">hex</property>
          <property name="bufferSize">65536</property>
          <property name="useStrictLLP">1</property>
          <property name="reconnectInterval">5000</property>
          <property name="waitForEndOfMessageCharacter">0</property>
          <property name="sendACK">1</property>
          <property name="port">6661</property>
          <property name="ackOnNewConnection">0</property>
          <property name="checkMSH15">0</property>
          <property name="ackMsgSuccessful"></property>
          <property name="tcpProtocolClassName">org.mule.providers.tcp.protocols.TcpProtocol</property>
          <property name="responseFromTransformer">0</property>
          <property name="segmentEnd">0x0D</property>
          <property name="ackPort"></property>
          <property name="charsetEncoding">DEFAULT_ENCODING</property>
          <property name="host">127.0.0.1</property>
          <property name="responseValue">None</property>
          <property name="DataType">LLP Listener</property>
          <property name="processBatchFiles">0</property>
          <property name="ackMsgError">An Error Occured Processing Message.</property>
          <property name="serverMode">1</property>
          <property name="ackCodeSuccessful">AA</property>
          <property name="ackIP"></property>
          <property name="recordSeparator">0x0D</property>
        </properties>
        <transformer>
          <steps/>
          <inboundProtocol>HL7V2</inboundProtocol>
          <outboundProtocol>HL7V2</outboundProtocol>
        </transformer>
        <filter>
          <rules/>
        </filter>
        <transportName>LLP Listener</transportName>
        <mode>SOURCE</mode>
        <enabled>true</enabled>
      </sourceConnector>
      <destinationConnectors>
        <com.webreach.mirth.model.Connector>
          <name>Destination 1</name>
          <properties>
            <property name="charsetEncoding">DEFAULT_ENCODING</property>
            <property name="outputAppend">1</property>
            <property name="DataType">File Writer</property>
            <property name="outputPattern">test</property>
            <property name="template">${message.rawData}</property>
            <property name="host">D:/mirth/messages</property>
            <property name="binary">0</property>
          </properties>
          <transformer>
            <steps/>
            <inboundProtocol>HL7V2</inboundProtocol>
            <outboundProtocol>HL7V2</outboundProtocol>
          </transformer>
          <filter>
            <rules/>
          </filter>
          <transportName>File Writer</transportName>
          <mode>DESTINATION</mode>
          <enabled>true</enabled>
        </com.webreach.mirth.model.Connector>
      </destinationConnectors>
      <properties>
        <property name="synchronous">true</property>
        <property name="removeNamespace">true</property>
        <property name="transactional">false</property>
        <property name="initialState">started</property>
        <property name="dont_store_filtered">false</property>
        <property name="error_messages_only">false</property>
        <property name="max_message_age">-1</property>
        <property name="store_messages">true</property>
        <property name="encryptData">false</property>
      </properties>
      <preprocessingScript>// Modify the message variable below to pre process data
    return message;</preprocessingScript>
      <postprocessingScript>// This script executes once after a message has been processed
    return;</postprocessingScript>
      <deployScript>// This script executes once when the mule engine is started
    // You only have access to the globalMap here to persist data
    return;</deployScript>
      <shutdownScript>// This script executes once when the mule engine is stopped
    // You only have access to the globalMap here to persist data
    return;</shutdownScript>
    </com.webreach.mirth.model.Channel>
    File 2 File

    Code:
    <com.webreach.mirth.model.Channel>
      <id>eca71e19-974f-471e-bc2b-58a319fcbc17</id>
      <name>File2File</name>
      <description></description>
      <enabled>true</enabled>
      <version>1.7.0.3185</version>
      <lastModified>
        <time>1199430329834</time>
        <timezone>Europe/Paris</timezone>
      </lastModified>
      <revision>2</revision>
      <sourceConnector>
        <name>sourceConnector</name>
        <properties>
          <property name="sortAttribute">date</property>
          <property name="pollingType">interval</property>
          <property name="pollingFrequency">1000</property>
          <property name="binary">0</property>
          <property name="processBatchFiles">0</property>
          <property name="DataType">File Reader</property>
          <property name="moveToErrorDirectory"></property>
          <property name="fileAge">0</property>
          <property name="moveToPattern"></property>
          <property name="charsetEncoding">DEFAULT_ENCODING</property>
          <property name="checkFileAge">0</property>
          <property name="autoDelete">0</property>
          <property name="host">D:/mirth/messages</property>
          <property name="fileFilter">*</property>
          <property name="moveToDirectory"></property>
        </properties>
        <transformer>
          <steps/>
          <inboundProtocol>HL7V2</inboundProtocol>
          <outboundProtocol>HL7V2</outboundProtocol>
        </transformer>
        <filter>
          <rules/>
        </filter>
        <transportName>File Reader</transportName>
        <mode>SOURCE</mode>
        <enabled>true</enabled>
      </sourceConnector>
      <destinationConnectors>
        <com.webreach.mirth.model.Connector>
          <name>Destination 1</name>
          <properties>
            <property name="charsetEncoding">DEFAULT_ENCODING</property>
            <property name="outputAppend">1</property>
            <property name="DataType">File Writer</property>
            <property name="outputPattern">testcopy</property>
            <property name="template">${message.rawData}</property>
            <property name="host">D:/mirth/MessagesCopy</property>
            <property name="binary">0</property>
          </properties>
          <transformer>
            <steps/>
            <inboundProtocol>HL7V2</inboundProtocol>
            <outboundProtocol>HL7V2</outboundProtocol>
          </transformer>
          <filter>
            <rules/>
          </filter>
          <transportName>File Writer</transportName>
          <mode>DESTINATION</mode>
          <enabled>true</enabled>
        </com.webreach.mirth.model.Connector>
      </destinationConnectors>
      <properties>
        <property name="synchronous">true</property>
        <property name="removeNamespace">true</property>
        <property name="transactional">false</property>
        <property name="initialState">started</property>
        <property name="dont_store_filtered">false</property>
        <property name="error_messages_only">false</property>
        <property name="max_message_age">-1</property>
        <property name="store_messages">true</property>
        <property name="encryptData">false</property>
      </properties>
      <preprocessingScript>// Modify the message variable below to pre process data
    return message;</preprocessingScript>
      <postprocessingScript>// This script executes once after a message has been processed
    return;</postprocessingScript>
      <deployScript>// This script executes once when the mule engine is started
    // You only have access to the globalMap here to persist data
    return;</deployScript>
      <shutdownScript>// This script executes once when the mule engine is stopped
    // You only have access to the globalMap here to persist data
    return;</shutdownScript>
    </com.webreach.mirth.model.Channel>

    Comment

    Working...
    X