Run All Business Rules in Router & Combine Results
Hi
We have several rules in router to validate HL7 messages, each rule check a particular field in HL7 message and send back response. We want to run all rules and combine the rules responses into some variable/object and at the end if variable/object is empty it means message is valid, else send the value from this variable/object. This way one message we dont run it again and again, and we can send one message and response will give us combine results from all rules.
For example,
Rule 1 - Check MSH.12 field, Send response "MSH.12 value not valid", and RETURN
Rule 2 - Check PID.3 field, Send response "PID.3 value not valid", and RETURN
Rule 3 - Check PD1.3 field, Send response "PV1.5 value not valid" and RETURN
So we will change the rules a below
Rule 1 - Check MSH.12 field, Add response "MSH.12 value not valid" to some XXX Variable/Object
Rule 2 - Check PID.3 field, Add response "PID.3 value not valid", to some XXX Variable/Object
Rule 3 - Check PD1.3 field, Add response "PV1.5 value not valid" to some XXX Variable/Object
Instead of getting single response, we want to show value from XXX Variable/Object with combine response "MSH.12 value not valid", "PV1.4 value not valid"
any guidance is appreciated.
Thanks