简体   繁体   中英

Change HL7 outgoing value from HL7 incoming value using Javascript in Mirth Connect

Hi I'm trying to change the code and value in HL7 using Javascript in Mirth Connect. If the incoming msg has Code labeled 'B' and B = Boy and I want to change the outgoing message to 'M' and M = Male . How would I do that if the HL7 msg segment is in msg['PID']['PID.8']['PID.8.1'] . I wrote down what I think the coding is below. Is it correct or am I missing something?

var PID8 = msg['PID']['PID.8']['PID.8.1']

var B = 'Boy'

var M = 'Male'

if (PID8 === B) {

msg['PID']['PID.8']['PID.8.1']().toString= 'M';

 } else if ('M');
// if B for Boy
if (msg['PID']['PID.8']['PID.8.1'].toString() == 'B') {
    // change to M for Male
    msg['PID']['PID.8']['PID.8.1'] = 'M';
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM