Announcement

Collapse
No announcement yet.

Help with String Contains

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

  • Help with String Contains

    Hello,
    Novice so while I appreciate any response, something dumbed down would be better for me.

    We are pulling Working DRG HL7 messages (BAR-P01). ZRG.4 may say several things. Medicare V.36, APR (all versions) V.36 or Rhode Island Mcd APR V.34 have all come so far. These version numbers will change yearly so I would like to search on 'Medicare' only and 'APR' only.

    I tried this:
    for each (zrg in msg.ZRG)
    {
    if ((zrg['ZRG.4']['ZRG.4.1'].toString().indexOf('Medicare') != -1))
    {
    zrg['ZRG.1']['ZRG.1.1'] = msg['ZRG']['ZRG.2']['ZRG.2.1'].toString();
    zrg['ZRG.2']['ZRG.2.1'] = 'W';

    AND I tried this (among a hundred other things)
    if ((msg['ZRG'][0]['ZRG.4']['ZRG.4.1'].toString().indexOf('Medicare') != -1))
    {
    msg['ZRG'][0]['ZRG.1']['ZRG.1.1'] = msg['ZRG'][0]['ZRG.2']['ZRG.2.1'].toString();
    msg['ZRG'][0]['ZRG.2']['ZRG.2.1'] = 'W';
    }

    else if ((msg['ZRG'][0]['ZRG.4']['ZRG.4.1'].toString().indexOf('APR') != -1))
    {
    msg['ZRG'][0]['ZRG.1']['ZRG.1.1'] = msg['ZRG'][0]['ZRG.2']['ZRG.2.1'].toString();
    msg['ZRG'][0]['ZRG.2']['ZRG.2.1'] = 'W';
    msg['ZRG'][0]['ZRG.3']['ZRG.3.1'] = '2019';

    }


    but am getting nothing.
    Any suggestions?
    Thanks, Patti

  • #2
    Hi Patti,

    What do you mean by getting nothing?

    Here's what I see using your 2nd block of code:

    ***************************
    ZRG|1|2|3|Medicare V 36, XXX|

    is transformed to

    ZRG|2|W|3|Medicare V 36, XXX|
    **************************
    ZRG|1|2|3|XXXX V 36, APR|

    is transformed to

    ZRG|2|W|2019|XXXX V 36, APR|
    **************************
    ZRG|1|2|3|XXXX V 36, XXX|

    is not transformed
    **************************

    Seems to be doing what you are asking... Can you post a full sample of your source message?
    Last edited by Brad_AZ; 05-17-2019, 09:19 AM.
    SIG|1|Brad|Mirth Certified Interface Analyst^Cancer Treatment Centers of America

    Comment

    Working...
    X