Repeat HL7 RGS group

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Repeat HL7 RGS group

  • Creator
    Topic
  • #51623
    Mike Thompson
    Participant

      Hi,

      I am looking for help on creating a repeating RGS group based on a segment values.

      My current output is as follows:

      RGS

      {AIS(0)

      AIS(1)

      AIS(2)

      AIS(3)

      AIG(0)

      AIG(1)

      AIL (0)

      AIP(0)

      }

      I need:

      RGS(0)

      {

      AIS(0)

      AIG(0)

      ………}

      RGS(1)

      {

      AIS(1)

      AIG(1)

      …….}

      I just can’t figure out the basis for the Group and then assiging each segment to the Appropriate group!  

      Any help would be greatly appreciated!  group?

      Thanks,

      Mike

    Viewing 9 reply threads
    • Author
      Replies
      • #71003
        Jim Kosloskey
        Participant

          Mike,

          To start with is your RGS Group defined as repeating in the variant you are using?

          If so does the inbound variant also have the RGS group defined as repeating?

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

        • #71004
          Mike Thompson
          Participant

            Yes, both defined as repeating.  Repeat is set on the group and on the RGS segement itself.  I tried changing this grouping mutiple times with no luck.

            Thanks,

            Mike

          • #71005
            Bob Richardson
            Participant

              Mark,

              It looks like the RGS segment is at the same level (group 0) and the XPM parser doesn’t “see” the second group 0.  Kinda like that problem with the A18 (?) where you have two PID segments at the same group level.

              I am thinking you probably have to dummy up a repeating group with the RGS segment as the first segment with the AIS segments under it as its own group to pull this off or:

              {RGS

               

              {

              AIS(0)

              AIG(0)

              ………} }

              Thinking that you can get the following:

              First group (the “0”):

              {RGS(0)

                { AIS(0)

                   AIG(0)

              }}

              Second group (the “1”):

              {RGS(1)

                { AIS(0)

                   AIG(0)

              }}

              Hope this helps.

            • #71006
              Jim Kosloskey
              Participant

                Mike,

                Email me and perhaps I can help you.

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

              • #71007
                Tom Rioux
                Participant

                  Mike,

                  When you reach your solution, please post it here.   I’m sure there are others that can benefit from your experience.

                  Thanks…

                  Tom Rioux

                • #71008
                  Mike Thompson
                  Participant

                    Yes, I was surprised to not see anything posted on Clovertech on RGS grouping already.  The way I understand the standard this should be a common requirement.  Perhaps I do not understand chapter 10 correctly?

                    Thanks,

                    Mike

                  • #71009
                    Mike Thompson
                    Participant

                      😀 Happy to report with the help of Jim I have come to a solution that meets my needs!  Here are results:

                      Here are the results for RGS iterate:

                      Set temp counter : copy =0  -> $%g99

                      Set iterate:  segment PRE_PROCEDURE  %s1

                      Copy action under iterate:  use basis on all inbound, in this case I am usinga VRL segments

                      i.e. PROCEDURE(%s1).SEQUENCE_NO

                      Now the trick figure out where the basis group should go for temp counter.  Since this is a group iterate it needs to go in the very first counter:  

                      2(%g99).0(0).RGS(0) ,#1

                      So copy action goes -> (%s1) to repeat group -> (%g99)

                      Close iterate with the following:

                      Math Add 1

                      =1 -> $%g99

                      This will set the next group to repeat.  

                      Results below:

                      2(0).0(0).RGS(0)  :  >|1|1<

                      2(0).1(0).0(0).AIS(0)  :  >|1|1|

                      2(0).2(0).0(0).AIG(0)  :  >|1|1|

                      2(0).3(0).0(0).AIL(0)  :  >|1|1|

                      2(0).4(0).0(0).AIP(0)  :  >|1|1|

                      2(1).0(0).RGS(0)  :  >|2|2<

                      2(1).1(0).0(0).AIS(0)  :  >|2|2|

                      2(1).2(0).0(0).AIG(0)  :  >|2|2|

                      2(1).3(0).0(0).AIL(0)  :  >|2|2|

                      2(1).4(0).0(0).AIP(0)  :  >|2|2

                      2(2).0(0).RGS(0)  :  >|3|3<

                      2(2).1(0).0(0).AIS(0)  :  >|3|3|

                      2(2).2(0).0(0).AIG(0)  :  >|3|3|

                      2(2).3(0).0(0).AIL(0)  :  >|3|3|

                      2(2).4(0).0(0).AIP(0)  :  >|3|3|

                      Again many thanks to Jim Kosloskey on this one!

                      Mike

                    • #71010
                      Lawrence Williams
                      Participant

                        I know this is an older posting… but any way I could get a couple screenshots of the Cloverleaf GUI for this Xlate logic ?

                      • #71011
                        Jim Kosloskey
                        Participant

                          Lawrence,

                          In case the Xlate is not posted, if you email me I will try to help you through your situation.

                          Just click the email button on this post.

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

                        • #71012
                          Lawrence Williams
                          Participant

                            With Jim’s help, I was able to build a Xlate that works perfectly for our interface.

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