HL7 Field Mapping…

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf HL7 Field Mapping…

  • Creator
    Topic
  • #50721
    Tom Rioux
    Participant

      Has anyone attempted to write a script or proc that would take the HL7 field mapping and change each field within an xlate according to the following example:

      0(0).PID.00106.[0]   to  0(0).PID.#3.[0]

      I like using the # better than having the 5 digit numbering scheme.  I would like to find an easy way to change the xlate without having to go in and touch every field.   I understand that there may me user-defined segments (Z segments) that would not be able to get updated necessarily, but if it could get the bulk of it, that would be great.

      Tom

    Viewing 15 reply threads
    • Author
      Replies
      • #67235
        Jim Kosloskey
        Participant

          Tom,

          Let us know when you have that written and tested  ðŸ˜†

          I suspect that will be a non-trivial task as the position of the field is based on the position in a segment.

          So one would need to look at the particular variant and determine where within the message the segment is and where within the segment the field is.

          Since the same field can reside in different segments and the same segment can actually reside within different groups within the same message that could be a challenge. Especially challenging might be determining how to navigate the Cloverleaf(R) variant definitions.

          I have some ideas – but I think it is just easier to modify the Xlate as I need to. In 5.6 the relative number notation is the default for new Xlates.

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

        • #67236
          Tom Rioux
          Participant

            Hey Jim,

            I started working on something yesterday afternoon for a bit.  I was attempting to use the the “fldmap” file from the hl7 directory under the root.  However, after studying the file and all of the xlates and hl7 variants, I realized that there are too many variables to consider when attempting to do this.  I thought of everything you mentioned and then some. I don’t think my tcl/scripting skills are accomplished enough to do this justice.  It would take a power far, far greater than me (Charlie!  ðŸ˜€ ) to get something of this magnitude done.

            Tom

          • #67237
            Charlie Bursell
            Participant

              Looked like a bit of a challenge so, since I had a couple of hours free yesterday I came up with this.

              USAGE:

            • #67238
              Tom Rioux
              Participant

                Charlie,

                This proc is awesome.  Thanks so much.  I did make one adjustment to it after downloading it.   I kept getting the following error:

                Serious Error!!  Offset not found in Segments array – ABORTED!!!”

                It appears as though that it had something to do with a possibly the field notation (i.e. in this case 90058) not having an offset in one of the variants that is being used.  So, what I did was commented that part out and put a continue in there.   In those cases where it would have normally aborted, it left the original field notation in place.  These are few and far between and can be adjusted manually as needed.   Does what I did  sound right according to the logic in your script?  I tried putting echo’s out to make sure I knew what I was seeing come in and go out.

                Thanks again…Tom

              • #67239
                Charlie Bursell
                Participant

                  What you did will keep the script from aborting but what about the undefined field?  That was the reason I aborted at that point to let you know you had a malformed variant.

                  I pull the name of the segment and the field address from the statement.

                  I then look for that segment first in the defined variant.  If the segment is not found there I pull it from the root.  I then number the fields from 1 – x

                  If that field is not defined in the segment using it, it is a problem that should be fixed.

                  I guess I could issue a warning and simply skip that file.

                  With that said I would not be surprised if you find troubles I tested it against about 25 – 30 Xlates I had.

                • #67240
                  Tom Rioux
                  Participant

                    Charlie,

                    This particular Xlate I’m testing with has a different inbound and outbound variants.  The segment size is larger in the inbound than in the outbound.  It is a Z-segment and is pretty much only used to read from inbound.  We don’t do hardly any mapping to this segment outbound.  I’m assuming that since the field exists in the inbound variant and the not in the outbound variant, that is why it is throwing the error.  

                    Would this be considered a malformed variant?  Should I go in and update all of the variants that have this type of issue?

                    Thanks for all your help!!!

                    Tom

                  • #67241
                    Charlie Bursell
                    Participant

                      No, the script uses the OB variant for OUT and tilde prefixes.  It use the IB variant for all else

                    • #67242
                      Charlie Bursell
                      Participant

                        Tom:

                        If you send me the Xlate file and variant in a zip I will test it.  Name the zip like zpp or something insteado zip as our lovely IT guys do not allow zips

                        cbursell@healthvision.com

                      • #67243
                        Charlie Bursell
                        Participant

                          Tom Rioux pointed out a problem.

                        • #67244
                          Tom Rioux
                          Participant

                            Charlie,

                            It appears I may have run into another issue.   I’m attempting to go through your code but my head hurts trying to understand it all.   I bow to the master.

                            ANYWAY….what I’m seeing, when I run the script against some xlates, is that it doesn’t appear to reaching into nested IF statements or IF statements within iterates.

                            Can you check that xlate I sent you?  If you run the script against and then check a segment like the AL1 segment.   When I ran it, it didn’t change any of the notations in that segment.   Hopefully, I’m not using an older copy.  I will download the script again and try it again.

                            Thanks…Tom

                          • #67245
                            Charlie Bursell
                            Participant

                              When I get one of those round tuits, I’ll look at it

                            • #67246
                              Tom Rioux
                              Participant

                                I know what you mean.   In between working on xlates and getting ready for go-lives, boss has laid some round tuits on my desk that are labeled “documentation”.   I hate those kind of round tuits but they are a necessary evil.  ðŸ˜ˆ  ðŸ˜¥

                                Tom

                              • #67247

                                dokuwiki has made my documentation life soooooooo much easier.

                                -- Max Drown (Infor)

                              • #67248
                                Charlie Bursell
                                Participant

                                  I guess we will keep trying until we get it right  ðŸ˜€   Please remember that I am doing all of this pro bono 0 no pay  ðŸ˜¥

                                  The problem was not in parsing it was in the regular expression that extracted the field addresses (addrPat).  It did not take into account iterations like (%s1), etc.  It was looking for all numbers.  Besides the regexp was much more complicated than it should be.

                                  Try the new one

                                • #67249
                                  Tom Rioux
                                  Participant

                                    I understand about the pro bono and do thank you very much for all of the work you have done on this.  I’m sure many others are gonna take advantage of this as well.  I will test this out and let you know.

                                    Tell you what Charlie…I’ll buy your next round of golf!!   😀

                                  • #67250
                                    Tom Rioux
                                    Participant

                                      THANKS CHARLIE!  WORKS LIKE A CHAMP!!!

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