6 Replies Latest reply: May 15, 2014 10:07 AM by Joe Berry RSS

    HL7 File

    Chuck B

      We are trying to parse out the data of an HL7 file using Monarch 10.5 Pro.

       

      I've seen several documents related to older versions of Monarch, and long drawn out processes, but I was curious if there was an easier way.

       

      Simply put an HL7 file has a pipe filter set up to break up the line into different fields.  Each line begins with a unique three digit code that can be understood here:

      http://www.corepointhealth.com/resource-center/hl7-resources[/url]

       

      MSH|~&|MS4ADT|MS40028|Rosetta|MS4|20070214||ADT^A08|000 00000000022519|P|2.3

      EVN|A08|20070214145347|||SPTRAIN

      PID|0001|450283|45-02-83|000428129|PITTBRAD||19630101|M||W|4201 HOLLYWOOD LANELOS ANGELESCA^59123||5558765331|5558907689||S||001102 03353|500333333

      PV1|0001|O|1|3|||114PLUARDTIMOTHYJ|3ANZALONEJ OHN||MOC||||1|||00897PLUARDTIMOTHYJ|1|001102033 53|2094|1|||||||||||||||1|||001|READY||||200702141 035|200702141035

      GT1|1|000428129|PITTBRAD||4201 HOLLYWOOD LANELOS ANGELESCA59123|5558765331|5558907689|19630101|M| |99|500333333||||MGM MOTION PICTURE|1701 VINEHOLLYWOODCA^90210|401555-7881|||||||||||59746|S||||||||Y|||||||||||ACTOR||| |||W

      IN1|1||2|AETNA INDEMNITY||||58689|PARAMOUNT|||20070114||||PITTBR AD|99|19630101|4201 HOLLYWOOD LANELOS ANGELESCA59123|||1||||||||||||||526981010||||||| M|1701 VINEHOLLYWOODCA^90210|N||||000428129

      IN1|2||12|CIGNA INDEMNITY||||87890|JOLIE'S PROD.|||20060101||||PITTBRAD|99|19630101|4201 HOLLYWOOD LANE^LOS

       

      Just recently, we bought Monarch for help with these types of files.  Any information would be appreciated.

       

      Thanks!

        • HL7 File
          Olly Bond

          Hello Chuck,

           

          Monarch can handle anything, so this shouldn't be a problem. And you've got Monarch v10.5, so you can use the floating trap on the pipe (|) character without any worries.

           

          You could set a trap in Monarch using the nonblank trap in the first three columns and that would make each line of the HL7 file correspond to one line in the table. You could then use the Lsplit() function to break out the data in between the | characters. But frankly, that wouldn't give you much more than using Excel's Text to Columns feature.

           

          The interesting thing you can do with Monarch on this kind of data is to associate different rows with each other according to rules. So if you know that each IN1 line is crucial, but that you needed the preceding MSH and PID lines, then you would trap on "IN1" as your detail, and "MSH and PID" as two Append templates. If you need to grab data from below the detail, use a Footer template.

           

          If you can post an example of the data you want to extract from this sample, we'll be able to give you more detailed hints...

           

          Best wishes,

           

          Olly

            • HL7 File
              elginreigner _

              I would recommend using this as a database file, thats what the HL7 refers to, separating data with the '|'. This will take multiple projects unless you need it in 1 project, that will takes a lot of extra coding to separate the values. I am very familiar with the 3 digit identifies (I work at a medical collection company). I would question as to why they are produing this in HL7 and not a fixed width file, which can easily be hanled in 1 project with no coding.

                • HL7 File
                  Olly Bond

                  Dear Elginreigner,

                   

                  If you use the alternate trap characters (introduced in v9) the you can use | as a trap character with the floating trap option, which would allow you to handle data like this in one pass.

                   

                  If the three letter codes are all that is needed to distinguish the relevant lines, then you don't even need to use that, and can just proceed with the LSplit() approach.

                   

                  One thing to watch out, not present in this sample data set, is lines longer than 254 characters - where the floating trap might be required.

                   

                  Best wishes,

                   

                  Olly

                    • HL7 File
                      elginreigner _

                      Reading the file in the format is not the real issue. It would be that each record has different number of fields, MSH has 11 , EVN has 5, etc. Unless I'm missing something, loading this into a single project wouldnt be logical.

                        • HL7 File
                          RalphB _

                          Chuck,

                           

                          I copied your sample out and was able to successfully import it into Monarch as a database.

                           

                          After you open your report in Monarch as a database, you will see a window that shows Delimited Text Parameters:.  Click on Other and in the box put your pipe (|) character as the delimiter character.

                           

                          Give this a try and let us know how it turns out.

                            • HL7 File
                              Joe Berry

                              I agree with Ralph, importing HL7 as a database file works beautifully; however, I don't know if that will get the desired result.  It's been a few years since I had to work with HL7 files, but if I remember correctly, each record can contain multiple segments (lines).  This could make it difficult to use the imported data without multiple models or exports.  I think I remember that the MSH segment is the start of a new record.

                               

                              Opening as Ralph indicated will get the data fields parsed, but I think you want more than that.  If you could describe what the desired output is, maybe we can be of a little more help.