need help with using repeat and condition options for HRLs

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf need help with using repeat and condition options for HRLs

  • Creator
    Topic
  • #48219
    Nancy McDaniel
    Participant

      I am needing to translate a ORU result message to a file with a pipe header in the first line.  The rest of the document will be copied from the OBX segments on the ORU message which could be 1 big OBX or multiple OBX segments, each one representing a line.

      I may also need to copy information from the NTE segments associated with the OBX segments.

      What is the best way to handle this in a HRL?  I created a VRL called TA_Header which has fields that make up the first line of the document  with fields separated by |.  

      Then, I created TA_Detail VRL which represents the lines of the documents.  I then created the HRL which has both files in its structure.

      If I just say it repeats 5 times for example, it works fine.  

      I have looked at the documentation for using the repeats and conditions but haven’t figured out the best way to do this.

      It seems like I could set some kind of condition that repeats until no more OBX.  What are the Repeat Block and the Repeat While used for and how would I set them up to accomplish what I need to do.

      thanks,

      Nancy Hellyer

      The Vancouver Clinic

      Software Analyst

      (360) 397-3222

    Viewing 2 reply threads
    • Author
      Replies
      • #58039
        Jim Kosloskey
        Participant

          Nancy,

          I have zero experience with HRL but as far as working through the OBX repetitions, just ITERATE over the OBX in your Xlate and that will happen as many times as there are OBX segments.

          Jim Kosloskey

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

        • #58040
          Nancy McDaniel
          Participant

            I am familiar with the iterate but it appears that I have to have some kind of repeat logic in the hrl setup itself for this to work.

            I could try setting some large number of repeats but would like to know more about how to use these options within HRL.

            thanks,

            Nancy

          • #58041
            John Perks
            Participant

              Yes, in order for your HRL segment to be considered repeating, like a repeating segment in an HL7 message, you must check off one of the “Repeat Options” in the “Segment Properties” of the HRL configuration.

              I had a fixed record length input file, with multiple record types, with the record type identified by three characters in a fixed position.

              I checked off the “Repeat While” option in the “Segment Properties”, and set the “Field” to the FRL field corresponding to the record type, and the “Value” to what is expected in that field.

              Until I set it up this way, the HRL worked fine until it hit a “segment” or record type that was not expected; i.e. if I set up the HRL with Z00, Z01, Z02, Z03 records, all non-repeating, and the Z02 repeated, the Xlate quit processing when it encountered the 2nd Z02 record.  Once I set it up as repeating, it processed all of them and continued.

              And Jim is right, just use the ITERATE action in your Xlate on the repeating segment (FRL).

              If this explanation was all too concise and you need further help, you may email me.

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