web stats
PIPE in MRN throwing Sequence - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Thread Tools Display Modes
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|
<scope>FACILITY A</scope>

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:

Then the transformation to XML fails as it sends:

But expects:

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

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

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 02:17 PM.

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