You are on page 1of 9

<com.mirth.connect.model.

Channel>
<inboundProtocol>HL7V2</inboundProtocol>
<outboundProtocol>HL7V2</outboundProtocol>
<inboundProperties>
<property name="handleRepetitions">false</property>
<property name="stripNamespaces">true</property>
<property name="convertLFtoCR">true</property>
<property name="useStrictParser">false</property>
<property name="useStrictValidation">false</property>
<property name="handleSubcomponents">false</property>
</inboundProperties>
<outboundProperties>
<property name="handleRepetitions">false</property>
<property name="stripNamespaces">true</property>
<property name="convertLFtoCR">true</property>
<property name="useStrictParser">false</property>
<property name="useStrictValidation">false</property>
<property name="handleSubcomponents">false</property>
</outboundProperties>
</transformer>
<filter>
<rules/>
</filter>
<transportName>File Reader</transportName>
<mode>SOURCE</mode>
<enabled>true</enabled>
<version>2.0.1.5164</version>
</sourceConnector>
<destinationConnectors>
<com.mirth.connect.model.Connector>
<name>Destination 1</name>
<properties>
<property name="secure">1</property>
<property name="scheme">file</property>
<property name="binary">1</property>
<property name="username">anonymous</property>
<property name="outputPattern">${GetFileName}.pdf</property>
<property name="validateConnections">1</property>
<property name="DataType">File Writer</property>
<property name="FTPAnonymous">1</property>
<property name="timeout">10000</property>
<property name="charsetEncoding">DEFAULT_ENCODING</property>
<property name="password">anonymous</property>
<property name="passive">1</property>
<property name="template">${data}</property>
<property name="outputAppend">1</property>
<property name="host">D:/Destination PDF files</property>
</properties>
<transformer>
<steps>
<step>
<sequenceNumber>0</sequenceNumber>
<name>New Step</name>
<script>var data = &quot;&quot;;
var OBXCount = 0;
for each (Segment in msg.children())
{
if (Segment.name() == &quot;OBX&quot;)
{
data = data +
msg[&apos;OBX&apos;][OBXCount][&apos;OBX.5&apos;][&apos;OBX.5.5&apos;].toString();
OBXCount = OBXCount+1;
}
}

channelMap.put(&apos;data&apos;,data);
//FileUtil.write(&quot;c://Test.txt&quot;,true,channelMap.get(&apos;data&apos;));

//var gagan = FileUtil.readBytes(&quot;D://writer//Test.pdf&quot;);
//FileUtil.write(&quot;c://Test.txt&quot;,true,&quot;b64Text =
&quot;+gagan.toByteArray()+&quot;\r\n&quot;);
//var b64Text = FileUtil.encode(contents.toByteArray());
//FileUtil.write(&quot;c://Test.txt&quot;,true,&quot;b64Text = &quot;+b64Text);</script>
<type>JavaScript</type>
<data class="map">
<entry>
<string>Script</string>
<string>var data = &quot;&quot;;
var OBXCount = 0;
for each (Segment in msg.children())
{
if (Segment.name() == &quot;OBX&quot;)
{
data = data +
msg[&apos;OBX&apos;][OBXCount][&apos;OBX.5&apos;][&apos;OBX.5.5&apos;].toString();
OBXCount = OBXCount+1;
}
}

channelMap.put(&apos;data&apos;,data);
//FileUtil.write(&quot;c://Test.txt&quot;,true,channelMap.get(&apos;data&apos;));

//var gagan = FileUtil.readBytes(&quot;D://writer//Test.pdf&quot;);
//FileUtil.write(&quot;c://Test.txt&quot;,true,&quot;b64Text =
&quot;+gagan.toByteArray()+&quot;\r\n&quot;);
//var b64Text = FileUtil.encode(contents.toByteArray());
//FileUtil.write(&quot;c://Test.txt&quot;,true,&quot;b64Text = &quot;+b64Text);</string>
</entry>
</data>
</step>
<step>
<sequenceNumber>1</sequenceNumber>
<name>New Step</name>
<script>var TempFileName=channelMap.get(&quot;originalFilename&quot;);
var FileName=TempFileName.split(&quot;.hl7&quot;)[0];
//var resultat=cos.split(&quot;-&quot;,2);
channelMap.put(&quot;GetFileName&quot;,FileName);</script>
<type>JavaScript</type>
<data class="map">
<entry>
<string>Script</string>
<string>var TempFileName=channelMap.get(&quot;originalFilename&quot;);
var FileName=TempFileName.split(&quot;.hl7&quot;)[0];
//var resultat=cos.split(&quot;-&quot;,2);
channelMap.put(&quot;GetFileName&quot;,FileName);</string>
</entry>
</data>
</step>
</steps>
<inboundTemplate
encoding="base64">TVNIfF5+XCZ8fFNlbmRpbmdBcHBsaWNhdGlvbnxTZW5kaW5nRmFjaWxpdHl8UHJhY
3RpY2VBY2Nv
dW50I3x8fE9SVV5SMDF8TWVzc2FnZUNvbnRyb2xJRHxQfDIuMwpQSUR8fHx8fFBhdGllbnR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ZXBvcnReUERGXkJhc2U2NF5SVGxF
TlRVeE9URkRNVEl3UXpRM09VRTBNRFUyTnpaRE5rTTRPREkxTXo1ZEwwbHVaR1Y0V3pFNElESTQK
T0JYfDd8RUR8UERGXlBERkJBU0U2NHwyfF5QREZSZXBvcnReUERGXkJhc2U2NF5SVGxFTlRVeE9U
RkRNVEl3UXpRM09VRTBNRFUyTnpaRE5rTTRPREkxTXo1ZEwwbHVaR1Y0V3pFNElESTQ=</inboundTempl
ate>
<outboundTemplate encoding="base64"></outboundTemplate>
<inboundProtocol>HL7V2</inboundProtocol>
<outboundProtocol>HL7V2</outboundProtocol>
<inboundProperties>
<property name="handleRepetitions">false</property>
<property name="stripNamespaces">true</property>
<property name="convertLFtoCR">true</property>
<property name="useStrictParser">false</property>
<property name="useStrictValidation">false</property>
<property name="handleSubcomponents">false</property>
</inboundProperties>
<outboundProperties>
<property name="handleRepetitions">false</property>
<property name="stripNamespaces">true</property>
<property name="convertLFtoCR">true</property>
<property name="useStrictParser">false</property>
<property name="useStrictValidation">false</property>
<property name="handleSubcomponents">false</property>
</outboundProperties>
</transformer>
<filter>
<rules/>
</filter>
<transportName>File Writer</transportName>
<mode>DESTINATION</mode>
<enabled>true</enabled>
<version>2.0.1.5164</version>
</com.mirth.connect.model.Connector>
</destinationConnectors>
<properties>
<property name="synchronous">true</property>
<property name="clearGlobalChannelMap">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 channel is deployed
// You only have access to the globalMap and globalChannelMap here to persist data
return;</deployScript>
<shutdownScript>// This script executes once when the channel is undeployed
// You only have access to the globalMap and globalChannelMap here to persist data
return;</shutdownScript>
</com.mirth.connect.model.Channel>

You might also like