Index: Scheduling/trunk/cs/bsdx0200GUISourceCode/CGView.cs
===================================================================
--- Scheduling/trunk/cs/bsdx0200GUISourceCode/CGView.cs	(revision 1174)
+++ Scheduling/trunk/cs/bsdx0200GUISourceCode/CGView.cs	(revision 1176)
@@ -257,4 +257,5 @@
             this.lblResource = new System.Windows.Forms.Label();
             this.panelCenter = new System.Windows.Forms.Panel();
+            this.calendarGrid1 = new IndianHealthService.ClinicalScheduling.CalendarGrid();
             this.ctxCalendarGrid = new System.Windows.Forms.ContextMenu();
             this.ctxCalGridAdd = new System.Windows.Forms.MenuItem();
@@ -276,5 +277,4 @@
             this.splitter1 = new System.Windows.Forms.Splitter();
             this.splitter2 = new System.Windows.Forms.Splitter();
-            this.calendarGrid1 = new IndianHealthService.ClinicalScheduling.CalendarGrid();
             this.panelRight.SuspendLayout();
             this.panelClip.SuspendLayout();
@@ -879,139 +879,4 @@
             this.panelCenter.Size = new System.Drawing.Size(857, 344);
             this.panelCenter.TabIndex = 7;
-            // 
-            // ctxCalendarGrid
-            // 
-            this.ctxCalendarGrid.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
-            this.ctxCalGridAdd,
-            this.ctxCalGridMkRadAppt,
-            this.ctxCalGridEdit,
-            this.ctxCalGridDelete,
-            this.ctxCalGridCancelRadAppt,
-            this.ctxCalGridCheckIn,
-            this.ctxCalGridUndoCheckin,
-            this.ctxCalGridSep1,
-            this.ctxCalGridNoShow,
-            this.ctxCalGridNoShowUndo,
-            this.ctxCalGridSep2,
-            this.ctxCalGridWalkin,
-            this.ctxCalGridSep3,
-            this.ctxCalGridReprintApptSlip});
-            this.ctxCalendarGrid.Popup += new System.EventHandler(this.ctxCalendarGrid_Popup);
-            // 
-            // ctxCalGridAdd
-            // 
-            this.ctxCalGridAdd.Index = 0;
-            this.ctxCalGridAdd.Text = "Add Appointment";
-            this.ctxCalGridAdd.Click += new System.EventHandler(this.ctxCalGridAdd_Click);
-            // 
-            // ctxCalGridMkRadAppt
-            // 
-            this.ctxCalGridMkRadAppt.Index = 1;
-            this.ctxCalGridMkRadAppt.Text = "Make Radiology Appointment";
-            this.ctxCalGridMkRadAppt.Click += new System.EventHandler(this.ctxCalGridMkRadAppt_Click);
-            // 
-            // ctxCalGridEdit
-            // 
-            this.ctxCalGridEdit.Index = 2;
-            this.ctxCalGridEdit.Text = "Edit Appointment";
-            this.ctxCalGridEdit.Click += new System.EventHandler(this.ctxCalGridEdit_Click);
-            // 
-            // ctxCalGridDelete
-            // 
-            this.ctxCalGridDelete.Index = 3;
-            this.ctxCalGridDelete.Text = "Cancel Appointment";
-            this.ctxCalGridDelete.Click += new System.EventHandler(this.ctxCalGridDelete_Click);
-            // 
-            // ctxCalGridCancelRadAppt
-            // 
-            this.ctxCalGridCancelRadAppt.Index = 4;
-            this.ctxCalGridCancelRadAppt.Text = "Cancel Radiology Appointment";
-            this.ctxCalGridCancelRadAppt.Click += new System.EventHandler(this.ctxCalGridCancelRadAppt_Click);
-            // 
-            // ctxCalGridCheckIn
-            // 
-            this.ctxCalGridCheckIn.Index = 5;
-            this.ctxCalGridCheckIn.Text = "Check In Patient";
-            this.ctxCalGridCheckIn.Click += new System.EventHandler(this.ctxCalGridCheckIn_Click);
-            // 
-            // ctxCalGridUndoCheckin
-            // 
-            this.ctxCalGridUndoCheckin.Index = 6;
-            this.ctxCalGridUndoCheckin.Text = "&Undo Check In";
-            this.ctxCalGridUndoCheckin.Click += new System.EventHandler(this.ctxCalGridUndoCheckin_Click);
-            // 
-            // ctxCalGridSep1
-            // 
-            this.ctxCalGridSep1.Index = 7;
-            this.ctxCalGridSep1.Text = "-";
-            // 
-            // ctxCalGridNoShow
-            // 
-            this.ctxCalGridNoShow.Index = 8;
-            this.ctxCalGridNoShow.Text = "Mark as No Show";
-            this.ctxCalGridNoShow.Click += new System.EventHandler(this.ctxCalGridNoShow_Click);
-            // 
-            // ctxCalGridNoShowUndo
-            // 
-            this.ctxCalGridNoShowUndo.Index = 9;
-            this.ctxCalGridNoShowUndo.Text = "Undo NoShow";
-            this.ctxCalGridNoShowUndo.Click += new System.EventHandler(this.ctxCalGridNoShowUndo_Click);
-            // 
-            // ctxCalGridSep2
-            // 
-            this.ctxCalGridSep2.Index = 10;
-            this.ctxCalGridSep2.Text = "-";
-            // 
-            // ctxCalGridWalkin
-            // 
-            this.ctxCalGridWalkin.Index = 11;
-            this.ctxCalGridWalkin.Text = "Create Wal&k-In Appointment";
-            this.ctxCalGridWalkin.Click += new System.EventHandler(this.ctxCalGridWalkin_Click);
-            // 
-            // ctxCalGridSep3
-            // 
-            this.ctxCalGridSep3.Index = 12;
-            this.ctxCalGridSep3.Text = "-";
-            // 
-            // ctxCalGridReprintApptSlip
-            // 
-            this.ctxCalGridReprintApptSlip.Index = 13;
-            this.ctxCalGridReprintApptSlip.Text = "&Reprint Appointment Slip";
-            this.ctxCalGridReprintApptSlip.Click += new System.EventHandler(this.ctxCalGridReprintApptSlip_Click);
-            // 
-            // panelBottom
-            // 
-            this.panelBottom.Controls.Add(this.statusBar1);
-            this.panelBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
-            this.panelBottom.Location = new System.Drawing.Point(136, 368);
-            this.panelBottom.Name = "panelBottom";
-            this.panelBottom.Size = new System.Drawing.Size(857, 24);
-            this.panelBottom.TabIndex = 8;
-            // 
-            // statusBar1
-            // 
-            this.statusBar1.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.statusBar1.Location = new System.Drawing.Point(0, 0);
-            this.statusBar1.Name = "statusBar1";
-            this.statusBar1.Size = new System.Drawing.Size(857, 24);
-            this.statusBar1.SizingGrip = false;
-            this.statusBar1.TabIndex = 0;
-            // 
-            // splitter1
-            // 
-            this.splitter1.Location = new System.Drawing.Point(128, 24);
-            this.splitter1.Name = "splitter1";
-            this.splitter1.Size = new System.Drawing.Size(8, 368);
-            this.splitter1.TabIndex = 9;
-            this.splitter1.TabStop = false;
-            // 
-            // splitter2
-            // 
-            this.splitter2.Dock = System.Windows.Forms.DockStyle.Right;
-            this.splitter2.Location = new System.Drawing.Point(993, 24);
-            this.splitter2.Name = "splitter2";
-            this.splitter2.Size = new System.Drawing.Size(3, 368);
-            this.splitter2.TabIndex = 10;
-            this.splitter2.TabStop = false;
             // 
             // calendarGrid1
@@ -1044,4 +909,139 @@
             this.calendarGrid1.MouseEnter += new System.EventHandler(this.calendarGrid1_MouseEnter);
             // 
+            // ctxCalendarGrid
+            // 
+            this.ctxCalendarGrid.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
+            this.ctxCalGridAdd,
+            this.ctxCalGridMkRadAppt,
+            this.ctxCalGridEdit,
+            this.ctxCalGridDelete,
+            this.ctxCalGridCancelRadAppt,
+            this.ctxCalGridCheckIn,
+            this.ctxCalGridUndoCheckin,
+            this.ctxCalGridSep1,
+            this.ctxCalGridNoShow,
+            this.ctxCalGridNoShowUndo,
+            this.ctxCalGridSep2,
+            this.ctxCalGridWalkin,
+            this.ctxCalGridSep3,
+            this.ctxCalGridReprintApptSlip});
+            this.ctxCalendarGrid.Popup += new System.EventHandler(this.ctxCalendarGrid_Popup);
+            // 
+            // ctxCalGridAdd
+            // 
+            this.ctxCalGridAdd.Index = 0;
+            this.ctxCalGridAdd.Text = "Add Appointment";
+            this.ctxCalGridAdd.Click += new System.EventHandler(this.ctxCalGridAdd_Click);
+            // 
+            // ctxCalGridMkRadAppt
+            // 
+            this.ctxCalGridMkRadAppt.Index = 1;
+            this.ctxCalGridMkRadAppt.Text = "Make Radiology Appointment";
+            this.ctxCalGridMkRadAppt.Click += new System.EventHandler(this.ctxCalGridMkRadAppt_Click);
+            // 
+            // ctxCalGridEdit
+            // 
+            this.ctxCalGridEdit.Index = 2;
+            this.ctxCalGridEdit.Text = "Edit Appointment";
+            this.ctxCalGridEdit.Click += new System.EventHandler(this.ctxCalGridEdit_Click);
+            // 
+            // ctxCalGridDelete
+            // 
+            this.ctxCalGridDelete.Index = 3;
+            this.ctxCalGridDelete.Text = "Cancel Appointment";
+            this.ctxCalGridDelete.Click += new System.EventHandler(this.ctxCalGridDelete_Click);
+            // 
+            // ctxCalGridCancelRadAppt
+            // 
+            this.ctxCalGridCancelRadAppt.Index = 4;
+            this.ctxCalGridCancelRadAppt.Text = "Cancel Radiology Appointment";
+            this.ctxCalGridCancelRadAppt.Click += new System.EventHandler(this.ctxCalGridCancelRadAppt_Click);
+            // 
+            // ctxCalGridCheckIn
+            // 
+            this.ctxCalGridCheckIn.Index = 5;
+            this.ctxCalGridCheckIn.Text = "Check In Patient";
+            this.ctxCalGridCheckIn.Click += new System.EventHandler(this.ctxCalGridCheckIn_Click);
+            // 
+            // ctxCalGridUndoCheckin
+            // 
+            this.ctxCalGridUndoCheckin.Index = 6;
+            this.ctxCalGridUndoCheckin.Text = "&Undo Check In";
+            this.ctxCalGridUndoCheckin.Click += new System.EventHandler(this.ctxCalGridUndoCheckin_Click);
+            // 
+            // ctxCalGridSep1
+            // 
+            this.ctxCalGridSep1.Index = 7;
+            this.ctxCalGridSep1.Text = "-";
+            // 
+            // ctxCalGridNoShow
+            // 
+            this.ctxCalGridNoShow.Index = 8;
+            this.ctxCalGridNoShow.Text = "Mark as No Show";
+            this.ctxCalGridNoShow.Click += new System.EventHandler(this.ctxCalGridNoShow_Click);
+            // 
+            // ctxCalGridNoShowUndo
+            // 
+            this.ctxCalGridNoShowUndo.Index = 9;
+            this.ctxCalGridNoShowUndo.Text = "Undo NoShow";
+            this.ctxCalGridNoShowUndo.Click += new System.EventHandler(this.ctxCalGridNoShowUndo_Click);
+            // 
+            // ctxCalGridSep2
+            // 
+            this.ctxCalGridSep2.Index = 10;
+            this.ctxCalGridSep2.Text = "-";
+            // 
+            // ctxCalGridWalkin
+            // 
+            this.ctxCalGridWalkin.Index = 11;
+            this.ctxCalGridWalkin.Text = "Create Wal&k-In Appointment";
+            this.ctxCalGridWalkin.Click += new System.EventHandler(this.ctxCalGridWalkin_Click);
+            // 
+            // ctxCalGridSep3
+            // 
+            this.ctxCalGridSep3.Index = 12;
+            this.ctxCalGridSep3.Text = "-";
+            // 
+            // ctxCalGridReprintApptSlip
+            // 
+            this.ctxCalGridReprintApptSlip.Index = 13;
+            this.ctxCalGridReprintApptSlip.Text = "&Reprint Appointment Slip";
+            this.ctxCalGridReprintApptSlip.Click += new System.EventHandler(this.ctxCalGridReprintApptSlip_Click);
+            // 
+            // panelBottom
+            // 
+            this.panelBottom.Controls.Add(this.statusBar1);
+            this.panelBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
+            this.panelBottom.Location = new System.Drawing.Point(136, 368);
+            this.panelBottom.Name = "panelBottom";
+            this.panelBottom.Size = new System.Drawing.Size(857, 24);
+            this.panelBottom.TabIndex = 8;
+            // 
+            // statusBar1
+            // 
+            this.statusBar1.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.statusBar1.Location = new System.Drawing.Point(0, 0);
+            this.statusBar1.Name = "statusBar1";
+            this.statusBar1.Size = new System.Drawing.Size(857, 24);
+            this.statusBar1.SizingGrip = false;
+            this.statusBar1.TabIndex = 0;
+            // 
+            // splitter1
+            // 
+            this.splitter1.Location = new System.Drawing.Point(128, 24);
+            this.splitter1.Name = "splitter1";
+            this.splitter1.Size = new System.Drawing.Size(8, 368);
+            this.splitter1.TabIndex = 9;
+            this.splitter1.TabStop = false;
+            // 
+            // splitter2
+            // 
+            this.splitter2.Dock = System.Windows.Forms.DockStyle.Right;
+            this.splitter2.Location = new System.Drawing.Point(993, 24);
+            this.splitter2.Name = "splitter2";
+            this.splitter2.Size = new System.Drawing.Size(3, 368);
+            this.splitter2.TabIndex = 10;
+            this.splitter2.TabStop = false;
+            // 
             // CGView
             // 
@@ -1402,7 +1402,14 @@
 		private void ctxCalendarGrid_Popup(object sender, System.EventArgs e)
 		{
-            bool bEditAppointments = (EditAppointmentEnabled() && (calendarGrid1.SelectedAppointment > 0)) ;
-
-            if (IsThisARadiologyResource())//this is a radiology resource
+            // our flags
+            bool _findApptsEnabled = (this.Document.Resources.Count > 0) ? true : false;
+            bool _addApptsEnabled = AddAppointmentEnabled();
+            bool _editApptsEnabled = EditAppointmentEnabled();
+            bool _isRadAppt = IsThisARadiologyResource();
+            bool _noShowEnabled = NoShowEnabled();
+            bool _undoCheckinEnabled = UndoCheckinEnabled();
+            //end flags
+
+            if (_isRadAppt)//this is a radiology resource
             {
                 ctxCalGridAdd.Visible = false;
@@ -1439,21 +1446,21 @@
                 ctxCalGridCancelRadAppt.Visible = false;
             }
-
-			//Toggle availability of make, edit, checkin and delete appointments
+           
+			//Toggle availability of make, edit, checkin and delete appointments etc
 			//based on whether appropriate element is selected.
-			ctxCalGridAdd.Enabled = AddAppointmentEnabled();
-			
-			ctxCalGridDelete.Enabled = bEditAppointments;
-			ctxCalGridEdit.Enabled = bEditAppointments;
-			ctxCalGridCheckIn.Enabled = bEditAppointments;
-			ctxCalGridNoShow.Enabled = NoShowEnabled();
-            ctxCalGridNoShowUndo.Enabled = !NoShowEnabled() && calendarGrid1.SelectedAppointment > 0;
-			ctxCalGridWalkin.Enabled = ctxCalGridAdd.Enabled;
-            ctxCalGridReprintApptSlip.Enabled = bEditAppointments;
-            ctxCalGridUndoCheckin.Enabled = UndoCheckinEnabled();
+            ctxCalGridAdd.Enabled = _addApptsEnabled && !_isRadAppt;
+			ctxCalGridWalkin.Enabled = _addApptsEnabled && !_isRadAppt;
+            ctxCalGridEdit.Enabled = _editApptsEnabled && !_isRadAppt;;
+            ctxCalGridDelete.Enabled = _editApptsEnabled && !_isRadAppt;
+
+            ctxCalGridCheckIn.Enabled = _editApptsEnabled && !_isRadAppt;
+            ctxCalGridUndoCheckin.Enabled = _undoCheckinEnabled && !_isRadAppt;
+            ctxCalGridNoShow.Enabled = _noShowEnabled && _editApptsEnabled;
+            ctxCalGridNoShowUndo.Enabled = !_noShowEnabled && _editApptsEnabled;
+            ctxCalGridReprintApptSlip.Enabled = _editApptsEnabled;
 
             //if the rad ones are visible, then these apply
-            ctxCalGridMkRadAppt.Enabled = !bEditAppointments;
-            ctxCalGridCancelRadAppt.Enabled = bEditAppointments;
+            ctxCalGridMkRadAppt.Enabled = _isRadAppt && _addApptsEnabled;
+            ctxCalGridCancelRadAppt.Enabled = _isRadAppt && _editApptsEnabled;
         }
 
@@ -1639,4 +1646,7 @@
                 if (bModAppts == false)
                     return false;
+
+                CGAvailability resultantAvail;
+                m_nSlots = m_Document.SlotsAvailable(dStart, dEnd, sResource, this.calendarGrid1.TimeScale, out resultantAvail);
 
                 bSlotsAvailable = (this.m_nSlots > 0);
@@ -2209,12 +2219,14 @@
             this.calendarGrid1.SelectedAppointment = 0;
 
+            //Now, Cancel the appointment
+            this.Document.DeleteAppointment(a.AppointmentKey);
+
             //Cancel Radiology Exam
             CGDocumentManager.Current.DAL.CancelRadiologyExam(a.PatientID, a.RadiologyExamIEN.Value);
 
-            //Now, Cancel the appointment
-            this.Document.DeleteAppointment(a.AppointmentKey);
-
             //redraw the grid to display new set of appointments after this appt was removed.
             this.UpdateArrays();
+
+            RaiseRPMSEvent("BSDX SCHEDULE", a.Resource);
         }
 
@@ -2630,75 +2642,105 @@
         private void AppointmentAddNewRadiology()
         {
-            DateTime dStart, dEnd;  //return vales for below
-            string sResource;       //ditto
-            int nAccessTypeID = 0;  //ditto
-
-            this.calendarGrid1.GetSelectedTime(out dStart, out dEnd, out sResource);
-            this.calendarGrid1.GetSelectedType(out nAccessTypeID);
-
-            Debug.Assert(sResource != null);
-            Debug.Assert(dStart > DateTime.MinValue);
-
-            //Display a dialog to collect Patient Name
-            DPatientLookup dPat = new DPatientLookup();
-            dPat.DocManager = m_DocManager;
-
-            if (dPat.ShowDialog(this) == DialogResult.Cancel)
+            try
             {
+                DateTime dStart, dEnd;  //return vales for below
+                string sResource;       //ditto
+                int nAccessTypeID = 0;  //ditto
+
+                this.calendarGrid1.GetSelectedTime(out dStart, out dEnd, out sResource);
+                this.calendarGrid1.GetSelectedType(out nAccessTypeID);
+
+                Debug.Assert(sResource != null);
+                Debug.Assert(dStart > DateTime.MinValue);
+
+                //Get Slots
+                CGAvailability resultantAvail;
+                m_nSlots = m_Document.SlotsAvailable(dStart, dEnd, sResource, this.calendarGrid1.TimeScale, out resultantAvail);
+
+                if (m_nSlots < 1)
+                {
+                    DialogResult dr = MessageBox.Show(this, "There are no slots available at the selected time.  Do you want to overbook this appointment?", "Clinical Scheduling", MessageBoxButtons.YesNo);
+                    if (dr != DialogResult.Yes)
+                    {
+                        return;
+                    }
+                }
+
+                //Display a dialog to collect Patient Name
+                DPatientLookup dPat = new DPatientLookup();
+                dPat.DocManager = m_DocManager;
+
+                if (dPat.ShowDialog(this) == DialogResult.Cancel)
+                {
+                    return;
+                }
+
+                int DFN = Int32.Parse(dPat.PatientIEN);
+                // Hospital Location IEN
+                int hlIEN = (from resource in CGDocumentManager.Current.GlobalDataSet.Tables["Resources"].AsEnumerable()
+                             where resource.Field<string>("RESOURCE_NAME") == sResource
+                             select resource.Field<int>("HOSPITAL_LOCATION_ID")).FirstOrDefault();
+
+                //Get Radiology Exams from the DB
+                List<RadiologyExam> _radExams = CGDocumentManager.Current.DAL.GetRadiologyExamsForPatientinHL(DFN, hlIEN);
+
+                //If none found...
+                if (!_radExams.Any())
+                {
+                    MessageBox.Show("Patient does not have any radiology exams to register.");
+                    return;
+                }
+
+                //Display a form for the user to select radiology exams.
+                DRadExamsSelect _radform = new DRadExamsSelect(_radExams);
+
+                if (_radform.ShowDialog() == DialogResult.Cancel) return;
+
+                //Get some return values
+                int _examien = _radform.ExamIEN;
+                string _procedurename = _radform.ProcedureName;
+
+                //Now create and save the appointment
+                CGAppointment appt = new CGAppointment();
+                string _sNote = "Radiology Exam (" + _examien + "): " + _procedurename;
+                appt.CreateAppointment(dStart, dEnd, _sNote, 0, sResource);
+                appt.PatientID = Int32.Parse(dPat.PatientIEN);
+                appt.PatientName = dPat.PatientName;
+                appt.AccessTypeID = nAccessTypeID;
+                appt.RadiologyExamIEN = _examien;
+                appt.Patient = new Patient
+                {
+                    DFN = Convert.ToInt32(dPat.PatientIEN),
+                    ID = dPat.PatientPID,
+                    Name = dPat.PatientName,
+                    HRN = dPat.HealthRecordNumber,
+                    DOB = dPat.PatientDOB
+                };
+
+                this.Document.CreateAppointment(appt);
+
+                //Save Radiology Exam Schedule Info to Radiology Package
+                CGDocumentManager.Current.DAL.ScheduleRadiologyExam(DFN, _examien, dStart);
+
+                //Print Appointment Slip if requested
+                if (_radform.PrintAppointmentSlip) this.PrintAppointmentSlip(appt);
+
+                //Now redraw the grid to display the new appointments
+                this.UpdateArrays();
+
+                //Raise event to other clients
+                RaiseRPMSEvent("BSDX SCHEDULE", appt.Resource);
+            }
+            catch (Exception ex)
+            {
+                string msg;
+                if (BMXNetLib.Piece(ex.Message, "~", 1) == "-10") // -10 means that BSDXAPI reported an error.
+                    msg = BMXNetLib.Piece(ex.Message, "~", 4);
+                else
+                    msg = ex.Message;
+
+                MessageBox.Show("VISTA says: \r\n" + msg, "Unable to Make Appointment");
                 return;
             }
-
-            int DFN = Int32.Parse(dPat.PatientIEN);
-            // Hospital Location IEN
-            int hlIEN = (from resource in CGDocumentManager.Current.GlobalDataSet.Tables["Resources"].AsEnumerable()
-                         where resource.Field<string>("RESOURCE_NAME") == sResource
-                         select resource.Field<int>("HOSPITAL_LOCATION_ID")).FirstOrDefault();
-
-            //Get Radiology Exams from the DB
-            List<RadiologyExam> _radExams = CGDocumentManager.Current.DAL.GetRadiologyExamsForPatientinHL(DFN, hlIEN);
-
-            //If none found...
-            if (!_radExams.Any())
-            {
-                MessageBox.Show("Patient does not have any radiology exams to register.");
-                return;
-            }
-
-            //Display a form for the user to select radiology exams.
-            DRadExamsSelect _radform = new DRadExamsSelect(_radExams);
-
-            if (_radform.ShowDialog() == DialogResult.Cancel) return;
-
-            //Get some return values
-            int _examien = _radform.ExamIEN;
-            string _procedurename = _radform.ProcedureName;
-
-            //Save Radiology Exam Schedule Info to Radiology Package
-            CGDocumentManager.Current.DAL.ScheduleRadiologyExam(DFN, _examien, dStart);
-
-            //Now create and save the appointment
-            CGAppointment appt = new CGAppointment();
-            string _sNote = "Radiology Exam (" + _examien + "): " + _procedurename;
-            appt.CreateAppointment(dStart, dEnd, _sNote, 0, sResource);
-            appt.PatientID = Int32.Parse(dPat.PatientIEN);
-            appt.PatientName = dPat.PatientName;
-            appt.AccessTypeID = nAccessTypeID;
-            appt.RadiologyExamIEN = _examien;
-            appt.Patient = new Patient
-            {
-                DFN = Convert.ToInt32(dPat.PatientIEN),
-                ID = dPat.PatientPID,
-                Name = dPat.PatientName,
-                HRN = dPat.HealthRecordNumber,
-                DOB = dPat.PatientDOB
-            };
-
-            this.Document.CreateAppointment(appt);
-
-            //Print Appointment Slip if requested
-            if (_radform.PrintAppointmentSlip) this.PrintAppointmentSlip(appt);
-
-            //Now redraw the grid to display the new appointments
-            this.UpdateArrays();
         }
 
