define([
    'Global',
    'AppointmentRequest',
    'BookingHeaderView',
    'PatientView',
    'MainView'
],
    function (Global, AppointmentRequest, BookingHeaderView, PatientView, MainView) {
        'use strict';

        var thisView;

        return Backbone.View.extend({
            initialize: function () {
                thisView = this;
            },

            render: function () {
                var $document = $(document),
					noRedraw = $document.jqmData("noRedraw");

				if (noRedraw) {
					$document.jqmData("noRedraw", "");

                    if (!AppointmentRequest.instance().isValid()) {
                        getSidebarContent().find('#below-filter').empty();
                    }
				} else {
					MainView
						.instance()
						.clearView();

					new BookingHeaderView().render();
				}
                return this;
            }
        });
    }
);