Hard code segments

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Hard code segments

  • Creator
    Topic
  • #54840
    Andres Alvarez
    Participant

    What is the best way to hard code segments into HL7 using cloverleaf?

    I have a scenario where I need to hard code a starting segment before the MSH and an end segments after the message is complete. There is no manipulation going in those segments, but they are required to be there.

    I am accomplishing this in our main engine, but I got to thinking how this could be done in cloverleaf and did not know where to start or if it was even possible without tcl scripting.

Viewing 6 reply threads
  • Author
    Replies
    • #83177
      Jerry Hendrickson
      Participant

      Hi Andres.  I am fairly new to cloverleaf, but I think I have an idea for you.  You should be able to create a variant with a user defined segment preceding the MSH (I just did one to test it out), and one or more other user defined segments at the end, or wherever else you need them.  You could than copy the values you need into the fields in those segments in the translation, along with the real data you wish to pass.  Jerry.

    • #83178
      Jim Kosloskey
      Participant

      Unfortunately the variant definition allows you to define it but the Xlate does not allow you to use that variant definition.

      In the Xlate, each HL/7 message has to start with an MSH.

      I think Tcl is in order.

      Now I believe you can place multiple MSH segments in a variant (as long as there is one as the first) then use simpler Tcl to remove the first MSH in something like the Outbound TPS.

      So variant would look like this:

      MSH <– Bogus MSH

      XXX <- your segment

      MSH <– real MSH

      .

      .

      .

      .

      YYY <– your ending segment

      In the Outbound TPS with Tcl remove the first MSH – now your message will look like this:

      XXX <- your segment

      MSH <– real MSH

      .

      .

      .

      .

      YYY <– your ending segment

      Or you can write a little more  complex proc to add the segments you want.

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

    • #83179
      Andres Alvarez
      Participant

      Exactly the issue I ran into with the xlate. I will try to accomplish the task with a simple tcl. Of course simple tcl may not be simple enough for me, but I am sure I’ll get better with practice and scenarios like this. Thank you both for your input.

      Jim Kosloskey wrote:

      Unfortunately the variant definition allows you to define it but the Xlate does not allow you to use that variant definition.

      In the Xlate, each HL/7 message has to start with an MSH.

      I think Tcl is in order.

      Now I believe you can place multiple MSH segments in a variant (as long as there is one as the first) then use simpler Tcl to remove the first MSH in something like the Outbound TPS.

      So variant would look like this:

      MSH <– Bogus MSH

      XXX <- your segment

      MSH <– real MSH

      .

      .

      .

      .

      YYY <– your ending segment

      In the Outbound TPS with Tcl remove the first MSH – now your message will look like this:

      XXX <- your segment

      MSH <– real MSH

      .

      .

      .

      .

      YYY <– your ending segment

      Or you can write a little more

    • #83180
      Jerry Hendrickson
      Participant

      Jim, thanks for the clarification on that.  I built the variant, but did not run it.  I do learn a lot on here:)

    • #83181
      Jim Kosloskey
      Participant

      I think if you search thee forum (not the best search I realize) you should see a proc somewhere to remove a named segment.

      If not maybe someone who has such a proc will offer it to you

      Anyone???

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

    • #83182
      Russ Ross
      Participant

      Jim a proc to remove a segment is something you and I already have in our master site from long ago called tps_remove_segment.tcl

      I found a previous clovertech post with the source code at this URL:

      <a href="http://clovertech.infor.com/viewtopic.php?t=1449&#8243; class=”bbcode_url”>http://clovertech.infor.com/viewtopic.php?t=1449

      Russ Ross
      RussRoss318@gmail.com

    • #83183
      Andres Alvarez
      Participant

      I appreciate the help on this. I was doing it in Cerner, but will now move it to cloverleaf. Learning alot thanks to you!

Viewing 6 reply threads
  • The forum ‘Cloverleaf’ 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