web stats
Problem with retrieving XML data - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 05-12-2014, 10:32 PM
neotof neotof is offline
Mirth Guru
 
Join Date: Jun 2011
Posts: 223
neotof is on a distinguished road
Default Problem with retrieving XML data

Hi,

I have an xml source, I get a recovered patient number and the file number of visits but not the date here is my code:

Code:
	var patId = msg['ORU_R01.PATIENT_RESULT']['ORU_R01.PATIENT'].PID['PID.3']['CX.1'].toString();
	var patVisit = msg['ORU_R01.PATIENT_RESULT']['ORU_R01.VISIT'].PV1['PV1.19']['CX.1'].toString();

logger.info(msg['MSH']['MSH.7'].MSH['TS.1'].toString());
Code:
-<ns0:MSH><ns0:MSH.1>|</ns0:MSH.1><ns0:MSH.2>^~\&</ns0:MSH.2>-<ns0:MSH.3><ns0:HD.1>Medisoft</ns0:HD.1></ns0:MSH.3>-<ns0:MSH.5><ns0:HD.1>SAP</ns0:HD.1></ns0:MSH.5>-<ns0:MSH.7><ns0:TS.1>20140512164448</ns0:TS.1></ns0:MSH.7>-<ns0:MSH.9><ns0:MSG.1>ORU</ns0:MSG.1><ns0:MSG.2>R01</ns0:MSG.2></ns0:MSH.9><ns0:MSH.10>1183</ns0:MSH.10>-<ns0:MSH.11><ns0:PT.1>P</ns0:PT.1></ns0:MSH.11>-<ns0:MSH.12><ns0:VID.1>2.5</ns0:VID.1></ns0:MSH.12></ns0:MSH>
I attach the file

Where is my mistake?

In advance thank you
Attached Files
File Type: xml ORU_43140.xml (123.7 KB, 4 views)
Reply With Quote
  #2  
Old 05-13-2014, 05:00 AM
rodrosa rodrosa is offline
OBX.2 Kenobi
 
Join Date: Jul 2013
Posts: 79
rodrosa is on a distinguished road
Default

i got an erro while tried to import your attachment.
Reply With Quote
  #3  
Old 05-13-2014, 05:45 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,119
narupley is on a distinguished road
Default

It should be "msg['MSH']['MSH.7']['TS.1']", not "msg['MSH']['MSH.7'].MSH['TS.1']".
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
Reply With Quote
  #4  
Old 05-13-2014, 10:38 PM
neotof neotof is offline
Mirth Guru
 
Join Date: Jun 2011
Posts: 223
neotof is on a distinguished road
Default

OK thank you narupley.

Good day !
Reply With Quote
  #5  
Old 05-14-2014, 05:25 AM
paulb0609 paulb0609 is offline
Mirth Newb
 
Join Date: Feb 2012
Location: India
Posts: 8
paulb0609 is on a distinguished road
Send a message via Skype™ to paulb0609
Default

It is right
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 01:30 AM.


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