web stats
< (less than) sign in physician summary notes causing error in document writer - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 08-02-2017, 02:07 PM
billyjc99 billyjc99 is offline
What's HL7?
 
Join Date: Aug 2017
Posts: 3
billyjc99 is on a distinguished road
Default < (less than) sign in physician summary notes causing error in document writer

Hello,
Mirth Connect 3.4.2.8129
We have a physician summary note from a hospital that was sent to us as an ORU-T01 message. We are sending the message as a pdf using document writer for destination. We transformed the message in document writer destination using the following javascript to create a variable:

var reportTxt = "";
for each (seg in msg.children())
{
if (seg.name().toString() == "OBX")
{
reportTxt += "<tr>" + seg['OBX.5']['OBX.5.1'].toString() + "</tr>";
}
}


channelMap.put('text', reportTxt);

and placed it into html template under document writer destination as html format to create the pdf:

<table>
${text}
</table>

We get the following error:

Document Writer error
ERROR MESSAGE: Error writing document
org.xml.sax.SAXParseException; lineNumber: 235; columnNumber: 77; The content of elements must consist of well-formed character data or markup.
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(U nknown Source)
at com.mirth.connect.connectors.doc.DocumentDispatche r.createPDF(DocumentDispatcher.java:217)
at com.mirth.connect.connectors.doc.DocumentDispatche r.writeDocument(DocumentDispatcher.java:175)
at com.mirth.connect.connectors.doc.DocumentDispatche r.send(DocumentDispatcher.java:118)
at com.mirth.connect.donkey.server.channel.Destinatio nConnector.handleSend(DestinationConnector.java:82 2)
at com.mirth.connect.donkey.server.channel.Destinatio nConnector.process(DestinationConnector.java:476)
at com.mirth.connect.donkey.server.channel.Destinatio nChain.doCall(DestinationChain.java:121)
at com.mirth.connect.donkey.server.channel.Destinatio nChain.call(DestinationChain.java:63)
at com.mirth.connect.donkey.server.channel.Channel.pr ocess(Channel.java:1715)
at com.mirth.connect.donkey.server.channel.Channel.di spatchRawMessage(Channel.java:1198)
at com.mirth.connect.donkey.server.channel.SourceConn ector.dispatchRawMessage(SourceConnector.java:192)
at com.mirth.connect.server.controllers.DonkeyEngineC ontroller.dispatchRawMessage(DonkeyEngineControlle r.java:1053)
at com.mirth.connect.server.api.servlets.MessageServl et$2.run(MessageServlet.java:106)
at java.lang.Thread.run(Unknown Source)

We found that it was because the physician note had a "<" symbol in their notes found in line OBX 234 and was causing this error. See below:

OBX|233|FT|000000000^Progress Note EMR No Cosign||movement yesterday. Electrolytes corrected and patient ambulating. Bilirubin||||||F|||20170729144536||00882^MOUSE^MIC KEY^^MD^^MD^^VBA Doc Number
OBX|234|FT|000000000^Progress Note EMR No Cosign||and LFT's trending down. Will keep pt in hospital until total bilirubin is <||||||F|||20170729144536||00882^MOUSE^MICKEY^^MD^^ MD^^VBA Doc Number
OBX|235|FT|000000000^Progress Note EMR No Cosign||10 as per surgery recommedations. Also the patient will be given meds for||||||F|||20170729144536||00882^MOUSE^MICKEY^^M D^^MD^^VBA Doc Number

When we remove "<" from OBX 234 than the pdf is created and sent as expected to destination. This occurs with the greater than sign ">" in physician notes as well. We understand that these are used as brackets for html but what do we need to do to allow these messages with these symbols in the OBX segments to be sent without error?

How can we fix this? I appreciate everyones help

Thank you!
Reply With Quote
  #2  
Old 08-03-2017, 07:08 AM
tiskinty tiskinty is offline
OBX.1 Kenobi
 
Join Date: Jun 2016
Posts: 43
tiskinty is on a distinguished road
Default

Have you tried adding something like .replace("<", "&lt;") ?
i.e. reportTxt += "<tr>" + seg['OBX.5']['OBX.5.1'].toString().replace("<", "&lt;") + "</tr>";
Reply With Quote
  #3  
Old 08-03-2017, 10:50 AM
billyjc99 billyjc99 is offline
What's HL7?
 
Join Date: Aug 2017
Posts: 3
billyjc99 is on a distinguished road
Thumbs up Worked perfectly

Quote:
Originally Posted by tiskinty View Post
Have you tried adding something like .replace("<", "&lt;") ?
i.e. reportTxt += "<tr>" + seg['OBX.5']['OBX.5.1'].toString().replace("<", "&lt;") + "</tr>";
Thank you! That is exactly what I was missing Works like a charm now.
Reply With Quote
  #4  
Old 08-03-2017, 10:51 AM
billyjc99 billyjc99 is offline
What's HL7?
 
Join Date: Aug 2017
Posts: 3
billyjc99 is on a distinguished road
Default

Thank you. It works perfect now!
Reply With Quote
Reply

Tags
< or >, document writer, error, greater than sign, html

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 07:10 AM.


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