web stats
HL7 V3 Batch Message - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 01-31-2010, 07:31 PM
simidau simidau is offline
OBX.2 Kenobi
 
Join Date: Feb 2008
Posts: 62
simidau
Default HL7 V3 Batch Message

I'm having a problem processing a batch message - Batch message is not supported for HL7 v3 is what I get told by mirth.
It's an XML file with the messages all together inside a CDATA tag.
I can't find a way to split them up. Any ideas on how I can move forward on this.

The data I receive looks like this:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<BATCH>
	<FHS>
		<FHS.1>|</FHS.1>
		<FHS.2>^~\&amp;</FHS.2>
		<FHS.3>
			<HD.1>Healthlink Online Application</HD.1>
			<HD.2 />
			<HD.3 />
		</FHS.3>
		<FHS.4>
			<HD.1>Healthlink</HD.1>
			<HD.2 />
			<HD.3 />
		</FHS.4>
		<FHS.6>
			<HD.1 />
			<HD.2 />
			<HD.3 />
		</FHS.6>
		<FHS.7>
			<TS.1 />
		</FHS.7>
		<FHS.11>
			<PT.1 />
		</FHS.11>
	</FHS>
	<MESSAGEBATCH>
		<MESSAGES><![CDATA[<ORU_R01><MSH><MSH.1>|</MSH.1><MSH.2>^~\&amp;</MSH.2><MSH.3><HD.1>APEX.HEALTHLINK.10</HD.1><HD.2></HD.2><HD.3></HD.3></MSH.3><MSH.4><HD.1>REGIONAL HOSPITAL</HD.1><HD.2>300</HD.2><HD.3>L</HD.3></MSH.4><MSH.6><HD.1>Twist, Oliver</HD.1><HD.2>33338</HD.2><HD.3>Medical Council No</HD.3></MSH.6><MSH.7><TS.1>200901081252</TS.1></MSH.7><MSH.9><MSG.1>ORU</MSG.1><MSG.2>R01</MSG.2></MSH.9><MSH.10>1683256</MSH.10><MSH.11><PT.1>P</PT.1></MSH.11><MSH.12><VID.1>2.4</VID.1></MSH.12></MSH><ORU_R01.PATIENT_RESULT><ORU_R01.PATIENT><PID><PID.3><CX.1>65JM555</CX.1><CX.4><HD.1>REGIONAL HOSPITAL</HD.1></CX.4><CX.5>CHART NUMBER</CX.5></PID.3><PID.5><XPN.1><FN.1>65JM555</FN.1></XPN.1><XPN.2>65JM555</XPN.2><XPN.3></XPN.3><XPN.4></XPN.4><XPN.5></XPN.5><XPN.6></XPN.6><XPN.7></XPN.7></PID.5><PID.7><TS.1>19580211</TS.1></PID.7><PID.8>M</PID.8><PID.11><XAD.1><SAD.1>C/O STD</SAD.1></XAD.1><XAD.2></XAD.2><XAD.3></XAD.3><XAD.4></XAD.4><XAD.5></XAD.5></PID.11><PID.13><XTN.1></XTN.1><XTN.4></XTN.4><XTN.6></XTN.6><XTN.7></XTN.7></PID.13></PID><ORU_R01.PATIENT_VISIT><PV1><PV1.2>O</PV1.2><PV1.3><PL.1></PL.1><PL.2></PL.2><PL.3></PL.3><PL.4><HD.1></HD.1><HD.2></HD.2><HD.3></HD.3></PL.4><PL.5></PL.5><PL.6></PL.6><PL.7></PL.7><PL.8></PL.8><PL.9></PL.9></PV1.3><PV1.19><CX.1></CX.1></PV1.19></PV1></ORU_R01.PATIENT_VISIT></ORU_R01.PATIENT><ORU_R01.ORDER_OBSERVATION><OBR><OBR.1>1</OBR.1><OBR.2><EI.1>6164246200</EI.1><EI.2></EI.2></OBR.2><OBR.3><EI.1>HF007411M</EI.1><EI.2></EI.2><EI.3></EI.3><EI.4></EI.4></OBR.3><OBR.4><CE.1>WBCS</CE.1><CE.2>WBC.........................&gt;</CE.2><CE.3>L</CE.3><CE.4></CE.4><CE.5></CE.5><CE.6></CE.6></OBR.4><OBR.7><TS.1>200901081250</TS.1></OBR.7><OBR.13></OBR.13><OBR.14><TS.1>200901081250</TS.1></OBR.14><OBR.15><SPS.1><CE.1></CE.1><CE.2>EDTA</CE.2><CE.3></CE.3><CE.4></CE.4><CE.5></CE.5><CE.6></CE.6></SPS.1><SPS.2></SPS.2><SPS.3></SPS.3><SPS.4><CE.1></CE.1><CE.2></CE.2><CE.3></CE.3><CE.4></CE.4><CE.5></CE.5><CE.6></CE.6></SPS.4><SPS.5><CE.2></CE.2></SPS.5><SPS.6><CE.2></CE.2></SPS.6></OBR.15><OBR.16><XCN.1>33338</XCN.1><XCN.2><FN.1>GP</FN.1></XCN.2><XCN.3>Dummy</XCN.3><XCN.4></XCN.4><XCN.5></XCN.5><XCN.6>Dr.</XCN.6></OBR.16><OBR.24>HM</OBR.24><OBR.25>F</OBR.25><OBR.28><XCN.1></XCN.1><XCN.2><FN.1></FN.1></XCN.2><XCN.3></XCN.3><XCN.4></XCN.4><XCN.5></XCN.5><XCN.6></XCN.6></OBR.28></OBR><ORU_R01.OBSERVATION><OBX><OBX.1>1</OBX.1><OBX.2>NM</OBX.2><OBX.3><CE.1>WBCS</CE.1><CE.2>WBC</CE.2><CE.3>L</CE.3><CE.4></CE.4><CE.5></CE.5><CE.6></CE.6></OBX.3><OBX.5>4.60</OBX.5><OBX.6><CE.1>10^9/L</CE.1><CE.2>10^9/L</CE.2><CE.3></CE.3><CE.4></CE.4><CE.5></CE.5><CE.6></CE.6></OBX.6><OBX.7>3.7-11.1</OBX.7><OBX.8></OBX.8><OBX.11>F</OBX.11></OBX></ORU_R01.OBSERVATION></ORU_R01.PATIENT_RESULT></ORU_R01><ORU_R01><MSH><MSH.1>|</MSH.1><MSH.2>^~\&amp;</MSH.2><MSH.3><HD.1>APEX.HEALTHLINK.10</HD.1><HD.2></HD.2><HD.3></HD.3></MSH.3><MSH.4><HD.1>REGIONAL HOSPITAL</HD.1><HD.2>300</HD.2><HD.3>L</HD.3></MSH.4><MSH.6><HD.1>Twist, Oliver</HD.1><HD.2>33339</HD.2><HD.3>Medical Council No</HD.3></MSH.6><MSH.7><TS.1>200901081252</TS.1></MSH.7><MSH.9><MSG.1>ORU</MSG.1><MSG.2>R01</MSG.2></MSH.9><MSH.10>1683256</MSH.10><MSH.11><PT.1>P</PT.1></MSH.11><MSH.12><VID.1>2.4</VID.1></MSH.12></MSH><ORU_R01.PATIENT_RESULT><ORU_R01.PATIENT><PID><PID.3><CX.1>65JM555</CX.1><CX.4><HD.1>REGIONAL HOSPITAL</HD.1></CX.4><CX.5>CHART NUMBER</CX.5></PID.3><PID.5><XPN.1><FN.1>65JM555</FN.1></XPN.1><XPN.2>65JM555</XPN.2><XPN.3></XPN.3><XPN.4></XPN.4><XPN.5></XPN.5><XPN.6></XPN.6><XPN.7></XPN.7></PID.5><PID.7><TS.1>19580211</TS.1></PID.7><PID.8>M</PID.8><PID.11><XAD.1><SAD.1>C/O STD</SAD.1></XAD.1><XAD.2></XAD.2><XAD.3></XAD.3><XAD.4></XAD.4><XAD.5></XAD.5></PID.11><PID.13><XTN.1></XTN.1><XTN.4></XTN.4><XTN.6></XTN.6><XTN.7></XTN.7></PID.13></PID><ORU_R01.PATIENT_VISIT><PV1><PV1.2>O</PV1.2><PV1.3><PL.1></PL.1><PL.2></PL.2><PL.3></PL.3><PL.4><HD.1></HD.1><HD.2></HD.2><HD.3></HD.3></PL.4><PL.5></PL.5><PL.6></PL.6><PL.7></PL.7><PL.8></PL.8><PL.9></PL.9></PV1.3><PV1.19><CX.1></CX.1></PV1.19></PV1></ORU_R01.PATIENT_VISIT></ORU_R01.PATIENT><ORU_R01.ORDER_OBSERVATION><OBR><OBR.1>1</OBR.1><OBR.2><EI.1>6164246200</EI.1><EI.2></EI.2></OBR.2><OBR.3><EI.1>HF007411M</EI.1><EI.2></EI.2><EI.3></EI.3><EI.4></EI.4></OBR.3><OBR.4><CE.1>WBCS</CE.1><CE.2>WBC2........................&gt;</CE.2><CE.3>L</CE.3><CE.4></CE.4><CE.5></CE.5><CE.6></CE.6></OBR.4><OBR.7><TS.1>200901081250</TS.1></OBR.7><OBR.13></OBR.13><OBR.14><TS.1>200901081250</TS.1></OBR.14><OBR.15><SPS.1><CE.1></CE.1><CE.2>EDTA</CE.2><CE.3></CE.3><CE.4></CE.4><CE.5></CE.5><CE.6></CE.6></SPS.1><SPS.2></SPS.2><SPS.3></SPS.3><SPS.4><CE.1></CE.1><CE.2></CE.2><CE.3></CE.3><CE.4></CE.4><CE.5></CE.5><CE.6></CE.6></SPS.4><SPS.5><CE.2></CE.2></SPS.5><SPS.6><CE.2></CE.2></SPS.6></OBR.15><OBR.16><XCN.1>33339</XCN.1><XCN.2><FN.1>GP</FN.1></XCN.2><XCN.3>Dummy</XCN.3><XCN.4></XCN.4><XCN.5></XCN.5><XCN.6>Dr.</XCN.6></OBR.16><OBR.24>HM</OBR.24><OBR.25>F</OBR.25><OBR.28><XCN.1></XCN.1><XCN.2><FN.1></FN.1></XCN.2><XCN.3></XCN.3><XCN.4></XCN.4><XCN.5></XCN.5><XCN.6></XCN.6></OBR.28></OBR><ORU_R01.OBSERVATION><OBX><OBX.1>1</OBX.1><OBX.2>NM</OBX.2><OBX.3><CE.1>WBCS</CE.1><CE.2>WBC</CE.2><CE.3>L</CE.3><CE.4></CE.4><CE.5></CE.5><CE.6></CE.6></OBX.3><OBX.5>4.60</OBX.5><OBX.6><CE.1>10^9/L</CE.1><CE.2>10^9/L</CE.2><CE.3></CE.3><CE.4></CE.4><CE.5></CE.5><CE.6></CE.6></OBX.6><OBX.7>3.7-11.1</OBX.7><OBX.8></OBX.8><OBX.11>F</OBX.11></OBX></ORU_R01.OBSERVATION></ORU_R01.PATIENT_RESULT></ORU_R01>]]></MESSAGES>
		<BTS>
			<BTS.1>6</BTS.1>
			<BTS.2><![CDATA[<MESSAGE><ID>33338</ID><TYPE>10</TYPE></MESSAGE><MESSAGE><ID>33339</ID><TYPE>10</TYPE></MESSAGE>]]></BTS.2>
		</BTS>
	</MESSAGEBATCH>
</BATCH>
Any help greatly appreciated.
Reply With Quote
  #2  
Old 02-08-2010, 04:15 PM
simidau simidau is offline
OBX.2 Kenobi
 
Join Date: Feb 2008
Posts: 62
simidau
Default

I managed to get what I wanted

In my reader channel I created a destination transformer - of type javascript and used the following, to read the batch section, set it as XML, then for each of the ORU segments send them to the channel that deals with the data (channel2).

Code:
batchString = msg['MESSAGEBATCH']['MESSAGES'].toString();

var xmlString = '<BATCH>' + msg['MESSAGEBATCH']['MESSAGES'].toString() + '</BATCH>';
var messagebatch = new XML(xmlString);

msg = messagebatch;


for (var iPid = 0; iPid < msg['ORU_R01'].length(); iPid++)
{
	var messageString = new XML(msg['ORU_R01'][iPid]);
	router.routeMessage('Channel2', messageString);
}
Reply With Quote
Reply

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


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