Validation Rules

Top  Previous  Next

Crash Magic allows validation rules to be created for data entry. Two types of validations exist Errors and Warnings. An Error will not allow the record to be saved. A warning will alert the user to a problem, but allow the record to be saved.

 

Common validation rules set for Data Entry.

 

Fields for required information:

Error - Primary Street the collision occurred on.
Error - Cross Street, Block or Milepost information is missing.
Error - Date of collision.
Warning - Time has not been entered.

 

Fields that require another field:

Warning - Vehicle total does not match actual vehicle information(Three total vehicles in the collision, but only one vehicle entered).
Waring - Distance and Direction from intersection(If direction is entered there must be a distance).
Waring - Vehicle direction and maneuver(If a maneuver is entered then a direction must also be given).
Error - Crash severity does not match number injured or fatal(Collision severity is fatal, but number killed is 0).
Warning - Pedestrian collision, but pedestrian not entered.
Warning - Cyclist collision, but cyclist not entered.

 

Fields outside of expected range:

Waring - Speed limit greater than 75.
Waring - Speed of vehicle greater than 80.
Waring - Driver age greater than 95.
Waring - Driver age less than 10.

 

 

 

 

 

Current XML definition for data entry validation rules. The purpose of this section is to document the XML structures used by the data entry validation rule. Clients should not alter the XML directly. The XML defines the validation rules used by the client to ensure data is valid on entry.

 

Defining a validation rule

         <ValidationRule>

                 <Expression>Null(AccidentFormDate.value)</Expression>

                 <Explanation>Date is blank</Explanation>

                 <Level>Error</Level>

                 <RelatedFields/>

         </ValidationRule>

Example validation rule

 

Expression - A valid Crash Magic expression that resolves to true or false. Expressions that evaluate to true will cause the validation rule to fire. In the preceding example the value of the data entry field AccidentFormDate is checked for null. Validation rules use standard filter functions.

Explanation - The reason displayed to the user on why the validation rule was triggered.

Level - This can be set to Error or Warning. Error will prevent the record from being saved. Warnings will only display the validation rule to the user.

RelatedFields - This field is reserved for future use.