web stats
Mirth Community - View Single Post - Can't save payload to queue
View Single Post
  #6  
Old 03-15-2013, 09:27 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,111
narupley is on a distinguished road
Default

It's hard to know exactly what's going on here without testing/debugging it in person, but my initial guess is that the data being pulled from the MySQL database contains one or more Unicode characters that are causing a SingleByteCharsetConverter to be included in the object to be put into the queue. When the message object is offered, it's serialized with an OOS first, and that's where it's breaking (because it can't serialize part of the object).

It might be the Connection object placed into the connector map. Instead of saving that with "$co('dbConn',getMySQLHIEConnection());", try just using it at runtime only:

Code:
// Get MySQL connection
//$co('dbConn',getMySQLHIEConnection());
var dbConn = getMySQLHIEConnection();
// Initial values
var cNTEOBR = 0; var cOBX = 0; var cNTEOBX = 0; // cNTEOBR = OBR level NTE counter; cOBX = OBX counter; cNTEOBX = OBX level NTE counter
ValidateStateCodes(msg); 
var msgEvent = msg['MSH']['MSH.9']['MSH.9.2'].toString(); // Message Event determines when to insert CLIA information
var CLIA_STRING = 'SBMF Lab, 530 N Lafayette Blvd, South Bend, IN 46601 CLIA #15D0357169'; // Default CLIA information
// Process message

...

//var dbConn = $co('dbConn'); // Establish db variable for qualifying the NPI
var personIDOBR = getProviderPersonID(getCodeValue(263,'SBMFPRVID', dbConn), getCodeValue(320,'PHYSICIANIDNUMBER', dbConn), parseSBMFPRVID(aliasOBR), dbConn);
var prvIDOBR = getPrsnlAlias(personIDOBR, getCodeValue(263,'NPI', dbConn), getCodeValue(320,'NATIONALPROVIDERIDENTIFIER', dbConn), dbConn);
tmp['OBR']['OBR.16']['OBR.16.1'] = prvIDOBR; 
tmp['OBR']['OBR.16']['OBR.16.2'] = msg['OBR']['OBR.16']['OBR.16.2'].toString(); 
tmp['OBR']['OBR.16']['OBR.16.3'] = msg['OBR']['OBR.16']['OBR.16.3'].toString(); 

...

// Insert the CLIA information
if (msgEvent == "R01"){
	var nte = <NTE/>; 
	nte['NTE.1']['NTE.1.1'] = (cNTEOBX+1);
	nte['NTE.2']['NTE.2.1'] = "";	
	nte['NTE.3']['NTE.3.1'] = CLIA_STRING.toString();
	tmp.appendChild(nte); }
// Close MySQL HIE connection
//$co('dbConn').close();
dbConn.clone();
__________________
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