Adding BHS and BTS segments

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Adding BHS and BTS segments

  • Creator
    Topic
  • #54830
    Andres Alvarez
    Participant

      Hello all. New to cloverleaf! I am sending out VXU messages from Cerner to Cloverleaf. The data recipient needs to have these BHS and BTS segments in each message. What would you suggest as the easiest way to accomplish this within cloverleaf?

      My understanding is that we have thr ability to append the messages into a batch file. What I do not understand is how to get the segments in there if they are not standard segments.

    Viewing 4 reply threads
    • Author
      Replies
      • #83138
        James Cobane
        Participant

          Andres,

          There are a few different approaches you can take with this.  If they are simply looking for a BHS and BTS around every message, you could just add the BHS/BTS segments to the outbound message definition in your variant and handle/map to them in your Xlate.  The BHS and BTS segments should be available to add to your message definition in the HL7 configurator tool.  If they are looking to have the BHS and BTS segments around a group of messages in a file, then you’ll need to write some tcl code to stick the BHS and BTS segments in your file after you have accumulated the group of desired messages.

          Jim Cobane

          Henry Ford Health

        • #83139
          Andres Alvarez
          Participant

            It looks like I will be able to get away with posting the segments in start and end of every message for now. However, it seems that they will leverage the functionality of having such segments in the future when they are able to accept batches. I’ probably have more experience with tcl then. I haven’t been to a tcl class yet, but have experience with other languages. I am trying to get a working knowledge through the forum and historical examples.

            One question to you. This may be simple, but I can’t find anything on it. In an xlate preproc where the source is hard coded “=1” and the destination has a path… What is the syntax in an IF statement to check if anything exists there at all.

            For example, If I wanted to check for a value there I’d do this…

            set val $xlateInVals

                                                   if { $val == “1”} {        

                                                                   set xlateOutVals

            6

                                                   } else {

                                                   }

            What if I wanted to check for the existence of the segment or path at all? I’ve tried NULL, ” “, and {} to no avail. I found ways around it, but knowing how to achieve it in this fashion will help me make shortcuts in the future.

            I greatly appreciate any help.

          • #83140
            James Cobane
            Participant

              The easiest way is to probably check for the existence of a required element for that segment, then if it exists you know the segment exists – i.e. for the PID segment the Set ID (PID.1) is required so you could have an IF statement something like:

              IF  0(0).PID(0).#1(0).[0]  ne @null

                   then your actions within the body of the IF…

              You would want to use the @null variable for checking whether something is null or not.

              Hope the makes sense.

              Jim Cobane

              Henry Ford Health

            • #83141
              Andres Alvarez
              Participant

                Makes perfect sense. I was able to make many modifications to make my test scenarios work with that piece of knowledge. I look at this as a hard coding success. Thank you.

                I am now engaging something a little more complex. I can make leaps with one good example. I’ve been poking around with it without much success.

                Using a %G1 with a 4(0).0 basis… I wanted to leverage the iterate counter using a a series of segments into becoming ascending set ids.

                SOURCE

                $%g1

                4(0).0(0).OBR(0).#1(0).[0].[0]

                COPY

                pre proc is

                set invalue [lindex $xlateInVals 0]

                       set itervar [lindex $xlateInVals 1]

                       incr itervar

                       set xlateOutVals

                Destination

                4(0).0($%g1).OBR(0).#1(0).[0].[0]

                Running through it in my head and in practice tells me it should probably be a %S interation on BOLD text below because that is the variable.

                4(0).0(0).OBR(1).#1(0).[0].[0]

                4(0).0(0).OBR(2).#1(0).[0].[0]  :  >1<

                Help with putting this together once will help me understand how it all comes together. I think I have the right ideas, but just don’t know how to put it together here. My next scenario is the same thing using the math functions.

              • #83142
                James Cobane
                Participant

                  You could use the MATH ADD command to accomplish that.  Use the $g1 and =1 as you input to the MATH command and then your output field would be the destination.  No tcl required.

                  Jim Cobane

                  Henry Ford Health

              Viewing 4 reply threads
              • The forum ‘Cloverleaf’ is closed to new topics and replies.