class EventQueryParams extends DataQueryParams {

    public boolean orgUnitFieldIsValid()
    {
        if ( orgUnitField == null )
        {
            return true;
        }

        if ( program != null )
        {
            return validateProgramHasOrgUnitField( program );
        }

        if ( !itemProgramIndicators.isEmpty() )
        {
            // Fail validation if at least one program indicator is invalid

            return !itemProgramIndicators.stream().anyMatch( pi -> !validateProgramHasOrgUnitField( pi.getProgram() ) );
        }

        return false;
    }

    private  EventQueryParams();

}