private void FillUsers() { UserGroups.Refresh(); Userods.Refresh(); SelectedGroupNum = 0; gridMain.BeginUpdate(); gridMain.Columns.Clear(); ODGridColumn col = new ODGridColumn(Lan.g("TableSecurity", "Username"), 90); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableSecurity", "Group"), 90); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableSecurity", "Employee"), 90); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableSecurity", "Provider"), 90); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableSecurity", "Clinic"), 90); gridMain.Columns.Add(col); gridMain.Rows.Clear(); ODGridRow row; string usertype = "all"; if (comboUsers.SelectedIndex == 1) { usertype = "prov"; } if (comboUsers.SelectedIndex == 2) { usertype = "emp"; } if (comboUsers.SelectedIndex == 3) { usertype = "other"; } int classNum = 0; if (comboSchoolClass.Visible && comboSchoolClass.SelectedIndex > 0) { classNum = SchoolClasses.List[comboSchoolClass.SelectedIndex - 1].SchoolClassNum; } table = Userods.RefreshSecurity(usertype, classNum); string userdesc; for (int i = 0; i < table.Rows.Count; i++) { row = new ODGridRow(); userdesc = table.Rows[i]["UserName"].ToString(); if (table.Rows[i]["IsHidden"].ToString() == "1") { userdesc += Lan.g(this, "(hidden)"); } row.Cells.Add(userdesc); row.Cells.Add(UserGroups.GetGroup(PIn.PInt(table.Rows[i]["UserGroupNum"].ToString())).Description); row.Cells.Add(Employees.GetNameFL(PIn.PInt(table.Rows[i]["EmployeeNum"].ToString()))); row.Cells.Add(Providers.GetNameLF(PIn.PInt(table.Rows[i]["ProvNum"].ToString()))); row.Cells.Add(Clinics.GetDesc(PIn.PInt(table.Rows[i]["ClinicNum"].ToString()))); gridMain.Rows.Add(row); } gridMain.EndUpdate(); }
private void FillGrid() { Operatories.Refresh(); gridMain.BeginUpdate(); gridMain.Rows.Clear(); UI.ODGridRow row; for (int i = 0; i < Operatories.List.Length; i++) { row = new OpenDental.UI.ODGridRow(); row.Cells.Add(Operatories.List[i].OpName); row.Cells.Add(Operatories.List[i].Abbrev); if (Operatories.List[i].IsHidden) { row.Cells.Add("X"); } else { row.Cells.Add(""); } row.Cells.Add(Clinics.GetDesc(Operatories.List[i].ClinicNum)); row.Cells.Add(Providers.GetAbbr(Operatories.List[i].ProvDentist)); row.Cells.Add(Providers.GetAbbr(Operatories.List[i].ProvHygienist)); if (Operatories.List[i].IsHygiene) { row.Cells.Add("X"); } else { row.Cells.Add(""); } gridMain.Rows.Add(row); } gridMain.EndUpdate(); }
///<summary>Used to update the main title bar when neither the patient nor the clinic need to change. ///Currently only used to refresh the title bar when the timer ticks for the update time countdown.</summary> public static string GetMainTitleSamePat() { string retVal = PrefC.GetString(PrefName.MainWindowTitle); if (!PrefC.GetBool(PrefName.EasyNoClinics) && _clinSelectedCur > 0) { if (retVal != "") { retVal += " - " + Lan.g("FormOpenDental", "Clinic") + ": "; } if (PrefC.GetBool(PrefName.TitleBarClinicUseAbbr)) { retVal += Clinics.GetAbbr(_clinSelectedCur); } else { retVal += Clinics.GetDesc(_clinSelectedCur); } } if (Security.CurUser != null) { retVal += " {" + Security.CurUser.UserName + "}"; } if (_patSelectedCur == null || _patSelectedCur.PatNum == 0 || _patSelectedCur.PatNum == -1) { retVal += MainTitleUpdateCountdown(); if (FormOpenDental.RegKeyIsForTesting) { retVal += " - " + Lan.g("FormOpenDental", "Developer Only License") + " - " + Lan.g("FormOpenDental", "Not for use with live patient data") + " - "; } return(retVal); } retVal += " - " + _patSelectedCur.GetNameLF(); if (PrefC.GetLong(PrefName.ShowIDinTitleBar) == 1) { retVal += " - " + _patSelectedCur.PatNum.ToString(); } else if (PrefC.GetLong(PrefName.ShowIDinTitleBar) == 2) { retVal += " - " + _patSelectedCur.ChartNumber; } else if (PrefC.GetLong(PrefName.ShowIDinTitleBar) == 3) { if (_patSelectedCur.Birthdate.Year > 1880) { retVal += " - " + _patSelectedCur.Birthdate.ToShortDateString(); } } if (_patSelectedCur.SiteNum != 0) { retVal += " - " + Sites.GetDescription(_patSelectedCur.SiteNum); } retVal += MainTitleUpdateCountdown(); if (FormOpenDental.RegKeyIsForTesting) { retVal += " - " + Lan.g("FormOpenDental", "Developer Only License") + " - " + Lan.g("FormOpenDental", "Not for use with live patient data") + " - "; } return(retVal); }
private void FillGrid() { DateTime dateFrom = PIn.Date(textDateFrom.Text); DateTime dateTo = PIn.Date(textDateTo.Text); long clinicNum = 0; if (comboClinic.SelectedIndex > 0) { clinicNum = Clinics.List[comboClinic.SelectedIndex - 1].ClinicNum; } ListClaimPay = ClaimPayments.GetForDateRange(dateFrom, dateTo, clinicNum); gridMain.BeginUpdate(); gridMain.Columns.Clear(); ODGridColumn col = new ODGridColumn(Lan.g(this, "Date"), 70); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Amount"), 75, HorizontalAlignment.Right); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Partial"), 40, HorizontalAlignment.Center); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Carrier"), 250); gridMain.Columns.Add(col); if (!PrefC.GetBool(PrefName.EasyNoClinics)) { col = new ODGridColumn(Lan.g(this, "Clinic"), 100); gridMain.Columns.Add(col); } col = new ODGridColumn(Lan.g(this, "Note"), 100); gridMain.Columns.Add(col); gridMain.Rows.Clear(); ODGridRow row; for (int i = 0; i < ListClaimPay.Count; i++) { row = new ODGridRow(); if (ListClaimPay[i].CheckDate.Year < 1800) { row.Cells.Add(""); } else { row.Cells.Add(ListClaimPay[i].CheckDate.ToShortDateString()); } row.Cells.Add(ListClaimPay[i].CheckAmt.ToString("c")); row.Cells.Add(ListClaimPay[i].IsPartial?"X":""); row.Cells.Add(ListClaimPay[i].CarrierName); if (!PrefC.GetBool(PrefName.EasyNoClinics)) { row.Cells.Add(Clinics.GetDesc(ListClaimPay[i].ClinicNum)); } row.Cells.Add(ListClaimPay[i].Note); gridMain.Rows.Add(row); } gridMain.EndUpdate(); gridMain.ScrollToEnd(); }
private void FillGrid() { Operatories.Refresh(); gridMain.BeginUpdate(); gridMain.Columns.Clear(); ODGridColumn col = new ODGridColumn(Lan.g("TableOperatories", "Op Name"), 150); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableOperatories", "Abbrev"), 70); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableOperatories", "IsHidden"), 64, HorizontalAlignment.Center); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableOperatories", "Clinic"), 80); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableOperatories", "Dentist"), 70); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableOperatories", "Hygienist"), 70); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableOperatories", "IsHygiene"), 72, HorizontalAlignment.Center); gridMain.Columns.Add(col); gridMain.Rows.Clear(); UI.ODGridRow row; for (int i = 0; i < Operatories.List.Length; i++) { row = new OpenDental.UI.ODGridRow(); row.Cells.Add(Operatories.List[i].OpName); row.Cells.Add(Operatories.List[i].Abbrev); if (Operatories.List[i].IsHidden) { row.Cells.Add("X"); } else { row.Cells.Add(""); } row.Cells.Add(Clinics.GetDesc(Operatories.List[i].ClinicNum)); row.Cells.Add(Providers.GetAbbr(Operatories.List[i].ProvDentist)); row.Cells.Add(Providers.GetAbbr(Operatories.List[i].ProvHygienist)); if (Operatories.List[i].IsHygiene) { row.Cells.Add("X"); } else { row.Cells.Add(""); } gridMain.Rows.Add(row); } gridMain.EndUpdate(); }
///<summary></summary> private string GetShortCodeOptInClinicTitle() { //Clinic 0 will be saved as a ClinicPref, not a practice wide Pref, so do not includeDefault here. string title = ClinicPrefs.GetPrefValue(PrefName.ShortCodeOptInClinicTitle, comboShortCodeClinic.SelectedClinicNum); if (!string.IsNullOrWhiteSpace(title)) { return(title); } title = (comboShortCodeClinic.SelectedClinicNum == 0) ? PrefC.GetString(PrefName.PracticeTitle) : Clinics.GetDesc(comboShortCodeClinic.SelectedClinicNum); if (!string.IsNullOrWhiteSpace(title)) { return(title); } //In case a clinic had an empty Description return(PrefC.GetString(PrefName.PracticeTitle)); }
private void FillGrid() { gridMain.BeginUpdate(); if (HasMoreThanOneMatch) { gridMain.Title = Lan.g(this, "Matches"); } gridMain.ListGridColumns.Clear(); GridColumn col = new GridColumn(Lan.g(this, "Last Name"), 110); gridMain.ListGridColumns.Add(col); col = new GridColumn(Lan.g(this, "First Name"), 110); gridMain.ListGridColumns.Add(col); col = new GridColumn(Lan.g(this, "Birthdate"), 110); gridMain.ListGridColumns.Add(col); if (PrefC.HasClinicsEnabled) { col = new GridColumn(Lan.g(this, "Clinic Name"), 110); gridMain.ListGridColumns.Add(col); } listPats = Patients.GetSimilarList(LnameEntered, FnameEntered, BdateEntered); gridMain.ListGridRows.Clear(); GridRow row; for (int i = 0; i < listPats.Count; i++) { row = new GridRow(); row.Cells.Add(listPats[i].LName); row.Cells.Add(listPats[i].FName); row.Cells.Add(listPats[i].Birthdate.ToShortDateString()); if (PrefC.HasClinicsEnabled) { string clinicName = Clinics.GetDesc(listPats[i].ClinicNum); row.Cells.Add(!string.IsNullOrWhiteSpace(clinicName) ? clinicName : "N/A"); } gridMain.ListGridRows.Add(row); } gridMain.EndUpdate(); }
private void FormPayPlanCharge_Load(object sender, System.EventArgs e) { textDate.Text = PayPlanChargeCur.ChargeDate.ToShortDateString(); //comboProvNum.Items.Clear(); //for(int i=0;i<ProviderC.List.Length;i++) { // comboProvNum.Items.Add(ProviderC.List[i].Abbr); // if(ProviderC.List[i].ProvNum==PayPlanChargeCur.ProvNum) // comboProvNum.SelectedIndex=i; //} textPrincipal.Text = PayPlanChargeCur.Principal.ToString("n"); textInterest.Text = PayPlanChargeCur.Interest.ToString("n"); textNote.Text = PayPlanChargeCur.Note; textProv.Text = Providers.GetAbbr(PayPlanChargeCur.ProvNum); if (PrefC.GetBool(PrefName.EasyNoClinics)) { labelClinic.Visible = false; textClinic.Visible = false; } else { textClinic.Text = Clinics.GetDesc(PayPlanChargeCur.ClinicNum); } }
public static string GetChanges(Procedure procCur, Procedure procOld, OrionProc orionProcCur, OrionProc orionProcOld) { Changes = ""; if (orionProcOld.DPC != orionProcCur.DPC) { if (Changes != "") { Changes += "\r\n"; } Changes += "DPC changed from " + POut.String(orionProcOld.DPC.ToString()) + " to " + POut.String(orionProcCur.DPC.ToString()) + "."; } if (orionProcOld.DPCpost != orionProcCur.DPCpost) { if (Changes != "") { Changes += "\r\n"; } Changes += "DPC Post Visit changed from " + POut.String(orionProcOld.DPCpost.ToString()) + " to " + POut.String(orionProcCur.DPCpost.ToString()) + "."; } //PatNum, AptNum, PlannedAptNum should never change--------------------------------------------------------------------------------------------- if (procOld.PatNum != procCur.PatNum) { if (Changes != "") { Changes += "\r\n"; } Changes += "Patient Num changed from " + procOld.PatNum + " to " + procCur.PatNum + "."; } if (procOld.AptNum != procCur.AptNum) { if (Changes != "") { Changes += "\r\n"; } Changes += "Apt Num changed from " + procOld.AptNum + " to " + procCur.AptNum + "."; } if (procOld.PlannedAptNum != procCur.PlannedAptNum) { if (Changes != "") { Changes += "\r\n"; } Changes += "Planned Apt Num changed from " + procOld.PlannedAptNum + " to " + procCur.PlannedAptNum + "."; } //Date and time related fields------------------------------------------------------------------------------------------------------------------ if (procOld.DateEntryC.Date != procCur.DateEntryC.Date) { if (Changes != "") { Changes += "\r\n"; } Changes += "Date Entry changed from " + procOld.DateEntryC.ToShortDateString() + " to " + procCur.DateEntryC.ToShortDateString() + "."; } if (procOld.ProcDate.Date != procCur.ProcDate.Date) { if (Changes != "") { Changes += "\r\n"; } Changes += "Proc Date changed from " + procOld.ProcDate.ToShortDateString() + " to " + procCur.ProcDate.ToShortDateString() + "."; } //if(procOld.StartTime != procCur.StartTime) { // if(Changes!=""){ Changes+="\r\n";} // Changes+="Start Time changed from "+procOld.StartTime+" to "+procCur.StartTime+"."; //} //if(procOld.StopTime != procCur.StopTime) { // if(Changes!=""){ Changes+="\r\n";} // Changes+="Stop Time changed from "+procOld.StopTime+" to "+procCur.StopTime+"."; //} if (procOld.ProcTime != procCur.ProcTime) { if (Changes != "") { Changes += "\r\n"; } Changes += "Procedure Time changed from " + (PIn.DateT(procOld.ProcTime.ToString()).ToShortTimeString() == "12:00 AM"?"none":PIn.DateT(procOld.ProcTime.ToString()).ToShortTimeString()) + " to " + (PIn.DateT(procCur.ProcTime.ToString()).ToShortTimeString() == "12:00 AM"?"none":PIn.DateT(procCur.ProcTime.ToString()).ToShortTimeString()) + "."; } if (procOld.ProcTimeEnd != procCur.ProcTimeEnd) { if (Changes != "") { Changes += "\r\n"; } Changes += "Procedure End Time changed from " + (PIn.DateT(procOld.ProcTimeEnd.ToString()).ToShortTimeString() == "12:00 AM"?"none":PIn.DateT(procOld.ProcTimeEnd.ToString()).ToShortTimeString()) + " to " + (PIn.DateT(procCur.ProcTimeEnd.ToString()).ToShortTimeString() == "12:00 AM"?"none":PIn.DateT(procCur.ProcTimeEnd.ToString()).ToShortTimeString()) + "."; } //Procedure, related areas, amount, hide graphics, etc.----------------------------------------------------------------------------------------- if (procOld.CodeNum != procCur.CodeNum) { if (Changes != "") { Changes += "\r\n"; } Changes += "Procedure changed from " + ProcedureCodes.GetLaymanTerm(procOld.CodeNum) + " to " + ProcedureCodes.GetLaymanTerm(procCur.CodeNum) + "."; } if (procOld.ProcFee != procCur.ProcFee) { if (Changes != "") { Changes += "\r\n"; } Changes += "Proc Fee changed from $" + procOld.ProcFee.ToString("F") + " to $" + procCur.ProcFee.ToString("F") + "."; } if (procOld.ToothNum != procCur.ToothNum) { if (Changes != "") { Changes += "\r\n"; } Changes += "Tooth Num changed from " + procOld.ToothNum + " to " + procCur.ToothNum + "."; } if (procOld.Surf != procCur.Surf) { if (Changes != "") { Changes += "\r\n"; } Changes += "Surface changed from " + procOld.Surf + " to " + procCur.Surf + "."; } if (procOld.ToothRange != procCur.ToothRange) { if (Changes != "") { Changes += "\r\n"; } Changes += "Tooth Range changed from " + procOld.ToothRange + " to " + procCur.ToothRange + "."; } if (procOld.HideGraphics != procCur.HideGraphics) { if (Changes != "") { Changes += "\r\n"; } Changes += "Hide Graphics changed from " + (procOld.HideGraphics?"Hide Graphics":"Do Not Hide Graphics") + " to " + (procCur.HideGraphics?"Hide Graphics":"Do Not Hide Graphics") + "."; } //Provider, Diagnosis, Priority, Place of Service, Clinic, Site--------------------------------------------------------------------------------- if (procOld.ProvNum != procCur.ProvNum) { if (Changes != "") { Changes += "\r\n"; } Changes += "Provider changed from " + Providers.GetAbbr(procOld.ProvNum) + " to " + Providers.GetAbbr(procCur.ProvNum) + "."; } if (procOld.Dx != procCur.Dx) { if (Changes != "") { Changes += "\r\n"; } Changes += "Diagnosis changed from " + DefC.GetDef(DefCat.Diagnosis, procOld.Dx).ItemName + " to " + DefC.GetDef(DefCat.Diagnosis, procCur.Dx).ItemName + "."; } if (procOld.Priority != procCur.Priority) { if (Changes != "") { Changes += "\r\n"; } Changes += "Priority changed from " + ((procOld.Priority != 0)?DefC.GetDef(DefCat.TxPriorities, procOld.Priority).ItemName:"no priority") + " to " + ((procCur.Priority != 0)?DefC.GetDef(DefCat.TxPriorities, procCur.Priority).ItemName:"no priority") + "."; } if (procOld.PlaceService != procCur.PlaceService) { if (Changes != "") { Changes += "\r\n"; } Changes += "Place of Service changed from " + procOld.PlaceService.ToString() + " to " + procCur.PlaceService.ToString() + "."; } if (procOld.ClinicNum != procCur.ClinicNum) { if (Changes != "") { Changes += "\r\n"; } Changes += "Clinic changed from " + Clinics.GetDesc(procOld.ClinicNum) + " to " + Clinics.GetDesc(procCur.ClinicNum) + "."; } if (procOld.SiteNum != procCur.SiteNum) { if (Changes != "") { Changes += "\r\n"; } Changes += "Site changed from " + (procOld.SiteNum == 0?"none":Sites.GetDescription(procOld.SiteNum)) + " to " + (procCur.SiteNum == 0?"none":Sites.GetDescription(procCur.SiteNum)) + "."; } //Prosthesis reverse lookup--------------------------------------------------------------------------------------------------------------------- if (procOld.Prosthesis != procCur.Prosthesis) { if (Changes != "") { Changes += "\r\n"; } string prosthesisOld; switch (procOld.Prosthesis.ToString()) { case "": prosthesisOld = "no"; break; case "I": prosthesisOld = "Initial"; break; case "R": prosthesisOld = "Replacement"; break; default: prosthesisOld = "error"; break; } string prosthesisCur; switch (procCur.Prosthesis.ToString()) { case "": prosthesisCur = "no"; break; case "I": prosthesisCur = "Initial"; break; case "R": prosthesisCur = "Replacement"; break; default: prosthesisCur = "error"; break; } Changes += "Prosthesis changed from " + prosthesisOld + " to " + prosthesisCur + "."; } if (procOld.DateOriginalProsth.Date != procCur.DateOriginalProsth.Date) { if (Changes != "") { Changes += "\r\n"; } Changes += "Date of Original Prosthesis changed from " + procOld.DateOriginalProsth.ToShortDateString() + " to " + procCur.DateOriginalProsth.ToShortDateString() + "."; } //Claim Note & Orion Proc Fields---------------------------------------------------------------------------------------------------------------- if (procOld.ClaimNote != procCur.ClaimNote) { if (Changes != "") { Changes += "\r\n"; } Changes += "Claim Note changed from " + (procOld.ClaimNote == ""?"none":"'" + procOld.ClaimNote + "'") + " to " + (procCur.ClaimNote == ""?"none":"'" + procCur.ClaimNote + "'"); } if (orionProcOld.OrionProcNum != orionProcCur.OrionProcNum) { if (Changes != "") { Changes += "\r\n"; } Changes += "Orion Proc Num changed from " + POut.Long(orionProcOld.OrionProcNum) + " to " + POut.Long(orionProcCur.OrionProcNum) + "."; } if (orionProcOld.ProcNum != orionProcCur.ProcNum) { if (Changes != "") { Changes += "\r\n"; } Changes += "Proc Num changed from " + POut.Long(orionProcOld.ProcNum) + " to " + POut.Long(orionProcCur.ProcNum) + "."; } //Orion Status Reverse Lookup for Description----------------------------------//None is equivalent to TP--------------------------------------- if (orionProcOld.Status2 != orionProcCur.Status2 && !(orionProcOld.Status2 == OrionStatus.None && orionProcCur.Status2 == OrionStatus.TP)) { if (Changes != "") { Changes += "\r\n"; } string[] status2 = new string[2]; string[] status2Desc = new string[2]; status2[0] = orionProcOld.Status2.ToString(); status2[1] = orionProcCur.Status2.ToString(); for (int i = 0; i < 2; i++) { switch (status2[i]) { case "None": status2Desc[i] = "TP-treatment planned"; break; case "TP": status2Desc[i] = "TP-treatment planned"; break; case "C": status2Desc[i] = "C-completed"; break; case "E": status2Desc[i] = "E-existing prior to incarceration"; break; case "R": status2Desc[i] = "R-refused treatment"; break; case "RO": status2Desc[i] = "RO-referred out to specialist"; break; case "CS": status2Desc[i] = "CS-completed by specialist"; break; case "CR": status2Desc[i] = "CR-completed by registry"; break; case "CA_Tx": status2Desc[i] = "CA_Tx-cancelled, tx plan changed"; break; case "CA_EPRD": status2Desc[i] = "CA_EPRD-cancelled, eligible parole"; break; case "CA_P/D": status2Desc[i] = "CA_P/D--cancelled, parole/discharge"; break; case "S": status2Desc[i] = "S-suspended, unacceptable plaque"; break; case "ST": status2Desc[i] = "ST-stop clock, multi visit"; break; case "W": status2Desc[i] = "W-watch"; break; case "A": status2Desc[i] = "A-alternative"; break; default: status2Desc[i] = "error"; break; } } Changes += "Orion Procedure Status changed from " + status2Desc[0] + " to " + status2Desc[1] + "."; } //Other orion fields---------------------------------------------------------------------------------------------------------------------------- if (orionProcOld.DateScheduleBy.Date != orionProcCur.DateScheduleBy.Date) { if (Changes != "") { Changes += "\r\n"; } Changes += "Date Schedule By changed from " + orionProcOld.DateScheduleBy.ToShortDateString() + " to " + orionProcCur.DateScheduleBy.ToShortDateString() + "."; } if (orionProcOld.DateStopClock.Date != orionProcCur.DateStopClock.Date) { if (Changes != "") { Changes += "\r\n"; } Changes += "Date Stop Clock changed from " + orionProcOld.DateStopClock.ToShortDateString() + " to " + orionProcCur.DateStopClock.ToShortDateString() + "."; } if (orionProcOld.IsOnCall != orionProcCur.IsOnCall) { if (Changes != "") { Changes += "\r\n"; } Changes += "Is On Call changed from " + (orionProcOld.IsOnCall?"Is On Call":"Is Not On Call") + " to " + (orionProcCur.IsOnCall?"Is On Call":"Is Not On Call") + "."; } if (orionProcOld.IsEffectiveComm != orionProcCur.IsEffectiveComm) { if (Changes != "") { Changes += "\r\n"; } Changes += "Is Effective Comm changed from " + (orionProcOld.IsEffectiveComm?"Is an Effective Communicator":"Is Not an Effective Communicator") + " to " + (orionProcCur.IsEffectiveComm?"Is an Effective Communicator":"Is Not an Effective Communicator") + "."; } if (orionProcOld.IsRepair != orionProcCur.IsRepair) { if (Changes != "") { Changes += "\r\n"; } Changes += "Is Repair changed from " + (orionProcOld.IsRepair?"Is a Repair":"Is Not a Repair") + " to " + (orionProcCur.IsRepair?"Is a Repair":"Is Not a Repair") + "."; } //Medical fields-------------------------------------------------------------------------------------------------------------------------------- if (procOld.MedicalCode != procCur.MedicalCode) { if (Changes != "") { Changes += "\r\n"; } Changes += "Medical Code changed from " + (procOld.MedicalCode == ""?"none":procOld.MedicalCode) + " to " + (procCur.MedicalCode == ""?"none":procCur.MedicalCode) + "."; } if (procOld.DiagnosticCode != procCur.DiagnosticCode) { if (Changes != "") { Changes += "\r\n"; } Changes += "Diagnostic Code changed from " + (procOld.DiagnosticCode == ""?"none":procOld.DiagnosticCode) + " to " + (procCur.DiagnosticCode == ""?"none":procCur.DiagnosticCode) + "."; } if (procOld.IsPrincDiag != procCur.IsPrincDiag) { if (Changes != "") { Changes += "\r\n"; } Changes += "Is Princ Diag changed from " + (procOld.IsPrincDiag?"Principal Diagnosis":"Not Principal Diagnosis") + " to " + (procCur.IsPrincDiag?"Principal Diagnosis":"Not Principal Diagnosis") + "."; } //if(procOld.RevCode != procCur.RevCode) { // if(Changes!=""){ Changes+="\r\n";} // Changes+="Rev Code changed from "+POut.String(procOld.RevCode)+"' to '"+POut.String(procCur.RevCode)+"."; //} //Proc status and billing fields---------------------------------------------------------------------------------------------------------------- if (procOld.ProcStatus != procCur.ProcStatus) { if (Changes != "") { Changes += "\r\n"; } Changes += "Procedure Status changed from " + procOld.ProcStatus.ToString() + " to " + procCur.ProcStatus.ToString() + "."; } if (procOld.DateTP.Date != procCur.DateTP.Date && procOld.DateTP.Date != DateTime.MinValue.Date) { if (Changes != "") { Changes += "\r\n"; } Changes += "Date TP changed from " + procOld.DateTP.ToShortDateString() + " to " + procCur.DateTP.ToShortDateString() + "."; } //if(procOld.BillingTypeOne != procCur.BillingTypeOne) { // if(Changes!=""){ Changes+="\r\n";} // Changes+="Billing Type One changed from "+(procOld.BillingTypeOne!=0?DefC.GetDef(DefCat.BillingTypes,procOld.BillingTypeOne).ItemName:"none") // +" to "+(procCur.BillingTypeOne!=0?DefC.GetDef(DefCat.BillingTypes,procCur.BillingTypeOne).ItemName:"none")+"."; //} //if(procOld.BillingTypeTwo != procCur.BillingTypeTwo) { // if(Changes!=""){ Changes+="\r\n";} // Changes+="Billing Type Two changed from "+(procOld.BillingTypeTwo!=0?DefC.GetDef(DefCat.BillingTypes,procOld.BillingTypeTwo).ItemName:"none") // +" to "+(procCur.BillingTypeTwo!=0?DefC.GetDef(DefCat.BillingTypes,procCur.BillingTypeTwo).ItemName:"none")+"."; //} if (procOld.ProcNumLab != procCur.ProcNumLab) { if (Changes != "") { Changes += "\r\n"; } Changes += "Proc Num Lab changed from " + POut.Long(procOld.ProcNumLab) + " to " + POut.Long(procCur.ProcNumLab) + "."; } //if(procOld.UnitCode != procCur.UnitCode) { // if(Changes!=""){ Changes+="\r\n";} // Changes+="Unit Code changed from "+POut.String(procOld.UnitCode)+" to "+POut.String(procCur.UnitCode)+"."; //} //UnitQty, Canadian Type Codes, and Note-------------------------------------------------------------------------------------------------------- if (procOld.UnitQty != procCur.UnitQty) { if (Changes != "") { Changes += "\r\n"; } Changes += "Unit Quantity changed from " + POut.Int(procOld.UnitQty) + " to " + POut.Int(procCur.UnitQty) + "."; } //if(procOld.CanadianTypeCodes != procCur.CanadianTypeCodes) { // if(Changes!=""){ Changes+="\r\n";} // Changes+="Canadian Code Type changed from "+POut.String(procOld.CanadianTypeCodes)+" to "+POut.String(procCur.CanadianTypeCodes)+"."; // } if (procOld.Note != procCur.Note && !(procOld.Note == null && procCur.Note == "")) //Null note is equivalent to an empty note string. { if (Changes != "") { Changes += "\r\n"; } Changes += "Note changed from " + (procOld.Note == ""?"none":"'" + procOld.Note + "'") + " to " + (procCur.Note == ""?"none":"'" + procCur.Note + "'"); } return(Changes); }
private void butOK_Click(object sender, System.EventArgs e) { if (!checkAllProv.Checked && listProv.SelectedIndices.Count == 0) { MsgBox.Show(this, "At least one provider must be selected."); return; } if (!PrefC.GetBool(PrefName.EasyNoClinics)) { if (!checkAllClin.Checked && listClin.SelectedIndices.Count == 0) { MsgBox.Show(this, "At least one clinic must be selected."); return; } } if (listType.SelectedIndices.Count == 0) { MsgBox.Show(this, "At least one type must be selected."); return; } string whereProv = ""; if (!checkAllProv.Checked) { for (int i = 0; i < listProv.SelectedIndices.Count; i++) { if (i == 0) { whereProv += " AND ("; } else { whereProv += "OR "; } whereProv += "adjustment.ProvNum = " + POut.Long(ProviderC.ListShort[listProv.SelectedIndices[i]].ProvNum) + " "; } whereProv += ") "; } string whereClin = ""; if (!checkAllClin.Checked) { for (int i = 0; i < listClin.SelectedIndices.Count; i++) { if (i == 0) { whereClin += " AND ("; } else { whereClin += "OR "; } if (listClin.SelectedIndices[i] == 0) { whereClin += "adjustment.ClinicNum = 0 "; } else { whereClin += "adjustment.ClinicNum = " + POut.Long(Clinics.List[listClin.SelectedIndices[i] - 1].ClinicNum) + " "; } } whereClin += ") "; } string whereType = "("; for (int i = 0; i < listType.SelectedIndices.Count; i++) { if (i > 0) { whereType += "OR "; } whereType += "adjustment.AdjType = '" + POut.Long(DefC.Short[(int)DefCat.AdjTypes][listType.SelectedIndices[i]].DefNum) + "' "; } whereType += ")"; ReportSimpleGrid report = new ReportSimpleGrid(); report.Query = "SELECT adjustment.AdjDate," + DbHelper.Concat("patient.LName", "', '", "patient.FName", "', '", "patient.MiddleI") + "," + "adjustment.ProvNum,adjustment.ClinicNum," + "definition.ItemName,adjustment.AdjNote,adjustment.AdjAmt FROM " + "adjustment,patient,definition WHERE adjustment.AdjType=definition.DefNum " + "AND patient.PatNum=adjustment.PatNum " + whereProv + whereClin + "AND " + whereType + " " + "AND adjustment.AdjDate >= " + POut.Date(date1.SelectionStart) + " " + "AND adjustment.AdjDate <= " + POut.Date(date2.SelectionStart); report.Query += " ORDER BY adjustment.AdjDate"; FormQuery2 = new FormQuery(report); FormQuery2.IsReport = true; DataTable table = report.GetTempTable(); report.TableQ = new DataTable(null); int colI = 6; if (!PrefC.GetBool(PrefName.EasyNoClinics)) { colI = 7; } for (int i = 0; i < colI; i++) //add columns { report.TableQ.Columns.Add(new System.Data.DataColumn()); //blank columns } report.InitializeColumns(); DataRow row; double dbl; for (int i = 0; i < table.Rows.Count; i++) { row = report.TableQ.NewRow(); //create new row called 'row' based on structure of TableQ row[0] = PIn.Date(table.Rows[i][0].ToString()).ToShortDateString(); row[1] = table.Rows[i][1].ToString(); //name row[2] = Providers.GetAbbr(PIn.Long(table.Rows[i][2].ToString())); //prov colI = 3; if (!PrefC.GetBool(PrefName.EasyNoClinics)) { row[colI] = Clinics.GetDesc(PIn.Long(table.Rows[i][3].ToString())); //clinic colI++; } row[colI] = table.Rows[i][4].ToString(); //Type colI++; row[colI] = table.Rows[i][5].ToString(); //Note colI++; dbl = PIn.Double(table.Rows[i][6].ToString()); //Amount row[colI] = dbl.ToString("n"); report.ColTotal[colI] += dbl; report.TableQ.Rows.Add(row); } FormQuery2.ResetGrid(); report.Title = "Daily Adjustments"; report.SubTitle.Add(PrefC.GetString(PrefName.PracticeTitle)); report.SubTitle.Add(date1.SelectionStart.ToString("d") + " - " + date2.SelectionStart.ToString("d")); if (checkAllProv.Checked) { report.SubTitle.Add(Lan.g(this, "All Providers")); } else { string provNames = ""; for (int i = 0; i < listProv.SelectedIndices.Count; i++) { if (i > 0) { provNames += ", "; } provNames += ProviderC.ListShort[listProv.SelectedIndices[i]].Abbr; } report.SubTitle.Add(provNames); } if (!PrefC.GetBool(PrefName.EasyNoClinics)) { if (checkAllClin.Checked) { report.SubTitle.Add(Lan.g(this, "All Clinics")); } else { string clinNames = ""; for (int i = 0; i < listClin.SelectedIndices.Count; i++) { if (i > 0) { clinNames += ", "; } if (listClin.SelectedIndices[i] == 0) { clinNames += Lan.g(this, "Unassigned"); } else { clinNames += Clinics.List[listClin.SelectedIndices[i] - 1].Description; } } report.SubTitle.Add(clinNames); } } report.SetColumn(this, 0, "Date", 90); report.SetColumn(this, 1, "Patient Name", 130); report.SetColumn(this, 2, "Prov", 60); if (!PrefC.GetBool(PrefName.EasyNoClinics)) { report.SetColumn(this, 3, "Clinic", 70); report.SetColumn(this, 4, "Adjustment Type", 150); report.SetColumn(this, 5, "Note", 150); report.SetColumn(this, 6, "Amount", 75, HorizontalAlignment.Right); } else { report.SetColumn(this, 3, "Adjustment Type", 150); report.SetColumn(this, 4, "Note", 150); report.SetColumn(this, 5, "Amount", 75, HorizontalAlignment.Right); } FormQuery2.ShowDialog(); DialogResult = DialogResult.OK; }
///<summary>Accepts null for pat and 0 for clinicNum.</summary> public static string GetMainTitle(Patient pat, long clinicNum) { string retVal = PrefC.GetString(PrefName.MainWindowTitle); object[] parameters = { retVal }; Plugins.HookAddCode(null, "PatientL.GetMainTitle_beginning", parameters); retVal = (string)parameters[0]; _patSelectedCur = pat; _clinSelectedCur = clinicNum; if (!PrefC.GetBool(PrefName.EasyNoClinics) && clinicNum > 0) { if (retVal != "") { retVal += " - " + Lan.g("FormOpenDental", "Clinic") + ": "; } if (PrefC.GetBool(PrefName.TitleBarClinicUseAbbr)) { retVal += Clinics.GetAbbr(clinicNum); } else { retVal += Clinics.GetDesc(clinicNum); } } if (Security.CurUser != null) { retVal += " {" + Security.CurUser.UserName + "}"; } if (pat == null || pat.PatNum == 0 || pat.PatNum == -1) { retVal += MainTitleUpdateCountdown(); if (FormOpenDental.RegKeyIsForTesting) { retVal += " - " + Lan.g("FormOpenDental", "Developer Only License") + " - " + Lan.g("FormOpenDental", "Not for use with live patient data") + " - "; } return(retVal); } retVal += " - " + pat.GetNameLF(); if (PrefC.GetLong(PrefName.ShowIDinTitleBar) == 1) { retVal += " - " + pat.PatNum.ToString(); } else if (PrefC.GetLong(PrefName.ShowIDinTitleBar) == 2) { retVal += " - " + pat.ChartNumber; } else if (PrefC.GetLong(PrefName.ShowIDinTitleBar) == 3) { if (pat.Birthdate.Year > 1880) { retVal += " - " + pat.Birthdate.ToShortDateString(); } } if (pat.SiteNum != 0) { retVal += " - " + Sites.GetDescription(pat.SiteNum); } retVal += MainTitleUpdateCountdown(); if (FormOpenDental.RegKeyIsForTesting) { retVal += " - " + Lan.g("FormOpenDental", "Developer Only License") + " - " + Lan.g("FormOpenDental", "Not for use with live patient data") + " - "; } return(retVal); }
private void FillGrid() { gridMain.BeginUpdate(); gridMain.ListGridColumns.Clear(); List <DisplayField> fieldsForGrid = DisplayFields.GetForCategory(DisplayFieldCategory.AccountModule); if (!PrefC.HasClinicsEnabled) { //remove clinics from displayfields if clinics are disabled fieldsForGrid.RemoveAll(x => x.InternalName.ToLower().Contains("clinic")); } fieldsForGrid.RemoveAll(x => x.InternalName.In("Abbr", "Balance", "Signed")); HorizontalAlignment align; GridSortingStrategy sort; for (int i = 0; i < fieldsForGrid.Count; i++) { align = HorizontalAlignment.Left; sort = GridSortingStrategy.StringCompare; if (fieldsForGrid[i].InternalName.In("Charges", "Credits")) { align = HorizontalAlignment.Right; sort = GridSortingStrategy.AmountParse; } if (fieldsForGrid[i].InternalName == "Tth") { sort = GridSortingStrategy.ToothNumberParse; } if (fieldsForGrid[i].InternalName == "Date") { sort = GridSortingStrategy.DateParse; } gridMain.ListGridColumns.Add(new GridColumn(fieldsForGrid[i].Description == ""?fieldsForGrid[i].InternalName:fieldsForGrid[i].Description, fieldsForGrid[i].ColumnWidth, align, sort)); } if (gridMain.ListGridColumns.Sum(x => x.ColWidth) > gridMain.Width) { gridMain.HScrollVisible = true; } gridMain.ListGridRows.Clear(); GridRow row; for (int i = 0; i < _listLimitedRows.Count; i++) { LimitedRow limitedRow = _listLimitedRows[i]; if (!limitedRow.Type.In(listBoxTransTypes.GetListSelected <AccountEntryType>())) { continue; } DateTime date = limitedRow.DateTime.Date; if (date.Date < odDatePickerFrom.GetDateTime().Date || date.Date > odDatePickerTo.GetDateTime().Date) { continue; //do not add to grid if it is outside the filtered date range. } row = new GridRow(); for (int f = 0; f < fieldsForGrid.Count; f++) { switch (fieldsForGrid[f].InternalName) { case "Date": row.Cells.Add(date.ToShortDateString()); break; case "Patient": row.Cells.Add(limitedRow.PatientName); break; case "Prov": row.Cells.Add(limitedRow.ProvName); break; case "Clinic": row.Cells.Add(Clinics.GetAbbr(limitedRow.ClinicNum)); break; case "ClinicDesc": row.Cells.Add(Clinics.GetDesc(limitedRow.ClinicNum)); break; case "Code": row.Cells.Add(limitedRow.ProcCode); break; case "Tth": row.Cells.Add(limitedRow.Tooth); break; case "Description": row.Cells.Add(limitedRow.Description); break; case "Charges": row.Cells.Add(limitedRow.Charges); break; case "Credits": row.Cells.Add(limitedRow.Credits); break; default: row.Cells.Add(""); break; } } row.ColorText = limitedRow.ColorText; if (i == _listLimitedRows.Count - 1 || limitedRow.DateTime.Date != _listLimitedRows[i + 1].DateTime.Date) { row.ColorLborder = Color.Black; } row.Tag = limitedRow; gridMain.ListGridRows.Add(row); } gridMain.EndUpdate(); for (int i = 0; i < gridMain.ListGridRows.Count; i++) { LimitedRow lRow = gridMain.ListGridRows[i].Tag as LimitedRow; gridMain.SetSelected(i, _dictSelectedRows.TryGetValue(lRow.Type, out List <long> listPriKeys) && listPriKeys.Contains(lRow.PrimaryKey)); } //this will refresh _dictSelectedRows and add any associated trans to the previously selected rows SelectAssociatedTrans(); }
private void FillUsers() { UserGroups.RefreshCache(); Cache.Refresh(InvalidType.Security); SelectedGroupNum = 0; gridMain.BeginUpdate(); gridMain.Columns.Clear(); ODGridColumn col = new ODGridColumn(Lan.g("TableSecurity", "Username"), 90); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableSecurity", "Group"), 90); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableSecurity", "Employee"), 90); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableSecurity", "Provider"), 90); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableSecurity", "Clinic"), 80); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableSecurity", "ClinicRestricted"), 100, HorizontalAlignment.Center); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableSecurity", "Strong"), 80, HorizontalAlignment.Center); gridMain.Columns.Add(col); gridMain.Rows.Clear(); ODGridRow row; string usertype = "all"; if (comboUsers.SelectedIndex == 1) { usertype = "prov"; } if (comboUsers.SelectedIndex == 2) { usertype = "emp"; } if (comboUsers.SelectedIndex == 3) { usertype = "other"; } long classNum = 0; if (comboSchoolClass.Visible && comboSchoolClass.SelectedIndex > 0) { classNum = SchoolClasses.List[comboSchoolClass.SelectedIndex - 1].SchoolClassNum; } ListUser = Userods.RefreshSecurity(usertype, classNum); string userdesc; for (int i = 0; i < ListUser.Count; i++) { row = new ODGridRow(); userdesc = ListUser[i].UserName; if (ListUser[i].IsHidden) { userdesc += Lan.g(this, "(hidden)"); } row.Cells.Add(userdesc); row.Cells.Add(UserGroups.GetGroup(ListUser[i].UserGroupNum).Description); row.Cells.Add(Employees.GetNameFL(ListUser[i].EmployeeNum)); row.Cells.Add(Providers.GetLongDesc(ListUser[i].ProvNum)); row.Cells.Add(Clinics.GetDesc(ListUser[i].ClinicNum)); row.Cells.Add(ListUser[i].ClinicIsRestricted?"X":""); row.Cells.Add(ListUser[i].PasswordIsStrong?"X":""); gridMain.Rows.Add(row); } gridMain.EndUpdate(); }
///<summary>Used to update the main title bar when neither the patient nor the clinic need to change. ///Currently only used to refresh the title bar when the timer ticks for the update time countdown.</summary> public static string GetMainTitleSamePat() { string retVal = PrefC.GetString(PrefName.MainWindowTitle); if (PrefC.HasClinicsEnabled && _clinSelectedCur > 0) { if (retVal != "") { retVal += " - " + Lan.g("FormOpenDental", "Clinic") + ": "; } if (PrefC.GetBool(PrefName.TitleBarClinicUseAbbr)) { retVal += Clinics.GetAbbr(_clinSelectedCur); } else { retVal += Clinics.GetDesc(_clinSelectedCur); } } if (Security.CurUser != null) { retVal += " {" + Security.CurUser.UserName + "}"; } if (_patSelectedCur == null || _patSelectedCur.PatNum == 0 || _patSelectedCur.PatNum == -1) { retVal += MainTitleUpdateCountdown(); if (FormOpenDental.RegKeyIsForTesting) { retVal += " - " + Lan.g("FormOpenDental", "Developer Only License") + " - " + Lan.g("FormOpenDental", "Not for use with live patient data") + " - "; } //Now check to see if this database has been put into "Testing Mode" if (Introspection.IsTestingMode) { retVal += " <TESTING MODE ENABLED> "; } return(retVal); } retVal += " - " + _patSelectedCur.GetNameLF(); if (PrefC.GetBool(PrefName.TitleBarShowSpecialty)) { retVal += string.IsNullOrWhiteSpace(_patSelectedCur.Specialty) ? "" : " (" + _patSelectedCur.Specialty + ")"; } if (PrefC.GetLong(PrefName.ShowIDinTitleBar) == 1) { retVal += " - " + _patSelectedCur.PatNum.ToString(); } else if (PrefC.GetLong(PrefName.ShowIDinTitleBar) == 2) { retVal += " - " + _patSelectedCur.ChartNumber; } else if (PrefC.GetLong(PrefName.ShowIDinTitleBar) == 3) { if (_patSelectedCur.Birthdate.Year > 1880) { retVal += " - " + _patSelectedCur.Birthdate.ToShortDateString(); } } if (_patSelectedCur.SiteNum != 0) { retVal += " - " + Sites.GetDescription(_patSelectedCur.SiteNum); } retVal += MainTitleUpdateCountdown(); if (FormOpenDental.RegKeyIsForTesting) { retVal += " - " + Lan.g("FormOpenDental", "Developer Only License") + " - " + Lan.g("FormOpenDental", "Not for use with live patient data") + " - "; } //Now check to see if this database has been put into "Testing Mode" if (Introspection.IsTestingMode) { retVal += " <TESTING MODE ENABLED> "; } return(retVal); }
private void FillConditions() { gridConditions.BeginUpdate(); gridConditions.ListGridColumns.Clear(); GridColumn col = new GridColumn(Lan.g(this, "Type"), 120); gridConditions.ListGridColumns.Add(col); col = new GridColumn(Lan.g(this, "Operator"), 80, HorizontalAlignment.Center); gridConditions.ListGridColumns.Add(col); col = new GridColumn(Lan.g(this, "Value"), 150); gridConditions.ListGridColumns.Add(col); gridConditions.ListGridRows.Clear(); GridRow row; RequiredFieldName currentType; string allCondValues = ""; for (int i = 0; i < _reqFieldCur.ListRequiredFieldConditions.Count; i++) { row = new GridRow(); currentType = _reqFieldCur.ListRequiredFieldConditions[i].ConditionType; if (currentType == RequiredFieldName.Birthdate) { row.Cells.Add(Lan.g("enumRequiredFieldName", "Age")); } else { row.Cells.Add(Lan.g("enumRequiredFieldName", currentType.ToString())); } if (_reqFieldCur.ListRequiredFieldConditions[i].Operator == ConditionOperator.NotEquals) { row.Cells.Add(Lan.g(this, "Is not")); } else { row.Cells.Add(Lan.g(this, "Is")); //If the operator is <,>,<=, or >=, this will be reflected in the 'Value' column } //Construct the string for the 'Value' column if (currentType == RequiredFieldName.Birthdate || currentType == RequiredFieldName.AdmitDate || currentType == RequiredFieldName.DateTimeDeceased) { //Continuous values //'Value' column will end up looking like: Greater than 18 and // less than 26 switch (_reqFieldCur.ListRequiredFieldConditions[i].Operator) { case ConditionOperator.GreaterThan: allCondValues += Lan.g(this, "greater than") + " "; break; case ConditionOperator.LessThan: allCondValues += Lan.g(this, "less than") + " "; break; case ConditionOperator.GreaterThanOrEqual: allCondValues += Lan.g(this, "greater than or equal to") + " "; break; case ConditionOperator.LessThanOrEqual: allCondValues += Lan.g(this, "less than or equal to") + " "; break; } if (allCondValues.Length > 0) { allCondValues = allCondValues[0].ToString().ToUpper() + allCondValues.Substring(1); //Turn the first letter to uppercase } } string condVal = _reqFieldCur.ListRequiredFieldConditions[i].ConditionValue; switch (currentType) { //These RequiredFieldName types store a FK to another value case RequiredFieldName.Clinic: if (condVal == "0") { condVal = Lan.g(this, "Unassigned"); } else { condVal = Clinics.GetDesc(PIn.Long(condVal)); } break; case RequiredFieldName.BillingType: condVal = Defs.GetName(DefCat.BillingTypes, PIn.Long(condVal)); break; case RequiredFieldName.PrimaryProvider: condVal = Providers.GetLongDesc(PIn.Long(condVal)); break; } allCondValues += condVal; if (i < _reqFieldCur.ListRequiredFieldConditions.Count - 1 && _reqFieldCur.ListRequiredFieldConditions[i + 1].ConditionType == currentType) //The next condition is of the same type { if ((currentType == RequiredFieldName.Birthdate || currentType == RequiredFieldName.AdmitDate || currentType == RequiredFieldName.DateTimeDeceased) && _reqFieldCur.ListRequiredFieldConditions[i].ConditionRelationship == LogicalOperator.And) { allCondValues += " " + Lan.g(this, "and") + "\r\n"; } else { allCondValues += " " + Lan.g(this, "or") + "\r\n"; } //Don't add the row, continue building the 'Value' string } else //The last condition of this type, now add the row { row.Cells.Add(allCondValues); row.Tag = currentType; gridConditions.ListGridRows.Add(row); allCondValues = ""; //for rebuilding the next Value string } } gridConditions.EndUpdate(); }
private void CreateIndividual(ReportSimpleGrid report) { //added Procnum to retrieve all codes report.Query = "SELECT procedurelog.ProcDate," + DbHelper.Concat("patient.LName", "', '", "patient.FName", "' '", "patient.MiddleI") + " " + "AS plfname, procedurecode.ProcCode," + "procedurelog.ToothNum,procedurecode.Descript,provider.Abbr," + "procedurelog.ClinicNum," + "procedurelog.ProcFee-IFNULL(SUM(claimproc.WriteOff),0) "; //\"$fee\" " //if no writeoff, then subtract 0 if (DataConnection.DBtype == DatabaseType.MySql) { report.Query += "$fee "; } else //Oracle needs quotes. { report.Query += "\"$fee\" "; } report.Query += "FROM patient,procedurecode,provider,procedurelog " + "LEFT JOIN claimproc ON procedurelog.ProcNum=claimproc.ProcNum " + "AND claimproc.Status='7' " //only CapComplete writeoffs are subtracted here. + "WHERE procedurelog.ProcStatus = '2' " + "AND patient.PatNum=procedurelog.PatNum " + "AND procedurelog.CodeNum=procedurecode.CodeNum " + "AND provider.ProvNum=procedurelog.ProvNum " + whereProv + whereClin + "AND procedurecode.ProcCode LIKE '%" + POut.String(textCode.Text) + "%' " + "AND " + DbHelper.DateColumn("procedurelog.ProcDate") + " >= " + POut.Date(date1.SelectionStart) + " " + "AND " + DbHelper.DateColumn("procedurelog.ProcDate") + " <= " + POut.Date(date2.SelectionStart) + " " + "GROUP BY procedurelog.ProcNum " + "ORDER BY " + DbHelper.DateColumn("procedurelog.ProcDate") + ",plfname,procedurecode.ProcCode,ToothNum"; FormQuery2 = new FormQuery(report); FormQuery2.IsReport = true; DataTable table = report.GetTempTable(); report.TableQ = new DataTable(null); int colI = 7; if (!PrefC.GetBool(PrefName.EasyNoClinics)) { colI = 8; } for (int i = 0; i < colI; i++) //add columns { report.TableQ.Columns.Add(new System.Data.DataColumn()); //blank columns } report.InitializeColumns(); DataRow row; double dbl = 0; for (int i = 0; i < table.Rows.Count; i++) { row = report.TableQ.NewRow(); //create new row called 'row' based on structure of TableQ row[0] = PIn.Date(table.Rows[i][0].ToString()).ToShortDateString(); row[1] = table.Rows[i][1].ToString(); //name row[2] = table.Rows[i][2].ToString(); //adacode row[3] = Tooth.ToInternat(table.Rows[i][3].ToString()); //tooth row[4] = table.Rows[i][4].ToString(); //descript row[5] = table.Rows[i][5].ToString(); //prov if (!PrefC.GetBool(PrefName.EasyNoClinics)) { row[6] = Clinics.GetDesc(PIn.Long(table.Rows[i][6].ToString())); //clinic dbl = PIn.Double(table.Rows[i][7].ToString()); //fee row[7] = dbl.ToString("n"); report.ColTotal[7] += dbl; } else { dbl = PIn.Double(table.Rows[i][7].ToString()); //fee row[6] = dbl.ToString("n"); report.ColTotal[6] += dbl; } report.TableQ.Rows.Add(row); } FormQuery2.ResetGrid(); report.Title = "Daily Procedures"; report.SubTitle.Add(PrefC.GetString(PrefName.PracticeTitle)); report.SubTitle.Add(date1.SelectionStart.ToString("d") + " - " + date2.SelectionStart.ToString("d")); if (checkAllProv.Checked) { report.SubTitle.Add(Lan.g(this, "All Providers")); } else { string provNames = ""; for (int i = 0; i < listProv.SelectedIndices.Count; i++) { if (i > 0) { provNames += ", "; } provNames += ProviderC.ListShort[listProv.SelectedIndices[i]].Abbr; } report.SubTitle.Add(provNames); } if (!PrefC.GetBool(PrefName.EasyNoClinics)) { if (checkAllClin.Checked) { report.SubTitle.Add(Lan.g(this, "All Clinics")); } else { string clinNames = ""; for (int i = 0; i < listClin.SelectedIndices.Count; i++) { if (i > 0) { clinNames += ", "; } if (listClin.SelectedIndices[i] == 0) { clinNames += Lan.g(this, "Unassigned"); } else { clinNames += Clinics.List[listClin.SelectedIndices[i] - 1].Description; } } report.SubTitle.Add(clinNames); } } report.SetColumn(this, 0, "Date", 80); report.SetColumn(this, 1, "Patient Name", 130); report.SetColumn(this, 2, "ADA Code", 75); report.SetColumn(this, 3, "Tooth", 45); report.SetColumn(this, 4, "Description", 200); report.SetColumn(this, 5, "Provider", 50); if (!PrefC.GetBool(PrefName.EasyNoClinics)) { report.SetColumn(this, 6, "Clinic", 70); report.SetColumn(this, 7, "Fee", 90, HorizontalAlignment.Right); } else { report.SetColumn(this, 6, "Fee", 90, HorizontalAlignment.Right); } FormQuery2.ShowDialog(); DialogResult = DialogResult.OK; }
private void FillGrid() { Cache.Refresh(InvalidType.Operatories); bool neededFixing = false; for (int i = 0; i < OperatoryC.Listt.Count; i++) { if (OperatoryC.Listt[i].ItemOrder != i) { OperatoryC.Listt[i].ItemOrder = i; Operatories.Update(OperatoryC.Listt[i]); neededFixing = true; } } if (neededFixing) { DataValid.SetInvalid(InvalidType.Operatories); } gridMain.BeginUpdate(); gridMain.Columns.Clear(); ODGridColumn col = new ODGridColumn(Lan.g("TableOperatories", "Op Name"), 150); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableOperatories", "Abbrev"), 70); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableOperatories", "IsHidden"), 64, HorizontalAlignment.Center); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableOperatories", "Clinic"), 80); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableOperatories", "Dentist"), 70); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableOperatories", "Hygienist"), 70); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableOperatories", "IsHygiene"), 72, HorizontalAlignment.Center); gridMain.Columns.Add(col); gridMain.Rows.Clear(); UI.ODGridRow row; for (int i = 0; i < OperatoryC.Listt.Count; i++) { row = new OpenDental.UI.ODGridRow(); row.Cells.Add(OperatoryC.Listt[i].OpName); row.Cells.Add(OperatoryC.Listt[i].Abbrev); if (OperatoryC.Listt[i].IsHidden) { row.Cells.Add("X"); } else { row.Cells.Add(""); } row.Cells.Add(Clinics.GetDesc(OperatoryC.Listt[i].ClinicNum)); row.Cells.Add(Providers.GetAbbr(OperatoryC.Listt[i].ProvDentist)); row.Cells.Add(Providers.GetAbbr(OperatoryC.Listt[i].ProvHygienist)); if (OperatoryC.Listt[i].IsHygiene) { row.Cells.Add("X"); } else { row.Cells.Add(""); } gridMain.Rows.Add(row); } gridMain.EndUpdate(); }