HL7 to CSV / FILE

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf HL7 to CSV / FILE

  • Creator
    Topic
  • #53700
    Jon Melin
    Participant

      Hello,

      I have been trying to get an HL7 message (certain segments and fields) into a file in a human readable format. I am using fileset-local output portion and have tried using an XLATE from HL7 to a VRL but the output file puts each message on the same line so each message is blending together. I went through the help on fileset and couldn’t find any way of fixing it.

      Has anyone ever needed to move HL7 to a flat human readable format, possibly a CSV, or at least a VRL that creates a new row each message rather than putting each message on the same row. I’m open for suggestions.

      Please let me know if you have any ideas and thank you in advance.

      Jon

    Viewing 9 reply threads
    • Author
      Replies
      • #78608
        Jennifer Hardesty
        Participant

          I’m looking to do this too.  I don’t suppose you got any offline answers.

        • #78609
          James Cobane
          Participant

            Jon,

            What ‘style’ do you have specified in the ‘Outbound’ section of your FileSet protocol?  It should put each message on a new line if you have ‘nl’ specified.

            Jim Cobane

            Henry Ford Health

          • #78610
            Jon Melin
            Participant

              I have the style set to nl

            • #78611
              Jim Kosloskey
              Participant

                Jon,

                On your global properties for the VRL try using x0d or x0a for the Termination value.

                If that does not work you can always CONCAT x0d or x0a to your last field.

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

              • #78612
                Jon Melin
                Participant

                  That seems to work perfectly. Thank you for the suggestion. Is the only way to get header information in there to use Pre/Post TCL?

                  Thank you,

                  Jon

                • #78613
                  Jennifer Hardesty
                  Participant

                    re: header information — what kind?  Does it need to be per message or per file?

                    Also, is this excel friendly?  Would you mind sharing?  Not the Xlate, just the variant.

                    🙂

                  • #78614
                    Jon Melin
                    Participant

                      One header per file.

                      As of right now I don’t think it would be excel friendly becasue it doesn’t have commas in place yet, but I will try to tweak it some more and share it I can get it to be so.

                      To get the data to the file essentially I mapped a regular P03, in this case, to a VRL that I built based on what data I wanted to output. So the IB is a normal HL7, and then I just mapped the fields I wanted to a custom VRL. I’ll let you know where I get with the excel friendly piece.

                      Thanks.

                    • #78615
                      Jim Kosloskey
                      Participant

                        You may be able to use HRL to include the header.

                        I have done this that way.

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

                      • #78616
                        Russ Ross
                        Participant

                          Cloverleaf produced the following Excel freindly tab delimited files from this morning’s daily pharmacy charge file run:

                          Code:

                          2013.06.12__05.38.42__prod_batch_020__charges_in_CDM_table_but_bogus_math_number.log
                          2013.06.12__05.38.42__prod_batch_020__charges_in_CDM_table_missing_UOM.log
                          2013.06.12__05.38.42__prod_batch_020__charges_in_CDM_table_quantity_changed.log
                          2013.06.12__05.38.42__prod_batch_020__charges_in_CDM_table_quantity_not_changed.log
                          2013.06.12__05.38.42__prod_batch_020__charges_not_in_CDM_table.log
                          2013.06.12__05.38.42__prod_batch_020__credits_DOS_before_golive_quantity_not_changed.log

                          Our batch integration for pharmacy is about 20,000 charges per day runnning up around 5 million dollars so to big to do any analysis without creating some Excel friendly files.

                          In my case I made them tab delimited to avoid any commas that might be in the fields but the concept is still the same for CSV or tab delimited.

                          My soultion met my needs but not exactly effeicient becuase the lines are appended to my Excel files during the xlate based on the conditions indicated by the file names.

                          That means I have the overhead of open/close for each line appended to a Excel friendly file but I gain the flexibility of inserting the appends in the xlate at exactly the right spot.

                          I ended up liking it overall and these supplemental Excel friendly files have made visible concerns that had been hidden previously.

                          The bulk of the work is done by a xlate proc ( xlt_020_append_next_line_to_file.tcl ) I wrote seen below:


                          # Begin Module Header ==========================================================
                          #
                          #——
                          # Name:
                          #——
                          #
                          # xlt_020_append_next_line_to_file
                          #
                          #———
                          # Purpose:
                          #———
                          #
                          # Append the next line to file,
                          # which can be useful to create an audit log file from an xlate.
                          #
                          #——–
                          # Inputs:
                          #——–
                          #
                          # xlateInVals 1 = dir_name
                          #
                          # xlateInVals 1 = file_name
                          #
                          # xlateInVals 2 = next_line
                          #
                          #———
                          # Outputs:
                          #———
                          #
                          # xlateOutVals = not used so be sure to use a CALL and not a COPY in the xlate
                          #
                          #——-
                          # Notes:
                          #——-
                          #
                          # The dir_name specified has to already exist or an ERROR will be generated an no action will be taken.
                          #
                          # If the file_name doesn’t already exist it will be created but a WARNING will be issued generated.
                          #
                          #———
                          # History:
                          #———
                          #
                          # 2009.04.14 Russ Ross
                          #
                          [code]
                          # Begin Module Header ==========================================================
                          #
                          #


                          # Name:
                          #


                          #
                          # xlt_020_append_next_line_to_file
                          #
                          #


                          # Purpose:
                          #


                          #
                          # Append the next line to file,
                          # which can be useful to create an audit log file from an xlate.
                          #
                          #


                          # Inputs:
                          #


                          #
                          # xlateInVals 1 = dir_name
                          #
                          # xlateInVals 1 = file_name
                          #
                          # xlateInVals 2 = next_line
                          #
                          #


                          # Outputs:
                          #


                          #
                          # xlateOutVals = not used so be sure to use a CALL and not a COPY in the xlate
                          #
                          #


                          # Notes:
                          #


                          #
                          # The dir_name specified has to already exist or an ERROR will be generated an no action will be taken.
                          #
                          # If the file_name doesn’t already exist it will be created but a WARNING will be issued generated.
                          #
                          #


                          # History:
                          #


                          #
                          # 2009.04.14 Russ Ross
                          #

                          Russ Ross
                          RussRoss318@gmail.com

                        • #78617
                          Jim Kosloskey
                          Participant

                            Jennifer,

                            What do you mean ‘Excel friendly’?

                            If you just mean delimited such that Excel can import then any of the Excel supported delimiters can be specified in the VRL/HRL.

                            If you mean column headers as the first record, thet too should be achievable.

                            If you mean something else let us know.

                            I have created a number of simple and more complex delimited and non-delimited files using the combinations of HRL/VRL/FRL with appropriate configuration.

                            I did not need to use much if any Tcl.

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

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