Skip to main content
Document validation varies by organization, document type, role, market and more. We’ve designed the validation framework to be customizable and extendable, as well as transparent and auditable. As part of the implementation, the validation rules are configured and tested to ensure they conform to the business processes.

Validation Rule Structure

Each validation follows this standard pattern:
{
  rule?: string,     // Name of rule (optional, used for named validations)
  type?: string,     // Type of validation logic (optional)
  valid: boolean,    // Result of validation
  conditions: object | array, // Validation conditions and details
  description?: string // Human-readable description (optional)
}
The conditions can be either:
  • Object: For simple validations with a single condition
  • Array: For complex validations with multiple sub-conditions

Condition Object Structure

When conditions is an object, it contains:
  • valid: boolean indicating if the condition passed
  • type: validation type (e.g., “equals”, “name_fuzzy_match”, “date_difference_lte”, “count_gte”)
  • description: human-readable description of the condition
For example, the validation results for a Hepatitis B vaccination or positive titer may look like so:
    "validations": [
        {
            "rule": "name_match",
            "valid": false,
            "conditions": {
                "type": "name_fuzzy_match",
                "valid": false,
                "description": "Name must match context"
            }
        },
        {
            "rule": "dob_match",
            "valid": false,
            "conditions": {
                "type": "equals",
                "valid": false,
                "description": "Date of birth must match context"
            }
        },
        {
            "type": "any",
            "valid": false,
            "conditions": [
                {
                    "type": "any",
                    "rule": "valid_hepb_dose",
                    "valid": false,
                    "conditions": [
                        {
                            "type": "date_difference_lte",
                            "valid": false,
                            "description": "Must have 2+ doses of Heplisav-B within 180 days"
                        },
                        {
                            "type": "date_difference_lte",
                            "valid": false,
                            "description": "Must have 3+ doses of a hepatitis B vaccine within 180 days"
                        }
                    ]
                },
                {
                    "rule": "valid_hepb_test",
                    "type": "count_gte",
                    "valid": false,
                    "conditions": [
                        {
                            "type": "equals",
                            "valid": false,
                            "description": "Test result must be positive"
                        }
                    ]
                }
            ]
        }
    ]

View and manage validations

From the Configurations and Validation tab in the Admin Dashboard, the validation rules can be managed.
I