Yuriy,
We solved the exact same problem using a routing rule.
First (rule 1), we use a transform to count the number of FT1 segments,
and populate an 'unused' MSH field (e.g. MSH:18). We also initialize a
second field (e.g. MSH 19) to 1.
You can also do any other needed transforms at this point.
The target for this rule is the business process that is using this
rule.
Rule 2, using the business process as the source, condition
MSH:18<=MSH:19, has two actions.
1. Create a new message, using the FT1 indicated by MSH:19, and
send to the business operation.
2. Create a copy of the original message, increment MSH:19, and
send back to the business process.
This will create a message for each FT1.
The export of the rule:
<?xml version="1.0" encoding="UTF-8"?>
<Export generator="Cache" version="22" zv="Cache for Windows (x86-32)
2008.2 (Build 526U)" ts="2009-06-23 10:14:14">
<Document name="BannerHealth.BprocRISChargeToBanner.rul"><routingRule
host="BannerHealth" name="BprocRISChargeToBanner"
context="BannerHealth.Context" doAll="false" source="" msgClass=""
docName="" docCategory="" docType="">
<description></description>
<rule source="ICCharge.Bproc.Router" msgClass="EnsLib.HL7.Message"
docName="" docCategory="ICCharge" docType="DFT_P03">
<action type="send" target="BannerHealth.Bproc.RISChargeToBanner"
transform="ICCharge.Transforms.UpdateFT1Count"></action>
</rule>
<rule source="BannerHealth.Bproc.RISChargeToBanner"
msgClass="EnsLib.HL7.Message" docName="" docCategory="ICCharge"
docType="DFT_P03">
<condition join="AND" operator="<="
op1="HL7.{MSH:SequenceNumber}"
op2="HL7.{MSH:ContinuationPointer}"></condition>
<action type="send" target="BannerHealth.Bop.ChargeTCP"
transform="BannerHealth.Transforms.RisChargeToBannerCharge"></action>
<action type="send" target="BannerHealth.Bproc.RISChargeToBanner"
transform="ICCharge.Transforms.UpdateFT1Count"></action>
</rule>
</routingRule>
</Document></Export>
-Ben
This electronic transmission and any documents accompanying this electronic transmission may contain information that is confidential and/or legally privileged. The information is intended only for the use of the individual or entity named above. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or the taking of any action in reliance on or regarding the contents of this electronically transmitted information is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this message immediately.