Context anatomy
A rule context consists of:
- A RefName that uniquely identifies the context.
- A key path specifying the item—in its section, form, and visit—to which the rule is applied. The format of a key path varies according to the context type:
Context type
Key path format
Generic Form
RefName path of item, with 0 in the visit position
Generic Item
Generic_Item:itemname
Specific Visit
RefName path of item
- Arguments—Any values that are substituted into the rule script when it runs against the item specified in the key path. For more information, see About arguments.
- Dependencies—Additional items used in the processing of the rule script. For more information, see About rule dependencies.
- Properties—Properties specifying the RefName, help text, and event specific to the context.
A single rule can have many contexts; for example, a rule that tests for range limits can be applied to very different items on multiple forms, passing arguments that are specific to the context each time it is applied. Thus a rule that checks for valid ranges on a height item can use arguments that specify minimum and maximum number of inches in the height context. When the same rule is applied to a pulse rate item, it can use a different set of arguments that specify a minimum and maximum number of heartbeats.
In the InForm Architect application, a context and all of its components are represented as nodes in the Rule window for the rule with which it is associated.
Context definition information appears in the Rule window, as part of the definition of the rule. When you select the Context RefName node in the Rule window, the Properties window reflects the properties of the context:
In addition, the Form window shows the contexts associated with each item. The following figure illustrates:
Note: Only form rules, calculations, and randomization rules have contexts. Conversion rules, which are applied to unit definitions, do not.