web stats
String to HL7 - Page 2 - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #11  
Old 01-22-2020, 01:06 PM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 1,159
agermano is on a distinguished road
Default

Quote:
Originally Posted by odo View Post
Code:
msg = SerializerFactory.getSerializer('HL7V2').toXML($('RawInbound'));
Code:
msg = new XML(SerializerFactory.getSerializer('HL7V2').toXML($('RawInbound')));
Reply With Quote
  #12  
Old 01-27-2020, 08:20 AM
gojoshi gojoshi is offline
OBX.1 Kenobi
 
Join Date: Jul 2013
Posts: 50
gojoshi is on a distinguished road
Default

Sorry, this is giving the error that I described at the beginning of this ticket:

Transformer error
ERROR MESSAGE: Error evaluating transformer
com.mirth.connect.server.MirthJavascriptTransforme rException:
CHANNEL: string2HL7
CONNECTOR: Destination 1
SCRIPT SOURCE: TRANSFORMER
SOURCE CODE:
1508:
1509: msg = SerializerFactory.getSerializer('HL7V2').toXML($(' RawInbound'));
1510:
1511:
1512:
1513: msg['MSH']['MSH.4']['MSH.4.1'] ="BlaBlaBLa";
1514: if ('xml' === typeof msg) {
1515: if (msg.hasSimpleContent()) {
1516: msg = msg.toXMLString();
1517: }
LINE NUMBER: 1513
DETAILS: TypeError: Cannot read property "MSH.4" from undefined
at 980b5155-c1e6-4c8e-a86c-01d79e2506f1:1513 (doTransform)
at 980b5155-c1e6-4c8e-a86c-01d79e2506f1:1535 (doScript)
at 980b5155-c1e6-4c8e-a86c-01d79e2506f1:1537
at com.mirth.connect.server.transformers.JavaScriptFi lterTransformer$FilterTransformerTask.doCall(JavaS criptFilterTransformer.java:154)
at com.mirth.connect.server.transformers.JavaScriptFi lterTransformer$FilterTransformerTask.doCall(JavaS criptFilterTransformer.java:119)
at com.mirth.connect.server.util.javascript.JavaScrip tTask.call(JavaScriptTask.java:113)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker( Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (Unknown Source)
at java.lang.Thread.run(Unknown Source)
Reply With Quote
  #13  
Old 01-27-2020, 08:23 AM
gojoshi gojoshi is offline
OBX.1 Kenobi
 
Join Date: Jul 2013
Posts: 50
gojoshi is on a distinguished road
Default

Sorry, this is giving the error that I described in the beginning of this ticket:

Transformer error
ERROR MESSAGE: Error evaluating transformer
com.mirth.connect.server.MirthJavascriptTransforme rException:
CHANNEL: string2HL7
CONNECTOR: Destination 1
SCRIPT SOURCE: TRANSFORMER
SOURCE CODE:
1508:
1509: msg = SerializerFactory.getSerializer('HL7V2').toXML($(' RawInbound'));
1510:
1511:
1512:
1513: msg['MSH']['MSH.4']['MSH.4.1'] ="BlaBlaBLa";
1514: if ('xml' === typeof msg) {
1515: if (msg.hasSimpleContent()) {
1516: msg = msg.toXMLString();
1517: }
LINE NUMBER: 1513
DETAILS: TypeError: Cannot read property "MSH.4" from undefined
at 980b5155-c1e6-4c8e-a86c-01d79e2506f1:1513 (doTransform)
at 980b5155-c1e6-4c8e-a86c-01d79e2506f1:1535 (doScript)
at 980b5155-c1e6-4c8e-a86c-01d79e2506f1:1537
at com.mirth.connect.server.transformers.JavaScriptFi lterTransformer$FilterTransformerTask.doCall(JavaS criptFilterTransformer.java:154)
at com.mirth.connect.server.transformers.JavaScriptFi lterTransformer$FilterTransformerTask.doCall(JavaS criptFilterTransformer.java:119)
at com.mirth.connect.server.util.javascript.JavaScrip tTask.call(JavaScriptTask.java:113)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker( Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (Unknown Source)
at java.lang.Thread.run(Unknown Source)
Reply With Quote
  #14  
Old 01-27-2020, 04:34 PM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 1,159
agermano is on a distinguished road
Default

Look at my previous post.
Reply With Quote
  #15  
Old 01-28-2020, 04:26 AM
gojoshi gojoshi is offline
OBX.1 Kenobi
 
Join Date: Jul 2013
Posts: 50
gojoshi is on a distinguished road
Thumbs up

Thanks agermano, the below works !

msg = new XML(SerializerFactory.getSerializer('HL7V2').toXML ($('RawInbound')));
Reply With Quote
Reply

Tags
convert to hl7, hl7, string, string to hl7

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 01:21 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Mirth Corporation