› Clovertech Forums › Read Only Archives › Cloverleaf › Cloverleaf › HL7 Field Mapping…
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
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 30+ years Cloverleaf, 61 years IT – old fart.
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
USAGE:
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
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.
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
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
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
Tom
-- Max Drown (Infor)
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
Tell you what Charlie…I’ll buy your next round of golf!!