HRL expertise needed.

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf HRL expertise needed.

  • Creator
    Topic
  • #50482
    Anonymous
    Participant

    Has any one used the “Repeat Block” in an HRL ?

    I have a file that has a tape header.

    It is followed by a Company Header of 189 bytes.

    Then under that Company Segment there is a repeating detail record.

    Followed by the next company and so on.

    I realize that not many people have really used this. Given the poor documentation on this feature it is no wonder why.

    I have it to where it is defined and repeating to the end of the first company detail.  But I need it to repeat over multiple companies.

    Kind of this format this is pseudo coded data

    These are all FRL fields.

    “TAPE HEADER”

    “Company A “

    “detail1 0”

    “detail2 0”

    .

    .

    .

    “Company B”

    “detail1 0”

Viewing 7 reply threads
  • Author
    Replies
    • #66269
      Robert Kersemakers
      Participant

      Hi John,

      If you need it to repeat over the companies, you will need another HRL that contains the HRL you already made. I have never done this, nor have I ever used the Repeat Block option. But there should be some field indicating what kinda line it is. Based on this, I would do it like this:

      Create HRL called Company.

       1 * Name: comp_line

          * File Name: comp.frl

          * No Repeat

       2 * Name detail_line

          * File Name: det.frl

          * Repeat While Field: detail_line.indicator_field

                                 Value: DETAIL

         

      Create another HRL called Total:

       1 * Name: header_line

          * File Name: head.frl

          * No Repeat

       2 * Name Company_hrl

          * File Name: Company.hrl

          * Repeat While Field: Company_hrl.indicator_field

                                 Value: COMPANY

      Again: I am not sure if this would work. Especially with this last Repeat While.

      If you will be creating precisely one message per company, then I would suggest using TCL to first get rid of the header line and then split the rest of the message in separate messages: one message per company. You can then use the Company HRL to process these separate messages.

      Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

    • #66270
      David Harrison
      Participant

      John,

      I have a similar kind of thing working. The only way I found to do it is to use the repeat . . . while.

      You will have two FRLs, one called HEADER.frl and one called DETAIL.frl. Set a one character field in DETAIL.frl called REPEAT – it can be anywhere so just tag it on to the end. When you read the data file use a bit of tcl to set the REPEAT field in the detail records to the constant value 1.

      In the HRL definition, set the name of the first segment as HEAD with the filename set to HEADER.frl. Set the second segment as DATA with the filename set to DETAIL.frl; check the Repeat While radio button; put DATA.REPEAT in the corresponding Field box and 1 in the Value box.

      In your Xlate, the iterate should be set with Type = Segment, Basis = DATA and Variable set to %s1. To reference fields within the iterate use DATA(%s1).FIELD1 etc.

      The names I’ve used are for example only.

    • #66271
      Robert Kersemakers
      Participant

      Hi David,

      I agree: John’s situation looks similar, but it is a bit more complicated. He has a Header-line, followed by an iteration of Companies. And each Company consists of a Company-line, followed by an iteration of Detail-lines. So he has an iteration within an iteration.

      Therefore I was thinking of an HRL within an HRL. Alas no time to test this myself…

      Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

    • #66272
      Anonymous
      Participant

      Thanks Guys.

      I did get it to work with an HRL within an HRL.

      I’m really curious about the Block repeat and what it does.

      I have used HRL to solve many different issues. But it has taken lots of trail and error to get it done. I really think there is lots of potential to do things with it.

    • #66273
      Robert Kersemakers
      Participant

      Good to hear you got this working. I am curious about the Repeat of your Companies (which is the HRL within the HRL). Can you tell what you did to get this working? I would love to try it myself, but other things to do around here…

      On the Repeat Block; here is a thread where Jim explains it a bit: http://clovertech.infor.com/viewtopic.php?t=3026&highlight=block

      Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

    • #66274
      Anonymous
      Participant

      Robert let me get the details all worked out of the field level stuff and I will post the HRL and FRL records. Right now I just did what I had to. It is working and iterating through things correctly now I need to get some good field defined for the rest and give the field real names.  What I have now is a mess just trying to make it work.

    • #66275
      Bob Richardson
      Participant

      John and company,

      It would be a good idea to have some sort of HRL presentation at the 2009 Annual Users Conference.  For myself it has been an extremely frustrating experience in trying to get it to work.  Not to mention that when we contacted Quovadx (now Healthvision) to work with an expert,

      we were told to use TCL and then paid their fee to boot.

      Just a suggestion.

      Thanks.

    • #66276
      Charlie Bursell
      Participant

      While we could do an HRL presentation, given the time frame allotted, I am not sure we could cover all of the nuances.

      I would be the first to admit that HRL is very hard to deal with.  For that reason, I almost never use it.  It is much easier to write a simple proc and an HL7 variant and simply change the HRL to HL7.

      HL7 is easier for iterations, optionals, etc.

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

Forum Statistics

Registered Users
5,115
Forums
28
Topics
9,290
Replies
34,422
Topic Tags
286
Empty Topic Tags
10