web stats
PIPE in MRN throwing Sequence - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 01-11-2019, 04:42 PM
mmonisky mmonisky is offline
OBX.1 Kenobi
 
Join Date: Aug 2015
Posts: 35
mmonisky is on a distinguished road
Default PIPE in MRN throwing Sequence

Running into an issue with the MRN being sent by the source contains a PIPE.
i.e. 1234|
<clinicalDocument>
<patient>
<aliases>
<scope>FACILITY A</scope>
<id>1234|</id>
<type>HL7.PID</type>
<facilityAliasModels/>
</aliases>


This is ingested by the empi (MM) as such 1234|
When making the API Call to the application and parsing out the HTML as JSON to delimited text (|) this throws off the sequence, causing an error:

TypeError: The content of elements must consist of well-formed character data or markup.

The delimited channel receives i.e.: PATIENTMRN|1234||POSTALCODE|90018-0005

But is expecting:
PATIENTMRN|1234|POSTALCODE|90018-0005

Then the transformation to XML fails as it sends:
<PATIENTMRN>1234</PATIENTMRN>
<>POSTALCODE</>
<90018-0005>DATEOFBIRTH</90018-0005>

But expects:
<PATIENTMRN>1234</PATIENTMRN>
<POSTALCODE>90018-0005</POSTALCODE>
<DATEOFBIRTH>19700101</DATEOFBIRTH>

How can i get rid of the extra PIPE?
Reply With Quote
  #2  
Old 01-12-2019, 07:33 PM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 718
agermano is on a distinguished road
Default

Code:
var mrn = msg.patient.aliases.id;
var pipeindex = mrn.indexOf('|');
if (pipeindex > -1) {
    // if a pipe is found, keep everything up to the first pipe
    mrn = mrn.slice(0, pipeindex);
}
Reply With Quote
Reply

Tags
delimiter, pipe

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 04:23 AM.


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