HRL Help needed, Please

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf HRL Help needed, Please

  • Creator
    Topic
  • #48522
    Anonymous
    Participant

      Hi,

      I have some idea about the HRL and VRL and I read topics or solutions I was looking for and almost got it, but not yet…

      I have file like this..

      “H”,”someval”,”thisval”,”four”,”five”

      “S”,”one”,”two”,”three”,”four”,”five”,”six”

      “T”,”1″,”2″,”3″,”4″,”5″,”6″,”7″,”8″,”comments”

      “T”,”11″,”22″,”33″,”44″,”55″,”66″,”77″,”88″,”comments”

      “S”,”one1″,”two2″,”three3″,”four4″,”five5″,”six6″

      “T”,”1″,”2″,”3″,”4″,”5″,”6″,”7″,”8″,”comments”

      “T”,”11″,”22″,”33″,”44″,”55″,”66″,”77″,”88″,”comments”

      “T”,”1″,”2″,”3″,”4″,”5″,”6″,”7″,”8″,”comments”

      “T”,”11″,”22″,”33″,”44″,”55″,”66″,”77″,”88″,”comments”

      “F”,”f1″,”f2″,”f3″

      I need to convert this to HL7.

      I don’t really care about first line and last line in the file.

      “S” line has all info about the patient that you can fill in for MSH and PID/PV1.

      “T” has lab results.

      As you can see each “S” pertains to one patient followed by “T” lab results (OBX) for that patient.

      How do I go about doing this.

      I created 2 VRL’s one for the “S” and one for the “T”. I created HRL but my HRL is treating each record as one individual record. I am not sure about the Global definition in VRL. I tried “n”, ‘n”,n in the termination.

      How do I go about fixing this.

      Any help is greatly greatly appreciated.

      Thanks,

      Hari

    Viewing 1 reply thread
    • Author
      Replies
      • #58866
        Charlie Bursell
        Participant

          This looks to me like a poorly designed Comma Separated Values (CSV) record format.  Normally with CSV, the double quotes are used only when the field contains special characters, i,e., a comma, etc.  CSV can be difficult to deal with sometime because of all the nuances.

          If I were doing this interface, I would deal with it as CSV.  While you can do that with VRL, I find it easier to use the csv package which is part of the tcllib library.  If you don’t have that it can easily be downloaded.  I think the latest version is tcllib1.7 o greater.

          Once installed

          package require csv

          foreach line in your data file

          set list [csv::split $line]

          This will return a list of values for each file.

          I would then normalize it to an HL7 variant.  Just change the first field to TXX, HXX, etc.  Then join the list with a pipe (|).  Now all you have to do is prepend a dummy MSH and you have an easy to deal with HL7 message that can be easily translated to whatever you want.

          Just my opinion.  I am sure there are others

        • #58867
          Anonymous
          Participant

            Well, this is not a CSV file as the example file I quoted certainly have comma separated values in it. Like the name. My bad on that file list.

            So this is truly a text file and with in the double quoted, the values can be “ONE, 1”.

            So a csv is not an option in this case.

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