Removing blank OBX segments and renumbering

Homepage Clovertech Forums Read Only Archives Cloverleaf Tcl Library Removing blank OBX segments and renumbering

  • Creator
    Topic
  • #54466
    Julie Brandt
    Participant

    I have a message that is sending across multiple blank obx lines.  I need to remove those lines then renumber the obx.  I currently have the tcl proc that gets all of the obx fields but when I try to add a IF statement it’s just not doing what I want.  Here is a copy of my message and what I need it to look like.

    1(0).1(0).1(53).OBX(0)  :  >|54|TX|||regular basis using proper specimen collection technique.|< 1(0).1(0).1(54).OBX(0)  :  >|55|TX||| |< 1(0).1(0).1(55).OBX(0)  :  >|56|TX|||CODES: Cervical / Endo|< 1(0).1(0).1(56).OBX(0)  :  >|57|TX||| |< 1(0).1(0).1(57).OBX(0)  :  >|58|TX|||PROCEDURES: PAP(THINLAY)SC (11/17/14-1043)|< 1(0).1(0).1(58).OBX(0)  :  >|59|TX||| |< 1(0).1(0).1(59).OBX(0)  :  >|60|TX||| |< 1(0).1(0).1(60).OBX(0)  :  >|61|TX||| |< Here is what I need it to look like 1(0).1(0).1(53).OBX(0)  :  >|54|TX|||regular basis using proper specimen collection technique.|< 1(0).1(0).1(55).OBX(0)  :  >|55|TX|||CODES: Cervical / Endo|< 1(0).1(0).1(57).OBX(0)  :  >|56|TX|||PROCEDURES: PAP(THINLAY)SC (11/17/14-1043)|<

Viewing 0 reply threads
  • Author
    Replies
    • #81600
      Jim Kosloskey
      Participant

      Julie,

      First issue is they are sending a space in the OBX-5 and that is the only field you can reliably check for a segment not to be COPY’d.

      The IF cannot check for just one character like that so you will need some Tcl to see if the length of the OBX-5 is one and that is a space.

      You could have a proc that gives you the length and then use the IF to check to see if that is eq =1 then inside that IF have another IF to check OBX-5 ne =  <– that is a single space there.

      If you need a proc to give you the length email me and I will send you one.

      Of course you coulld write a proc to do all of the checking above.

      Once you have that logic working you will need to manage your own counter for the outbounnd repetitions so you can keep things in order, the set id (OBX-1) can be calculated from your own counter.

      If you don’t knoow how to manage your own counter let me know.

      email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

Viewing 0 reply threads
  • The forum ‘Tcl Library’ is closed to new topics and replies.

Forum Statistics

Registered Users
5,129
Forums
28
Topics
9,301
Replies
34,448
Topic Tags
288
Empty Topic Tags
10