source: Scheduling/trunk/cs/bsdx0200GUISourceCode/DCheckIn.cs@ 1110

Last change on this file since 1110 was 1062, checked in by Sam Habiel, 14 years ago

CGView:

  • Changed the parameters required for checkin.
  • Removed references to PCC+ and Stop Code processing, as they don't apply in VISTA.

CGDocument:

  • Changed RPC call parameters to check in an appointment (BSDX CHECKIN APPOINTMENT).
  • Date passed to BSDX Checkin Appointment is now an FM Date.
  • Both necessitated server side changes.

DCheckIn:

  • Removed processing for PCC+ and Stop Codes.

CGDocumentManager

  • Removed Clinic Stop Code table loading.
File size: 17.0 KB
Line 
1using System;
2using System.Drawing;
3using System.Collections;
4using System.ComponentModel;
5using System.Windows.Forms;
6using System.Data;
7using System.Diagnostics;
8using IndianHealthService.BMXNet;
9
10namespace IndianHealthService.ClinicalScheduling
11{
12 /// <summary>
13 /// Summary description for DCheckIn.
14 /// </summary>
15 public class DCheckIn : System.Windows.Forms.Form
16 {
17 private IContainer components;
18
19 public DCheckIn()
20 {
21 //
22 // Required for Windows Form Designer support
23 //
24 InitializeComponent();
25
26 //
27 // TODO: Add any constructor code after InitializeComponent call
28 //
29 }
30
31
32 #region Fields
33 private System.Windows.Forms.Panel pnlPageBottom;
34 private System.Windows.Forms.Button cmdCancel;
35 private System.Windows.Forms.Button cmdOK;
36 private System.Windows.Forms.Panel pnlDescription;
37 private System.Windows.Forms.GroupBox grpDescriptionResourceGroup;
38 private System.Windows.Forms.Label lblDescriptionResourceGroup;
39 private System.Windows.Forms.Label label1;
40 private System.Windows.Forms.DateTimePicker dtpCheckIn;
41 private System.Windows.Forms.Label lblAlready;
42 private System.Windows.Forms.Label label3;
43 private System.Windows.Forms.Label lblPatientName;
44 private System.Windows.Forms.Label label2;
45 private System.Windows.Forms.ComboBox cboProvider;
46 private System.Windows.Forms.CheckBox chkRoutingSlip;
47
48 private string m_sPatientName;
49 private DateTime m_dCheckIn;
50 private string m_sProvider;
51 private string m_sProviderIEN;
52 private CGDocumentManager m_DocManager;
53 private DataSet m_dsGlobal;
54 private DataTable m_dtProvider;
55 private DataView m_dvCS;
56 private bool m_bProviderRequired;
57 private DataTable m_dtClinic;
58 private DataTable m_dtForm;
59 private DataView m_dvClinic;
60 private DataView m_dvForm;
61 private bool m_bInit;
62 public bool m_bPrintRouteSlip;
63 private ToolTip toolTip1;
64
65 #endregion Fields
66
67 #region Properties
68
69 /// <summary>
70 /// Returns string representation of internal entry number of Provider in PROVIDER File
71 /// </summary>
72 public string ProviderIEN
73 {
74 get
75 {
76 return this.m_sProviderIEN;
77 }
78 }
79
80 /// <summary>
81 /// Returns 'true' if routing slip to be printed; otherwise 'false'
82 /// </summary>
83 public bool PrintRouteSlip
84 {
85 get
86 {
87 return m_bPrintRouteSlip;
88 }
89 }
90
91 /// <summary>
92 /// Appointment checkin time
93 /// </summary>
94 public DateTime CheckInTime
95 {
96 get
97 {
98 return m_dCheckIn;
99 }
100 set
101 {
102 m_dCheckIn = value;
103 }
104 }
105
106 #endregion Properties
107
108 #region Methods
109
110 /// <summary>
111 /// Fill memeber variables before showing dialog
112 /// </summary>
113 /// <param name="a">Appointment</param>
114 /// <param name="docManager">Document Manager</param>
115 /// <param name="sDefaultProvider">Default provider</param>
116 public void InitializePage(CGAppointment a, CGDocumentManager docManager,
117 string sDefaultProvider, int nHospLoc)
118 {
119 m_bInit = true;
120 m_DocManager = docManager;
121 m_dsGlobal = m_DocManager.GlobalDataSet;
122 int nFind = 0;
123
124 //smh new code
125 //if the resource is linked to a valid hospital location, grab this locations providers
126 //from the provider multiple and put them in the combo box.
127 if (nHospLoc != 0)
128 {
129 //RPC BSDX HOSP LOC PROVIDERS returns Table w/ Columns:
130 //HOSPITAL_LOCATION_ID^BMXIEN (ie Prov IEN)^NAME^DEFALUT
131 string sCommandText = "BSDX HOSP LOC PROVIDERS^" + nHospLoc;
132 m_dtProvider = docManager.RPMSDataTable(sCommandText, "ClinicProviders");
133 m_dtProvider.DefaultView.Sort = "NAME ASC";
134
135 cboProvider.DataSource = m_dtProvider;
136 cboProvider.DisplayMember = "NAME";
137 cboProvider.ValueMember = "BMXIEN";
138
139 //Add None to the top of the list
140 DataRow drProv = m_dtProvider.NewRow();
141 drProv.BeginEdit();
142 drProv["HOSPITAL_LOCATION_ID"] = 0;
143 drProv["NAME"] = "<None>";
144 drProv["BMXIEN"] = 0;
145 drProv.EndEdit();
146 m_dtProvider.Rows.InsertAt(drProv, 0);
147 cboProvider.SelectedIndex = 0;
148
149 //Find default provider--search for Yes in Field DEFAULT
150 DataRow[] nRow = m_dtProvider.Select("DEFAULT='YES'", "NAME ASC");
151 if (nRow.Length > 0) nFind = m_dtProvider.Rows.IndexOf(nRow[0]);
152 cboProvider.SelectedIndex = nFind;
153
154 }
155 //otherwise, just use the default provider table
156 else
157 {
158 m_dtProvider = m_dsGlobal.Tables["Provider"];
159 m_dtProvider.DefaultView.Sort = "NAME ASC";
160
161 cboProvider.DataSource = m_dtProvider;
162 cboProvider.DisplayMember = "NAME";
163 cboProvider.ValueMember = "BMXIEN";
164
165 //Add None to the top of the list
166 DataRow drProv = m_dtProvider.NewRow();
167 drProv.BeginEdit();
168 drProv["NAME"] = "<None>";
169 drProv["BMXIEN"] = 0;
170 drProv.EndEdit();
171 m_dtProvider.Rows.InsertAt(drProv, 0);
172 cboProvider.SelectedIndex = 0;
173 }
174
175
176 m_sPatientName = a.PatientName;
177 if (a.CheckInTime.Ticks != 0)
178 {
179 m_dCheckIn = a.CheckInTime;
180 dtpCheckIn.Enabled = false;
181 this.cboProvider.Enabled = false;
182 lblAlready.Visible = true;
183 }
184 else
185 {
186 m_dCheckIn = DateTime.Now;
187 }
188
189 UpdateDialogData(true);
190 m_bInit = false;
191 }
192
193
194 /// <summary>
195 /// If b is true, moves member vars into control data
196 /// otherwise, moves control data into member vars
197 /// </summary>
198 /// <param name="b"></param>
199 private void UpdateDialogData(bool b)
200 {
201 if (b == true) //Move data to dialog controls from member variables
202 {
203 this.lblPatientName.Text = m_sPatientName;
204 this.dtpCheckIn.Value = m_dCheckIn;
205 }
206 else //Move data to member variables from dialog controls
207 {
208 m_dCheckIn = this.dtpCheckIn.Value;
209 m_sProviderIEN = this.cboProvider.SelectedValue.ToString();
210 m_bPrintRouteSlip = chkRoutingSlip.Checked;
211 }
212 }
213
214 /// <summary>
215 /// Clean up any resources being used.
216 /// </summary>
217 protected override void Dispose(bool disposing)
218 {
219 if (disposing)
220 {
221 if (components != null)
222 {
223 components.Dispose();
224 }
225 }
226 base.Dispose(disposing);
227 }
228 #endregion Methods
229
230 #region Windows Form Designer generated code
231 /// <summary>
232 /// Required method for Designer support - do not modify
233 /// the contents of this method with the code editor.
234 /// </summary>
235 private void InitializeComponent()
236 {
237 this.components = new System.ComponentModel.Container();
238 this.pnlPageBottom = new System.Windows.Forms.Panel();
239 this.cmdCancel = new System.Windows.Forms.Button();
240 this.cmdOK = new System.Windows.Forms.Button();
241 this.pnlDescription = new System.Windows.Forms.Panel();
242 this.grpDescriptionResourceGroup = new System.Windows.Forms.GroupBox();
243 this.lblDescriptionResourceGroup = new System.Windows.Forms.Label();
244 this.label1 = new System.Windows.Forms.Label();
245 this.dtpCheckIn = new System.Windows.Forms.DateTimePicker();
246 this.lblAlready = new System.Windows.Forms.Label();
247 this.label3 = new System.Windows.Forms.Label();
248 this.lblPatientName = new System.Windows.Forms.Label();
249 this.cboProvider = new System.Windows.Forms.ComboBox();
250 this.label2 = new System.Windows.Forms.Label();
251 this.chkRoutingSlip = new System.Windows.Forms.CheckBox();
252 this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
253 this.pnlPageBottom.SuspendLayout();
254 this.pnlDescription.SuspendLayout();
255 this.grpDescriptionResourceGroup.SuspendLayout();
256 this.SuspendLayout();
257 //
258 // pnlPageBottom
259 //
260 this.pnlPageBottom.Controls.Add(this.cmdCancel);
261 this.pnlPageBottom.Controls.Add(this.cmdOK);
262 this.pnlPageBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
263 this.pnlPageBottom.Location = new System.Drawing.Point(0, 203);
264 this.pnlPageBottom.Name = "pnlPageBottom";
265 this.pnlPageBottom.Size = new System.Drawing.Size(520, 40);
266 this.pnlPageBottom.TabIndex = 5;
267 //
268 // cmdCancel
269 //
270 this.cmdCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
271 this.cmdCancel.Location = new System.Drawing.Point(440, 8);
272 this.cmdCancel.Name = "cmdCancel";
273 this.cmdCancel.Size = new System.Drawing.Size(56, 24);
274 this.cmdCancel.TabIndex = 2;
275 this.cmdCancel.Text = "Cancel";
276 //
277 // cmdOK
278 //
279 this.cmdOK.DialogResult = System.Windows.Forms.DialogResult.OK;
280 this.cmdOK.Location = new System.Drawing.Point(360, 8);
281 this.cmdOK.Name = "cmdOK";
282 this.cmdOK.Size = new System.Drawing.Size(64, 24);
283 this.cmdOK.TabIndex = 1;
284 this.cmdOK.Text = "OK";
285 this.cmdOK.Click += new System.EventHandler(this.cmdOK_Click);
286 //
287 // pnlDescription
288 //
289 this.pnlDescription.Controls.Add(this.grpDescriptionResourceGroup);
290 this.pnlDescription.Dock = System.Windows.Forms.DockStyle.Bottom;
291 this.pnlDescription.Location = new System.Drawing.Point(0, 131);
292 this.pnlDescription.Name = "pnlDescription";
293 this.pnlDescription.Size = new System.Drawing.Size(520, 72);
294 this.pnlDescription.TabIndex = 6;
295 //
296 // grpDescriptionResourceGroup
297 //
298 this.grpDescriptionResourceGroup.Controls.Add(this.lblDescriptionResourceGroup);
299 this.grpDescriptionResourceGroup.Dock = System.Windows.Forms.DockStyle.Fill;
300 this.grpDescriptionResourceGroup.Location = new System.Drawing.Point(0, 0);
301 this.grpDescriptionResourceGroup.Name = "grpDescriptionResourceGroup";
302 this.grpDescriptionResourceGroup.Size = new System.Drawing.Size(520, 72);
303 this.grpDescriptionResourceGroup.TabIndex = 1;
304 this.grpDescriptionResourceGroup.TabStop = false;
305 this.grpDescriptionResourceGroup.Text = "Description";
306 //
307 // lblDescriptionResourceGroup
308 //
309 this.lblDescriptionResourceGroup.Dock = System.Windows.Forms.DockStyle.Fill;
310 this.lblDescriptionResourceGroup.Location = new System.Drawing.Point(3, 16);
311 this.lblDescriptionResourceGroup.Name = "lblDescriptionResourceGroup";
312 this.lblDescriptionResourceGroup.Size = new System.Drawing.Size(514, 53);
313 this.lblDescriptionResourceGroup.TabIndex = 0;
314 this.lblDescriptionResourceGroup.Text = "Use this panel to check in an appointment. A patient may only be checked-in once." +
315 "";
316 //
317 // label1
318 //
319 this.label1.Location = new System.Drawing.Point(16, 16);
320 this.label1.Name = "label1";
321 this.label1.Size = new System.Drawing.Size(80, 16);
322 this.label1.TabIndex = 7;
323 this.label1.Text = "Patient Name:";
324 //
325 // dtpCheckIn
326 //
327 this.dtpCheckIn.AllowDrop = true;
328 this.dtpCheckIn.CustomFormat = "MMMM dd yyyy H:mm";
329 this.dtpCheckIn.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
330 this.dtpCheckIn.Location = new System.Drawing.Point(96, 48);
331 this.dtpCheckIn.Name = "dtpCheckIn";
332 this.dtpCheckIn.ShowUpDown = true;
333 this.dtpCheckIn.Size = new System.Drawing.Size(176, 20);
334 this.dtpCheckIn.TabIndex = 9;
335 //
336 // lblAlready
337 //
338 this.lblAlready.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
339 this.lblAlready.ForeColor = System.Drawing.Color.Green;
340 this.lblAlready.Location = new System.Drawing.Point(288, 40);
341 this.lblAlready.Name = "lblAlready";
342 this.lblAlready.Size = new System.Drawing.Size(192, 32);
343 this.lblAlready.TabIndex = 10;
344 this.lblAlready.Text = "This Patient is already checked in.";
345 this.lblAlready.Visible = false;
346 //
347 // label3
348 //
349 this.label3.Location = new System.Drawing.Point(16, 48);
350 this.label3.Name = "label3";
351 this.label3.Size = new System.Drawing.Size(80, 16);
352 this.label3.TabIndex = 7;
353 this.label3.Text = "Check-in Time:";
354 //
355 // lblPatientName
356 //
357 this.lblPatientName.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
358 this.lblPatientName.Location = new System.Drawing.Point(96, 16);
359 this.lblPatientName.Name = "lblPatientName";
360 this.lblPatientName.Size = new System.Drawing.Size(256, 16);
361 this.lblPatientName.TabIndex = 11;
362 //
363 // cboProvider
364 //
365 this.cboProvider.Location = new System.Drawing.Point(96, 88);
366 this.cboProvider.Name = "cboProvider";
367 this.cboProvider.Size = new System.Drawing.Size(240, 21);
368 this.cboProvider.TabIndex = 12;
369 //
370 // label2
371 //
372 this.label2.Location = new System.Drawing.Point(16, 88);
373 this.label2.Name = "label2";
374 this.label2.Size = new System.Drawing.Size(80, 16);
375 this.label2.TabIndex = 7;
376 this.label2.Text = "Visit Provider:";
377 //
378 // chkRoutingSlip
379 //
380 this.chkRoutingSlip.Location = new System.Drawing.Point(380, 93);
381 this.chkRoutingSlip.Name = "chkRoutingSlip";
382 this.chkRoutingSlip.Size = new System.Drawing.Size(128, 16);
383 this.chkRoutingSlip.TabIndex = 14;
384 this.chkRoutingSlip.Text = "Print Routing Slip";
385 this.toolTip1.SetToolTip(this.chkRoutingSlip, "Prints routing slip to the Windows Default Printer");
386 //
387 // DCheckIn
388 //
389 this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
390 this.ClientSize = new System.Drawing.Size(520, 243);
391 this.Controls.Add(this.chkRoutingSlip);
392 this.Controls.Add(this.cboProvider);
393 this.Controls.Add(this.lblPatientName);
394 this.Controls.Add(this.lblAlready);
395 this.Controls.Add(this.dtpCheckIn);
396 this.Controls.Add(this.label1);
397 this.Controls.Add(this.pnlDescription);
398 this.Controls.Add(this.pnlPageBottom);
399 this.Controls.Add(this.label3);
400 this.Controls.Add(this.label2);
401 this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
402 this.Name = "DCheckIn";
403 this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
404 this.Text = "Appointment Check In";
405 this.pnlPageBottom.ResumeLayout(false);
406 this.pnlDescription.ResumeLayout(false);
407 this.grpDescriptionResourceGroup.ResumeLayout(false);
408 this.ResumeLayout(false);
409
410 }
411 #endregion
412
413 #region Events
414
415 private void cmdOK_Click(object sender, System.EventArgs e)
416 {
417 this.UpdateDialogData(false);
418 }
419
420 #endregion Events
421 }
422}
Note: See TracBrowser for help on using the repository browser.