<if condition='sendFlag="true"'>
...
But your sample code has other problems.
You can't just take the DTL syntax and put a Set in the beginning to get valid code. You have to use the correct syntax for setting variables and you have to use a method call to return the value of a field.
SET priorityFlag=source.GetValueAt("ORCgrp(1).ORC:Quantitytiming(1).priority")
'Quit' will take you out of a do loop or a for loop to the next level, but an 'if' condition doesn't start a new level so this quit will take you out of the DTL altogether. Remove the quit.
You have to make sure sendFlag is set in the false branch or you will get an <UNDEFINED> error when you test it.
dave
--
You received this message because you are subscribed to the Google Groups "InterSystems: Ensemble in Healthcare Community" group.
To post to this group, send email to Ensemble-in...@googlegroups.com
To unsubscribe from this group, send email to Ensemble-in-Healt...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/Ensemble-in-Healthcare?hl=en
You want to send a message through, unchanged, if your conditions evaluate to true - that is what a rule is for.
One problem is that you want to compare the Scheduled date time to Today and only send it if they are the same (and the time is after 3 AM)
However, you can't do that in a rule because $H isn't valid in a rule.
Therefore, you should create a custom function class and call it from your rule.
The class could be this:
Class test.Functions Extends Ens.Rule.FunctionSet
{
/// Retruns now as a 14 character string YYYMMDDHHMMSS
ClassMethod now() As %String [ CodeMode = expression ]
{
##class(Ens.Util.Time).FormatDateTime("%Y%m%d%H%M%S")
}
}
The rule could be this:
<?xml version="1.0" encoding="UTF-16"?>
<routingRule host="test" name="test" effectiveBeginDateTime="" effectiveEndDateTime="" context="EnsLib.MsgRouter.RoutingEngine" doAll="false" source="" msgClass="" docName="" docCategory="" docType="">
<FullName>test</FullName>
<description></description>
<reportGroup></reportGroup>
<reportName></reportName>
<shortDescription></shortDescription>
<rule source="" msgClass="EnsLib.HL7.Message" docName="" docCategory="2.2" docType="ORM_O01">
<condition join="AND" operator="=" op1="Document.{ORCgrp(1).ORC:Quantitytiming(1).priority}" op2=""M""></condition>
<condition join="AND" operator="=" op1="SubString(Document.{ORCgrp(1).OBRuniongrp.OBRunion.OBR:Scheduleddatetime},1,8)" op2="SubString(now(),1,8)"></condition>
<condition join="AND" operator=">" op1="SubString(Document.{ORCgrp(1).OBRuniongrp.OBRunion.OBR:Scheduleddatetime},9)" op2="SubString(now(),9)"></condition>
</rule>
</routingRule>
Thanks!
Matt Simpson
Information Systems | Inland Imaging Business Associates
Tel: 509.363.7759 | Cell: 509.370.7141 | Fax: 509.363.7082
dave
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.