web stats
Mirth Community - View Single Post - Combine Two Z Segments Into One
View Single Post
  #1  
Old 09-03-2013, 09:08 AM
nplaisted nplaisted is offline
What's HL7?
 
Join Date: Jul 2012
Posts: 5
nplaisted is on a distinguished road
Default Combine Two Z Segments Into One

We have an inbound HL7 feed that often contains multiple ZP2 segments in a single message. We have a problem with values that should be in the same segment being split into 2 segments. The vendor will only fix it on their side for a large fee, so we are trying to fix it within Mirth Connect, but are a little stumped how to go about it.

Here is an example of the ZP2 segments:

ZP2|1|P|30|O|FAM||||||||1000||22|||Coinsurance Out of Network|EXCLUDES DEDUCTIBLE|||
ZP2|1|P|30|O|FAM|||||||||2000||||||||
ZP2|1|P|60|O|IND||||||||1000||22|||Coinsurance Out of Network|EXCLUDES DEDUCTIBLE|||
ZP2|1|P|60|O|IND|||||||||2000||||||||

What I need to do with these ZP2 segments is this:
- If ZP2.1 through ZP2.5 are all the same in 2 diferent segments, Then move the value from ZP2.14 from the 2nd segment into the first segment, and then delete the 2nd ZP2 segment.

Note: there could be many more ZP2 segments with all different values. Some will have a match and need this transformation, some will not.

So for the example above, the outbound ZP2 segments should look like this:

ZP2|1|P|30|O|FAM||||||||1000|2000|22|||Coinsurance Out of Network|EXCLUDES DEDUCTIBLE|||
ZP2|1|P|60|O|IND||||||||1000|2000|22|||Coinsurance Out of Network|EXCLUDES DEDUCTIBLE|||

Ultimately what we are trying to do is call a stored procedure for each ZP2 segment, but when that ZP2.14 value is not in the same segment it does not work.

I hope all this makes sense. Any guidance getting started on this would be greatly appreciated.
Reply With Quote