Creating test data
To create a test case:
- Open the Rule window, and click the Test Cases tab.
- In the Expected Result column do one of the following:
- If the rule is a form rule, select Pass or Fail to indicate whether the rule should return a passing or failing value when it processes the accompanying test data.
- If the rule is a calculation or conversion rule, enter the expected result of the calculation.
- In the Input Value 1 column, specify the value of the first argument referenced in the rule script. In subsequent Input Value columns, specify the values of each additional argument referenced by the rule script.
- Repeat these steps to create as many as ten default test cases.
- Save the rule with the Install MedML When Saving option on.
Note: The testing component of the InForm Architect application treats input values as strings. To test nonstring data, you must use VBScript casting functions in your test rule script to cast the input values appropriately. For example, if your script tests an item’s input value against minimum and maximum ranges of integer values, cast each obtained value as an integer by using the CInt function:
val = CInt(Patient.GetValueRF (Patient.GetCurPath(), "", 0,0,0))
If ( val > CInt(Patient.GetArgument("Min")) AND
val < CInt(Patient.GetArgument("Max")) ) Then
Result.RulePassed=1
Else
Result.RulePassed=0
End If
For a list of VBScript casting functions recognized by the InForm Architect application, see the VBS.ini file in the \bin directory of your InForm application installation.