web stats
pass a list of consulting physician from javascript to java code - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 12-03-2013, 07:01 PM
rahil rahil is offline
Mirth Newb
 
Join Date: Nov 2013
Posts: 6
rahil is on a distinguished road
Default pass a list of consulting physician from javascript to java code

In my case...

source inbound = HL7 2.x
source outbound = HL7 2.x
destination inbound = HL7 2.x
destination outbound = HL7 2.x

There is a multiple consulting physician on 9th filed of PV1 Segment. And
Now I want to pass this physician list to java code. And
I have written a javascript in desination transformer like this.
================================================== ====
var physicianList = [];
var totalPhysician = msg['PV1']['PV1.9'].length();
for (var i = 0; i < totalPhysician ; i++)
{
var physician =
{
physicianID : msg['PV1']['PV1.9']['PV1.9.1'].toString(),
lastName: msg['PV1']['PV1.9']['PV1.9.2'].toString(),
firstName:msg['PV1']['PV1.9']['PV1.9.3'].toString(),
middleName:msg['PV1']['PV1.9']['PV1.9.4'].toString(),
suffix : msg['PV1']['PV1.9']['PV1.9.5'].toString(),
preffix:msg['PV1']['PV1.9']['PV1.9.6'].toString()
};
physicianList.push(physician);
}
return physicianList;
================================================== ====

And I am calling java code from destination(connector type = javascript).
like this
================================================== ====
var dbWriter = Packages.com.test.DataBaseWriter();
dbWriter.insert(physicianList);
================================================== ====

Is it possible ?
If not then pls... pls.. suggest me best way to do this.

Thanks to all.
Reply With Quote
  #2  
Old 12-04-2013, 05:18 AM
cory_cole cory_cole is offline
Mirth Guru
 
Join Date: Mar 2012
Posts: 1,227
cory_cole is on a distinguished road
Default

var physician =
{
physicianID : msg['PV1']['PV1.9'][i]['PV1.9.1'].toString(),
lastName: msg['PV1']['PV1.9'][i]['PV1.9.2'].toString(),
firstName:msg['PV1']['PV1.9'][i]['PV1.9.3'].toString(),
middleName:msg['PV1']['PV1.9'][i]['PV1.9.4'].toString(),
suffix : msg['PV1']['PV1.9'][i]['PV1.9.5'].toString(),
preffix:msg['PV1']['PV1.9'][i]['PV1.9.6'].toString()
};
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 09:29 AM.


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