web stats
XML containing field names in output - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 03-30-2012, 06:56 AM
Sachin Dangi Sachin Dangi is offline
Mirth Newb
 
Join Date: Mar 2012
Posts: 11
Sachin Dangi is on a distinguished road
Default XML containing field names in output

Hi,
I am getting a xml message as output from Mirth. In the tag name the output is in the format of
ex.
<MSH.3.1>MASTER PAT INDX</MSH.3.1>
Can Mirth give the actual field name instead of <MSH3.1> ? If yes how ?

It would be a great help for me as I want to insert data in the fieldname,fieldValue format into the database.
Reply With Quote
  #2  
Old 03-30-2012, 08:47 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 3,529
narupley is on a distinguished road
Default

Quote:
Originally Posted by Sachin Dangi View Post
Hi,
I am getting a xml message as output from Mirth. In the tag name the output is in the format of
ex.
<MSH.3.1>MASTER PAT INDX</MSH.3.1>
Can Mirth give the actual field name instead of <MSH3.1> ? If yes how ?

It would be a great help for me as I want to insert data in the fieldname,fieldValue format into the database.
If you're mapping from E4X, make sure to add a .toString() on the end of your RHS, otherwise you're referencing the node, rather than its content.

Last edited by narupley; 03-30-2012 at 10:43 AM.
Reply With Quote
  #3  
Old 04-02-2012, 07:20 AM
Sachin Dangi Sachin Dangi is offline
Mirth Newb
 
Join Date: Mar 2012
Posts: 11
Sachin Dangi is on a distinguished road
Default

Sorry, I was unable to unserstand your reply to my query. Can you please elaborate a little. The output which I expect from Mirth is in the below format

<field_name> hl7_value <field_name>
Reply With Quote
  #4  
Old 04-02-2012, 07:27 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 3,529
narupley is on a distinguished road
Default

Quote:
Originally Posted by Sachin Dangi View Post
Sorry, I was unable to unserstand your reply to my query. Can you please elaborate a little. The output which I expect from Mirth is in the below format

<field_name> hl7_value <field_name>
I'm confused now as to which way you want it... do you want to retrieve "<MSH.3.1>MASTER PAT INDX</MSH.3.1>" or "MASTER PAT INDX"?

If the former, then you would map "msg.MSH['MSH.3']['MSH.3.1.']". If the latter, than you would map "msg.MSH['MSH.3']['MSH.3.1.'].toString()".
Reply With Quote
  #5  
Old 04-02-2012, 10:11 PM
Sachin Dangi Sachin Dangi is offline
Mirth Newb
 
Join Date: Mar 2012
Posts: 11
Sachin Dangi is on a distinguished road
Default

What I want actually is the value of the MSH3.1 field i.e the output should be in the format of

<Receiving Application> MASTER PAT INDX </Receiving Application>

instead of

<MSH 3.1> MASTER PAT INDX </MSH 3.1>
Reply With Quote
  #6  
Old 04-03-2012, 05:55 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 3,529
narupley is on a distinguished road
Default

Quote:
Originally Posted by Sachin Dangi View Post
What I want actually is the value of the MSH3.1 field i.e the output should be in the format of

<Receiving Application> MASTER PAT INDX </Receiving Application>

instead of

<MSH 3.1> MASTER PAT INDX </MSH 3.1>
Ah I gotcha, look here: http://www.mirthcorp.com/community/f...ead.php?t=6657
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 -7. The time now is 04:16 PM.


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