Need help translating HL7 to VRL

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Need help translating HL7 to VRL

  • Creator
  • #50302
    April Dunbar

    Any ideas how to get a repeating segment within an HL7 message convert over to VRL so all data within the hl7 message shows?  I’ve tried using iterate, but it is not working.  HELP!!!  🙁


    April Dunbar

Viewing 15 reply threads
  • Author
    • #65548

      April, could you please paste an example test HL7 message and what  you want the output to look like, too?

      -- Max Drown (Infor)

    • #65549
      Jim Kosloskey


      I think you will need to  use HRL with VRL.

      The idea is the VRL will define the equivalent HL/7 segment information, the HRL specifies the framework for the VRL repetition (which mirrors the HL/7 segment).

      That is the theory at any rate.

      Otherwise, you will probably need to define a fixed number o fields in the VRL to accomodate the largest number of occurences of the HL/7 segment – that is not a good alternative.


    • #65550
      April Dunbar

      HL7 message: MSH:;~&:ST01:A:ES01::20080922010521::MFN;M01:170:D:2.2:170::AL:::::::2.2b

      MFI:SJE;GL JE OUTBOUND;99ST01::UPD::200809220105:NE


      ZJE:10179;;99SJE:H:PA:JE 10179 PA Daily Journal Entry – 20080921:20080921:0:0:0:0:0:7:USD:ACTUAL:0:0:::10:1:0:0

      ZJD:10179;;99SJE:D:10100000500:JE 10179  PA Daily Journal Entry:-1726.00:: :DFDPRV

      ZJD:10179;;99SJE:D:10103112100:JE 10179  PA Daily Journal Entry:86777.00:: :PA

      ZJD:10179;;99SJE:D:10301031000:JE 10179  PA Daily Journal Entry:-8636.00:: :DPRV

      ZJD:10179;;99SJE:D:10301032000:JE 10179  PA Daily Journal Entry:-4064.00:: :DPRV

      ZJD:10179;;99SJE:D:10301033000:JE 10179  PA Daily Journal Entry:-508.00:: :DPRV

      ZJD:10179;;99SJE:D:10301034000:JE 10179  PA Daily Journal Entry:-1524.00:: :DPRV

      ZJD:10179;;99SJE:D:10301036000:JE 10179  PA Daily Journal Entry:-1016.00:: :DPRV

      ZJD:10179;;99SJE:D:10301038000:JE 10179  PA Daily Journal Entry:-17272.00:: :DPRV

      ZJD:10179;;99SJE:D:10303031000:JE 10179  PA Daily Journal Entry:-1554.00:: :DPRV

      ZJD:10179;;99SJE:D:10303032000:JE 10179  PA Daily Journal Entry:-777.00:: :DPRV

      ZJD:10179;;99SJE:D:10303038000:JE 10179  PA Daily Journal Entry:-2331.00:: :DPRV

      ZJD:10179;;99SJE:D:10304031000:JE 10179  PA Daily Journal Entry:-2084.00:: :DPRV

      ZJD:10179;;99SJE:D:10304036000:JE 10179  PA Daily Journal Entry:-1042.00:: :DPRV

      ZJD:10179;;99SJE:D:10304038000:JE 10179  PA Daily Journal Entry:-14588.00:: :DPRV

      ZJD:10179;;99SJE:D:10317031000:JE 10179  PA Daily Journal Entry:-833.00:: :DPRV

      ZJD:10179;;99SJE:D:10317038000:JE 10179  PA Daily Journal Entry:-4998.00:: :DPRV

      ZJD:10179;;99SJE:D:10321034000:JE 10179  PA Daily Journal Entry:-543.00:: :DPRV

      ZJD:10179;;99SJE:D:10321038000:JE 10179  PA Daily Journal Entry:-543.00:: :DPRV

      ZJD:10179;;99SJE:D:10325032000:JE 10179  PA Daily Journal Entry:-2079.00:: :DPRV

      ZJD:10179;;99SJE:D:10325038000:JE 10179  PA Daily Journal Entry:-4158.00:: :DPRV

      ZJD:10179;;99SJE:D:10333031000:JE 10179  PA Daily Journal Entry:-1439.00:: :DPRV

      ZJD:10179;;99SJE:D:10333038000:JE 10179  PA Daily Journal Entry:-11512.00:: :DPRV

      ZJD:10179;;99SJE:D:10351031000:JE 10179  PA Daily Journal Entry:-355.00:: :DPRV

      ZJD:10179;;99SJE:D:10351032000:JE 10179  PA Daily Journal Entry:-1420.00:: :DPRV

      ZJD:10179;;99SJE:D:10351038000:JE 10179  PA Daily Journal Entry:-1775.00:: :DPRV

      To VRL (Comma Separated Values format):

      MESSAGE 1

              Posting_Date: ts >20080921< Fully_Qualified_Acct: ch >10351038000< Line_Item_Description: ch >JE 10179  PA Daily Journal Ent<               Amount: zd >-1775.00< As you can see, in my xlate, it is only picking up the last value even though I have an iterate in there.  Oh and I only need 4 fields out of the ZJE and ZJD segments.

    • #65551
      April Dunbar

      Jim – I’ve never used HRL.  Would I first take hl7 message into engine and use HRL as outbound thread.  And then pick it up on inbound and send it out as VRL?

      Thanks, April

    • #65552

      Using that example you pasted, what do you want the output to look like?

      -- Max Drown (Infor)

    • #65553
      Jim Kosloskey


      In theory, you go into the HRL Configurator (it is a record structure not a protocol) and specify the VRLs (or FRL/VRL combinations if that fits) that comprise the HRL.

      So in your case, you might have a VRL that is the portion of the record prior to the repeating portion. You  might have another VRL that specifes the repeating data and in the HRL you would indicate the conditions under which the repetitions happen. You might have another VRL that defines a trailing non repeating set of data. All of that is defined as existing in the HRL configuration.

      The reason you are only seeing the last repetition in what you have set up is although you can iterate through the HL/7 segments (because the HL/7 configurator allows specification of repetition) there is no capability of specifying repetition in VRL so there is only one occurrence to put the data. Thus you are always placing the data from each HL/7 segment repetition to the one repetition in the VRL (all that is allowed) and so as you move through the iteration (let’s say there are 5 repetitions) the first repetition goes in the VRL, the second overlays the first (because there is only one VRL repetition, the third overlays the second and so on until the iteration is exhausted in which case the fifth and last repetition (in our example) overlays the fourth.


    • #65554
      Bob Richardson


      April, I would suggest using TCL to solve your problem here.  I have tried to use the HRL message format in a translation with much frustration. In a call to (then) Quovadx tech support and a consult with an expert at (then) Quovadx, I was informed that HRL was broken.  At the last Annual Conference I had attended (2007) an announcement had been made that (then) Quovadx would fix it.  So far there have not been any release notes to the effect that HRL now works as advertised or that it is on the list to be fixed at this time.

      TCL would give you more control over creating your VRL style fields and records.  I am thinking that you split the HL7 message; use list commands and foreach loops to build your VRL message from the HL7 message.

      Again another approach to consider here.

    • #65555
      April Dunbar

      I came up with a solution, but thank you for your assistance.  I sent the message through localhost and split it up as hl7.  Then on the inbound localhost, used the vrl xlate to send the designated fields to the file.

      Thanks again,

      April 😀

    • #65556
      Jim Kosloskey


      The only section of HRL we have not gotten to work has to do with the repeat while. It may be we have not gotten the secret handshake down yet and we will be investigating more.

      In my opinion, HRL as a whole is not broken.


    • #65557
      Robert Kersemakers

      Hi Jim,

      I got the Repeat While in an HRL working. I included a few examples: the HRL, the two FRL’s that comprise the HRL and an example file (length encoded).

      Should be clear what is going on. But do ask if you have questions.

      I never had any use for the Repeats option. I assume you must define how often the Repeat is done. Anyone know what the Repeat Block does?

      Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

    • #65558
      Jim Kosloskey


      I am at the User Conference and will look at your examples when I get back to my office.

      Thanks for the assistance.

      My take on the repeat blocks is if you have a series of repetitions which have an unknown limit and you do not have something to while on but you can identify a start and end (kind of like mlp) to constrain a block then the repeat block works.

      I can recall some record structures from my mainframe days that would fit the repeat block construct and I certainly can make a test construct that fits.

      However, I don’t think there are that many real world examples.

      Thanks again.


    • #65559
      Bob Richardson


      Does Healthvision R & D have any plans to complete the development of the HRL message format?  I had banged my head on a wall for two weeks in trying to utilize the HRL on an input flat file that had fixed and variable components some of which repeated.  This was over a year ago; we had paid for consult time with (then) Quovadx:  recommendation: do a TCL proc to build a dummy HL7 message and then set up a translate.  We were doing a flat file to XML at that time.  Then a source at (then) Quovadx informed me that the HRL was never completed prior to distribution.  HRL was not a priority to complete as advertised in the documentation.  It would be very useful to have a fully functional HRL format available as more applications are requiring Cloverleaf to process file extracts from various databases like Epic Systems’ cache globals.

      It would be a loss to allow HRL to wind up with the same fate as Version Manager (dumped rather than completed).



    • #65560
      Robert Kersemakers

      Hi Robert!

      I must agree with Jim: I don’t think HRL is broken. It is just hard to use because there are not a lot of examples and documentation on how to setup a decent HRL is lacking.

      We have been using HRL in 5.2 also. Maybe it even worked in 3.7.1 too!!

      Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

    • #65561
      Jim Kosloskey


      Healthvision will correct HRL if there is a real bug. So we need to identify anything that is a bug.

      Also, Healthvision will continue support for HRL and perhaps even expand it (if needed) as long as there is user interest. I have what I think is an upcoming need and thus HRL may be useful to me.

      Others in the user community need to post if they are using HRL or have a need for HRL if they can make it function (I think it can be made to function but it will take some patience).

      Bob – could you add a poll regarding who is using HRL or is interested in HRL?


    • #65562
      Mark Thompson


      We have an integration where the input is a comma-delimited (.csv) spreadsheet and the output is XML.  The first couple columns are high-level information that is repeated on multiple lines.  I spent quite a while trying to set up an HRL iteration based on the high-level data.  I finally gave up and followed some advice posted earlier on the forum – convert the whole thing into an HL7 message and iterate the HL7 message.  The data is something like:

      A,X,”Detail stuff 1″

      A,X,”Detail stuff 2″

      A,Y,”Detail stuff 3″

      B,X,”Detail stuff 4″

      I would like to use an iterate on the first column with a nested iterate on the second column to produce something like:


         Detail stuff 1

         Detail stuff 2



         Detail stuff 3



         Detail stuff 4


      I’m not sure if this needs better examples or a Cloverleaf change or maybe just a smarter implementer.

      - Mark Thompson

    • #65563
      Robert Kersemakers

      Hi Mark,

      So the format of each of these lines is the same:

      * field1 (A/B)

      * field2 (X/Y)

      * detail stuff/fields…

      You would need to define one VRL, based on this format; lets call it ‘line.vrl’. Then you can define your HRL like this:

      First segment:

      * Name: lineA

      * File Name: line.vrl

      * Repeats While

       – Field: lineA.field1

       – Text: A

      Second segment:

      * Name: lineB

      * File Name: line.vrl

      * Repeats While

       – Field: lineB.field1

       – Text: B

      This way you can first iterate through your lineA lines (Type: segment; Basis: lineA; Variable: %s1), check for the X/Y line with ‘LineA(%s1).field2 and add the information to the XML (or gather the information and put it in the XML later). You will need to check yourself whether you have the X or Y-line.

      Then iterate through the LineB lines.

      It’s not possible to define the HRL in such a way as to let you iterate through A and then do a nested iterate on X/Y.

      Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

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

Forum Statistics

Registered Users
Topic Tags