Announcement

Collapse
No announcement yet.

'!=' operator not working

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • '!=' operator not working

    Hi

    facing a problem here.....
    my "!=" operator is not working
    this is my code:-

    for each(obr in msg.OBR)
    {
    if(obr['OBR.4']['OBR.4.1'].toString() == '24222-8')
    {
    for each(obx in msg.OBX)
    {
    for(var i = 0; i<msg['OBX']['OBX.3'].length(); i++)
    {
    if(msg['OBX'][i]['OBX.3']['OBX.3.1'].toString() != '4321-6' || msg['OBX'][i] ['OBX.3']['OBX.3.1'].toString() != '4321-4')
    {
    delete msg['OBX'][i];
    }
    }
    }
    }
    }

    Even though ['OBX.3.1'] is not equal to the given value, it goes into the condition and deletes the corresponding OBX segment.
    Can anyone please help me with that?????

  • #2
    @asahoo3000 Please do not cross post. Also this section of the forum is for the development of Mirth itself. This question was answered at https://forums.mirthproject.io/forum...854#post179854.

    The problem is bad logic for an OR statement.
    Diridium Technologies, Inc.
    https://diridium.com

    Comment

    Working...
    X