web stats
Converting HL7 v.3 to a custom XML - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 02-15-2012, 07:45 AM
asolovey asolovey is offline
What's HL7?
 
Join Date: Feb 2012
Posts: 1
asolovey is on a distinguished road
Default Converting HL7 v.3 to a custom XML

I am evaluating MIRTH Connect as a platform for exchanging HL7 messages. I am fairly new to this framework and still trying to figure out the benefits it can provide.
For example, I would like to convert the XML MIRTH generates from a HL7 2.x message into my own XML format. Is there an easy way to do that in MIRTH Connect Administrator without writing a javascript?
I tried to do that by providing my custom XML in the outbound message template. I then added mappings between HL7 elements and my custom XML tags. It worked fine as long as the number of repeating elements (such as OBX) in the HL7 message is always the same but it is not the case.
Having that said, I still do not know how to do that and I would much appreciate if someone would point me to the right direction.
Reply With Quote
  #2  
Old 03-30-2017, 10:56 AM
nadipallyck1 nadipallyck1 is offline
Mirth Newb
 
Join Date: Mar 2017
Posts: 18
nadipallyck1 is on a distinguished road
Default repeating elements in XML

Hi,

I am also facing a similar kind of problem. I am mapping a XML message to ccd. I am using javascript in the transformer. Please let me know if you come across any solution and I'll do the same.

here is the code I have written in the transformer.

while(i>=0){
tmp.*::['recordTarget'].*::['patientRole'].*::['telecom'] = new XML("<telecom/>");
var temp = msg['Header']['PatientCareReport']['ePatient']['ePatient.18'][i].toString();
if(temp == null)
{
tmp.*::['recordTarget'].*::['patientRole'].*::['telecom']['@value']= "NA";
}
else{
tmp.*::['recordTarget'].*::['patientRole'].*::['telecom']['@value'] = temp;
}
i++;
}

And the error I am facing is:
TypeError: Cannot call method "toString" of undefined.
Reply With Quote
Reply

Tags
custom, xml

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


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