Changeset 1084 for Scheduling


Ignore:
Timestamp:
Jan 27, 2011, 2:46:45 AM (13 years ago)
Author:
Sam Habiel
Message:

CGDocument: On Delete Appointment, no update done by Document method. View responsible for this request.
CGView:

  1. Drag and Dropped code made to be the same as the rest. Call Document for updating appointments, but not redraw the grid. Drag Drop does not request a refresh directly; but rather, it shoots RPMS events which when they are raised back update the grid.
  2. Fixed bug in Drag and Drop where the source appointment resource is changed before passing it to Document.CreateAppointment() which saves it to the database. This causes the appointments maintained by Document to be temporarily corrupted if CreateAppointment fails during drag and drop.
  3. View calls refershdocumentasync now after Document.DeleteAppointment call.

Last but not least: new version of ClinicalScheduling.exe and BMXNet23.dll (release).

Location:
Scheduling/trunk/cs/bsdx0200GUISourceCode
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/CGDocument.cs

    r1083 r1084  
    799799            sErrorID = r["ERRORID"].ToString();
    800800            if ((sErrorID != "") || (nApptID < 1))
     801            {
    801802                throw new Exception(sErrorID);
     803            }
    802804            aCopy.AppointmentKey = nApptID;
    803805            this.m_appointments.AddAppointment(aCopy);
     
    885887            {
    886888                this.m_appointments.RemoveAppointment(nApptID);
    887                 bool bRet = RefreshAvailabilitySchedule();
    888                 UpdateAllViews();
     889               
     890                // View responsible for deciding to redraw the grid; not the document now.
     891                //bool bRet = RefreshAvailabilitySchedule();
     892                //UpdateAllViews();
    889893            }
    890894            return "";
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/CGView.cs

    r1083 r1084  
    617617            this.tvSchedules.Location = new System.Drawing.Point(0, 0);
    618618            this.tvSchedules.Name = "tvSchedules";
    619             this.tvSchedules.Size = new System.Drawing.Size(128, 290);
     619            this.tvSchedules.Size = new System.Drawing.Size(128, 400);
    620620            this.tvSchedules.Sorted = true;
    621621            this.tvSchedules.TabIndex = 1;
     
    664664            this.panelRight.Location = new System.Drawing.Point(941, 0);
    665665            this.panelRight.Name = "panelRight";
    666             this.panelRight.Size = new System.Drawing.Size(128, 290);
     666            this.panelRight.Size = new System.Drawing.Size(128, 400);
    667667            this.panelRight.TabIndex = 3;
    668668            this.panelRight.Visible = false;
     
    754754            this.lblResource.Size = new System.Drawing.Size(456, 19);
    755755            this.lblResource.TabIndex = 2;
    756             this.lblResource.Text = "lblResource";
    757756            //
    758757            // panelCenter
     
    762761            this.panelCenter.Location = new System.Drawing.Point(136, 24);
    763762            this.panelCenter.Name = "panelCenter";
    764             this.panelCenter.Size = new System.Drawing.Size(802, 242);
     763            this.panelCenter.Size = new System.Drawing.Size(802, 352);
    765764            this.panelCenter.TabIndex = 7;
    766765            //
     
    848847            this.panelBottom.Controls.Add(this.statusBar1);
    849848            this.panelBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
    850             this.panelBottom.Location = new System.Drawing.Point(136, 266);
     849            this.panelBottom.Location = new System.Drawing.Point(136, 376);
    851850            this.panelBottom.Name = "panelBottom";
    852851            this.panelBottom.Size = new System.Drawing.Size(802, 24);
     
    866865            this.splitter1.Location = new System.Drawing.Point(128, 24);
    867866            this.splitter1.Name = "splitter1";
    868             this.splitter1.Size = new System.Drawing.Size(8, 266);
     867            this.splitter1.Size = new System.Drawing.Size(8, 376);
    869868            this.splitter1.TabIndex = 9;
    870869            this.splitter1.TabStop = false;
     
    875874            this.splitter2.Location = new System.Drawing.Point(938, 24);
    876875            this.splitter2.Name = "splitter2";
    877             this.splitter2.Size = new System.Drawing.Size(3, 266);
     876            this.splitter2.Size = new System.Drawing.Size(3, 376);
    878877            this.splitter2.TabIndex = 10;
    879878            this.splitter2.TabStop = false;
     
    903902            this.calendarGrid1.Resources = ((System.Collections.ArrayList)(resources.GetObject("calendarGrid1.Resources")));
    904903            this.calendarGrid1.SelectedAppointment = 0;
    905             this.calendarGrid1.Size = new System.Drawing.Size(802, 242);
     904            this.calendarGrid1.Size = new System.Drawing.Size(802, 352);
    906905            this.calendarGrid1.StartDate = new System.DateTime(2003, 1, 27, 0, 0, 0, 0);
    907906            this.calendarGrid1.TabIndex = 0;
     
    916915            //
    917916            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
    918             this.ClientSize = new System.Drawing.Size(1069, 290);
     917            this.ClientSize = new System.Drawing.Size(1069, 400);
    919918            this.Controls.Add(this.panelCenter);
    920919            this.Controls.Add(this.panelBottom);
     
    18381837                {
    18391838                        calendarGrid1.CGToolTip.Active = false;
    1840                         CGAppointments  alRebookList = new CGAppointments();
     1839                        CGAppointments alRebookList = new CGAppointments();
    18411840
    18421841                        DCancelAppt dCancel = new DCancelAppt();
     
    19021901                                try
    19031902                                {
     1903                    this.UpdateArrays();
    19041904                                        RaiseRPMSEvent("BSDX SCHEDULE" , m_Document.DocName);
     1905
     1906                    //Get the appointments and availabilities, async, from Server. Callback updates this thread's controls.
     1907                    OnUpdateScheduleDelegate ousd = new OnUpdateScheduleDelegate(OnUpdateSchedule);
     1908                    ousd.BeginInvoke(OnUpdateScheduleCallback, null);
    19051909                                }
    19061910                                catch (Exception ex)
     
    21222126                        try
    21232127                        {
    2124                                 CGAppointment appt = new CGAppointment();
     2128                               
    21252129                       
    21262130                                //Get Time and Resource from Selected Cell
     
    21962200                                }
    21972201
     2202                CGAppointment appt = new CGAppointment();
    21982203                                appt.PatientID = Convert.ToInt32(dPat.PatientIEN);
    21992204                                appt.PatientName = dPat.PatientName;
     
    23242329        private void OnUpdateScheduleCallback(IAsyncResult itfAR)
    23252330        {
     2331            // if the view meanwhile closed, just return
     2332            if (this == null) return;
     2333
    23262334            OnUpdateScheduleDelegate d = new OnUpdateScheduleDelegate(UpdateArrays);
    23272335            this.Invoke(d);
     
    27102718                }
    27112719
     2720        /// <summary>
     2721        /// Fired during drag and drop, on the drop action.
     2722        /// </summary>
     2723        /// <param name="sender"></param>
     2724        /// <param name="e"></param>
    27122725                private void calendarGrid1_CGAppointmentChanged(object sender, IndianHealthService.ClinicalScheduling.CGAppointmentChangedArgs e)
    27132726                {
     
    27272740                }
    27282741
     2742                //Can user edit destination resource?
    27292743                                if (EditAppointmentEnabled(e.Resource) == false)
    27302744                                        return;
     2745               
     2746                //Can user edit original schedule?
    27312747                                if (EditAppointmentEnabled(e.Appointment.Resource) == false)
    27322748                                        return;
     
    27722788                                }
    27732789
    2774                                 e.Appointment.StartTime = e.StartTime;
    2775                                 e.Appointment.EndTime = e.EndTime;
    2776                                 e.Appointment.Resource = e.Resource;
    2777                                 e.Appointment.AccessTypeID = e.AccessTypeID;
    2778                                 m_Document.CreateAppointment(e.Appointment);
     2790                //Create a new appointment using old data for patient demographics and note and new data
     2791                //for StartTime, EndTime, Resource, AccessTypeID
     2792                CGAppointment appt = new CGAppointment();
     2793                appt.PatientID = e.Appointment.PatientID;
     2794                appt.PatientName = e.Appointment.PatientName;
     2795                appt.StartTime = e.StartTime;
     2796                appt.EndTime = e.EndTime;
     2797                appt.Resource = e.Resource;
     2798                appt.Note = e.Appointment.Note;
     2799                appt.HealthRecordNumber = e.Appointment.HealthRecordNumber;
     2800                appt.AccessTypeID = e.AccessTypeID;
     2801                this.Document.CreateAppointment(appt);
     2802
     2803                //CGAppointment a = new CGAppointment();
     2804                //a.StartTime = e.StartTime;
     2805                ////e.Appointment.StartTime = e.StartTime
     2806                //a.EndTime = e.EndTime;
     2807                ////e.Appointment.EndTime = e.EndTime;
     2808                //a.Resource = e.Resource;
     2809                ////e.Appointment.Resource = e.Resource;
     2810                //a.AccessTypeID = e.AccessTypeID;
     2811                ////e.Appointment.AccessTypeID = e.AccessTypeID;
     2812                //m_Document.CreateAppointment(a);
    27792813                       
    27802814                               
     
    27902824                        {
    27912825                                MessageBox.Show("Unable to change appointment  " +  ex.Message, "Clinical Scheduling");
    2792                                 this.m_DocManager.UpdateViews();
     2826                                //this.m_DocManager.UpdateViews();
    27932827                                return;
    27942828                        }
    27952829                        finally
    27962830                        {
    2797 
     2831                this.UpdateArrays();
    27982832            }
    27992833                        try
     
    28022836                                if (e.Resource != e.OldResource)
    28032837                                        RaiseRPMSEvent("BSDX SCHEDULE", e.OldResource);
    2804                                 this.m_DocManager.UpdateViews(e.Resource, e.OldResource);
     2838                               
     2839                //That will take too long. Don't do it. Try and see what happens when you come
     2840                //this.m_DocManager.UpdateViews(e.Resource, e.OldResource);
    28052841                        }
    28062842                        catch (Exception ex)
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/ClinicalScheduling.sln

    r1065 r1084  
    1111        EndGlobalSection
    1212        GlobalSection(ProjectConfigurationPlatforms) = postSolution
    13                 {8C05C4F7-FE81-479F-87A0-44E04C7F6E0F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
    14                 {8C05C4F7-FE81-479F-87A0-44E04C7F6E0F}.Debug|Any CPU.Build.0 = Debug|Any CPU
    15                 {8C05C4F7-FE81-479F-87A0-44E04C7F6E0F}.Release|Any CPU.ActiveCfg = Debug|Any CPU
    16                 {8C05C4F7-FE81-479F-87A0-44E04C7F6E0F}.Release|Any CPU.Build.0 = Debug|Any CPU
    17                 {DE8E4CC9-4F3A-4E32-8DFE-EE5692E8FC45}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
    18                 {DE8E4CC9-4F3A-4E32-8DFE-EE5692E8FC45}.Debug|Any CPU.Build.0 = Debug|Any CPU
     13                {8C05C4F7-FE81-479F-87A0-44E04C7F6E0F}.Debug|Any CPU.ActiveCfg = Release|Any CPU
     14                {8C05C4F7-FE81-479F-87A0-44E04C7F6E0F}.Debug|Any CPU.Build.0 = Release|Any CPU
     15                {8C05C4F7-FE81-479F-87A0-44E04C7F6E0F}.Release|Any CPU.ActiveCfg = Release|Any CPU
     16                {8C05C4F7-FE81-479F-87A0-44E04C7F6E0F}.Release|Any CPU.Build.0 = Release|Any CPU
     17                {DE8E4CC9-4F3A-4E32-8DFE-EE5692E8FC45}.Debug|Any CPU.ActiveCfg = Release|Any CPU
     18                {DE8E4CC9-4F3A-4E32-8DFE-EE5692E8FC45}.Debug|Any CPU.Build.0 = Release|Any CPU
    1919                {DE8E4CC9-4F3A-4E32-8DFE-EE5692E8FC45}.Release|Any CPU.ActiveCfg = Release|Any CPU
    2020                {DE8E4CC9-4F3A-4E32-8DFE-EE5692E8FC45}.Release|Any CPU.Build.0 = Release|Any CPU
Note: See TracChangeset for help on using the changeset viewer.