Insurance group problem

Homepage Clovertech Forums Read Only Archives Cloverleaf Tcl Library Insurance group problem

  • Creator
    Topic
  • #53460
    John Bass
    Participant

    I need to create an HL7 message insurance group based on the following requirements:

    The sending system

Viewing 1 reply thread
  • Author
    Replies
    • #77758
      Tom Rioux
      Participant

      One way to do this is to write a pre-xlate tcl to do the sorting of the IN1 segments.   I am assuming here, that while they aren’t coming out in order, they are coming all together.

      First, split your message into segments.  Grab the IN1 segments and their index’s (you will need to put them back into the message in the proper spots.

      Second, loop through each IN1 segment, split on the field separator (|), and do an lappend to a list variable.   Each split IN1 segment will be an element in the list.  Also, while you are doing this, you can check the insurance date to make sure it is in effect.  If it is, then you lappend to the list variable.   IF it isn’t, then dont.

      Third, perform an lsort using the -index option.  For example:

          lsort -index 22 $ins_grps

      Fourth, grab the first four elements (IN segments) in the list, join each one back together with the field separator and place it back in the proper place in the message.

      Remember, before you join the message back together, you need to accommodate for any IN1 segments you may have removed from the message list variable.    You will need to remove any empty list elements.

      Hope this gets your started!

      Tom Rioux

    • #77759
      Jim Kosloskey
      Participant

      John,

      We do it in the Xlate without any Tcl – just Xlate Actions.

      If you want an example of how we do it let me know via email.

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

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

Forum Statistics

Registered Users
5,117
Forums
28
Topics
9,292
Replies
34,435
Topic Tags
286
Empty Topic Tags
10