Iterate vrl to hl7

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Iterate vrl to hl7

  • Creator
    Topic
  • #49886
    Jayne Stutz
    Participant

      I am brand new to Cloverleaf, just finished level 1 class. I have built my first translation, vrl to hl7.  It worked to a point.  I have reviewed other posts on this topic but not finding one to match what I’m doing.  Please forgive me if I missed it.

      I have a vrl file, 10 records, fields delimted by |.  I need to create MSH, MFI, then repeating groups of CD1, CD2, CD3.  Currently my output is creating repeats of MSH, MFI, CD1, CD2, CD3.  

      I know I need to use the iterate function.  I want to repeat the group of CD  segments.  But I don’t understand what to put in the basis and what/where to assign the variable.  I tried to put group 1 in the basis, it shows as ~1.  I get an error Unable to get iteration basis address ‘1(0).CD1(0)’  I don’t know what to copy from the source because it’s multiple fields into each segment.

      Hope I have explained this correctly.  Thanks in advance for any assisstance you can give me.

    Viewing 3 reply threads
    • Author
      Replies
      • #64007
        Tom Rioux
        Participant

          Jayne,

          You mentioned you were getting the following error:

          Unable to get iteration basis address ‘1(0).CD1(0)’

          I would imagine that you have the CD1, CD2, and CD3 grouped together in your variant.  If that is the case, try using the just the group indicator as your basis.  Try entering “1(0)” as your basis and see if that gets you the desired results.

          I’d be curious to see your code since you say the MSH is repeating as well.

          Thanks…

          Tom Rioux

          Baylor Health Care

        • #64008
          Robert Kersemakers
          Participant

            Hi Jayne,

            I’m a bit confused…

            If the vrl is the inbound format, then you should be iterating over a basis within the vrl. And not within the HL7 outbound format.

            Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

          • #64009
            Jayne Stutz
            Participant

              I may not have clearly defined what I have and what I want to create.  I have 1 source file with 3 records in it, vrl format, delimited by a |.  Example:

              1235|this is an item||||xx456

              4567|this is another item||||xx567

              59688|this is a third item||||xx998

              These data elements belong in various places in the CD1, 2, and 3 segments

              I want 1 destination file, a batch file, with repeating groups of segments, except for MSH and MFI.

              Example:

              MSH|~^&||||||||

              MFI|CDM||

              CD1|1235||||

              CD2|||||

              CD3|||||

              CD1|4567||||

              CD2|||||

              CD3|||||

              CD1|59688||||

              CD2|||||

              CD3|||||

              My CD1,2,3 is a repeating group in my message, so this part is fine.  But I don’t want multiple messages, therefore I don’t want more then 1 MSH and MFI.

              If anyone has done anything like this, I appreciate your help.  But I can’t use tcl yet, I don’t know it enough, so I need to figure it out within the gui.

              Thanks.

            • #64010
              Robert Kersemakers
              Participant

                You can do this without tcl, but you need to define an HRL as your inbound format. This HRL consists of (one or more of) the VRLs you already defined.

                By using this HRL as your inbound format in the translation, you can then iterate throught the VRL’s and fill the CD1/2/3 segments, while only creating one MSH messages.

                Hope this gives you an indication on how this works. The difficulty lies in defining the Repeat Options of the VRLs in the HRL. I always use the Repeat While option, but I’m not sure if this is possible in your case.

                Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

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