Previous Topic

Next Topic

Book Contents

Form rule with dynamic query text

The following form rule script checks whether a systolic component of a blood pressure measurement is less than the diastolic component. If the rule fails, the rule calls the AddNamedValue method to issue a query whose text overrides the default query text specified in the Event definition for the rule. This script uses the predefined QUERYTEXT and QUERYSTATE named value pairs:

MeasureItem1 = "0.BPREADINGGROUP.SYSTEXT"
MeasureItem2 = "0.BPREADINGGROUP.DIASTEXT"

Measure1=CInt(Patient.GetValueRF(MeasureItem1,"",0,0,0))
Measure2=CInt(Patient.GetValueRF(MeasureItem2,"",0,0,0))

if (Measure1<Measure2) Then
Result.RulePassed=0
Patient.AddNamedValue “QUERYTEXT”, “Systolic value
must be higher than diastolic”
Patient.AddNamedValue “QUERYSTATE”, “Open”
Else
Result.RulePassed=1
End If

Send Feedback