there must be something i am doing wrong, i removed all my code and simply wants to return message type value from the msg and debugging it to see the value but somehow its not coming.

Class VALIDATION.RulesFunctionSet Extends Ens.Rule.FunctionSet
{ ClassMethod getPatientClass(pHL7 As EnsLib.HL7.Message) As %String [ Final ]
SET msgType = pHL7.GetValueAt("MSH:MessageType.TriggerEvent")
return msgType

Hi thanks, with routing rules it was easy to enable/disable a validation rule by end users, also the onboarding systems are huge list so better to validate inbound feed before routing msg to the edges productions. 

Response from WRC is 2020 version was HS yet to be updated with parsing mechanism thats why its working for I4H but not on HS.

can you please give some link where i can study building validation & NACK logic in BPL ?

Hi Scott, need another help.  I have code that check a value in HL7 msg and send NACK msg. the code works fine for IRIS For Health but not for HealthShare as %ErrorStatus property not available in HealthShare. Any guidance to fix in the code 

Error coming in compiling the below rules.

Class Hospital.HospitalProd.RoutingRule Extends Ens.Rule.Definition
Parameter RuleAssistClass = "EnsLib.MsgRouter.RuleAssist";
XData RuleDefinition [ XMLNamespace = "]
<ruleDefinition alias="" context="EnsLib.MsgRouter.RoutingEngine" production="Hospital.HospitalProd">
<ruleSet name="" effectiveBegin="" effectiveEnd="">
<rule name="Valid Facility Code Required">
<when condition="Lookup(&quot;OnboardedFacilities&quot;,HL7.{MSH:SendingFacility.NamespaceID},&quot;No&quot;,&quot;No&quot;)!=&quot;Yes&quot;">
<assign property="%ErrorStatus" value="GenerateNACK(&quot;Invalid Sending Facility Code&quot;,%ErrorStatus)"></assign>

Below class compiling on HealthShare

Class Hospital.DHARule Extends Ens.Rule.FunctionSet

ClassMethod GenerateNACK(text As %String, status As %Status) As %Status [ CodeMode = expression, Final ]


Error Msg

@Jeffrey Drumm  any advice on this error,  the same code is working fine on IRIS for Health but on HealthShare giving error.

Class Training.HL7Validation.RoutingRule Extends Ens.Rule.Definition

If i change above statement with below, it compile in studio and error disappears but when i open rule editor  Ens.Rule.Definition comes back and the same error

Class Training.HL7Validation.RoutingRule Extends EnsLib.HL7.MsgRouter.RoutingEngine

Hi thanks actually we don’t want to create multiple instance but on the same instance we will be creating multiple edges where some external systems sending data will have dedicated single edge where some systems will be combined together into a single edge. Not much documentation or best practices available so I reached to this community. So the question is how to design when discussing with external systems that we should create separate edge (SysEdgeA) for System A but for System B & C we should create combined edge (CombinedEdge1).

then later system C comes how we decide CombinedEdge1 is sufficient so include system C in this edge or create another CombinedEdge2, then system D comes we link it to also with CombinedEdge2. Then system E comes we link it to CombinedEdge2, but System F we create again dedicated edge SysEdgeF

so what parameters we use to take these decisions , any help will be appreciated 

Thanks, it worked. Actually i am putting all rules from the specs doc, and generating custom NACK msgs, for example here i have rule, for newborn mother identifier value should not be empty, so 1) DOB is valid,  2) Age is less than 3 days , 3) Mother MRN not empty, then process else send NACK ("For NewBorn Encounters, PID.21 Mother Identifier should not be empty"). Similarly I  have like  30 + rules from specs doc, so adding one by one, learning and getting help from community.  These rules I will put in Edge router before message routes to multiple edges.