I am building an application in Cloverleaf 8 and I am handling HL7 ACK via Java UPOC.
I tested the code on TPS Testing tool in clover and everything went perfectlky fine. however when I run on network monitor, I get the following error:
[sms :sms :ERR /0: Send_ADT:06/24/2015 08:55:56] Tcl error:
msgId = message0
proc = ‘cljTPS’
args = ‘{CLASS ChangePatientStatusByACK} ‘
result = ‘com.quovadx.cloverleaf.upoc.CloverleafException: Could not instantiate user-defined class ChangePatientStatusByACK InvocationTargetException: null’
errorInfo: ‘
com.quovadx.cloverleaf.upoc.CloverleafException: Could not instantiate user-defined class ChangePatientStatusByACK InvocationTargetException: null
at com.quovadx.cloverleaf.upoc.CloverEnv.makeUpocInstance(CloverEnv.java:1195)
invoked from within
“makeUpocInstance $className TPS $__userArgsCfgs”
(procedure “cljTPS” line 29)
invoked from within
“cljTPS {MSGID message0} {OBMSGID message1} {CONTEXT sms_ib_reply} {ARGS {{CLASS ChangePatientStatusByACK} }} {MODE run} {…”‘
Can anybody give me a hand?
Here is my code:
public DispositionList process(CloverEnv cloverEnv, String context,
String mode, Message msg) throws CloverleafException {
DispositionList dl = new DispositionList();
if (mode.compareToIgnoreCase(”start”) == 0) {
logger.fine(”Nothing to run in START MODE”);
} else if ((mode.compareToIgnoreCase(”run”) == 0)) {
System.out.println(”Printing Message: n” + msg.getContent());
Hl7M ack = msg.makeHl7M(”2.3″, null, “ACK”);
logger.fine(”ACK Code: ” + ack.getString(”0(0).MSA(0).#1(0)”));
logger.fine(”Message Control ID: ”
+ ack.getString(”0(0).MSA(0).#2(0)”));
logger.fine(”Text Message: ” + ack.getString(”0(0).MSA(0).#3(0)”));
String id = new String();
id = ack.getString(”0(0).MSA(0).#2(0)”);
if (id != null && id == “”) {
HospitalInformationSystemDB hisDB = new HospitalInformationSystemDB();
this.dbConnection = hisDB.getDBConnection();
try {
PatientDAO patientDAO = new PatientDAO(dbConnection);
// Cast Message ID to Long
Patient patient = patientDAO.findByMessageID(Long
.parseLong(id));
String newStatus = new String();
String errorDescription = new String();
if (ack.getString(”0(0).MSA(0).#1(0)”).compareTo(”AA”) == 0) {
newStatus = PatientStatus.getFinished();
errorDescription = “”;
} else {
newStatus = PatientStatus.getError();
errorDescription = ack.getString(”0(0).MSA(0).#3(0)”);
}
patient.setControlIntegration(newStatus);
patient.setErrorDescription(errorDescription);
patientDAO.updateStatusMessageId(patient);
} catch (Exception ex) {
ex.printStackTrace();
} finally {
hisDB.close();
}
}
logger.fine(”Running KILLREPLY”);
dl.add(DispositionList.KILLREPLY, msg);
logger.fine(”ack destroy”);
ack.destroy();
}
logger.fine(”return disposition”);
return dl;
}