Announcement

Collapse
No announcement yet.

For Duplicate FT1 Segment Add Modifier to FT1.26.1

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

  • For Duplicate FT1 Segment Add Modifier to FT1.26.1

    Given the following message, if the FT1 segment is duplicated, I need to add the value/modifier '51' to FT1.26.1.

    FT1|1|||20131210141212|20131211103006|C|80053^COMP REHENSIVE METABOLIC PANEL W/GFR|||1|||PHYS||||||V58.69||||1973284||80053^COMPR EHENSIVE METABOLIC PANEL W/GFR|
    FT1|2|||20131210141212|20131211103006|C|85025^COMP LETE BLOOD COUNT|||1|||PHYS||||||V58.69||||1973284||85025^COM PLETE BLOOD COUNT|
    FT1|3|||20131210141212|20131211103006|C|86140^C-REACTIVE PROTEIN (CRP)|||1|||PHYS||||||710.9||||1973284||86140^C-REACTIVE PROTEIN (CRP)|
    FT1|4|||20131210141212|20131211103006|C|85652^SED RATE |||1|||PHYS||||||710.9||||1973284||85652^SED RATE |
    FT1|5|||20131210141212|20131211103006|C|86160^COMP LEMENT C3 AND C4|||1|||PHYS||||||790.99||||1973284||86160^COMPLE MENT C3 AND C4|
    FT1|6|||20131210141212|20131211103006|C|86160^COMP LEMENT C3 AND C4|||1|||PHYS||||||790.99||||1973284||86160^COMPLE MENT C3 AND C4|

    In a similar instance, if the FT1 segment is replicated 4 times over, I need to add the value/modifier '91' to FT1.26.1 for only the last two FT1 segments.

    I did make an attempt in following the instructions posted on this link:

    http://www.mirthcorp.com/community/f...ferrerid=27983

    Any insight is greatly appreciated.

  • #2
    var i = 0;

    if(msg['FT1'].length > 1)
    {
    for each (ft1 in msg.FT1)
    {
    if(i < 3)
    {
    ft1['FT1.26']['FT1.26.1'] = '51';
    }
    else
    {
    ft1['FT1.26']['FT1.26.1'] = '91';
    }
    }
    }

    Comment

    Working...
    X