web stats
Error return information on subselect for variable in Transformer - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 08-23-2018, 07:35 AM
cristhianeduardo cristhianeduardo is offline
What's HL7?
 
Join Date: Nov 2017
Location: brazil,são paulo
Posts: 1
cristhianeduardo is on a distinguished road
Question Error return information on subselect for variable in Transformer

Hello,

NEED HELP!!!!

Mirth : 3.5.0.8232
windows : server 2008 r2 64bits

I'm having trouble retrieving to a variable the return of a subselect
follows example

-------------------------------------------------------------------
var vStatus = $('vStatus_Report');
var vDoctorCode = $('vDoctorCode');
var vAss1 = "";
var vAss2 = "";

if (vStatus.equals("PRELIM")){
logger.info("pASSOU PRELIM: "+vStatus);
vAss1 = vDoctorCode;
vAss2 = vDoctorCode;

}else if (vStatus.equals("FINAL")){
logger.info("PASSOU FINAL");

var dbConn ="string_connection"

var sSQL = "SELECT ASSP FROM (SELECT (SELECT x.user_name FROM secm_ext_pass x WHERE u1.DBID = x.user_dbid) AS assp FROM DIDB_STUDIES S left join secm_users u1 on u1.login_id = substr(S.REP_PRELIM_SIGNED_BY, 1, instr(S.REP_PRELIM_SIGNED_BY, '@sc') - 1) left join secm_users u2 on u2.login_id = substr(REP_FINAL_SIGNED_BY, 1, instr(REP_FINAL_SIGNED_BY, '@sc') - 1) WHERE s.accession_number = '"+$('vAccesssion_number')+"')";

var result = dbConn.executeCachedQuery(sSQL);

if (result.equals(null) || result.equals('null') ) {
logger.info("PASSOU 1")
vAss1 = vDoctorCode;
vAss2 = vDoctorCode;
}else{
logger.info("PASSOU 2")
vAss1 = result.getString('ASSP'); //STRING
vAss2 = vDoctorCode;
}
}
------------------------------------------------------------------------------
I tried to make the following changes

vAss1 = result.getString('assp'); --
vAss1 = result.getString(1); --
And in query up

For all the same error

Transformer error
ERROR MESSAGE: Error evaluating transformer
com.mirth.connect.server.MirthJavascriptTransforme rException:
CHANNEL: 7_Report_To_Tasy
CONNECTOR: sourceConnector
SCRIPT SOURCE: TRANSFORMER
SOURCE CODE:
286: logger.info("PASSOU 1");
287: vAss1 = vDoctorCode;
288: vAss2 = vDoctorCode;
289: }else{
290: logger.info("PASSOU 2");
291: vAss1 = result.getString('assp');
292: vAss2 = vDoctorCode;
293: }
294: }
295:
LINE NUMBER: 291
DETAILS: Wrapped java.sql.SQLException: Invalid cursor position
at 972af213-f19f-448d-b20f-22d90ab055db:291 (doTransform)
at 972af213-f19f-448d-b20f-22d90ab055db:325 (doScript)
at 972af213-f19f-448d-b20f-22d90ab055db:327
at com.mirth.connect.server.transformers.JavaScriptFi lterTransformer$FilterTransformerTask.doCall(JavaS criptFilterTransformer.java:154)
at com.mirth.connect.server.transformers.JavaScriptFi lterTransformer$FilterTransformerTask.doCall(JavaS criptFilterTransformer.java:119)
at com.mirth.connect.server.util.javascript.JavaScrip tTask.call(JavaScriptTask.java:113)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker( Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.sql.SQLException: Invalid cursor position
at com.sun.rowset.CachedRowSetImpl.checkCursor(Unknow n Source)
at com.sun.rowset.CachedRowSetImpl.getString(Unknown Source)
at com.mirth.connect.server.userutil.MirthCachedRowSe t.getString(MirthCachedRowSet.java:71)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.mozilla.javascript.MemberBox.invoke(MemberBox. java:126)
at org.mozilla.javascript.NativeJavaMethod.call(Nativ eJavaMethod.java:225)
at org.mozilla.javascript.Interpreter.interpretLoop(I nterpreter.java:1479)
at org.mozilla.javascript.Interpreter.interpret(Inter preter.java:815)
at org.mozilla.javascript.InterpretedFunction.call(In terpretedFunction.java:109)
at org.mozilla.javascript.ContextFactory.doTopCall(Co ntextFactory.java:393)
at org.mozilla.javascript.ScriptRuntime.doTopCall(Scr iptRuntime.java:3280)
at org.mozilla.javascript.InterpretedFunction.exec(In terpretedFunction.java:120)
at com.mirth.connect.server.util.javascript.JavaScrip tTask.executeScript(JavaScriptTask.java:150)
at com.mirth.connect.server.transformers.JavaScriptFi lterTransformer$FilterTransformerTask.doCall(JavaS criptFilterTransformer.java:143)
... 6 more
Reply With Quote
Reply

Tags
mirth 3.5.0, query response, transformer

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 12:10 AM.


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