CGAppointment: Added Provider as a Member of Class. (auto property)
CGDocument: No changes CGDocumentManager: Added UserPreferences as a member of a Class (private and property) CGView: Changes to support printing of Routing Slip DAppointPage: Changes to support UserPreferences member for auto printing the routing slips DCheckIn: Extensive changes in load code (now uses LINQ instead of ADO.net). Changes to support UserPreferences member for auto printing the routing slips. Patient: Documentation for UserFriendlyAge. Provider: New class to represent Provider UserPreferences: New class to represent User preferences. Does not interact with DB right now.
This commit is contained in:
parent
45490945a8
commit
dfe0dd8e09
|
@ -3,8 +3,8 @@
|
|||
using System;
|
||||
using System.Drawing;
|
||||
/// <summary>
|
||||
/// This class was regenerated from Calendargrid.dll using Reflector.exe
|
||||
/// by Sam Habiel for WorldVista. The original source code is lost.
|
||||
/// Data Structuer to Represent an Appointment
|
||||
///
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class CGAppointment
|
||||
|
@ -304,6 +304,7 @@
|
|||
}
|
||||
|
||||
public Patient Patient { get; set; }
|
||||
public Provider Provider { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1053,8 +1053,6 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
Debug.Assert(dtAppt.Rows.Count == 1);
|
||||
DataRow r = dtAppt.Rows[0];
|
||||
string sErrorID = r["ERRORID"].ToString();
|
||||
|
||||
|
||||
}
|
||||
|
||||
public string DeleteAppointment(int nApptID)
|
||||
|
|
|
@ -93,6 +93,11 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
m_dsGlobal = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// More later...
|
||||
/// </summary>
|
||||
public UserPreferences UserPreferences { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the single CGDocumentManager object
|
||||
|
@ -460,6 +465,9 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
this.m_PrintingObject = Creator.PrintFactory();
|
||||
}
|
||||
|
||||
//User Preferences Object
|
||||
_current.UserPreferences = new UserPreferences();
|
||||
|
||||
//Create global dataset
|
||||
_current.m_dsGlobal = new DataSet("GlobalDataSet");
|
||||
|
||||
|
|
|
@ -1263,14 +1263,8 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
if (apptID <= 0) return;
|
||||
|
||||
CGAppointment a = (CGAppointment) this.Appointments.AppointmentTable[apptID];
|
||||
|
||||
PrintDocument pd = new PrintDocument() { DocumentName = "Appointment Slip for Appt " + apptID }; //Autoinit for DocName
|
||||
pd.PrintPage += (s, pe) => //son of a lambda
|
||||
{
|
||||
CGDocumentManager.Current.PrintingObject.PrintAppointmentSlip(a, pe);
|
||||
};
|
||||
|
||||
pd.Print();
|
||||
|
||||
PrintAppointmentSlip(a);
|
||||
}
|
||||
//end new code
|
||||
|
||||
|
@ -1929,7 +1923,6 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
|
||||
private void AppointmentCheckIn()
|
||||
{
|
||||
|
||||
int nApptID = this.calendarGrid1.SelectedAppointment;
|
||||
Debug.Assert(nApptID != 0);
|
||||
|
||||
|
@ -1949,35 +1942,9 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
MessageBox.Show(this, "It is too early to check in " + a.PatientName, "Windows Scheduling", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
return;
|
||||
}
|
||||
//Find the default provider for the resource & load into combo box
|
||||
DataView rv = new DataView(this.m_DocManager.GlobalDataSet.Tables["Resources"]);
|
||||
rv.Sort="RESOURCE_NAME ASC";
|
||||
int nFind = rv.Find((string) a.Resource);
|
||||
DataRowView drv = rv[nFind];
|
||||
|
||||
string sHospLoc = drv["HOSPITAL_LOCATION_ID"].ToString();
|
||||
sHospLoc = (sHospLoc == "")?"0":sHospLoc;
|
||||
int nHospLoc = 0;
|
||||
try
|
||||
{
|
||||
nHospLoc = Convert.ToInt32(sHospLoc);
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
Debug.Write("CGView.AppointmentCheckIn Error: " + ex.Message);
|
||||
}
|
||||
|
||||
string sProv = "";
|
||||
|
||||
if (nHospLoc > 0)
|
||||
{
|
||||
DataRow dr = drv.Row;
|
||||
DataRow drHL = dr.GetParentRow(m_DocManager.GlobalDataSet.Relations["HospitalLocationResource"]);
|
||||
sProv = drHL["DEFAULT_PROVIDER"].ToString();
|
||||
}
|
||||
|
||||
DCheckIn dlgCheckin = new DCheckIn();
|
||||
dlgCheckin.InitializePage(a, this.m_DocManager, sProv, nHospLoc);
|
||||
dlgCheckin.InitializePage(a);
|
||||
calendarGrid1.CGToolTip.Active = false;
|
||||
if (dlgCheckin.ShowDialog(this) != DialogResult.OK)
|
||||
{
|
||||
|
@ -1991,16 +1958,19 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
|
||||
DateTime dtCheckIn = dlgCheckin.CheckInTime;
|
||||
|
||||
//Save to Database
|
||||
//Tell appointment that it is checked in, for proper coloring;
|
||||
//When you refresh from the DB, it will have this property.
|
||||
a.CheckInTime = DateTime.Now;
|
||||
|
||||
//Save to Database
|
||||
this.Document.CheckInAppointment(nApptID, dtCheckIn);
|
||||
|
||||
//Tell appointment that it is checked in
|
||||
a.CheckInTime = DateTime.Now;
|
||||
//Get Provider (XXXXXXXX: NOT SAVED TO THE DATABASE RIGHT NOW)
|
||||
a.Provider = dlgCheckin.Provider;
|
||||
|
||||
//smh new code
|
||||
// Print Routing Slip if user checks that box...
|
||||
if (dlgCheckin.PrintRouteSlip)
|
||||
// this.printRoutingSlip.Print();
|
||||
// end new code
|
||||
this.PrintRoutingSlip(a);
|
||||
|
||||
//redraw grid
|
||||
this.calendarGrid1.Invalidate();
|
||||
|
@ -2217,12 +2187,10 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
//Call Document to add a new appointment. Document adds appointment to CGAppointments array.
|
||||
this.Document.CreateAppointment(appt);
|
||||
|
||||
//Experimental now.
|
||||
|
||||
if (dAppt.PrintAppointmentSlip)
|
||||
{
|
||||
System.Drawing.Printing.PrintDocument pd = new System.Drawing.Printing.PrintDocument();
|
||||
pd.PrintPage += (object s, System.Drawing.Printing.PrintPageEventArgs e) => CGDocumentManager.Current.PrintingObject.PrintAppointmentSlip(appt, e);
|
||||
pd.Print();
|
||||
PrintAppointmentSlip(appt);
|
||||
}
|
||||
|
||||
//Show the new set of appointments by calling UpdateArrays. Fetches Document's CGAppointments
|
||||
|
@ -3246,11 +3214,18 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
}
|
||||
}
|
||||
|
||||
private void printRoutingSlip_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
|
||||
private void PrintRoutingSlip(CGAppointment appt)
|
||||
{
|
||||
int nApptID = this.calendarGrid1.SelectedAppointment;
|
||||
CGAppointment a = (CGAppointment)this.Appointments.AppointmentTable[nApptID];
|
||||
CGDocumentManager.Current.PrintingObject.PrintRoutingSlip(a, "Routing Slip", e);
|
||||
PrintDocument pd = new PrintDocument() { DocumentName = "Routing Slip for Appt " + appt.AppointmentKey };
|
||||
pd.PrintPage += (object s, System.Drawing.Printing.PrintPageEventArgs e) => CGDocumentManager.Current.PrintingObject.PrintRoutingSlip(appt, "Routing Slip", e);
|
||||
pd.Print();
|
||||
}
|
||||
|
||||
private void PrintAppointmentSlip(CGAppointment appt)
|
||||
{
|
||||
PrintDocument pd = new PrintDocument() { DocumentName = "Appointment Slip for Appt " + appt.AppointmentKey }; //Autoinit for DocName
|
||||
pd.PrintPage += (object s, System.Drawing.Printing.PrintPageEventArgs e) => CGDocumentManager.Current.PrintingObject.PrintAppointmentSlip(appt, e);
|
||||
pd.Print();
|
||||
}
|
||||
|
||||
|
||||
|
@ -3310,6 +3285,9 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
|
||||
#endregion events
|
||||
|
||||
/// <summary>
|
||||
/// Refresh grid if needed.
|
||||
/// </summary>
|
||||
void RequestRefreshGrid()
|
||||
{
|
||||
DateTime dDate = dateTimePicker1.Value.Date;
|
||||
|
|
|
@ -139,6 +139,8 @@
|
|||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Provider.cs" />
|
||||
<Compile Include="UserPreferences.cs" />
|
||||
<None Include="app.config" />
|
||||
<None Include="dsPatientApptDisplay2.xsc">
|
||||
<DependentUpon>dsPatientApptDisplay2.xsd</DependentUpon>
|
||||
|
@ -200,7 +202,7 @@
|
|||
<Compile Include="CGView.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="CustomPrinting.cs" />
|
||||
<Compile Include="Printing.cs" />
|
||||
<Compile Include="DAccessBlock.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
<RemoteDebugMachine>
|
||||
</RemoteDebugMachine>
|
||||
<StartAction>Project</StartAction>
|
||||
<StartArguments>/s=172.16.16.108 /p=9250 /a=s.habiel /v=catdog.66</StartArguments>
|
||||
<StartArguments>/s=172.16.16.108 /p=9250 /a=BASMA.ALDWAIRI /v=SELEN.123</StartArguments>
|
||||
<StartPage>
|
||||
</StartPage>
|
||||
<StartProgram>C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\IEExec.exe</StartProgram>
|
||||
|
|
Binary file not shown.
|
@ -93,6 +93,8 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.txtSex = new System.Windows.Forms.TextBox();
|
||||
this.label18 = new System.Windows.Forms.Label();
|
||||
this.label14 = new System.Windows.Forms.Label();
|
||||
this.txtHRN = new System.Windows.Forms.TextBox();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
|
@ -128,8 +130,6 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
this.patientApptsBindingSource = new System.Windows.Forms.BindingSource(this.components);
|
||||
this.dsPatientApptDisplay2BindingSource = new System.Windows.Forms.BindingSource(this.components);
|
||||
this.dsPatientApptDisplay2 = new IndianHealthService.ClinicalScheduling.dsPatientApptDisplay2();
|
||||
this.label18 = new System.Windows.Forms.Label();
|
||||
this.txtSex = new System.Windows.Forms.TextBox();
|
||||
this.tabControl1.SuspendLayout();
|
||||
this.tabAppointment.SuspendLayout();
|
||||
this.groupBox3.SuspendLayout();
|
||||
|
@ -280,6 +280,24 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "Patient ID";
|
||||
//
|
||||
// txtSex
|
||||
//
|
||||
this.txtSex.BackColor = System.Drawing.SystemColors.Control;
|
||||
this.txtSex.Location = new System.Drawing.Point(273, 41);
|
||||
this.txtSex.Name = "txtSex";
|
||||
this.txtSex.ReadOnly = true;
|
||||
this.txtSex.Size = new System.Drawing.Size(160, 20);
|
||||
this.txtSex.TabIndex = 15;
|
||||
//
|
||||
// label18
|
||||
//
|
||||
this.label18.AutoSize = true;
|
||||
this.label18.Location = new System.Drawing.Point(238, 44);
|
||||
this.label18.Name = "label18";
|
||||
this.label18.Size = new System.Drawing.Size(29, 13);
|
||||
this.label18.TabIndex = 14;
|
||||
this.label18.Text = "Sex:";
|
||||
//
|
||||
// label14
|
||||
//
|
||||
this.label14.Location = new System.Drawing.Point(50, 64);
|
||||
|
@ -557,6 +575,7 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
this.chkPrint.TabIndex = 2;
|
||||
this.chkPrint.Text = "Print Appointment Letter";
|
||||
this.chkPrint.UseVisualStyleBackColor = true;
|
||||
this.chkPrint.CheckedChanged += new System.EventHandler(this.chkPrint_CheckedChanged);
|
||||
//
|
||||
// cmdCancel
|
||||
//
|
||||
|
@ -592,24 +611,6 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
this.dsPatientApptDisplay2.DataSetName = "dsPatientApptDisplay2";
|
||||
this.dsPatientApptDisplay2.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema;
|
||||
//
|
||||
// label18
|
||||
//
|
||||
this.label18.AutoSize = true;
|
||||
this.label18.Location = new System.Drawing.Point(238, 44);
|
||||
this.label18.Name = "label18";
|
||||
this.label18.Size = new System.Drawing.Size(29, 13);
|
||||
this.label18.TabIndex = 14;
|
||||
this.label18.Text = "Sex:";
|
||||
//
|
||||
// txtSex
|
||||
//
|
||||
this.txtSex.BackColor = System.Drawing.SystemColors.Control;
|
||||
this.txtSex.Location = new System.Drawing.Point(273, 41);
|
||||
this.txtSex.Name = "txtSex";
|
||||
this.txtSex.ReadOnly = true;
|
||||
this.txtSex.Size = new System.Drawing.Size(160, 20);
|
||||
this.txtSex.TabIndex = 15;
|
||||
//
|
||||
// DAppointPage
|
||||
//
|
||||
this.AcceptButton = this.cmdOK;
|
||||
|
@ -716,6 +717,8 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
Control UC = new UCPatientAppts(m_DocManager, int.Parse(m_sPatientIEN));
|
||||
UC.Dock = DockStyle.Fill;
|
||||
groupBox4.Controls.Add(UC);
|
||||
|
||||
chkPrint.Checked = CGDocumentManager.Current.UserPreferences.PrintAppointmentSlipAutomacially;
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
|
@ -857,6 +860,17 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
}
|
||||
#endregion //Properties
|
||||
|
||||
/// <summary>
|
||||
/// Save Print Slip preference in UserPreferences object. For now, it always starts false since
|
||||
/// it isn't saved in the DB; but that will change in the future.
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void chkPrint_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
CGDocumentManager.Current.UserPreferences.PrintAppointmentSlipAutomacially = chkPrint.Checked;
|
||||
}
|
||||
|
||||
|
||||
} //end Class
|
||||
}
|
||||
|
|
|
@ -123,12 +123,6 @@
|
|||
<metadata name="dsPatientApptDisplay2BindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>179, 17</value>
|
||||
</metadata>
|
||||
<metadata name="dsPatientApptDisplay2BindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>179, 17</value>
|
||||
</metadata>
|
||||
<metadata name="dsPatientApptDisplay2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="dsPatientApptDisplay2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
|
|
|
@ -6,6 +6,8 @@ using System.Windows.Forms;
|
|||
using System.Data;
|
||||
using System.Diagnostics;
|
||||
using IndianHealthService.BMXNet;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace IndianHealthService.ClinicalScheduling
|
||||
{
|
||||
|
@ -22,10 +24,6 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
// Required for Windows Form Designer support
|
||||
//
|
||||
InitializeComponent();
|
||||
|
||||
//
|
||||
// TODO: Add any constructor code after InitializeComponent call
|
||||
//
|
||||
}
|
||||
|
||||
|
||||
|
@ -58,8 +56,8 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
private DataTable m_dtForm;
|
||||
private DataView m_dvClinic;
|
||||
private DataView m_dvForm;
|
||||
private bool m_bInit;
|
||||
public bool m_bPrintRouteSlip;
|
||||
private List<Provider> _providers;
|
||||
private ToolTip toolTip1;
|
||||
|
||||
#endregion Fields
|
||||
|
@ -67,13 +65,14 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
#region Properties
|
||||
|
||||
/// <summary>
|
||||
/// Returns string representation of internal entry number of Provider in PROVIDER File
|
||||
/// Returns Provider chosen for Check-In
|
||||
/// </summary>
|
||||
public string ProviderIEN
|
||||
public Provider Provider
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_sProviderIEN;
|
||||
if (cboProvider.SelectedIndex < 1) return null; // because first item is empty placeholder
|
||||
else return this._providers[cboProvider.SelectedIndex];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -112,66 +111,113 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
/// </summary>
|
||||
/// <param name="a">Appointment</param>
|
||||
/// <param name="docManager">Document Manager</param>
|
||||
/// <param name="sDefaultProvider">Default provider</param>
|
||||
public void InitializePage(CGAppointment a, CGDocumentManager docManager,
|
||||
string sDefaultProvider, int nHospLoc)
|
||||
public void InitializePage(CGAppointment a)
|
||||
{
|
||||
m_bInit = true;
|
||||
m_DocManager = docManager;
|
||||
m_DocManager = CGDocumentManager.Current;
|
||||
m_dsGlobal = m_DocManager.GlobalDataSet;
|
||||
int nFind = 0;
|
||||
|
||||
Int32? nHospLoc = (from resource in m_dsGlobal.Tables["Resources"].AsEnumerable()
|
||||
where resource.Field<string>("RESOURCE_NAME") == a.Resource
|
||||
select resource.Field<Int32?>("HOSPITAL_LOCATION_ID"))
|
||||
.SingleOrDefault();
|
||||
|
||||
//smh - following logic replaced with above...
|
||||
/*
|
||||
DataView rv = new DataView(this.m_DocManager.GlobalDataSet.Tables["Resources"]);
|
||||
rv.Sort = "RESOURCE_NAME ASC";
|
||||
int nFind = rv.Find((string)a.Resource);
|
||||
DataRowView drv = rv[nFind];
|
||||
|
||||
string sHospLoc = drv["HOSPITAL_LOCATION_ID"].ToString();
|
||||
sHospLoc = (sHospLoc == "") ? "0" : sHospLoc;
|
||||
int nHospLoc = 0;
|
||||
try
|
||||
{
|
||||
nHospLoc = Convert.ToInt32(sHospLoc);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.Write("CGView.AppointmentCheckIn Error: " + ex.Message);
|
||||
}
|
||||
*/
|
||||
|
||||
//smh new code
|
||||
//if the resource is linked to a valid hospital location, grab this locations providers
|
||||
//from the provider multiple and put them in the combo box.
|
||||
if (nHospLoc != 0)
|
||||
if (nHospLoc != null)
|
||||
{
|
||||
//RPC BSDX HOSP LOC PROVIDERS returns Table w/ Columns:
|
||||
//HOSPITAL_LOCATION_ID^BMXIEN (ie Prov IEN)^NAME^DEFALUT
|
||||
string sCommandText = "BSDX HOSP LOC PROVIDERS^" + nHospLoc;
|
||||
m_dtProvider = docManager.RPMSDataTable(sCommandText, "ClinicProviders");
|
||||
m_dtProvider.DefaultView.Sort = "NAME ASC";
|
||||
m_dtProvider = m_DocManager.RPMSDataTable(sCommandText, "ClinicProviders");
|
||||
|
||||
_providers = (from providerRow in m_dtProvider.AsEnumerable()
|
||||
orderby providerRow.Field<string>("NAME")
|
||||
select new Provider
|
||||
{
|
||||
IEN = providerRow.Field<int>("BMXIEN"),
|
||||
Name = providerRow.Field<string>("NAME"),
|
||||
Default = providerRow.Field<string>("DEFAULT") == "YES" ? true : false
|
||||
}).ToList();
|
||||
|
||||
cboProvider.DataSource = m_dtProvider;
|
||||
cboProvider.DisplayMember = "NAME";
|
||||
cboProvider.ValueMember = "BMXIEN";
|
||||
|
||||
//Add None to the top of the list
|
||||
DataRow drProv = m_dtProvider.NewRow();
|
||||
drProv.BeginEdit();
|
||||
drProv["HOSPITAL_LOCATION_ID"] = 0;
|
||||
drProv["NAME"] = "<None>";
|
||||
drProv["BMXIEN"] = 0;
|
||||
drProv.EndEdit();
|
||||
m_dtProvider.Rows.InsertAt(drProv, 0);
|
||||
cboProvider.SelectedIndex = 0;
|
||||
|
||||
//cboProvider.DisplayMember = "NAME";
|
||||
//cboProvider.ValueMember = "BMXIEN";
|
||||
_providers.Insert(0, new Provider { Name = "<None>", IEN = -1 });
|
||||
cboProvider.DataSource = _providers;
|
||||
cboProvider.SelectedIndex = _providers.FindIndex(prov => prov.Default);
|
||||
// if no provider is default, set default to be <none> item.
|
||||
if (cboProvider.SelectedIndex == -1) cboProvider.SelectedIndex = 0;
|
||||
////Add None to the top of the list
|
||||
//DataRow drProv = m_dtProvider.NewRow();
|
||||
//drProv.BeginEdit();
|
||||
//drProv["HOSPITAL_LOCATION_ID"] = 0;
|
||||
//drProv["NAME"] = "<None>";
|
||||
//drProv["BMXIEN"] = 0;
|
||||
//drProv.EndEdit();
|
||||
//m_dtProvider.Rows.InsertAt(drProv, 0);
|
||||
////cboProvider.SelectedIndex = 0;
|
||||
|
||||
//Find default provider--search for Yes in Field DEFAULT
|
||||
DataRow[] nRow = m_dtProvider.Select("DEFAULT='YES'", "NAME ASC");
|
||||
if (nRow.Length > 0) nFind = m_dtProvider.Rows.IndexOf(nRow[0]);
|
||||
cboProvider.SelectedIndex = nFind;
|
||||
//DataRow[] nRow = m_dtProvider.Select("DEFAULT='YES'", "NAME ASC");
|
||||
//if (nRow.Length > 0) nFind = m_dtProvider.Rows.IndexOf(nRow[0]);
|
||||
|
||||
|
||||
}
|
||||
//otherwise, just use the default provider table
|
||||
else
|
||||
{
|
||||
m_dtProvider = m_dsGlobal.Tables["Provider"];
|
||||
m_dtProvider.DefaultView.Sort = "NAME ASC";
|
||||
|
||||
cboProvider.DataSource = m_dtProvider;
|
||||
cboProvider.DisplayMember = "NAME";
|
||||
cboProvider.ValueMember = "BMXIEN";
|
||||
_providers = (from providerRow in m_dsGlobal.Tables["Provider"].AsEnumerable()
|
||||
orderby providerRow.Field<string>("NAME")
|
||||
select new Provider
|
||||
{
|
||||
IEN = providerRow.Field<int>("BMXIEN"),
|
||||
Name = providerRow.Field<string>("NAME"),
|
||||
Default = false
|
||||
}).ToList();
|
||||
|
||||
|
||||
/*m_dtProvider = m_dsGlobal.Tables["Provider"];
|
||||
m_dtProvider.DefaultView.Sort = "NAME ASC";*/
|
||||
_providers.Insert(0, new Provider { Name = "<None>", IEN = -1 });
|
||||
cboProvider.DataSource = _providers;
|
||||
cboProvider.SelectedIndex = 0;
|
||||
//cboProvider.DisplayMember = "NAME";
|
||||
//cboProvider.ValueMember = "BMXIEN";
|
||||
|
||||
//Add None to the top of the list
|
||||
DataRow drProv = m_dtProvider.NewRow();
|
||||
drProv.BeginEdit();
|
||||
drProv["NAME"] = "<None>";
|
||||
drProv["BMXIEN"] = 0;
|
||||
drProv.EndEdit();
|
||||
m_dtProvider.Rows.InsertAt(drProv, 0);
|
||||
cboProvider.SelectedIndex = 0;
|
||||
//DataRow drProv = m_dtProvider.NewRow();
|
||||
//drProv.BeginEdit();
|
||||
//drProv["NAME"] = "<None>";
|
||||
//drProv["BMXIEN"] = 0;
|
||||
//drProv.EndEdit();
|
||||
//m_dtProvider.Rows.InsertAt(drProv, 0);
|
||||
//cboProvider.SelectedIndex = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
m_sPatientName = a.PatientName;
|
||||
if (a.CheckInTime.Ticks != 0)
|
||||
|
@ -186,8 +232,10 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
m_dCheckIn = DateTime.Now;
|
||||
}
|
||||
|
||||
//Print Routing Slip based on user preferences.
|
||||
chkRoutingSlip.Checked = CGDocumentManager.Current.UserPreferences.PrintRoutingSlipAutomatically;
|
||||
|
||||
UpdateDialogData(true);
|
||||
m_bInit = false;
|
||||
}
|
||||
|
||||
|
||||
|
@ -362,6 +410,7 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
//
|
||||
// cboProvider
|
||||
//
|
||||
this.cboProvider.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cboProvider.Location = new System.Drawing.Point(96, 88);
|
||||
this.cboProvider.Name = "cboProvider";
|
||||
this.cboProvider.Size = new System.Drawing.Size(240, 21);
|
||||
|
@ -383,6 +432,7 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
this.chkRoutingSlip.TabIndex = 14;
|
||||
this.chkRoutingSlip.Text = "Print Routing Slip";
|
||||
this.toolTip1.SetToolTip(this.chkRoutingSlip, "Prints routing slip to the Windows Default Printer");
|
||||
this.chkRoutingSlip.CheckedChanged += new System.EventHandler(this.chkRoutingSlip_CheckedChanged);
|
||||
//
|
||||
// DCheckIn
|
||||
//
|
||||
|
@ -417,6 +467,17 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
this.UpdateDialogData(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Save this in User Preferences Object.
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void chkRoutingSlip_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
CGDocumentManager.Current.UserPreferences.PrintRoutingSlipAutomatically = chkRoutingSlip.Checked;
|
||||
}
|
||||
|
||||
#endregion Events
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -112,12 +112,12 @@
|
|||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
|
@ -43,6 +43,11 @@ namespace IndianHealthService.ClinicalScheduling
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns User Friendly Age. If Age < 5, then Years and Months
|
||||
/// If Age > 5, then only Years.
|
||||
/// Humans tend to round down their ages. So I follow the same rule here.
|
||||
/// </summary>
|
||||
public string UserFriendlyAge
|
||||
{
|
||||
get
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace IndianHealthService.ClinicalScheduling
|
||||
{
|
||||
/// <summary>
|
||||
/// Provider puppet
|
||||
/// </summary>
|
||||
public class Provider
|
||||
{
|
||||
public int IEN { get; set; }
|
||||
public string Name { get; set; }
|
||||
public bool Default { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Name;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace IndianHealthService.ClinicalScheduling
|
||||
{
|
||||
/// <summary>
|
||||
/// Designed to keep user preferences. Very basic for now.
|
||||
/// </summary>
|
||||
public class UserPreferences
|
||||
{
|
||||
public UserPreferences()
|
||||
{
|
||||
PrintAppointmentSlipAutomacially = false;
|
||||
PrintRoutingSlipAutomatically = false;
|
||||
}
|
||||
|
||||
public bool PrintAppointmentSlipAutomacially { get; set; }
|
||||
public bool PrintRoutingSlipAutomatically { get; set; }
|
||||
}
|
||||
}
|
Binary file not shown.
Loading…
Reference in New Issue