I've got two different javascript transformer steps for two different channels, both steps use channelMap.put but the variable they create is only available to one channel. I don't expect or want them to be available across channels, but each should be available within the channel that creates it. What is happening is the transformer step for the database writer creates a variable that may be used in later steps, but the transformer step for the file writer does not create a variable that can be used in later steps. Why? As far as I can tell there are only minor differences between the two. So what would cause the file writer's transformer step to not create a variable?
File Writer transformer step:
Database Writer transformer step:
The only other difference is the channel with the database writer is set to use HL7 for incoming and outgoing data while the file writer is set for XML incoming data and HL7 outgoing data.
File Writer transformer step:
Code:
var firstName = ''; if( msg['usrnam'] != null ){ var thing = msg['usrnam'].toString(); var stuff = thing.match( /(^\w*)\s(\w*)\s(\w*)/); firstName = RegExp.$1; } channelMap.put( "FirstName", firstName );
Code:
if( msg['PID']['PID.7']['PID.7.1'] != null && msg['PID']['PID.7']['PID.7.1'].toString() != null){ var dob = msg['PID']['PID.7']['PID.7.1'].toString(); var junk = dob.match(/(\d\d\d\d)(\d\d)(\d\d)/); channelMap.put("usrBirthDateFmt", RegExp.$1 + '-' + RegExp.$2 + '-' + RegExp.$3 ); }
Comment