The problem is that I receive in mirth a message of this type:
edi
*123456789|1234567* and I want that it me sends it by tcp ?123456789 1234567? I what I do it is a transformation in source in java script to var mensa=messageObject.getRawData ();
to var numhistoria=mensa.substring (1,9);
to var numepiso=mensa.substring (11,18);
channelMap.put (?numhistoria?, numhistoria);
channelMap.put (?numepiso?, numepiso);
but he does not work to me I have proven of many forms and not like doing it is some form to change to the separators of the message edi? as I can put a message group edi without putting menssage*?
my chanel is :
<com.webreach.mirth.model.Channel>
<id>ceb40b73-f2dd-4572-8e85-7e556921245c</id>
<name>solicitud demograficos</name>
<description></description>
<enabled>true</enabled>
<version>1.4.0</version>
<revision>32</revision>
<sourceConnector>
<name>sourceConnector</name>
<properties>
<property name="charsetEncoding">DEFAULT_ENCODING</property>
<property name="receiveTimeout">5000</property>
<property name="port">6661</property>
<property name="ackOnNewConnection">0</property>
<property name="DataType">TCP Listener</property>
<property name="ackPort"></property>
<property name="host">127.0.0.1</property>
<property name="responseValue">None</property>
<property name="keepSendSocketOpen">0</property>
<property name="bufferSize">65536</property>
<property name="ackIP">...</property>
</properties>
<transformer>
<steps>
<com.webreach.mirth.model.Step>
<sequenceNumber>0</sequenceNumber>
<name>New Step</name>
<script>var mensa=messageObject.getRawData();
var numhistoria=mensa.substring(1,9);
var numepiso=mensa.substring(11,18);
channelMap.put('numhistoria',numhistoria );
channelMap.put('numepiso',numepiso);</script>
<type>JavaScript</type>
<data class="map">
<entry>
<string>Script</string>
<string>var mensa=messageObject.getRawData();
var numhistoria=mensa.substring(1,9);
var numepiso=mensa.substring(11,18);
channelMap.put('numhistoria',numhistoria );
channelMap.put('numepiso',numepiso);</string>
</entry>
</data>
</com.webreach.mirth.model.Step>
</steps>
<inboundTemplate>message*123456789|1234567*
& #x0D;
</inboundTemplate>
<outboundTemplate></outboundTemplate>
<inboundProtocol>EDI</inboundProtocol>
<outboundProtocol>EDI</outboundProtocol>
<inboundProperties>
<property name="elementDelimiter">*</property>
<property name="subelementDelimiter">:</property>
<property name="segmentDelimiter">~</property>
</inboundProperties>
<outboundProperties>
<property name="elementDelimiter">*</property>
<property name="subelementDelimiter">:</property>
<property name="segmentDelimiter">~</property>
</outboundProperties>
</transformer>
<filter>
<rules/>
</filter>
<transportName>TCP Listener</transportName>
<mode>SOURCE</mode>
</sourceConnector>
<destinationConnectors>
<com.webreach.mirth.model.Connector>
<name>Destination 1</name>
<properties>
<property name="binary">0</property>
<property name="charsetEncoding">DEFAULT_ENCODING</property>
<property name="host">C:/Documents and Settings/Medicalis/Escritorio/Clinisoft/resultados</property>
<property name="outputPattern">prueba.txt</property>
<property name="DataType">File Writer</property>
<property name="template">"0202rea002iri602PP_ADMCLI000 00001000000002007051012261 1 1 0 0 000115"+${numhistoria}${numepiso}</property>
<property name="outputAppend">1</property>
</properties>
<transformer>
<steps/>
<inboundTemplate></inboundTemplate>
<outboundTemplate></outboundTemplate>
<inboundProtocol>EDI</inboundProtocol>
<outboundProtocol>EDI</outboundProtocol>
<inboundProperties/>
<outboundProperties/>
</transformer>
<filter>
<rules/>
</filter>
<transportName>File Writer</transportName>
<mode>DESTINATION</mode>
</com.webreach.mirth.model.Connector>
</destinationConnectors>
<properties>
<property name="synchronous">true</property>
<property name="encryptData">false</property>
<property name="dont_store_filtered">false</property>
<property name="store_messages">true</property>
<property name="initialState">started</property>
<property name="max_message_age">-1</property>
<property name="transactional">false</property>
<property name="error_messages_only">false</property>
</properties>
<preprocessingScript>// Modify the message variable below to pre process data
return message;</preprocessingScript>
</com.webreach.mirth.model.Channel>
edi
*123456789|1234567* and I want that it me sends it by tcp ?123456789 1234567? I what I do it is a transformation in source in java script to var mensa=messageObject.getRawData ();
to var numhistoria=mensa.substring (1,9);
to var numepiso=mensa.substring (11,18);
channelMap.put (?numhistoria?, numhistoria);
channelMap.put (?numepiso?, numepiso);
but he does not work to me I have proven of many forms and not like doing it is some form to change to the separators of the message edi? as I can put a message group edi without putting menssage*?
my chanel is :
<com.webreach.mirth.model.Channel>
<id>ceb40b73-f2dd-4572-8e85-7e556921245c</id>
<name>solicitud demograficos</name>
<description></description>
<enabled>true</enabled>
<version>1.4.0</version>
<revision>32</revision>
<sourceConnector>
<name>sourceConnector</name>
<properties>
<property name="charsetEncoding">DEFAULT_ENCODING</property>
<property name="receiveTimeout">5000</property>
<property name="port">6661</property>
<property name="ackOnNewConnection">0</property>
<property name="DataType">TCP Listener</property>
<property name="ackPort"></property>
<property name="host">127.0.0.1</property>
<property name="responseValue">None</property>
<property name="keepSendSocketOpen">0</property>
<property name="bufferSize">65536</property>
<property name="ackIP">...</property>
</properties>
<transformer>
<steps>
<com.webreach.mirth.model.Step>
<sequenceNumber>0</sequenceNumber>
<name>New Step</name>
<script>var mensa=messageObject.getRawData();
var numhistoria=mensa.substring(1,9);
var numepiso=mensa.substring(11,18);
channelMap.put('numhistoria',numhistoria );
channelMap.put('numepiso',numepiso);</script>
<type>JavaScript</type>
<data class="map">
<entry>
<string>Script</string>
<string>var mensa=messageObject.getRawData();
var numhistoria=mensa.substring(1,9);
var numepiso=mensa.substring(11,18);
channelMap.put('numhistoria',numhistoria );
channelMap.put('numepiso',numepiso);</string>
</entry>
</data>
</com.webreach.mirth.model.Step>
</steps>
<inboundTemplate>message*123456789|1234567*
& #x0D;
</inboundTemplate>
<outboundTemplate></outboundTemplate>
<inboundProtocol>EDI</inboundProtocol>
<outboundProtocol>EDI</outboundProtocol>
<inboundProperties>
<property name="elementDelimiter">*</property>
<property name="subelementDelimiter">:</property>
<property name="segmentDelimiter">~</property>
</inboundProperties>
<outboundProperties>
<property name="elementDelimiter">*</property>
<property name="subelementDelimiter">:</property>
<property name="segmentDelimiter">~</property>
</outboundProperties>
</transformer>
<filter>
<rules/>
</filter>
<transportName>TCP Listener</transportName>
<mode>SOURCE</mode>
</sourceConnector>
<destinationConnectors>
<com.webreach.mirth.model.Connector>
<name>Destination 1</name>
<properties>
<property name="binary">0</property>
<property name="charsetEncoding">DEFAULT_ENCODING</property>
<property name="host">C:/Documents and Settings/Medicalis/Escritorio/Clinisoft/resultados</property>
<property name="outputPattern">prueba.txt</property>
<property name="DataType">File Writer</property>
<property name="template">"0202rea002iri602PP_ADMCLI000 00001000000002007051012261 1 1 0 0 000115"+${numhistoria}${numepiso}</property>
<property name="outputAppend">1</property>
</properties>
<transformer>
<steps/>
<inboundTemplate></inboundTemplate>
<outboundTemplate></outboundTemplate>
<inboundProtocol>EDI</inboundProtocol>
<outboundProtocol>EDI</outboundProtocol>
<inboundProperties/>
<outboundProperties/>
</transformer>
<filter>
<rules/>
</filter>
<transportName>File Writer</transportName>
<mode>DESTINATION</mode>
</com.webreach.mirth.model.Connector>
</destinationConnectors>
<properties>
<property name="synchronous">true</property>
<property name="encryptData">false</property>
<property name="dont_store_filtered">false</property>
<property name="store_messages">true</property>
<property name="initialState">started</property>
<property name="max_message_age">-1</property>
<property name="transactional">false</property>
<property name="error_messages_only">false</property>
</properties>
<preprocessingScript>// Modify the message variable below to pre process data
return message;</preprocessingScript>
</com.webreach.mirth.model.Channel>