[614] | 1 | using System;
|
---|
| 2 | using System.Drawing;
|
---|
| 3 | using System.Collections;
|
---|
| 4 | using System.ComponentModel;
|
---|
| 5 | using System.Windows.Forms;
|
---|
| 6 | using System.Diagnostics;
|
---|
| 7 | using System.Data;
|
---|
| 8 | using System.Data.OleDb;
|
---|
| 9 | using System.IO;
|
---|
| 10 | using System.Runtime.Serialization;
|
---|
| 11 | using System.Runtime.Serialization.Formatters.Binary;
|
---|
| 12 | using IndianHealthService.BMXNet;
|
---|
| 13 |
|
---|
| 14 |
|
---|
| 15 | namespace IndianHealthService.ClinicalScheduling
|
---|
| 16 | {
|
---|
| 17 | /// <summary>
|
---|
| 18 | /// Summary description for CGAVView.
|
---|
| 19 | /// </summary>
|
---|
| 20 | public class CGAVView : System.Windows.Forms.Form
|
---|
| 21 | {
|
---|
| 22 |
|
---|
| 23 |
|
---|
| 24 | public CGAVView()
|
---|
| 25 | {
|
---|
| 26 | //
|
---|
| 27 | // Required for Windows Form Designer support
|
---|
| 28 | //
|
---|
| 29 | InitializeComponent();
|
---|
| 30 |
|
---|
| 31 | //
|
---|
| 32 | // TODO: Add any constructor code after InitializeComponent call
|
---|
| 33 | //
|
---|
| 34 | this.panelRight.Visible = false;
|
---|
| 35 | this.tvSchedules.Visible = false;
|
---|
| 36 | m_ClipList = new CGAppointments();
|
---|
| 37 | }
|
---|
| 38 |
|
---|
| 39 | #region Windows Form Designer generated code
|
---|
| 40 | /// <summary>
|
---|
| 41 | /// Required method for Designer support - do not modify
|
---|
| 42 | /// the contents of this method with the code editor.
|
---|
| 43 | /// </summary>
|
---|
| 44 | private void InitializeComponent()
|
---|
| 45 | {
|
---|
| 46 | this.components = new System.ComponentModel.Container();
|
---|
| 47 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CGAVView));
|
---|
| 48 | this.panelRight = new System.Windows.Forms.Panel();
|
---|
| 49 | this.panelClip = new System.Windows.Forms.Panel();
|
---|
| 50 | this.lstClip = new System.Windows.Forms.ListBox();
|
---|
| 51 | this.ctxApptClipMenu = new System.Windows.Forms.ContextMenu();
|
---|
| 52 | this.mnuRemoveClipItem = new System.Windows.Forms.MenuItem();
|
---|
| 53 | this.mnuClearClipItems = new System.Windows.Forms.MenuItem();
|
---|
| 54 | this.label1 = new System.Windows.Forms.Label();
|
---|
| 55 | this.panelBottom = new System.Windows.Forms.Panel();
|
---|
| 56 | this.statusBar1 = new System.Windows.Forms.StatusBar();
|
---|
| 57 | this.panelTop = new System.Windows.Forms.Panel();
|
---|
| 58 | this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker();
|
---|
| 59 | this.lblResource = new System.Windows.Forms.Label();
|
---|
| 60 | this.panelCenter = new System.Windows.Forms.Panel();
|
---|
| 61 | this.calendarGrid1 = new IndianHealthService.ClinicalScheduling.CalendarGrid();
|
---|
| 62 | this.ctxCalendarGrid = new System.Windows.Forms.ContextMenu();
|
---|
| 63 | this.ctxCalGridAdd = new System.Windows.Forms.MenuItem();
|
---|
| 64 | this.ctxCalGridEdit = new System.Windows.Forms.MenuItem();
|
---|
| 65 | this.ctxCalGridDelete = new System.Windows.Forms.MenuItem();
|
---|
| 66 | this.tvSchedules = new System.Windows.Forms.TreeView();
|
---|
| 67 | this.mainMenu1 = new System.Windows.Forms.MainMenu(this.components);
|
---|
| 68 | this.menuItem1 = new System.Windows.Forms.MenuItem();
|
---|
| 69 | this.mnuLoadTemplate = new System.Windows.Forms.MenuItem();
|
---|
| 70 | this.mnuSaveTemplate = new System.Windows.Forms.MenuItem();
|
---|
| 71 | this.menuItem6 = new System.Windows.Forms.MenuItem();
|
---|
| 72 | this.mnuSchedulingManagment = new System.Windows.Forms.MenuItem();
|
---|
| 73 | this.menuItem5 = new System.Windows.Forms.MenuItem();
|
---|
| 74 | this.mnuClose = new System.Windows.Forms.MenuItem();
|
---|
| 75 | this.mnuAvailability = new System.Windows.Forms.MenuItem();
|
---|
| 76 | this.mnuAddNewAV = new System.Windows.Forms.MenuItem();
|
---|
| 77 | this.mnuRemoveAV = new System.Windows.Forms.MenuItem();
|
---|
| 78 | this.mnuEditAV = new System.Windows.Forms.MenuItem();
|
---|
| 79 | this.mnuCalendar = new System.Windows.Forms.MenuItem();
|
---|
| 80 | this.mnu1Day = new System.Windows.Forms.MenuItem();
|
---|
| 81 | this.mnu5Day = new System.Windows.Forms.MenuItem();
|
---|
| 82 | this.mnu7Day = new System.Windows.Forms.MenuItem();
|
---|
| 83 | this.menuItem7 = new System.Windows.Forms.MenuItem();
|
---|
| 84 | this.mnuTimeScale = new System.Windows.Forms.MenuItem();
|
---|
| 85 | this.mnu10Minute = new System.Windows.Forms.MenuItem();
|
---|
| 86 | this.mnu15Minute = new System.Windows.Forms.MenuItem();
|
---|
| 87 | this.mnu20Minute = new System.Windows.Forms.MenuItem();
|
---|
| 88 | this.mnu30Minute = new System.Windows.Forms.MenuItem();
|
---|
| 89 | this.mnuViewRightPanel = new System.Windows.Forms.MenuItem();
|
---|
| 90 | this.mnuHelp = new System.Windows.Forms.MenuItem();
|
---|
| 91 | this.mnuHelpAbout = new System.Windows.Forms.MenuItem();
|
---|
| 92 | this.splitter1 = new System.Windows.Forms.Splitter();
|
---|
| 93 | this.panelRight.SuspendLayout();
|
---|
| 94 | this.panelClip.SuspendLayout();
|
---|
| 95 | this.panelBottom.SuspendLayout();
|
---|
| 96 | this.panelTop.SuspendLayout();
|
---|
| 97 | this.panelCenter.SuspendLayout();
|
---|
| 98 | this.SuspendLayout();
|
---|
| 99 | //
|
---|
| 100 | // panelRight
|
---|
| 101 | //
|
---|
| 102 | this.panelRight.Controls.Add(this.panelClip);
|
---|
| 103 | this.panelRight.Dock = System.Windows.Forms.DockStyle.Right;
|
---|
| 104 | this.panelRight.Location = new System.Drawing.Point(728, 0);
|
---|
| 105 | this.panelRight.Name = "panelRight";
|
---|
| 106 | this.panelRight.Size = new System.Drawing.Size(120, 450);
|
---|
| 107 | this.panelRight.TabIndex = 1;
|
---|
| 108 | //
|
---|
| 109 | // panelClip
|
---|
| 110 | //
|
---|
| 111 | this.panelClip.Controls.Add(this.lstClip);
|
---|
| 112 | this.panelClip.Controls.Add(this.label1);
|
---|
| 113 | this.panelClip.Dock = System.Windows.Forms.DockStyle.Top;
|
---|
| 114 | this.panelClip.Location = new System.Drawing.Point(0, 0);
|
---|
| 115 | this.panelClip.Name = "panelClip";
|
---|
| 116 | this.panelClip.Size = new System.Drawing.Size(120, 448);
|
---|
| 117 | this.panelClip.TabIndex = 1;
|
---|
| 118 | //
|
---|
| 119 | // lstClip
|
---|
| 120 | //
|
---|
| 121 | this.lstClip.AllowDrop = true;
|
---|
| 122 | this.lstClip.ContextMenu = this.ctxApptClipMenu;
|
---|
| 123 | this.lstClip.DisplayMember = "ToString()";
|
---|
| 124 | this.lstClip.Dock = System.Windows.Forms.DockStyle.Fill;
|
---|
| 125 | this.lstClip.Location = new System.Drawing.Point(0, 32);
|
---|
| 126 | this.lstClip.Name = "lstClip";
|
---|
| 127 | this.lstClip.Size = new System.Drawing.Size(120, 407);
|
---|
| 128 | this.lstClip.TabIndex = 0;
|
---|
| 129 | this.lstClip.DragDrop += new System.Windows.Forms.DragEventHandler(this.lstClip_DragDrop);
|
---|
| 130 | this.lstClip.MouseMove += new System.Windows.Forms.MouseEventHandler(this.lstClip_MouseMove);
|
---|
| 131 | this.lstClip.MouseDown += new System.Windows.Forms.MouseEventHandler(this.lstClip_MouseDown);
|
---|
[616] | 132 | this.lstClip.DragEnter += new System.Windows.Forms.DragEventHandler(this.lstClip_DragEnter);
|
---|
[614] | 133 | //
|
---|
| 134 | // ctxApptClipMenu
|
---|
| 135 | //
|
---|
| 136 | this.ctxApptClipMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
|
---|
| 137 | this.mnuRemoveClipItem,
|
---|
| 138 | this.mnuClearClipItems});
|
---|
| 139 | this.ctxApptClipMenu.Popup += new System.EventHandler(this.ctxApptClipMenu_Popup);
|
---|
| 140 | //
|
---|
| 141 | // mnuRemoveClipItem
|
---|
| 142 | //
|
---|
| 143 | this.mnuRemoveClipItem.Index = 0;
|
---|
| 144 | this.mnuRemoveClipItem.Text = "Remove Item";
|
---|
| 145 | this.mnuRemoveClipItem.Click += new System.EventHandler(this.mnuRemoveClipItem_Click);
|
---|
| 146 | //
|
---|
| 147 | // mnuClearClipItems
|
---|
| 148 | //
|
---|
| 149 | this.mnuClearClipItems.Index = 1;
|
---|
| 150 | this.mnuClearClipItems.Text = "Clear All";
|
---|
| 151 | this.mnuClearClipItems.Click += new System.EventHandler(this.mnuClearClipItems_Click);
|
---|
| 152 | //
|
---|
| 153 | // label1
|
---|
| 154 | //
|
---|
| 155 | this.label1.Dock = System.Windows.Forms.DockStyle.Top;
|
---|
| 156 | this.label1.Location = new System.Drawing.Point(0, 0);
|
---|
| 157 | this.label1.Name = "label1";
|
---|
| 158 | this.label1.Size = new System.Drawing.Size(120, 32);
|
---|
| 159 | this.label1.TabIndex = 1;
|
---|
| 160 | this.label1.Text = "Access Block Clipboard";
|
---|
| 161 | this.label1.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
|
---|
| 162 | //
|
---|
| 163 | // panelBottom
|
---|
| 164 | //
|
---|
| 165 | this.panelBottom.Controls.Add(this.statusBar1);
|
---|
| 166 | this.panelBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
|
---|
| 167 | this.panelBottom.Location = new System.Drawing.Point(8, 426);
|
---|
| 168 | this.panelBottom.Name = "panelBottom";
|
---|
| 169 | this.panelBottom.Size = new System.Drawing.Size(720, 24);
|
---|
| 170 | this.panelBottom.TabIndex = 2;
|
---|
| 171 | //
|
---|
| 172 | // statusBar1
|
---|
| 173 | //
|
---|
| 174 | this.statusBar1.Dock = System.Windows.Forms.DockStyle.Fill;
|
---|
| 175 | this.statusBar1.Location = new System.Drawing.Point(0, 0);
|
---|
| 176 | this.statusBar1.Name = "statusBar1";
|
---|
| 177 | this.statusBar1.Size = new System.Drawing.Size(720, 24);
|
---|
| 178 | this.statusBar1.SizingGrip = false;
|
---|
| 179 | this.statusBar1.TabIndex = 1;
|
---|
| 180 | //
|
---|
| 181 | // panelTop
|
---|
| 182 | //
|
---|
| 183 | this.panelTop.Controls.Add(this.dateTimePicker1);
|
---|
| 184 | this.panelTop.Controls.Add(this.lblResource);
|
---|
| 185 | this.panelTop.Dock = System.Windows.Forms.DockStyle.Top;
|
---|
| 186 | this.panelTop.Location = new System.Drawing.Point(8, 0);
|
---|
| 187 | this.panelTop.Name = "panelTop";
|
---|
| 188 | this.panelTop.Size = new System.Drawing.Size(720, 24);
|
---|
| 189 | this.panelTop.TabIndex = 3;
|
---|
| 190 | //
|
---|
| 191 | // dateTimePicker1
|
---|
| 192 | //
|
---|
| 193 | this.dateTimePicker1.Dock = System.Windows.Forms.DockStyle.Right;
|
---|
| 194 | this.dateTimePicker1.DropDownAlign = System.Windows.Forms.LeftRightAlignment.Right;
|
---|
| 195 | this.dateTimePicker1.Format = System.Windows.Forms.DateTimePickerFormat.Short;
|
---|
| 196 | this.dateTimePicker1.Location = new System.Drawing.Point(592, 0);
|
---|
| 197 | this.dateTimePicker1.Name = "dateTimePicker1";
|
---|
| 198 | this.dateTimePicker1.Size = new System.Drawing.Size(128, 20);
|
---|
| 199 | this.dateTimePicker1.TabIndex = 4;
|
---|
| 200 | this.dateTimePicker1.ValueChanged += new System.EventHandler(this.dateTimePicker1_ValueChanged);
|
---|
| 201 | //
|
---|
| 202 | // lblResource
|
---|
| 203 | //
|
---|
| 204 | this.lblResource.Dock = System.Windows.Forms.DockStyle.Fill;
|
---|
| 205 | this.lblResource.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
---|
| 206 | this.lblResource.ForeColor = System.Drawing.SystemColors.Highlight;
|
---|
| 207 | this.lblResource.Location = new System.Drawing.Point(0, 0);
|
---|
| 208 | this.lblResource.Name = "lblResource";
|
---|
| 209 | this.lblResource.Size = new System.Drawing.Size(720, 24);
|
---|
| 210 | this.lblResource.TabIndex = 3;
|
---|
| 211 | this.lblResource.Text = "lblResource";
|
---|
| 212 | //
|
---|
| 213 | // panelCenter
|
---|
| 214 | //
|
---|
| 215 | this.panelCenter.Controls.Add(this.calendarGrid1);
|
---|
| 216 | this.panelCenter.Dock = System.Windows.Forms.DockStyle.Fill;
|
---|
| 217 | this.panelCenter.Location = new System.Drawing.Point(8, 24);
|
---|
| 218 | this.panelCenter.Name = "panelCenter";
|
---|
| 219 | this.panelCenter.Size = new System.Drawing.Size(712, 402);
|
---|
| 220 | this.panelCenter.TabIndex = 4;
|
---|
| 221 | //
|
---|
| 222 | // calendarGrid1
|
---|
| 223 | //
|
---|
| 224 | this.calendarGrid1.AllowDrop = true;
|
---|
| 225 | this.calendarGrid1.Appointments = null;
|
---|
| 226 | this.calendarGrid1.ApptDragSource = null;
|
---|
| 227 | this.calendarGrid1.AutoScroll = true;
|
---|
| 228 | this.calendarGrid1.AutoScrollMinSize = new System.Drawing.Size(600, 1898);
|
---|
| 229 | this.calendarGrid1.AvailabilityArray = null;
|
---|
| 230 | this.calendarGrid1.BackColor = System.Drawing.SystemColors.Window;
|
---|
| 231 | this.calendarGrid1.Columns = 5;
|
---|
| 232 | this.calendarGrid1.ContextMenu = this.ctxCalendarGrid;
|
---|
| 233 | this.calendarGrid1.Dock = System.Windows.Forms.DockStyle.Fill;
|
---|
| 234 | this.calendarGrid1.DrawWalkIns = true;
|
---|
| 235 | this.calendarGrid1.GridBackColor = "blue";
|
---|
| 236 | this.calendarGrid1.GridEnter = false;
|
---|
| 237 | this.calendarGrid1.Location = new System.Drawing.Point(0, 0);
|
---|
| 238 | this.calendarGrid1.Name = "calendarGrid1";
|
---|
| 239 | this.calendarGrid1.Resources = ((System.Collections.ArrayList)(resources.GetObject("calendarGrid1.Resources")));
|
---|
| 240 | this.calendarGrid1.SelectedAppointment = 0;
|
---|
| 241 | this.calendarGrid1.Size = new System.Drawing.Size(712, 402);
|
---|
| 242 | this.calendarGrid1.StartDate = new System.DateTime(2003, 1, 27, 0, 0, 0, 0);
|
---|
| 243 | this.calendarGrid1.TabIndex = 2;
|
---|
| 244 | this.calendarGrid1.TimeScale = 20;
|
---|
| 245 | this.calendarGrid1.DoubleClick += new System.EventHandler(this.calendarGrid1_DoubleClick);
|
---|
| 246 | this.calendarGrid1.CGSelectionChanged += new IndianHealthService.ClinicalScheduling.CGSelectionChangedHandler(this.calendarGrid1_CGSelectionChanged);
|
---|
| 247 | this.calendarGrid1.CGAppointmentChanged += new IndianHealthService.ClinicalScheduling.CGAppointmentChangedHandler(this.calendarGrid1_CGAppointmentChanged);
|
---|
| 248 | this.calendarGrid1.CGAppointmentAdded += new IndianHealthService.ClinicalScheduling.CGAppointmentChangedHandler(this.calendarGrid1_CGAppointmentAdded);
|
---|
| 249 | //
|
---|
| 250 | // ctxCalendarGrid
|
---|
| 251 | //
|
---|
| 252 | this.ctxCalendarGrid.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
|
---|
| 253 | this.ctxCalGridAdd,
|
---|
| 254 | this.ctxCalGridEdit,
|
---|
| 255 | this.ctxCalGridDelete});
|
---|
| 256 | this.ctxCalendarGrid.Popup += new System.EventHandler(this.ctxCalendarGrid_Popup);
|
---|
| 257 | //
|
---|
| 258 | // ctxCalGridAdd
|
---|
| 259 | //
|
---|
| 260 | this.ctxCalGridAdd.Index = 0;
|
---|
| 261 | this.ctxCalGridAdd.Text = "Add New Access Block";
|
---|
| 262 | this.ctxCalGridAdd.Click += new System.EventHandler(this.ctxCalGridAdd_Click);
|
---|
| 263 | //
|
---|
| 264 | // ctxCalGridEdit
|
---|
| 265 | //
|
---|
| 266 | this.ctxCalGridEdit.Index = 1;
|
---|
| 267 | this.ctxCalGridEdit.Text = "Edit Access Block";
|
---|
| 268 | this.ctxCalGridEdit.Click += new System.EventHandler(this.ctxCalGridEdit_Click);
|
---|
| 269 | //
|
---|
| 270 | // ctxCalGridDelete
|
---|
| 271 | //
|
---|
| 272 | this.ctxCalGridDelete.Index = 2;
|
---|
| 273 | this.ctxCalGridDelete.Text = "Delete Access Block";
|
---|
| 274 | this.ctxCalGridDelete.Click += new System.EventHandler(this.ctxCalGridDelete_Click);
|
---|
| 275 | //
|
---|
| 276 | // tvSchedules
|
---|
| 277 | //
|
---|
| 278 | this.tvSchedules.BackColor = System.Drawing.SystemColors.ControlLight;
|
---|
| 279 | this.tvSchedules.Dock = System.Windows.Forms.DockStyle.Left;
|
---|
| 280 | this.tvSchedules.HotTracking = true;
|
---|
| 281 | this.tvSchedules.Location = new System.Drawing.Point(0, 0);
|
---|
| 282 | this.tvSchedules.Name = "tvSchedules";
|
---|
| 283 | this.tvSchedules.Size = new System.Drawing.Size(8, 450);
|
---|
| 284 | this.tvSchedules.Sorted = true;
|
---|
| 285 | this.tvSchedules.TabIndex = 5;
|
---|
| 286 | //
|
---|
| 287 | // mainMenu1
|
---|
| 288 | //
|
---|
| 289 | this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
|
---|
| 290 | this.menuItem1,
|
---|
| 291 | this.mnuAvailability,
|
---|
| 292 | this.mnuCalendar,
|
---|
| 293 | this.mnuHelp});
|
---|
| 294 | //
|
---|
| 295 | // menuItem1
|
---|
| 296 | //
|
---|
| 297 | this.menuItem1.Index = 0;
|
---|
| 298 | this.menuItem1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
|
---|
| 299 | this.mnuLoadTemplate,
|
---|
| 300 | this.mnuSaveTemplate,
|
---|
| 301 | this.menuItem6,
|
---|
| 302 | this.mnuSchedulingManagment,
|
---|
| 303 | this.menuItem5,
|
---|
| 304 | this.mnuClose});
|
---|
| 305 | this.menuItem1.Text = "&File";
|
---|
| 306 | //
|
---|
| 307 | // mnuLoadTemplate
|
---|
| 308 | //
|
---|
| 309 | this.mnuLoadTemplate.Index = 0;
|
---|
| 310 | this.mnuLoadTemplate.Text = "&Apply Template";
|
---|
| 311 | this.mnuLoadTemplate.Click += new System.EventHandler(this.mnuLoadTemplate_Click);
|
---|
| 312 | //
|
---|
| 313 | // mnuSaveTemplate
|
---|
| 314 | //
|
---|
| 315 | this.mnuSaveTemplate.Index = 1;
|
---|
| 316 | this.mnuSaveTemplate.Text = "&Save Template";
|
---|
| 317 | this.mnuSaveTemplate.Click += new System.EventHandler(this.mnuSaveTemplate_Click);
|
---|
| 318 | //
|
---|
| 319 | // menuItem6
|
---|
| 320 | //
|
---|
| 321 | this.menuItem6.Index = 2;
|
---|
| 322 | this.menuItem6.Text = "-";
|
---|
| 323 | //
|
---|
| 324 | // mnuSchedulingManagment
|
---|
| 325 | //
|
---|
| 326 | this.mnuSchedulingManagment.Index = 3;
|
---|
| 327 | this.mnuSchedulingManagment.Text = "Scheduling &Management";
|
---|
| 328 | this.mnuSchedulingManagment.Click += new System.EventHandler(this.mnuSchedulingManagment_Click);
|
---|
| 329 | //
|
---|
| 330 | // menuItem5
|
---|
| 331 | //
|
---|
| 332 | this.menuItem5.Index = 4;
|
---|
| 333 | this.menuItem5.Text = "-";
|
---|
| 334 | //
|
---|
| 335 | // mnuClose
|
---|
| 336 | //
|
---|
| 337 | this.mnuClose.Index = 5;
|
---|
| 338 | this.mnuClose.Text = "&Close";
|
---|
| 339 | this.mnuClose.Click += new System.EventHandler(this.mnuClose_Click);
|
---|
| 340 | //
|
---|
| 341 | // mnuAvailability
|
---|
| 342 | //
|
---|
| 343 | this.mnuAvailability.Index = 1;
|
---|
| 344 | this.mnuAvailability.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
|
---|
| 345 | this.mnuAddNewAV,
|
---|
| 346 | this.mnuRemoveAV,
|
---|
| 347 | this.mnuEditAV});
|
---|
| 348 | this.mnuAvailability.Text = "&Access Blocks";
|
---|
| 349 | this.mnuAvailability.Popup += new System.EventHandler(this.mnuAvailability_Popup);
|
---|
| 350 | //
|
---|
| 351 | // mnuAddNewAV
|
---|
| 352 | //
|
---|
| 353 | this.mnuAddNewAV.Index = 0;
|
---|
| 354 | this.mnuAddNewAV.Text = "&Add New Block";
|
---|
| 355 | this.mnuAddNewAV.Click += new System.EventHandler(this.mnuAddNewAV_Click);
|
---|
| 356 | //
|
---|
| 357 | // mnuRemoveAV
|
---|
| 358 | //
|
---|
| 359 | this.mnuRemoveAV.Index = 1;
|
---|
| 360 | this.mnuRemoveAV.Text = "&Remove Block";
|
---|
| 361 | this.mnuRemoveAV.Click += new System.EventHandler(this.mnuRemoveAV_Click);
|
---|
| 362 | //
|
---|
| 363 | // mnuEditAV
|
---|
| 364 | //
|
---|
| 365 | this.mnuEditAV.Index = 2;
|
---|
| 366 | this.mnuEditAV.Text = "&Edit Block";
|
---|
| 367 | this.mnuEditAV.Click += new System.EventHandler(this.mnuEditAV_Click);
|
---|
| 368 | //
|
---|
| 369 | // mnuCalendar
|
---|
| 370 | //
|
---|
| 371 | this.mnuCalendar.Index = 2;
|
---|
| 372 | this.mnuCalendar.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
|
---|
| 373 | this.mnu1Day,
|
---|
| 374 | this.mnu5Day,
|
---|
| 375 | this.mnu7Day,
|
---|
| 376 | this.menuItem7,
|
---|
| 377 | this.mnuTimeScale,
|
---|
| 378 | this.mnuViewRightPanel});
|
---|
| 379 | this.mnuCalendar.Text = "&View";
|
---|
| 380 | //
|
---|
| 381 | // mnu1Day
|
---|
| 382 | //
|
---|
| 383 | this.mnu1Day.Index = 0;
|
---|
| 384 | this.mnu1Day.Text = "&1-Day View";
|
---|
| 385 | this.mnu1Day.Click += new System.EventHandler(this.mnu1Day_Click);
|
---|
| 386 | //
|
---|
| 387 | // mnu5Day
|
---|
| 388 | //
|
---|
| 389 | this.mnu5Day.Index = 1;
|
---|
| 390 | this.mnu5Day.Text = "&5-Day View";
|
---|
| 391 | this.mnu5Day.Click += new System.EventHandler(this.mnu5Day_Click);
|
---|
| 392 | //
|
---|
| 393 | // mnu7Day
|
---|
| 394 | //
|
---|
| 395 | this.mnu7Day.Index = 2;
|
---|
| 396 | this.mnu7Day.Text = "&7-Day View";
|
---|
| 397 | this.mnu7Day.Click += new System.EventHandler(this.mnu7Day_Click);
|
---|
| 398 | //
|
---|
| 399 | // menuItem7
|
---|
| 400 | //
|
---|
| 401 | this.menuItem7.Index = 3;
|
---|
| 402 | this.menuItem7.Text = "-";
|
---|
| 403 | //
|
---|
| 404 | // mnuTimeScale
|
---|
| 405 | //
|
---|
| 406 | this.mnuTimeScale.Index = 4;
|
---|
| 407 | this.mnuTimeScale.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
|
---|
| 408 | this.mnu10Minute,
|
---|
| 409 | this.mnu15Minute,
|
---|
| 410 | this.mnu20Minute,
|
---|
| 411 | this.mnu30Minute});
|
---|
| 412 | this.mnuTimeScale.Text = "&Time Scale";
|
---|
| 413 | //
|
---|
| 414 | // mnu10Minute
|
---|
| 415 | //
|
---|
| 416 | this.mnu10Minute.Index = 0;
|
---|
| 417 | this.mnu10Minute.Text = "&10-Minute";
|
---|
| 418 | this.mnu10Minute.Click += new System.EventHandler(this.mnu10Minute_Click);
|
---|
| 419 | //
|
---|
| 420 | // mnu15Minute
|
---|
| 421 | //
|
---|
| 422 | this.mnu15Minute.Index = 1;
|
---|
| 423 | this.mnu15Minute.Text = "&15-Minute";
|
---|
| 424 | this.mnu15Minute.Click += new System.EventHandler(this.mnu15Minute_Click);
|
---|
| 425 | //
|
---|
| 426 | // mnu20Minute
|
---|
| 427 | //
|
---|
| 428 | this.mnu20Minute.Index = 2;
|
---|
| 429 | this.mnu20Minute.Text = "&20-Minute";
|
---|
| 430 | this.mnu20Minute.Click += new System.EventHandler(this.mnu20Minute_Click);
|
---|
| 431 | //
|
---|
| 432 | // mnu30Minute
|
---|
| 433 | //
|
---|
| 434 | this.mnu30Minute.Index = 3;
|
---|
| 435 | this.mnu30Minute.Text = "&30-Minute";
|
---|
| 436 | this.mnu30Minute.Click += new System.EventHandler(this.mnu30Minute_Click);
|
---|
| 437 | //
|
---|
| 438 | // mnuViewRightPanel
|
---|
| 439 | //
|
---|
| 440 | this.mnuViewRightPanel.Index = 5;
|
---|
| 441 | this.mnuViewRightPanel.Text = "&Access Block Clipboard";
|
---|
| 442 | this.mnuViewRightPanel.Click += new System.EventHandler(this.mnuViewRightPanel_Click);
|
---|
| 443 | //
|
---|
| 444 | // mnuHelp
|
---|
| 445 | //
|
---|
| 446 | this.mnuHelp.Index = 3;
|
---|
| 447 | this.mnuHelp.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
|
---|
| 448 | this.mnuHelpAbout});
|
---|
| 449 | this.mnuHelp.Text = "&Help";
|
---|
| 450 | //
|
---|
| 451 | // mnuHelpAbout
|
---|
| 452 | //
|
---|
| 453 | this.mnuHelpAbout.Index = 0;
|
---|
| 454 | this.mnuHelpAbout.Text = "&About";
|
---|
| 455 | this.mnuHelpAbout.Click += new System.EventHandler(this.mnuHelpAbout_Click);
|
---|
| 456 | //
|
---|
| 457 | // splitter1
|
---|
| 458 | //
|
---|
| 459 | this.splitter1.Dock = System.Windows.Forms.DockStyle.Right;
|
---|
| 460 | this.splitter1.Location = new System.Drawing.Point(720, 24);
|
---|
| 461 | this.splitter1.Name = "splitter1";
|
---|
| 462 | this.splitter1.Size = new System.Drawing.Size(8, 402);
|
---|
| 463 | this.splitter1.TabIndex = 6;
|
---|
| 464 | this.splitter1.TabStop = false;
|
---|
| 465 | //
|
---|
| 466 | // CGAVView
|
---|
| 467 | //
|
---|
| 468 | this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
|
---|
| 469 | this.ClientSize = new System.Drawing.Size(848, 450);
|
---|
| 470 | this.Controls.Add(this.panelCenter);
|
---|
| 471 | this.Controls.Add(this.splitter1);
|
---|
| 472 | this.Controls.Add(this.panelTop);
|
---|
| 473 | this.Controls.Add(this.panelBottom);
|
---|
| 474 | this.Controls.Add(this.panelRight);
|
---|
| 475 | this.Controls.Add(this.tvSchedules);
|
---|
| 476 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
---|
| 477 | this.Menu = this.mainMenu1;
|
---|
| 478 | this.Name = "CGAVView";
|
---|
| 479 | this.Text = "CGAVView";
|
---|
[616] | 480 | this.Load += new System.EventHandler(this.CGAVView_Load);
|
---|
[614] | 481 | this.Closing += new System.ComponentModel.CancelEventHandler(this.CGAVView_Closing);
|
---|
| 482 | this.panelRight.ResumeLayout(false);
|
---|
| 483 | this.panelClip.ResumeLayout(false);
|
---|
| 484 | this.panelBottom.ResumeLayout(false);
|
---|
| 485 | this.panelTop.ResumeLayout(false);
|
---|
| 486 | this.panelCenter.ResumeLayout(false);
|
---|
| 487 | this.ResumeLayout(false);
|
---|
| 488 |
|
---|
| 489 | }
|
---|
| 490 | #endregion
|
---|
| 491 |
|
---|
| 492 | private IContainer components;
|
---|
| 493 |
|
---|
| 494 | #region Member Variables
|
---|
| 495 |
|
---|
| 496 | private CGAVDocument m_Document;
|
---|
| 497 | private System.Windows.Forms.Panel panelRight;
|
---|
| 498 | private System.Windows.Forms.Panel panelBottom;
|
---|
| 499 | private System.Windows.Forms.Panel panelTop;
|
---|
| 500 | private System.Windows.Forms.Panel panelCenter;
|
---|
| 501 | private System.Windows.Forms.Label lblResource;
|
---|
| 502 | private System.Windows.Forms.TreeView tvSchedules;
|
---|
| 503 | private System.Windows.Forms.DateTimePicker dateTimePicker1;
|
---|
| 504 | private IndianHealthService.ClinicalScheduling.CalendarGrid calendarGrid1;
|
---|
| 505 | private System.Windows.Forms.StatusBar statusBar1;
|
---|
| 506 | private System.Windows.Forms.MainMenu mainMenu1;
|
---|
| 507 | private System.Windows.Forms.MenuItem mnuAvailability;
|
---|
| 508 | private System.Windows.Forms.MenuItem mnuAddNewAV;
|
---|
| 509 | private System.Windows.Forms.MenuItem mnuRemoveAV;
|
---|
| 510 | private System.Windows.Forms.MenuItem mnuEditAV;
|
---|
| 511 | private System.Windows.Forms.MenuItem menuItem1;
|
---|
| 512 | private System.Windows.Forms.MenuItem mnuSchedulingManagment;
|
---|
| 513 | private System.Windows.Forms.MenuItem menuItem5;
|
---|
| 514 | private System.Windows.Forms.MenuItem menuItem6;
|
---|
| 515 | private System.Windows.Forms.MenuItem mnuClose;
|
---|
| 516 | private System.Windows.Forms.MenuItem mnuHelp;
|
---|
| 517 | private System.Windows.Forms.MenuItem mnuHelpAbout;
|
---|
| 518 | private System.Windows.Forms.MenuItem mnuLoadTemplate;
|
---|
| 519 | private System.Windows.Forms.MenuItem mnuSaveTemplate;
|
---|
| 520 | private System.Windows.Forms.Panel panelClip;
|
---|
| 521 | private System.Windows.Forms.ListBox lstClip;
|
---|
| 522 | private System.Windows.Forms.Label label1;
|
---|
| 523 | private System.Windows.Forms.MenuItem mnuCalendar;
|
---|
| 524 | private System.Windows.Forms.MenuItem mnuViewRightPanel;
|
---|
| 525 | private System.Windows.Forms.MenuItem mnuTimeScale;
|
---|
| 526 | private System.Windows.Forms.MenuItem mnu10Minute;
|
---|
| 527 | private System.Windows.Forms.MenuItem mnu15Minute;
|
---|
| 528 | private System.Windows.Forms.MenuItem mnu20Minute;
|
---|
| 529 | private System.Windows.Forms.MenuItem mnu30Minute;
|
---|
| 530 | private System.Windows.Forms.MenuItem menuItem7;
|
---|
| 531 | private System.Windows.Forms.MenuItem mnu1Day;
|
---|
| 532 | private System.Windows.Forms.MenuItem mnu5Day;
|
---|
| 533 | private System.Windows.Forms.MenuItem mnu7Day;
|
---|
| 534 | private System.Windows.Forms.Splitter splitter1;
|
---|
| 535 | private CGDocumentManager m_DocManager;
|
---|
| 536 | private CGAppointments m_ClipList;
|
---|
| 537 | private System.Windows.Forms.ContextMenu ctxApptClipMenu;
|
---|
| 538 | private System.Windows.Forms.MenuItem mnuRemoveClipItem;
|
---|
| 539 | private System.Windows.Forms.MenuItem mnuClearClipItems;
|
---|
| 540 | private System.Windows.Forms.ContextMenu ctxCalendarGrid;
|
---|
| 541 | private System.Windows.Forms.MenuItem ctxCalGridAdd;
|
---|
| 542 | private System.Windows.Forms.MenuItem ctxCalGridEdit;
|
---|
| 543 | private System.Windows.Forms.MenuItem ctxCalGridDelete;
|
---|
| 544 | private bool m_bDragDropStart = false;
|
---|
| 545 |
|
---|
| 546 | #endregion
|
---|
| 547 |
|
---|
| 548 | #region Properties
|
---|
| 549 |
|
---|
| 550 | /// <summary>
|
---|
| 551 | /// Access the CalendarGrid associated with this view
|
---|
| 552 | /// </summary>
|
---|
| 553 | public CalendarGrid CGrid
|
---|
| 554 | {
|
---|
| 555 | get
|
---|
| 556 | {
|
---|
| 557 | return this.calendarGrid1;
|
---|
| 558 | }
|
---|
| 559 | }
|
---|
| 560 | /// <summary>
|
---|
| 561 | /// Accesses the document associated with this view
|
---|
| 562 | /// </summary>
|
---|
| 563 | public CGAVDocument Document
|
---|
| 564 | {
|
---|
| 565 | get
|
---|
| 566 | {
|
---|
| 567 | return this.m_Document;
|
---|
| 568 | }
|
---|
| 569 | set
|
---|
| 570 | {
|
---|
| 571 | this.m_Document = value;
|
---|
| 572 | }
|
---|
| 573 | }
|
---|
| 574 |
|
---|
| 575 | public CGDocumentManager DocManager
|
---|
| 576 | {
|
---|
| 577 | get
|
---|
| 578 | {
|
---|
| 579 | return m_DocManager;
|
---|
| 580 | }
|
---|
| 581 | set
|
---|
| 582 | {
|
---|
| 583 | m_DocManager = value;
|
---|
| 584 | }
|
---|
| 585 |
|
---|
| 586 | }
|
---|
| 587 |
|
---|
| 588 | public CGAppointments AVBlocks
|
---|
| 589 | {
|
---|
| 590 | get
|
---|
| 591 | {
|
---|
| 592 | return this.calendarGrid1.Appointments;
|
---|
| 593 | }
|
---|
| 594 | set
|
---|
| 595 | {
|
---|
| 596 | this.calendarGrid1.Appointments = value;
|
---|
| 597 | }
|
---|
| 598 | }
|
---|
| 599 |
|
---|
| 600 | public DateTime StartDate
|
---|
| 601 | {
|
---|
| 602 | get
|
---|
| 603 | {
|
---|
| 604 | return this.calendarGrid1.StartDate;
|
---|
| 605 | }
|
---|
| 606 | set
|
---|
| 607 | {
|
---|
| 608 | this.calendarGrid1.StartDate = value;
|
---|
| 609 | }
|
---|
| 610 | }
|
---|
| 611 |
|
---|
| 612 | #endregion //Properties
|
---|
| 613 |
|
---|
| 614 | #region Methods
|
---|
| 615 |
|
---|
| 616 | private void RaiseRPMSEvent(string sEvent, string sParams)
|
---|
| 617 | {
|
---|
| 618 | try
|
---|
| 619 | {
|
---|
| 620 | //Signal RPMS to raise an event
|
---|
| 621 | // string sSql;
|
---|
| 622 | // sSql = "BSDX RAISE EVENT^" + sEvent + "^" + sParams + "^^";
|
---|
| 623 | // DataTable dtAppt =m_DocManager.RPMSDataTable(sSql, "RaiseEvent");
|
---|
| 624 | this.m_DocManager.ConnectInfo.RaiseEvent(sEvent, sParams, true);
|
---|
| 625 | }
|
---|
| 626 | catch (Exception ex)
|
---|
| 627 | {
|
---|
| 628 | Debug.Write(ex.Message);
|
---|
| 629 | }
|
---|
| 630 | }
|
---|
| 631 |
|
---|
| 632 | void UpdateStatusBar(DateTime dStart, DateTime dEnd)
|
---|
| 633 | {
|
---|
| 634 | string sMsg = dStart.ToShortTimeString() + " to " + dEnd.ToShortTimeString();
|
---|
| 635 | this.statusBar1.Text = sMsg;
|
---|
| 636 | }
|
---|
| 637 |
|
---|
| 638 | private void AvailabilityEdit()
|
---|
| 639 | {
|
---|
| 640 | try
|
---|
| 641 | {
|
---|
| 642 | int nApptID = this.calendarGrid1.SelectedAppointment;
|
---|
| 643 | if (nApptID != 0)
|
---|
| 644 | {
|
---|
| 645 |
|
---|
| 646 | CGAppointment pAppt = this.Document.AVBlocks.GetAppointment(nApptID);
|
---|
| 647 | DAccessBlock dA = new DAccessBlock();
|
---|
| 648 | dA.InitializePage(pAppt, m_DocManager.GlobalDataSet);
|
---|
| 649 | calendarGrid1.CGToolTip.Active = false;
|
---|
| 650 | if (dA.ShowDialog(this) == DialogResult.Cancel)
|
---|
| 651 | {
|
---|
| 652 | calendarGrid1.CGToolTip.Active = true;
|
---|
| 653 | return;
|
---|
| 654 | }
|
---|
| 655 | calendarGrid1.CGToolTip.Active = true;
|
---|
| 656 | this.Document.DeleteAvailability(nApptID);
|
---|
| 657 | this.Document.CreateAppointment(dA.Appointment);
|
---|
| 658 | this.calendarGrid1.Invalidate();
|
---|
| 659 | this.m_DocManager.UpdateViews((string) this.m_Document.Resources[0], "");
|
---|
| 660 | }
|
---|
| 661 | }
|
---|
| 662 | catch (Exception ex)
|
---|
| 663 | {
|
---|
[620] | 664 | MessageBox.Show("Unable to add new access block " + ex.Message, "Clinical Scheduling");
|
---|
[614] | 665 | return;
|
---|
| 666 | }
|
---|
| 667 | try
|
---|
| 668 | {
|
---|
| 669 | RaiseRPMSEvent("BSDX SCHEDULE", m_Document.DocName);
|
---|
| 670 | this.calendarGrid1.Invalidate();
|
---|
| 671 | }
|
---|
| 672 | catch (Exception ex)
|
---|
| 673 | {
|
---|
| 674 | Debug.Write(ex.Message);
|
---|
| 675 | }
|
---|
| 676 | }
|
---|
| 677 |
|
---|
| 678 | private void AvailabilityAddNew()
|
---|
| 679 | {
|
---|
| 680 | try
|
---|
| 681 | {
|
---|
| 682 | CGAppointment appt = new CGAppointment();
|
---|
| 683 |
|
---|
| 684 | //Get Time and Resource from Selected Cell
|
---|
| 685 | DateTime dStart = DateTime.Today;
|
---|
| 686 | DateTime dEnd = DateTime.Today;
|
---|
| 687 | string sResource = "";
|
---|
| 688 | bool bRet = this.calendarGrid1.GetSelectedTime(out dStart, out dEnd, out sResource);
|
---|
| 689 | if (bRet == false)
|
---|
| 690 | return;
|
---|
| 691 |
|
---|
| 692 | foreach (CGAppointment a in this.Document.m_AVBlocks.AppointmentTable.Values)
|
---|
| 693 | {
|
---|
| 694 | DateTime sStart2 = a.StartTime;
|
---|
| 695 | DateTime sEnd2 = a.EndTime;
|
---|
| 696 | if (CGSchedLib.TimesOverlap(dStart, dEnd, a.StartTime, a.EndTime))
|
---|
| 697 | {
|
---|
[620] | 698 | MessageBox.Show("Access blocks may not overlap.","Clinical Scheduling", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
---|
[614] | 699 | return;
|
---|
| 700 | }
|
---|
| 701 | }
|
---|
| 702 |
|
---|
| 703 | string sNote = "";
|
---|
| 704 | DAccessBlock dA = new DAccessBlock();
|
---|
| 705 | dA.InitializePage(dStart, dEnd, sResource, sNote, this.m_DocManager.GlobalDataSet);
|
---|
| 706 | if (dA.ShowDialog(this) == DialogResult.Cancel)
|
---|
| 707 | {
|
---|
| 708 | return;
|
---|
| 709 | }
|
---|
| 710 | appt.StartTime = dStart;
|
---|
| 711 | appt.EndTime = dEnd;
|
---|
| 712 | appt.Resource = sResource;
|
---|
| 713 | appt.Note = " " + dA.Note; // + ": " + dA.Slots.ToString()+ " Slots";
|
---|
| 714 | appt.AccessTypeID = dA.AccessTypeID;
|
---|
| 715 | appt.Slots = dA.Slots;
|
---|
| 716 |
|
---|
| 717 | //Call Document to add a new appointment
|
---|
| 718 | this.Document.CreateAppointment(appt);
|
---|
| 719 | this.m_DocManager.UpdateViews((string) this.m_Document.Resources[0], "");
|
---|
| 720 | }
|
---|
| 721 | catch (Exception ex)
|
---|
| 722 | {
|
---|
[620] | 723 | MessageBox.Show("Unable to add new access block " + ex.Message, "Clinical Scheduling");
|
---|
[614] | 724 | return;
|
---|
| 725 | }
|
---|
| 726 | try
|
---|
| 727 | {
|
---|
| 728 | RaiseRPMSEvent("BSDX SCHEDULE", m_Document.DocName);
|
---|
| 729 | this.calendarGrid1.Invalidate();
|
---|
| 730 | }
|
---|
| 731 | catch (Exception ex)
|
---|
| 732 | {
|
---|
| 733 | Debug.Write(ex.Message);
|
---|
| 734 | }
|
---|
| 735 | }//End AvailabilityAddNew
|
---|
| 736 |
|
---|
| 737 | private void AppointmentDelete()
|
---|
| 738 | {
|
---|
| 739 | calendarGrid1.CGToolTip.Active = false;
|
---|
| 740 | string sMsg = " this access block?";
|
---|
| 741 | if (calendarGrid1.SelectedAppointments.AppointmentTable.Count > 1)
|
---|
| 742 | sMsg = " these access blocks?";
|
---|
| 743 |
|
---|
[620] | 744 | if (MessageBox.Show("Are you sure you want to delete" + sMsg, "Clinical Scheduling", MessageBoxButtons.YesNo) != DialogResult.Yes)
|
---|
[614] | 745 | {
|
---|
| 746 | calendarGrid1.CGToolTip.Active = true;
|
---|
| 747 | return;
|
---|
| 748 | }
|
---|
| 749 | calendarGrid1.CGToolTip.Active = true;
|
---|
| 750 |
|
---|
| 751 | bool bDeleted = false;
|
---|
| 752 | foreach (CGAppointment a in this.calendarGrid1.SelectedAppointments.AppointmentTable.Values)
|
---|
| 753 | {
|
---|
| 754 | int nApptID = a.AppointmentKey;
|
---|
| 755 | Debug.Assert(nApptID != 0);
|
---|
| 756 | try
|
---|
| 757 | {
|
---|
| 758 | Document.DeleteAvailability(nApptID);
|
---|
| 759 | bDeleted = true;
|
---|
| 760 | }
|
---|
| 761 | catch (Exception ex)
|
---|
| 762 | {
|
---|
[620] | 763 | MessageBox.Show("Unable to delete access block" + ex.Message, "Clinical Scheduling");
|
---|
[614] | 764 | }
|
---|
| 765 | }
|
---|
| 766 | if (bDeleted == true)
|
---|
| 767 | {
|
---|
| 768 | try
|
---|
| 769 | {
|
---|
| 770 | this.m_DocManager.UpdateViews((string) this.m_Document.Resources[0], "");
|
---|
| 771 | RaiseRPMSEvent("BSDX SCHEDULE", m_Document.DocName);
|
---|
| 772 | }
|
---|
| 773 | catch (Exception ex)
|
---|
| 774 | {
|
---|
| 775 | Debug.Write(ex.Message);
|
---|
| 776 | }
|
---|
| 777 | this.calendarGrid1.Invalidate();
|
---|
| 778 | }
|
---|
| 779 | }
|
---|
| 780 |
|
---|
| 781 | private void AccessTypeManage()
|
---|
| 782 | {
|
---|
| 783 | // DAccessType dAT = new DAccessType();
|
---|
| 784 | // dAT.InitializePage(0, this.m_DocManager.GlobalDataSet, this.m_DocManager.ADOConnection);
|
---|
| 785 | // if (dAT.ShowDialog(this) == DialogResult.Cancel)
|
---|
| 786 | // {
|
---|
| 787 | // return;
|
---|
| 788 | // }
|
---|
| 789 | }
|
---|
| 790 |
|
---|
| 791 | private void SchedulingManagement()
|
---|
| 792 | {
|
---|
| 793 | try
|
---|
| 794 | {
|
---|
| 795 | bool bLock = DocManager.ConnectInfo.bmxNetLib.Lock("^BSDXMGR", "+");
|
---|
| 796 | if (bLock == false)
|
---|
| 797 | {
|
---|
| 798 | throw new Exception("Another user is currently in Scheduling Management. Try later.");
|
---|
| 799 | }
|
---|
| 800 |
|
---|
| 801 | DManagement dMgm = new DManagement();
|
---|
| 802 | dMgm.InitializeDialog(this.m_DocManager);
|
---|
| 803 |
|
---|
| 804 | if (dMgm.ShowDialog(this) == DialogResult.Cancel)
|
---|
| 805 | {
|
---|
| 806 | return;
|
---|
| 807 | }
|
---|
| 808 | bLock = DocManager.ConnectInfo.bmxNetLib.Lock("^BSDXMGR", "-");
|
---|
| 809 | }
|
---|
| 810 | catch (Exception ex)
|
---|
| 811 | {
|
---|
[620] | 812 | MessageBox.Show("Scheduling Management Error: " + ex.Message, "Clinical Scheduling");
|
---|
[614] | 813 | }
|
---|
| 814 | }
|
---|
| 815 |
|
---|
| 816 | public void UpdateArrays()
|
---|
| 817 | {
|
---|
| 818 | //TODO: Create these components
|
---|
| 819 | this.calendarGrid1.Resources = this.m_Document.Resources;
|
---|
| 820 | this.calendarGrid1.OnUpdateArrays();
|
---|
| 821 | this.lblResource.Text = this.m_Document.DocName;
|
---|
| 822 |
|
---|
| 823 | }
|
---|
| 824 |
|
---|
| 825 | /// <summary>
|
---|
| 826 | /// Clean up any resources being used.
|
---|
| 827 | /// </summary>
|
---|
| 828 | protected override void Dispose( bool disposing )
|
---|
| 829 | {
|
---|
| 830 | if( disposing )
|
---|
| 831 | {
|
---|
| 832 | if(components != null)
|
---|
| 833 | {
|
---|
| 834 | components.Dispose();
|
---|
| 835 | }
|
---|
| 836 | }
|
---|
| 837 | base.Dispose( disposing );
|
---|
| 838 | }
|
---|
| 839 | #endregion //Methods
|
---|
| 840 |
|
---|
| 841 | #region Events
|
---|
| 842 |
|
---|
| 843 | private void dateTimePicker1_ValueChanged(object sender, System.EventArgs e)
|
---|
| 844 | {
|
---|
| 845 | DateTime dDate = dateTimePicker1.Value;
|
---|
| 846 | dDate = dDate.Date;
|
---|
| 847 | this.Document.SelectedDate = dDate;
|
---|
| 848 | if (this.calendarGrid1.Columns > 1)
|
---|
| 849 | {
|
---|
| 850 | this.StartDate = this.Document.StartDate;
|
---|
| 851 | }
|
---|
| 852 | else
|
---|
| 853 | {
|
---|
| 854 | this.StartDate = this.Document.SelectedDate;
|
---|
| 855 | }
|
---|
| 856 | this.Document.UpdateAllViews();
|
---|
| 857 | this.calendarGrid1.Invalidate();
|
---|
| 858 | }
|
---|
| 859 |
|
---|
| 860 | private void CGAVView_Load(object sender, System.EventArgs e)
|
---|
| 861 | {
|
---|
| 862 | Debug.Assert (this.Document != null);
|
---|
| 863 |
|
---|
| 864 | //Register the view
|
---|
| 865 | CGDocumentManager.Current.RegisterAVDocumentView(this.Document, this);
|
---|
| 866 | this.mnu5Day.Click += new System.EventHandler(this.dateTimePicker1_ValueChanged); // MJL 1/17/2007
|
---|
| 867 | this.mnu7Day.Click += new System.EventHandler(this.dateTimePicker1_ValueChanged);
|
---|
| 868 |
|
---|
| 869 | }
|
---|
| 870 |
|
---|
| 871 | private void CGAVView_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
---|
| 872 | {
|
---|
| 873 | this.calendarGrid1.CloseGrid();
|
---|
| 874 | DocManager.ConnectInfo.bmxNetLib.Lock("^BSDXRES(" + Document.ResourceID.ToString() + ")", "-");
|
---|
| 875 | }
|
---|
| 876 |
|
---|
| 877 | private void calendarGrid1_CGSelectionChanged(object sender, IndianHealthService.ClinicalScheduling.CGSelectionChangedArgs e)
|
---|
| 878 | {
|
---|
| 879 | UpdateStatusBar(e.StartTime, e.EndTime);
|
---|
| 880 | }
|
---|
| 881 |
|
---|
| 882 | private void calendarGrid1_CGAppointmentChanged(object sender, IndianHealthService.ClinicalScheduling.CGAppointmentChangedArgs e)
|
---|
| 883 | {
|
---|
| 884 | try
|
---|
| 885 | {
|
---|
| 886 | // this.DocManager.EnableAutoRefresh(false);
|
---|
| 887 |
|
---|
[620] | 888 | if (MessageBox.Show("Are you sure you want to move this access block?", "Clinical Scheduling", MessageBoxButtons.YesNo) != DialogResult.Yes)
|
---|
[614] | 889 | return;
|
---|
| 890 |
|
---|
| 891 | m_Document.ChangeAppointmentTime(e.Appointment, e.StartTime, e.EndTime, e.Resource);
|
---|
| 892 | this.m_DocManager.UpdateViews((string) this.m_Document.Resources[0], "");
|
---|
| 893 | }
|
---|
| 894 | catch (Exception ex)
|
---|
| 895 | {
|
---|
[620] | 896 | MessageBox.Show("Unable to change access block " + ex.Message, "Clinical Scheduling");
|
---|
[614] | 897 | this.m_DocManager.UpdateViews();
|
---|
| 898 | return;
|
---|
| 899 | }
|
---|
| 900 | finally
|
---|
| 901 | {
|
---|
| 902 | // this.DocManager.EnableAutoRefresh(true);
|
---|
| 903 | }
|
---|
| 904 | try
|
---|
| 905 | {
|
---|
| 906 | RaiseRPMSEvent("BSDX SCHEDULE", m_Document.DocName);
|
---|
| 907 | this.calendarGrid1.Invalidate();
|
---|
| 908 | }
|
---|
| 909 | catch (Exception ex)
|
---|
| 910 | {
|
---|
| 911 | Debug.Write(ex.Message);
|
---|
| 912 | }
|
---|
| 913 | }
|
---|
| 914 |
|
---|
| 915 | private void mnuAddNewAV_Click(object sender, System.EventArgs e)
|
---|
| 916 | {
|
---|
| 917 | AvailabilityAddNew();
|
---|
| 918 | }
|
---|
| 919 |
|
---|
| 920 | private void mnuRemoveAV_Click(object sender, System.EventArgs e)
|
---|
| 921 | {
|
---|
| 922 | this.AppointmentDelete();
|
---|
| 923 | }
|
---|
| 924 |
|
---|
| 925 | private void mnuManageAT_Click(object sender, System.EventArgs e)
|
---|
| 926 | {
|
---|
| 927 | AccessTypeManage();
|
---|
| 928 | }
|
---|
| 929 |
|
---|
| 930 | private void mnuEditAV_Click(object sender, System.EventArgs e)
|
---|
| 931 | {
|
---|
| 932 | AvailabilityEdit();
|
---|
| 933 | }
|
---|
| 934 |
|
---|
| 935 | private void mnuAvailability_Popup(object sender, System.EventArgs e)
|
---|
| 936 | {
|
---|
| 937 | this.mnuAddNewAV.Enabled = (this.calendarGrid1.SelectedRange.Cells.CellCount > 0);
|
---|
| 938 | this.mnuEditAV.Enabled = (this.calendarGrid1.SelectedAppointment > 0);
|
---|
| 939 | this.mnuRemoveAV.Enabled = (this.calendarGrid1.SelectedAppointment > 0);
|
---|
| 940 | }
|
---|
| 941 |
|
---|
| 942 | private void mnuSchedulingManagment_Click(object sender, System.EventArgs e)
|
---|
| 943 | {
|
---|
| 944 | SchedulingManagement();
|
---|
| 945 | }
|
---|
| 946 |
|
---|
| 947 | #endregion //Events
|
---|
| 948 |
|
---|
| 949 | private void mnuClose_Click(object sender, System.EventArgs e)
|
---|
| 950 | {
|
---|
| 951 | DialogResult dr = MessageBox.Show("Are you sure you want to close this schedule?", Application.ProductName, MessageBoxButtons.OKCancel);
|
---|
| 952 | if (dr != DialogResult.OK)
|
---|
| 953 | return;
|
---|
| 954 |
|
---|
| 955 | this.Close();
|
---|
| 956 | }
|
---|
| 957 |
|
---|
| 958 | private void mnuHelpAbout_Click(object sender, System.EventArgs e)
|
---|
| 959 | {
|
---|
[620] | 960 | MessageBox.Show("Clinical Scheduling Version " + Application.ProductVersion, "Clinical Scheduling", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
---|
[614] | 961 | }
|
---|
| 962 |
|
---|
| 963 | private void ImplementMsg()
|
---|
| 964 | {
|
---|
[620] | 965 | MessageBox.Show("Clinical Scheduling", "TODO: Implement this function");
|
---|
[614] | 966 | }
|
---|
| 967 |
|
---|
| 968 | private void mnuLoadTemplate_Click(object sender, System.EventArgs e)
|
---|
| 969 | {
|
---|
| 970 | /*
|
---|
| 971 | * Display dialog to collect:
|
---|
| 972 | * - Number of weeks to apply template
|
---|
| 973 | * - Starting week Monday
|
---|
| 974 | * - Template path & filename
|
---|
| 975 | *
|
---|
| 976 | * for each week,
|
---|
| 977 | * Delete all availability during that week
|
---|
| 978 | * apply the template
|
---|
| 979 | *
|
---|
| 980 | */
|
---|
| 981 | DAccessTemplate dlg = new DAccessTemplate();
|
---|
| 982 | dlg.InitializePage();
|
---|
| 983 | if (dlg.ShowDialog(this) == DialogResult.Cancel)
|
---|
| 984 | {
|
---|
| 985 | return;
|
---|
| 986 | }
|
---|
| 987 |
|
---|
| 988 | try
|
---|
| 989 | {
|
---|
| 990 | OpenFileDialog openFileDialog1 = dlg.FileDialog;
|
---|
| 991 | Stream streamFile;
|
---|
| 992 | if((streamFile = openFileDialog1.OpenFile())== null)
|
---|
| 993 | {
|
---|
| 994 | MessageBox.Show("Unable to open template file.");
|
---|
| 995 | return;
|
---|
| 996 | }
|
---|
| 997 |
|
---|
| 998 | BinaryFormatter formatter = new BinaryFormatter();
|
---|
| 999 | CGAppointments cgaTemp = (CGAppointments) formatter.Deserialize(streamFile);
|
---|
| 1000 | streamFile.Close();
|
---|
| 1001 |
|
---|
| 1002 | DateTime dtStart = dlg.StartDate;
|
---|
| 1003 | int nWeeksToApply = dlg.WeeksToApply;
|
---|
| 1004 | DateTime dtEnd = dtStart.AddDays(6); // or 7?
|
---|
| 1005 | string sResourceID = this.m_Document.ResourceID.ToString();
|
---|
| 1006 | DataTable dt;
|
---|
| 1007 |
|
---|
| 1008 | for (int j=1; j < nWeeksToApply + 1; j++)
|
---|
| 1009 | {
|
---|
| 1010 | //Convert start and end to string
|
---|
[864] | 1011 | //string sStart = dtStart.ToString("M/d/yyyy");
|
---|
| 1012 | //string sEnd = dtEnd.ToString("M/d/yyyy");
|
---|
| 1013 | //i18n
|
---|
| 1014 | string sStart = FMDateTime.Create(dtStart).DateOnly.FMDateString;
|
---|
| 1015 | string sEnd = FMDateTime.Create(dtEnd).DateOnly.FMDateString;
|
---|
[614] | 1016 | //Cancel all existing access blocks in the date range
|
---|
| 1017 | string sSql = "BSDX CANCEL AV BY DATE^" + sResourceID + "^" + sStart + "^" + sEnd;
|
---|
| 1018 | dt = this.m_DocManager.RPMSDataTable(sSql, "Cancelled");
|
---|
| 1019 |
|
---|
| 1020 | //for each CGAppointment in AVBlocks, call AddNew
|
---|
| 1021 | string sResource = "";
|
---|
| 1022 | sResource = (string) this.Document.Resources[0];
|
---|
| 1023 | foreach (CGAppointment a in cgaTemp.AppointmentTable.Values)
|
---|
| 1024 | {
|
---|
| 1025 | //Change the resource to the current one
|
---|
| 1026 | a.Resource = sResource;
|
---|
| 1027 |
|
---|
| 1028 | //Change the date to correspond to the GridColumn member
|
---|
| 1029 | int col = a.GridColumn;
|
---|
| 1030 | col--;
|
---|
| 1031 | DateTime dBuildDate = dtStart.Date;
|
---|
| 1032 | dBuildDate = dBuildDate.AddDays(col);
|
---|
| 1033 | dBuildDate = dBuildDate.AddHours(a.StartTime.Hour);
|
---|
| 1034 | dBuildDate = dBuildDate.AddMinutes(a.StartTime.Minute);
|
---|
| 1035 | a.StartTime = dBuildDate;
|
---|
| 1036 | dBuildDate = dtStart.Date;
|
---|
| 1037 | dBuildDate = dBuildDate.AddDays(col);
|
---|
| 1038 | dBuildDate = dBuildDate.AddHours(a.EndTime.Hour);
|
---|
| 1039 | dBuildDate = dBuildDate.AddMinutes(a.EndTime.Minute);
|
---|
| 1040 | a.EndTime = dBuildDate;
|
---|
| 1041 |
|
---|
| 1042 | //Call Document to add a new appointment
|
---|
| 1043 | this.Document.CreateAppointmentAuto(a);
|
---|
| 1044 | }
|
---|
| 1045 |
|
---|
| 1046 | //Increment start and end
|
---|
| 1047 | dtStart = dtStart.AddDays(7);
|
---|
| 1048 | dtEnd = dtStart.AddDays(6);
|
---|
| 1049 |
|
---|
| 1050 | }//end for
|
---|
| 1051 | try
|
---|
| 1052 | {
|
---|
| 1053 | RaiseRPMSEvent("BSDX SCHEDULE", m_Document.DocName);
|
---|
| 1054 | }
|
---|
| 1055 | catch (Exception ex)
|
---|
| 1056 | {
|
---|
| 1057 | Debug.Write(ex.Message);
|
---|
| 1058 | }
|
---|
| 1059 | this.calendarGrid1.Invalidate();
|
---|
| 1060 | this.m_DocManager.UpdateViews((string) this.m_Document.Resources[0], "");
|
---|
| 1061 | }
|
---|
| 1062 | catch (Exception ex)
|
---|
| 1063 | {
|
---|
[620] | 1064 | MessageBox.Show(this, "Error loading template: " + ex.Message, "Clinical Scheduling", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
---|
[614] | 1065 | }
|
---|
| 1066 | }
|
---|
| 1067 |
|
---|
| 1068 | //Check that there are no blocks in document
|
---|
| 1069 | // if (this.Document.AVBlocks.AppointmentTable.Count > 0)
|
---|
| 1070 | // {
|
---|
| 1071 | // Exception bmxex = new Exception("You may not load a template if there are already access blocks defined for the week.");
|
---|
| 1072 | // throw bmxex;
|
---|
| 1073 | // }
|
---|
| 1074 | // OpenFileDialog openFileDialog1 = new OpenFileDialog();
|
---|
| 1075 | // string sPath = "";
|
---|
| 1076 | // sPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
|
---|
| 1077 | //
|
---|
| 1078 | // openFileDialog1.InitialDirectory = "c:\\" ;
|
---|
| 1079 | // openFileDialog1.InitialDirectory = sPath ;
|
---|
| 1080 | // openFileDialog1.Filter = "Schedule Template Files (*.bsdxa)|*.bsdxa|All files (*.*)|*.*" ;
|
---|
| 1081 | // openFileDialog1.FilterIndex = 0 ;
|
---|
| 1082 | // openFileDialog1.RestoreDirectory = true ;
|
---|
| 1083 |
|
---|
| 1084 | // Stream streamFile;
|
---|
| 1085 | // if(openFileDialog1.ShowDialog() == DialogResult.OK)
|
---|
| 1086 | // {
|
---|
| 1087 | // if((streamFile = openFileDialog1.OpenFile())!= null)
|
---|
| 1088 | // {
|
---|
| 1089 | // BinaryFormatter formatter = new BinaryFormatter();
|
---|
| 1090 | // CGAppointments cgaTemp = (CGAppointments) formatter.Deserialize(streamFile);
|
---|
| 1091 | // streamFile.Close();
|
---|
| 1092 | //
|
---|
| 1093 | // //for each CGAppointment in AVBlocks, call AddNew
|
---|
| 1094 | // string sResource = "";
|
---|
| 1095 | // sResource = (string) this.Document.Resources[0];
|
---|
| 1096 | // foreach (CGAppointment a in cgaTemp.AppointmentTable.Values)
|
---|
| 1097 | // {
|
---|
| 1098 | // //Change the resource to the current one
|
---|
| 1099 | // a.Resource = sResource;
|
---|
| 1100 | //
|
---|
| 1101 | // //Change the date to correspond to the GridColumn member
|
---|
| 1102 | // int col = a.GridColumn;
|
---|
| 1103 | // Rectangle r = new Rectangle(0,0,0,0);
|
---|
| 1104 | // int row = 5;
|
---|
| 1105 | // CGCell c = new CGCell(r, row, col);
|
---|
| 1106 | // DateTime dTemp = this.calendarGrid1.GetTimeFromCell(c);
|
---|
| 1107 | // DateTime dBuildDate = dTemp.Date;
|
---|
| 1108 | // dBuildDate = dBuildDate.AddHours(a.StartTime.Hour);
|
---|
| 1109 | // dBuildDate = dBuildDate.AddMinutes(a.StartTime.Minute);
|
---|
| 1110 | // a.StartTime = dBuildDate;
|
---|
| 1111 | // dBuildDate = dTemp.Date;
|
---|
| 1112 | // dBuildDate = dBuildDate.AddHours(a.EndTime.Hour);
|
---|
| 1113 | // dBuildDate = dBuildDate.AddMinutes(a.EndTime.Minute);
|
---|
| 1114 | // a.EndTime = dBuildDate;
|
---|
| 1115 | //
|
---|
| 1116 | // //Call Document to add a new appointment
|
---|
| 1117 | // this.Document.CreateAppointment(a);
|
---|
| 1118 | // }
|
---|
| 1119 | // try
|
---|
| 1120 | // {
|
---|
| 1121 | // RaiseRPMSEvent("SCHEDULE-" + m_Document.DocName, "");
|
---|
| 1122 | // }
|
---|
| 1123 | // catch (Exception ex)
|
---|
| 1124 | // {
|
---|
| 1125 | // Debug.Write(ex.Message);
|
---|
| 1126 | // }
|
---|
| 1127 | // this.calendarGrid1.Invalidate();
|
---|
| 1128 | // this.m_DocManager.UpdateViews((string) this.m_Document.Resources[0], "");
|
---|
| 1129 | // }
|
---|
| 1130 | // }
|
---|
| 1131 | // }//end try
|
---|
| 1132 | // catch (Exception ex)
|
---|
| 1133 | // {
|
---|
[620] | 1134 | // MessageBox.Show(this, "Error loading template: " + ex.Message, "Clinical Scheduling", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
---|
[614] | 1135 | // }
|
---|
| 1136 | // }
|
---|
| 1137 |
|
---|
| 1138 | private void mnuSaveTemplate_Click(object sender, System.EventArgs e)
|
---|
| 1139 | {
|
---|
| 1140 | try
|
---|
| 1141 | {
|
---|
| 1142 | //Check that there is at least one block in document
|
---|
| 1143 | // if (this.Document.AVBlocks.AppointmentTable.Count == 0)
|
---|
| 1144 | // {
|
---|
| 1145 | // Exception bmxex = new Exception("You may not save a template if there are no access blocks defined for the week.");
|
---|
| 1146 | // throw bmxex;
|
---|
| 1147 | // }
|
---|
| 1148 |
|
---|
| 1149 | Stream streamFile ;
|
---|
| 1150 | SaveFileDialog saveFileDialog1 = new SaveFileDialog();
|
---|
| 1151 |
|
---|
| 1152 | saveFileDialog1.Filter = "Schedule Template Files (*.bsdxa)|*.bsdxa|All files (*.*)|*.*" ;
|
---|
| 1153 | saveFileDialog1.FilterIndex = 0 ;
|
---|
| 1154 | saveFileDialog1.RestoreDirectory = true ;
|
---|
| 1155 | saveFileDialog1.AddExtension = true;
|
---|
| 1156 | saveFileDialog1.DefaultExt = "bsdxa";
|
---|
| 1157 |
|
---|
| 1158 | //Iterate through AVBlocks and set the GridColumn member based on the date
|
---|
| 1159 | foreach (CGAppointment a in this.Document.AVBlocks.AppointmentTable.Values)
|
---|
| 1160 | {
|
---|
| 1161 | //Get the column by subtracting the grid's Start day from dStart.
|
---|
| 1162 | int col =(int) a.StartTime.DayOfWeek - (int) this.calendarGrid1.StartDate.DayOfWeek + 1;
|
---|
| 1163 | a.GridColumn = col;
|
---|
| 1164 | }
|
---|
| 1165 |
|
---|
| 1166 | if(saveFileDialog1.ShowDialog() == DialogResult.OK)
|
---|
| 1167 | {
|
---|
| 1168 | if((streamFile = saveFileDialog1.OpenFile()) != null)
|
---|
| 1169 | {
|
---|
| 1170 | BinaryFormatter formatter = new BinaryFormatter();
|
---|
| 1171 |
|
---|
| 1172 | formatter.Serialize(streamFile, this.Document.AVBlocks);
|
---|
| 1173 |
|
---|
| 1174 | streamFile.Close();
|
---|
| 1175 | }
|
---|
| 1176 | }
|
---|
| 1177 | }
|
---|
| 1178 | catch (Exception ex)
|
---|
| 1179 | {
|
---|
[620] | 1180 | MessageBox.Show(this, "Error saving template: " + ex.Message, "Clinical Scheduling", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
---|
[614] | 1181 | }
|
---|
| 1182 | }
|
---|
| 1183 |
|
---|
| 1184 | private void mnuViewRightPanel_Click(object sender, System.EventArgs e)
|
---|
| 1185 | {
|
---|
| 1186 | this.mnuViewRightPanel.Checked = this.panelRight.Visible;
|
---|
| 1187 | this.panelRight.Visible = !(this.panelRight.Visible);
|
---|
| 1188 | this.mnuViewRightPanel.Checked = !(this.mnuViewRightPanel.Checked);
|
---|
| 1189 | }
|
---|
| 1190 |
|
---|
| 1191 | private void lstClip_DragDrop(object sender, System.Windows.Forms.DragEventArgs e)
|
---|
| 1192 | {
|
---|
| 1193 | try
|
---|
| 1194 | {
|
---|
| 1195 | CGAppointment a = (CGAppointment) e.Data.GetData(typeof(CGAppointment));
|
---|
| 1196 | if (m_ClipList.AppointmentTable.Contains((int) a.AppointmentKey))
|
---|
| 1197 | {
|
---|
| 1198 | return;
|
---|
| 1199 | }
|
---|
| 1200 | m_ClipList.AddAppointment(a);
|
---|
| 1201 | lstClip.Items.Add(a);
|
---|
| 1202 | }
|
---|
| 1203 | catch(Exception ex)
|
---|
| 1204 | {
|
---|
| 1205 | Debug.Write(ex.Message);
|
---|
| 1206 | }
|
---|
| 1207 | }
|
---|
| 1208 |
|
---|
| 1209 | private void lstClip_DragEnter(object sender, System.Windows.Forms.DragEventArgs e)
|
---|
| 1210 | {
|
---|
| 1211 | bool b = e.Data.GetDataPresent(typeof(CGAppointment));
|
---|
| 1212 | if (b == true)
|
---|
| 1213 | {
|
---|
| 1214 | e.Effect = DragDropEffects.Move;
|
---|
| 1215 | }
|
---|
| 1216 | else
|
---|
| 1217 | {
|
---|
| 1218 | e.Effect = DragDropEffects.None;
|
---|
| 1219 | }
|
---|
| 1220 | }
|
---|
| 1221 |
|
---|
| 1222 | private void lstClip_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
|
---|
| 1223 | {
|
---|
| 1224 | m_bDragDropStart = false;
|
---|
| 1225 | }
|
---|
| 1226 |
|
---|
| 1227 | private void lstClip_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
|
---|
| 1228 | {
|
---|
| 1229 | try
|
---|
| 1230 | {
|
---|
| 1231 | if ((m_bDragDropStart == false)&&(lstClip.SelectedIndex > -1))
|
---|
| 1232 | {
|
---|
| 1233 | CGAppointment a = (CGAppointment) lstClip.Items[lstClip.SelectedIndex];
|
---|
| 1234 | this.calendarGrid1.ApptDragSource = "list";
|
---|
| 1235 | DragDropEffects effect = DoDragDrop(a, DragDropEffects.Move);
|
---|
| 1236 | m_bDragDropStart = true;
|
---|
| 1237 | }
|
---|
| 1238 | }
|
---|
| 1239 | catch (Exception ex)
|
---|
| 1240 | {
|
---|
| 1241 | Debug.Write(ex.Message);
|
---|
| 1242 | }
|
---|
| 1243 | }
|
---|
| 1244 |
|
---|
| 1245 | private void calendarGrid1_CGAppointmentAdded(object sender, IndianHealthService.ClinicalScheduling.CGAppointmentChangedArgs e)
|
---|
| 1246 | {
|
---|
| 1247 | //CalendarGrid Event raised when appointment is dragdropped onto the grid
|
---|
| 1248 |
|
---|
| 1249 | try
|
---|
| 1250 | {
|
---|
| 1251 | CGAppointment aCopy = new CGAppointment();
|
---|
| 1252 | aCopy.CreateAppointment(e.StartTime, e.EndTime, e.Appointment.Note, 0, e.Resource);
|
---|
| 1253 | aCopy.AccessTypeID = e.AccessTypeID;
|
---|
| 1254 | aCopy.Slots = e.Slots;
|
---|
| 1255 |
|
---|
| 1256 | m_Document.CreateAppointment(aCopy);
|
---|
| 1257 | // RaiseRPMSEvent("SCHEDULE-" + e.Resource , "");
|
---|
| 1258 | this.m_DocManager.UpdateViews(e.Resource, e.OldResource);
|
---|
| 1259 | }
|
---|
| 1260 | catch (Exception ex)
|
---|
| 1261 | {
|
---|
[620] | 1262 | MessageBox.Show("Unable to add new access block " + ex.Message, "Clinical Scheduling");
|
---|
[614] | 1263 | return;
|
---|
| 1264 | }
|
---|
| 1265 | try
|
---|
| 1266 | {
|
---|
| 1267 | RaiseRPMSEvent("BSDX SCHEDULE", m_Document.DocName);
|
---|
| 1268 | if (e.Resource != e.OldResource)
|
---|
| 1269 | RaiseRPMSEvent("BSDX SCHEDULE", m_Document.DocName);
|
---|
| 1270 | this.calendarGrid1.Invalidate();
|
---|
| 1271 | }
|
---|
| 1272 | catch (Exception ex)
|
---|
| 1273 | {
|
---|
| 1274 | Debug.Write(ex.Message);
|
---|
| 1275 | }
|
---|
| 1276 | }
|
---|
| 1277 |
|
---|
| 1278 | #region ctxApptClipMenu Handlers
|
---|
| 1279 |
|
---|
| 1280 | private void ctxApptClipMenu_Popup(object sender, System.EventArgs e)
|
---|
| 1281 | {
|
---|
| 1282 | mnuClearClipItems.Enabled = (m_ClipList.AppointmentTable.Count > 0);
|
---|
| 1283 | mnuRemoveClipItem.Enabled = (lstClip.SelectedIndex > -1);
|
---|
| 1284 | }
|
---|
| 1285 |
|
---|
| 1286 | private void mnuRemoveClipItem_Click(object sender, System.EventArgs e)
|
---|
| 1287 | {
|
---|
| 1288 | int i = lstClip.SelectedIndex;
|
---|
| 1289 | CGAppointment a = (CGAppointment) lstClip.SelectedItem;
|
---|
| 1290 | int nKey = a.AppointmentKey;
|
---|
| 1291 | if (i > -1)
|
---|
| 1292 | {
|
---|
| 1293 | m_ClipList.RemoveAppointment(nKey);
|
---|
| 1294 | lstClip.Items.RemoveAt(i);
|
---|
| 1295 | }
|
---|
| 1296 | }
|
---|
| 1297 |
|
---|
| 1298 | private void mnuClearClipItems_Click(object sender, System.EventArgs e)
|
---|
| 1299 | {
|
---|
| 1300 | this.m_ClipList.ClearAllAppointments();
|
---|
| 1301 | lstClip.Items.Clear();
|
---|
| 1302 | }
|
---|
| 1303 |
|
---|
| 1304 | #endregion ctxApptClipMenu Handlers
|
---|
| 1305 |
|
---|
| 1306 | #region ctxCalGridMenu Handlers
|
---|
| 1307 |
|
---|
| 1308 | private void ctxCalGridAdd_Click(object sender, System.EventArgs e)
|
---|
| 1309 | {
|
---|
| 1310 | AvailabilityAddNew();
|
---|
| 1311 | }
|
---|
| 1312 |
|
---|
| 1313 | private void ctxCalGridEdit_Click(object sender, System.EventArgs e)
|
---|
| 1314 | {
|
---|
| 1315 | AvailabilityEdit();
|
---|
| 1316 | }
|
---|
| 1317 |
|
---|
| 1318 | private void ctxCalGridDelete_Click(object sender, System.EventArgs e)
|
---|
| 1319 | {
|
---|
| 1320 | AppointmentDelete();
|
---|
| 1321 | }
|
---|
| 1322 |
|
---|
| 1323 | private void ctxCalendarGrid_Popup(object sender, System.EventArgs e)
|
---|
| 1324 | {
|
---|
| 1325 | //Toggle availability of make, edit and delete appointments
|
---|
| 1326 | //based on whether appropriate element is selected.
|
---|
| 1327 | ctxCalGridAdd.Enabled = ((calendarGrid1.SelectedRange.Cells.CellCount > 0) );
|
---|
| 1328 | ctxCalGridDelete.Enabled = (calendarGrid1.SelectedAppointment > 0);
|
---|
| 1329 | ctxCalGridEdit.Enabled = (calendarGrid1.SelectedAppointment > 0);
|
---|
| 1330 | }
|
---|
| 1331 |
|
---|
| 1332 | private void calendarGrid1_DoubleClick(object sender, System.EventArgs e)
|
---|
| 1333 | {
|
---|
| 1334 | if (calendarGrid1.SelectedAppointment > 0)
|
---|
| 1335 | AvailabilityEdit();
|
---|
| 1336 | }
|
---|
| 1337 |
|
---|
| 1338 | #endregion ctxCalGridMenu Handlers
|
---|
| 1339 |
|
---|
| 1340 | private void mnu10Minute_Click(object sender, System.EventArgs e)
|
---|
| 1341 | {
|
---|
| 1342 | CalendarGrid cg = this.calendarGrid1;
|
---|
| 1343 | cg.TimeScale = 10;
|
---|
| 1344 | PositionGrid(cg, 7);
|
---|
| 1345 | }
|
---|
| 1346 |
|
---|
| 1347 | private void mnu15Minute_Click(object sender, System.EventArgs e)
|
---|
| 1348 | {
|
---|
| 1349 | CalendarGrid cg = this.calendarGrid1;
|
---|
| 1350 | cg.TimeScale = 15;
|
---|
| 1351 | PositionGrid(cg, 7);
|
---|
| 1352 | }
|
---|
| 1353 |
|
---|
| 1354 | private void mnu20Minute_Click(object sender, System.EventArgs e)
|
---|
| 1355 | {
|
---|
| 1356 | CalendarGrid cg = this.calendarGrid1;
|
---|
| 1357 | cg.TimeScale = 20;
|
---|
| 1358 | PositionGrid(cg, 7);
|
---|
| 1359 | }
|
---|
| 1360 |
|
---|
| 1361 | private void mnu30Minute_Click(object sender, System.EventArgs e)
|
---|
| 1362 | {
|
---|
| 1363 | CalendarGrid cg = this.calendarGrid1;
|
---|
| 1364 | cg.TimeScale = 30;
|
---|
| 1365 | PositionGrid(cg, 7);
|
---|
| 1366 | }
|
---|
| 1367 |
|
---|
| 1368 | private void mnu1Day_Click(object sender, System.EventArgs e)
|
---|
| 1369 | {
|
---|
| 1370 | DateTime dtPicker = dateTimePicker1.Value;
|
---|
| 1371 | DateTime DayOnly = new DateTime(dtPicker.Year, dtPicker.Month, dtPicker.Day);
|
---|
| 1372 | this.calendarGrid1.StartDate = DayOnly;
|
---|
| 1373 | this.calendarGrid1.Columns = 1;
|
---|
| 1374 | }
|
---|
| 1375 |
|
---|
| 1376 | private void mnu5Day_Click(object sender, System.EventArgs e)
|
---|
| 1377 | {
|
---|
| 1378 | if (this.calendarGrid1.Columns == 1)
|
---|
| 1379 | {
|
---|
| 1380 | this.StartDate = this.Document.StartDate;
|
---|
| 1381 | }
|
---|
| 1382 |
|
---|
| 1383 | this.calendarGrid1.Columns = 5;
|
---|
| 1384 | this.Document.UpdateAllViews();
|
---|
| 1385 | }
|
---|
| 1386 |
|
---|
| 1387 | private void mnu7Day_Click(object sender, System.EventArgs e)
|
---|
| 1388 | {
|
---|
| 1389 | this.calendarGrid1.Columns = 7;
|
---|
| 1390 | }
|
---|
| 1391 |
|
---|
| 1392 | private void PositionGrid(CalendarGrid cg, int nHour)
|
---|
| 1393 | {
|
---|
| 1394 | //Position grid to nHour
|
---|
| 1395 | int nRow = 0, nCol = 0;
|
---|
| 1396 | DateTime dStart = DateTime.Today;
|
---|
| 1397 | dStart = dStart.AddHours(nHour);
|
---|
| 1398 | cg.GetCellFromTime(dStart, ref nRow, ref nCol, false, "");
|
---|
| 1399 | int nHeight = cg.CellHeight;
|
---|
| 1400 | nHeight *= nRow;
|
---|
| 1401 | cg.AutoScrollPosition = new Point(50, nHeight);
|
---|
| 1402 | cg.Invalidate();
|
---|
| 1403 | }
|
---|
| 1404 | }
|
---|
| 1405 | }
|
---|