Changeset 1111
- Timestamp:
- Mar 23, 2011, 5:15:51 AM (14 years ago)
- Location:
- Scheduling/trunk/cs/bsdx0200GUISourceCode
- Files:
-
- 2 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
Scheduling/trunk/cs/bsdx0200GUISourceCode/CGAppointment.cs
r1106 r1111 4 4 using System.Drawing; 5 5 /// <summary> 6 /// This class was regenerated from Calendargrid.dll using Reflector.exe7 /// by Sam Habiel for WorldVista. The original source code is lost.6 /// Data Structuer to Represent an Appointment 7 /// 8 8 /// </summary> 9 9 [Serializable] … … 305 305 306 306 public Patient Patient { get; set; } 307 public Provider Provider { get; set; } 307 308 } 308 309 } -
Scheduling/trunk/cs/bsdx0200GUISourceCode/CGDocument.cs
r1110 r1111 1054 1054 DataRow r = dtAppt.Rows[0]; 1055 1055 string sErrorID = r["ERRORID"].ToString(); 1056 1057 1058 1056 } 1059 1057 -
Scheduling/trunk/cs/bsdx0200GUISourceCode/CGDocumentManager.cs
r1110 r1111 94 94 } 95 95 } 96 97 /// <summary> 98 /// More later... 99 /// </summary> 100 public UserPreferences UserPreferences { get; private set; } 96 101 97 102 /// <summary> … … 461 466 } 462 467 468 //User Preferences Object 469 _current.UserPreferences = new UserPreferences(); 470 463 471 //Create global dataset 464 472 _current.m_dsGlobal = new DataSet("GlobalDataSet"); -
Scheduling/trunk/cs/bsdx0200GUISourceCode/CGView.cs
r1110 r1111 1264 1264 1265 1265 CGAppointment a = (CGAppointment) this.Appointments.AppointmentTable[apptID]; 1266 1267 PrintDocument pd = new PrintDocument() { DocumentName = "Appointment Slip for Appt " + apptID }; //Autoinit for DocName 1268 pd.PrintPage += (s, pe) => //son of a lambda 1269 { 1270 CGDocumentManager.Current.PrintingObject.PrintAppointmentSlip(a, pe); 1271 }; 1272 1273 pd.Print(); 1266 1267 PrintAppointmentSlip(a); 1274 1268 } 1275 1269 //end new code … … 1930 1924 private void AppointmentCheckIn() 1931 1925 { 1932 1933 1926 int nApptID = this.calendarGrid1.SelectedAppointment; 1934 1927 Debug.Assert(nApptID != 0); … … 1950 1943 return; 1951 1944 } 1952 //Find the default provider for the resource & load into combo box1953 DataView rv = new DataView(this.m_DocManager.GlobalDataSet.Tables["Resources"]);1954 rv.Sort="RESOURCE_NAME ASC";1955 int nFind = rv.Find((string) a.Resource);1956 DataRowView drv = rv[nFind];1957 1958 string sHospLoc = drv["HOSPITAL_LOCATION_ID"].ToString();1959 sHospLoc = (sHospLoc == "")?"0":sHospLoc;1960 int nHospLoc = 0;1961 try1962 {1963 nHospLoc = Convert.ToInt32(sHospLoc);1964 }1965 catch(Exception ex)1966 {1967 Debug.Write("CGView.AppointmentCheckIn Error: " + ex.Message);1968 }1969 1970 string sProv = "";1971 1972 if (nHospLoc > 0)1973 {1974 DataRow dr = drv.Row;1975 DataRow drHL = dr.GetParentRow(m_DocManager.GlobalDataSet.Relations["HospitalLocationResource"]);1976 sProv = drHL["DEFAULT_PROVIDER"].ToString();1977 }1978 1945 1979 1946 DCheckIn dlgCheckin = new DCheckIn(); 1980 dlgCheckin.InitializePage(a , this.m_DocManager, sProv, nHospLoc);1947 dlgCheckin.InitializePage(a); 1981 1948 calendarGrid1.CGToolTip.Active = false; 1982 1949 if (dlgCheckin.ShowDialog(this) != DialogResult.OK) … … 1992 1959 DateTime dtCheckIn = dlgCheckin.CheckInTime; 1993 1960 1994 //Save to Database 1961 //Tell appointment that it is checked in, for proper coloring; 1962 //When you refresh from the DB, it will have this property. 1963 a.CheckInTime = DateTime.Now; 1964 1965 //Save to Database 1995 1966 this.Document.CheckInAppointment(nApptID, dtCheckIn); 1996 1967 1997 // Tell appointment that it is checked in1998 a. CheckInTime = DateTime.Now;1999 2000 // smh new code1968 //Get Provider (XXXXXXXX: NOT SAVED TO THE DATABASE RIGHT NOW) 1969 a.Provider = dlgCheckin.Provider; 1970 1971 // Print Routing Slip if user checks that box... 2001 1972 if (dlgCheckin.PrintRouteSlip) 2002 // this.printRoutingSlip.Print(); 2003 // end new code 1973 this.PrintRoutingSlip(a); 2004 1974 2005 1975 //redraw grid … … 2218 2188 this.Document.CreateAppointment(appt); 2219 2189 2220 //Experimental now.2190 2221 2191 if (dAppt.PrintAppointmentSlip) 2222 2192 { 2223 System.Drawing.Printing.PrintDocument pd = new System.Drawing.Printing.PrintDocument(); 2224 pd.PrintPage += (object s, System.Drawing.Printing.PrintPageEventArgs e) => CGDocumentManager.Current.PrintingObject.PrintAppointmentSlip(appt, e); 2225 pd.Print(); 2193 PrintAppointmentSlip(appt); 2226 2194 } 2227 2195 … … 3247 3215 } 3248 3216 3249 private void printRoutingSlip_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)3217 private void PrintRoutingSlip(CGAppointment appt) 3250 3218 { 3251 int nApptID = this.calendarGrid1.SelectedAppointment; 3252 CGAppointment a = (CGAppointment)this.Appointments.AppointmentTable[nApptID]; 3253 CGDocumentManager.Current.PrintingObject.PrintRoutingSlip(a, "Routing Slip", e); 3219 PrintDocument pd = new PrintDocument() { DocumentName = "Routing Slip for Appt " + appt.AppointmentKey }; 3220 pd.PrintPage += (object s, System.Drawing.Printing.PrintPageEventArgs e) => CGDocumentManager.Current.PrintingObject.PrintRoutingSlip(appt, "Routing Slip", e); 3221 pd.Print(); 3222 } 3223 3224 private void PrintAppointmentSlip(CGAppointment appt) 3225 { 3226 PrintDocument pd = new PrintDocument() { DocumentName = "Appointment Slip for Appt " + appt.AppointmentKey }; //Autoinit for DocName 3227 pd.PrintPage += (object s, System.Drawing.Printing.PrintPageEventArgs e) => CGDocumentManager.Current.PrintingObject.PrintAppointmentSlip(appt, e); 3228 pd.Print(); 3254 3229 } 3255 3230 … … 3311 3286 #endregion events 3312 3287 3288 /// <summary> 3289 /// Refresh grid if needed. 3290 /// </summary> 3313 3291 void RequestRefreshGrid() 3314 3292 { -
Scheduling/trunk/cs/bsdx0200GUISourceCode/ClinicalScheduling.csproj
r1110 r1111 140 140 </ItemGroup> 141 141 <ItemGroup> 142 <Compile Include="Provider.cs" /> 143 <Compile Include="UserPreferences.cs" /> 142 144 <None Include="app.config" /> 143 145 <None Include="dsPatientApptDisplay2.xsc"> … … 201 203 <SubType>Form</SubType> 202 204 </Compile> 203 <Compile Include=" CustomPrinting.cs" />205 <Compile Include="Printing.cs" /> 204 206 <Compile Include="DAccessBlock.cs"> 205 207 <SubType>Form</SubType> -
Scheduling/trunk/cs/bsdx0200GUISourceCode/ClinicalScheduling.csproj.user
r1097 r1111 37 37 </RemoteDebugMachine> 38 38 <StartAction>Project</StartAction> 39 <StartArguments>/s=172.16.16.108 /p=9250 /a= s.habiel /v=catdog.66</StartArguments>39 <StartArguments>/s=172.16.16.108 /p=9250 /a=BASMA.ALDWAIRI /v=SELEN.123</StartArguments> 40 40 <StartPage> 41 41 </StartPage> -
Scheduling/trunk/cs/bsdx0200GUISourceCode/DAppointPage.cs
r1110 r1111 94 94 this.label3 = new System.Windows.Forms.Label(); 95 95 this.groupBox1 = new System.Windows.Forms.GroupBox(); 96 this.txtSex = new System.Windows.Forms.TextBox(); 97 this.label18 = new System.Windows.Forms.Label(); 96 98 this.label14 = new System.Windows.Forms.Label(); 97 99 this.txtHRN = new System.Windows.Forms.TextBox(); … … 129 131 this.dsPatientApptDisplay2BindingSource = new System.Windows.Forms.BindingSource(this.components); 130 132 this.dsPatientApptDisplay2 = new IndianHealthService.ClinicalScheduling.dsPatientApptDisplay2(); 131 this.label18 = new System.Windows.Forms.Label();132 this.txtSex = new System.Windows.Forms.TextBox();133 133 this.tabControl1.SuspendLayout(); 134 134 this.tabAppointment.SuspendLayout(); … … 280 280 this.groupBox1.TabStop = false; 281 281 this.groupBox1.Text = "Patient ID"; 282 // 283 // txtSex 284 // 285 this.txtSex.BackColor = System.Drawing.SystemColors.Control; 286 this.txtSex.Location = new System.Drawing.Point(273, 41); 287 this.txtSex.Name = "txtSex"; 288 this.txtSex.ReadOnly = true; 289 this.txtSex.Size = new System.Drawing.Size(160, 20); 290 this.txtSex.TabIndex = 15; 291 // 292 // label18 293 // 294 this.label18.AutoSize = true; 295 this.label18.Location = new System.Drawing.Point(238, 44); 296 this.label18.Name = "label18"; 297 this.label18.Size = new System.Drawing.Size(29, 13); 298 this.label18.TabIndex = 14; 299 this.label18.Text = "Sex:"; 282 300 // 283 301 // label14 … … 558 576 this.chkPrint.Text = "Print Appointment Letter"; 559 577 this.chkPrint.UseVisualStyleBackColor = true; 578 this.chkPrint.CheckedChanged += new System.EventHandler(this.chkPrint_CheckedChanged); 560 579 // 561 580 // cmdCancel … … 592 611 this.dsPatientApptDisplay2.DataSetName = "dsPatientApptDisplay2"; 593 612 this.dsPatientApptDisplay2.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema; 594 //595 // label18596 //597 this.label18.AutoSize = true;598 this.label18.Location = new System.Drawing.Point(238, 44);599 this.label18.Name = "label18";600 this.label18.Size = new System.Drawing.Size(29, 13);601 this.label18.TabIndex = 14;602 this.label18.Text = "Sex:";603 //604 // txtSex605 //606 this.txtSex.BackColor = System.Drawing.SystemColors.Control;607 this.txtSex.Location = new System.Drawing.Point(273, 41);608 this.txtSex.Name = "txtSex";609 this.txtSex.ReadOnly = true;610 this.txtSex.Size = new System.Drawing.Size(160, 20);611 this.txtSex.TabIndex = 15;612 613 // 613 614 // DAppointPage … … 717 718 UC.Dock = DockStyle.Fill; 718 719 groupBox4.Controls.Add(UC); 720 721 chkPrint.Checked = CGDocumentManager.Current.UserPreferences.PrintAppointmentSlipAutomacially; 719 722 } 720 723 catch(Exception e) … … 858 861 #endregion //Properties 859 862 863 /// <summary> 864 /// Save Print Slip preference in UserPreferences object. For now, it always starts false since 865 /// it isn't saved in the DB; but that will change in the future. 866 /// </summary> 867 /// <param name="sender"></param> 868 /// <param name="e"></param> 869 private void chkPrint_CheckedChanged(object sender, EventArgs e) 870 { 871 CGDocumentManager.Current.UserPreferences.PrintAppointmentSlipAutomacially = chkPrint.Checked; 872 } 873 860 874 861 875 } //end Class -
Scheduling/trunk/cs/bsdx0200GUISourceCode/DAppointPage.resx
r1110 r1111 124 124 <value>179, 17</value> 125 125 </metadata> 126 <metadata name="dsPatientApptDisplay2BindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">127 <value>179, 17</value>128 </metadata>129 <metadata name="dsPatientApptDisplay2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">130 <value>17, 17</value>131 </metadata>132 126 <metadata name="dsPatientApptDisplay2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 133 127 <value>17, 17</value> -
Scheduling/trunk/cs/bsdx0200GUISourceCode/DCheckIn.cs
r1062 r1111 7 7 using System.Diagnostics; 8 8 using IndianHealthService.BMXNet; 9 using System.Collections.Generic; 10 using System.Linq; 9 11 10 12 namespace IndianHealthService.ClinicalScheduling … … 23 25 // 24 26 InitializeComponent(); 25 26 //27 // TODO: Add any constructor code after InitializeComponent call28 //29 27 } 30 28 … … 59 57 private DataView m_dvClinic; 60 58 private DataView m_dvForm; 61 private bool m_bInit;62 59 public bool m_bPrintRouteSlip; 60 private List<Provider> _providers; 63 61 private ToolTip toolTip1; 64 62 … … 68 66 69 67 /// <summary> 70 /// Returns string representation of internal entry number of Provider in PROVIDER File71 /// </summary> 72 public string ProviderIEN68 /// Returns Provider chosen for Check-In 69 /// </summary> 70 public Provider Provider 73 71 { 74 72 get 75 73 { 76 return this.m_sProviderIEN; 74 if (cboProvider.SelectedIndex < 1) return null; // because first item is empty placeholder 75 else return this._providers[cboProvider.SelectedIndex]; 77 76 } 78 77 } … … 113 112 /// <param name="a">Appointment</param> 114 113 /// <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; 114 public void InitializePage(CGAppointment a) 115 { 116 m_DocManager = CGDocumentManager.Current; 121 117 m_dsGlobal = m_DocManager.GlobalDataSet; 122 int nFind = 0; 118 119 Int32? nHospLoc = (from resource in m_dsGlobal.Tables["Resources"].AsEnumerable() 120 where resource.Field<string>("RESOURCE_NAME") == a.Resource 121 select resource.Field<Int32?>("HOSPITAL_LOCATION_ID")) 122 .SingleOrDefault(); 123 124 //smh - following logic replaced with above... 125 /* 126 DataView rv = new DataView(this.m_DocManager.GlobalDataSet.Tables["Resources"]); 127 rv.Sort = "RESOURCE_NAME ASC"; 128 int nFind = rv.Find((string)a.Resource); 129 DataRowView drv = rv[nFind]; 130 131 string sHospLoc = drv["HOSPITAL_LOCATION_ID"].ToString(); 132 sHospLoc = (sHospLoc == "") ? "0" : sHospLoc; 133 int nHospLoc = 0; 134 try 135 { 136 nHospLoc = Convert.ToInt32(sHospLoc); 137 } 138 catch (Exception ex) 139 { 140 Debug.Write("CGView.AppointmentCheckIn Error: " + ex.Message); 141 } 142 */ 123 143 124 144 //smh new code 125 145 //if the resource is linked to a valid hospital location, grab this locations providers 126 146 //from the provider multiple and put them in the combo box. 127 if (nHospLoc != 0)147 if (nHospLoc != null) 128 148 { 129 149 //RPC BSDX HOSP LOC PROVIDERS returns Table w/ Columns: 130 150 //HOSPITAL_LOCATION_ID^BMXIEN (ie Prov IEN)^NAME^DEFALUT 131 151 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; 152 m_dtProvider = m_DocManager.RPMSDataTable(sCommandText, "ClinicProviders"); 153 154 _providers = (from providerRow in m_dtProvider.AsEnumerable() 155 orderby providerRow.Field<string>("NAME") 156 select new Provider 157 { 158 IEN = providerRow.Field<int>("BMXIEN"), 159 Name = providerRow.Field<string>("NAME"), 160 Default = providerRow.Field<string>("DEFAULT") == "YES" ? true : false 161 }).ToList(); 162 163 164 165 //cboProvider.DisplayMember = "NAME"; 166 //cboProvider.ValueMember = "BMXIEN"; 167 _providers.Insert(0, new Provider { Name = "<None>", IEN = -1 }); 168 cboProvider.DataSource = _providers; 169 cboProvider.SelectedIndex = _providers.FindIndex(prov => prov.Default); 170 // if no provider is default, set default to be <none> item. 171 if (cboProvider.SelectedIndex == -1) cboProvider.SelectedIndex = 0; 172 ////Add None to the top of the list 173 //DataRow drProv = m_dtProvider.NewRow(); 174 //drProv.BeginEdit(); 175 //drProv["HOSPITAL_LOCATION_ID"] = 0; 176 //drProv["NAME"] = "<None>"; 177 //drProv["BMXIEN"] = 0; 178 //drProv.EndEdit(); 179 //m_dtProvider.Rows.InsertAt(drProv, 0); 180 ////cboProvider.SelectedIndex = 0; 148 181 149 182 //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;183 //DataRow[] nRow = m_dtProvider.Select("DEFAULT='YES'", "NAME ASC"); 184 //if (nRow.Length > 0) nFind = m_dtProvider.Rows.IndexOf(nRow[0]); 185 153 186 154 187 } … … 156 189 else 157 190 { 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"; 191 192 _providers = (from providerRow in m_dsGlobal.Tables["Provider"].AsEnumerable() 193 orderby providerRow.Field<string>("NAME") 194 select new Provider 195 { 196 IEN = providerRow.Field<int>("BMXIEN"), 197 Name = providerRow.Field<string>("NAME"), 198 Default = false 199 }).ToList(); 200 201 202 /*m_dtProvider = m_dsGlobal.Tables["Provider"]; 203 m_dtProvider.DefaultView.Sort = "NAME ASC";*/ 204 _providers.Insert(0, new Provider { Name = "<None>", IEN = -1 }); 205 cboProvider.DataSource = _providers; 206 cboProvider.SelectedIndex = 0; 207 //cboProvider.DisplayMember = "NAME"; 208 //cboProvider.ValueMember = "BMXIEN"; 164 209 165 210 //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 211 //DataRow drProv = m_dtProvider.NewRow(); 212 //drProv.BeginEdit(); 213 //drProv["NAME"] = "<None>"; 214 //drProv["BMXIEN"] = 0; 215 //drProv.EndEdit(); 216 //m_dtProvider.Rows.InsertAt(drProv, 0); 217 //cboProvider.SelectedIndex = 0; 218 } 219 220 175 221 176 222 m_sPatientName = a.PatientName; … … 187 233 } 188 234 235 //Print Routing Slip based on user preferences. 236 chkRoutingSlip.Checked = CGDocumentManager.Current.UserPreferences.PrintRoutingSlipAutomatically; 237 189 238 UpdateDialogData(true); 190 m_bInit = false;191 239 } 192 240 … … 363 411 // cboProvider 364 412 // 413 this.cboProvider.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 365 414 this.cboProvider.Location = new System.Drawing.Point(96, 88); 366 415 this.cboProvider.Name = "cboProvider"; … … 384 433 this.chkRoutingSlip.Text = "Print Routing Slip"; 385 434 this.toolTip1.SetToolTip(this.chkRoutingSlip, "Prints routing slip to the Windows Default Printer"); 435 this.chkRoutingSlip.CheckedChanged += new System.EventHandler(this.chkRoutingSlip_CheckedChanged); 386 436 // 387 437 // DCheckIn … … 418 468 } 419 469 470 /// <summary> 471 /// Save this in User Preferences Object. 472 /// </summary> 473 /// <param name="sender"></param> 474 /// <param name="e"></param> 475 private void chkRoutingSlip_CheckedChanged(object sender, EventArgs e) 476 { 477 CGDocumentManager.Current.UserPreferences.PrintRoutingSlipAutomatically = chkRoutingSlip.Checked; 478 } 479 420 480 #endregion Events 481 421 482 } 422 483 } -
Scheduling/trunk/cs/bsdx0200GUISourceCode/DCheckIn.resx
r1062 r1111 113 113 </resheader> 114 114 <resheader name="reader"> 115 <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version= 2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>115 <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 116 116 </resheader> 117 117 <resheader name="writer"> 118 <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version= 2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>118 <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 119 119 </resheader> 120 <metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version= 2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">120 <metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 121 121 <value>17, 17</value> 122 122 </metadata> -
Scheduling/trunk/cs/bsdx0200GUISourceCode/Patient.cs
r1110 r1111 44 44 } 45 45 46 /// <summary> 47 /// Returns User Friendly Age. If Age < 5, then Years and Months 48 /// If Age > 5, then only Years. 49 /// Humans tend to round down their ages. So I follow the same rule here. 50 /// </summary> 46 51 public string UserFriendlyAge 47 52 {
Note:
See TracChangeset
for help on using the changeset viewer.