class EventQueryParams extends DataQueryParams {

    public boolean timeFieldIsValid()
    {
        if ( timeField == null )
        {
            return true;
        }

        if ( TimeField.fieldIsValid( timeField ) )
        {
            return true;
        }

        if ( program.getTrackedEntityAttributes().stream()
            .anyMatch( at -> at.getValueType().isDate() && timeField.equals( at.getUid() ) ) )
        {
            return true;
        }

        if ( program.getDataElements().stream()
            .anyMatch( de -> de.getValueType().isDate() && timeField.equals( de.getUid() ) ) )
        {
            return true;
        }

        return false;
    }

    private  EventQueryParams();

}