I am setting up Mirth to catch scheduling messages and update an ancilliary system with a SOAP call. It gets the HL7 message, picks out what I need and makes the SOAP call just fine. The problem is that I need to covert the HL7 date to the SOAP date format.
HL7 is YYYYMMDDHHMMSS
SOAP is [-]CCYY-MM-DDThh:mm:ss[Z|(+|-)hh:mm]
My current mapping code is:
I know I'm close, but I suspect I'm missing something basic about how Mirth expects the Mapping to be formed and how it actually gets data out of that. I get errors at the server from the javascript parser.
HL7 is YYYYMMDDHHMMSS
SOAP is [-]CCYY-MM-DDThh:mm:ss[Z|(+|-)hh:mm]
My current mapping code is:
Code:
var startdate = msg['SCH']['SCH.11']['TQ.4']['TS.1'].toString() var outdate = ''; //4 year outdate += startdate.substr(0,3) + '-'; //2 month outdate += startdate.substr(4,5) + '-'; //2 day outdate += startdate.substr(6,7) + 'T'; //2 hour outdate += startdate.substr(8,9) + ':'; //2 minute outdate += startdate.substr(10,11) + ':'; //2 second outdate += startdate.substr(12,13); //[-]CCYY-MM-DDThh:mm:ss[Z|(+|-)hh:mm] localMap.put('start', outdate);
Comment