private void FillGrid() { gridMain.BeginUpdate(); gridMain.Columns.Clear(); ODGridColumn col = new ODGridColumn(Lan.g(this, "Date"), 100); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Category"), 120); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Description"), 300); gridMain.Columns.Add(col); gridMain.Rows.Clear(); ODGridRow row; Docs = Documents.GetAllWithPat(PatNum); for (int i = 0; i < Docs.Length; i++) { row = new ODGridRow(); row.Cells.Add(Docs[i].DateCreated.ToShortDateString()); row.Cells.Add(DefC.GetName(DefCat.ImageCats, Docs[i].DocCategory)); row.Cells.Add(Docs[i].Description); gridMain.Rows.Add(row); } gridMain.EndUpdate(); }
///<summary>Used to sort supply list. Returns -1 if sup1 should come before sup2, 0 is they are the same, and 1 is sup2 should come before sup1.</summary> private int sortSupplyListByCategoryOrderThenItemOrder(Supply sup1, Supply sup2) { int sup1Cat = DefC.GetOrder(DefCat.SupplyCats, sup1.Category); int sup2Cat = DefC.GetOrder(DefCat.SupplyCats, sup2.Category); if (sup1Cat == sup2Cat) //Items in same category { if (sup1.ItemOrder == sup2.ItemOrder) //same item { return(0); } else if (sup1.ItemOrder < sup2.ItemOrder) { return(-1); } else { return(1); } } else if (sup1Cat < sup2Cat) { return(-1); } else { return(1); } }
private void FormSupplyOrderItemEdit_Load(object sender, EventArgs e) { Supp = Supplies.GetSupply(ItemCur.SupplyNum); textSupplier.Text = Suppliers.GetName(ListSupplier, Supp.SupplierNum); textCategory.Text = DefC.GetName(DefCat.SupplyCats, Supp.Category); textCatalogNumber.Text = Supp.CatalogNumber; textDescript.Text = Supp.Descript; textQty.Text = ItemCur.Qty.ToString(); textPrice.Text = ItemCur.Price.ToString("n"); }
private void FillGrid() { Automations.RefreshCache(); gridMain.BeginUpdate(); gridMain.Columns.Clear(); ODGridColumn col = new ODGridColumn("Description", 200); gridMain.Columns.Add(col); col = new ODGridColumn("Trigger", 150); gridMain.Columns.Add(col); col = new ODGridColumn("Action", 150); gridMain.Columns.Add(col); col = new ODGridColumn("Details", 200); gridMain.Columns.Add(col); gridMain.Rows.Clear(); UI.ODGridRow row; string detail; for (int i = 0; i < Automations.Listt.Count; i++) { row = new OpenDental.UI.ODGridRow(); row.Cells.Add(Automations.Listt[i].Description); if (Automations.Listt[i].Autotrigger == AutomationTrigger.CompleteProcedure) { row.Cells.Add(Automations.Listt[i].ProcCodes); } else { row.Cells.Add(Automations.Listt[i].Autotrigger.ToString()); } row.Cells.Add(Automations.Listt[i].AutoAction.ToString()); //details: detail = ""; if (Automations.Listt[i].AutoAction == AutomationAction.CreateCommlog) { detail += DefC.GetName(DefCat.CommLogTypes, Automations.Listt[i].CommType) + ". " + Automations.Listt[i].MessageContent; } else if (Automations.Listt[i].AutoAction == AutomationAction.PrintPatientLetter) { detail += SheetDefs.GetDescription(Automations.Listt[i].SheetDefNum); } else if (Automations.Listt[i].AutoAction == AutomationAction.PrintReferralLetter) { detail += SheetDefs.GetDescription(Automations.Listt[i].SheetDefNum); } row.Cells.Add(detail); gridMain.Rows.Add(row); } gridMain.EndUpdate(); }
private void butSave_Click(object sender, EventArgs e) { long defNum = DefC.GetList(DefCat.ImageCats)[0].DefNum; Bitmap bitmap = new Bitmap(this.Width, this.Height); this.DrawToBitmap(bitmap, new Rectangle(0, 0, this.Width, this.Height)); Patient guar = Patients.GetPat(Guarantor); try { ImageStore.Import(bitmap, defNum, ImageType.Photo, guar); } catch (Exception ex) { MessageBox.Show("Unable to save file: " + ex.Message); return; } MsgBox.Show(this, "Saved."); }
private void FillGrid() { int curSelection = gridMain.GetSelectedIndex(); gridMain.BeginUpdate(); gridMain.Columns.Clear(); gridMain.Columns.Add(new ODGridColumn(Lan.g("TableLabImage", "Attached"), 60, HorizontalAlignment.Center)); gridMain.Columns.Add(new ODGridColumn(Lan.g("TableLabImage", "Date"), 80, HorizontalAlignment.Center)); gridMain.Columns.Add(new ODGridColumn(Lan.g("TableLabImage", "Category"), 80, HorizontalAlignment.Center)); gridMain.Columns.Add(new ODGridColumn(Lan.g("TableLabImage", "Desc"), 180, HorizontalAlignment.Left)); gridMain.Rows.Clear(); ODGridRow row; for (int i = 0; i < _listPatientDocuments.Count; i++) { if (_listPatientDocuments[i].DocNum <= 0) //Invalid doc num indicates 'Waiting for images'. This flag is set in the Load event. { continue; } //Test if this is a valid image. Bitmap bmp = ImageStore.OpenImage(_listPatientDocuments[i], _patFolder); if (bmp == null) { continue; } bmp.Dispose(); bmp = null; bool isAttached = EhrLabImages.GetDocNumExistsInList(_ehrLabNum, _listPatientDocuments[i].DocNum, _listAttached); row = new ODGridRow(); row.Cells.Add(isAttached?"X":""); row.Cells.Add(_listPatientDocuments[i].DateCreated.ToShortDateString()); row.Cells.Add(DefC.GetName(DefCat.ImageCats, _listPatientDocuments[i].DocCategory)); row.Cells.Add(_listPatientDocuments[i].Description); row.Tag = _listPatientDocuments[i]; gridMain.Rows.Add(row); } gridMain.EndUpdate(); if (curSelection >= 0) { gridMain.SetSelected(curSelection, true); } }
private void butSave_Click(object sender, EventArgs e) { long defNumToothCharts = DefC.GetImageCat(ImageCategorySpecial.T); if (defNumToothCharts == 0) { MsgBox.Show(this, "In Setup, Definitions, Image Categories, a category needs to be set for graphical tooth charts."); return; } Bitmap bitmap = null; Graphics g = null; Document doc = new Document(); bitmap = new Bitmap(750, 1000); g = Graphics.FromImage(bitmap); g.Clear(Color.White); g.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality; g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; RenderPerioPrintout(g, PatCur, new Rectangle(0, 0, bitmap.Width, bitmap.Height)); try { ImageStore.Import(bitmap, defNumToothCharts, ImageType.Photo, PatCur); } catch (Exception ex) { MessageBox.Show(Lan.g(this, "Unable to save file: ") + ex.Message); bitmap.Dispose(); bitmap = null; g.Dispose(); return; } MsgBox.Show(this, "Saved."); if (g != null) { g.Dispose(); g = null; } if (bitmap != null) { bitmap.Dispose(); bitmap = null; } }
private void FillPayGrid() { gridMain.BeginUpdate(); gridMain.Columns.Clear(); ODGridColumn col = new ODGridColumn(Lan.g("TableAccountingAutoPay", "Payment Type"), 200); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableAccountingAutoPay", "Pick List"), 250); gridMain.Columns.Add(col); gridMain.Rows.Clear(); ODGridRow row; for (int i = 0; i < payList.Count; i++) { row = new ODGridRow(); row.Cells.Add(DefC.GetName(DefCat.PaymentTypes, payList[i].PayType)); row.Cells.Add(AccountingAutoPays.GetPickListDesc(payList[i])); gridMain.Rows.Add(row); } gridMain.EndUpdate(); }
///<summary></summary> private void FillGrids() { if (IsNew) { DateTime dateStart = PIn.Date(textDateStart.Text); long clinicNum = 0; if (comboClinic.SelectedIndex != 0) { clinicNum = Clinics.List[comboClinic.SelectedIndex - 1].ClinicNum; } List <long> payTypes = new List <long>(); //[listPayType.SelectedIndices.Count]; for (int i = 0; i < listPayType.SelectedIndices.Count; i++) { payTypes.Add(DefC.Short[(int)DefCat.PaymentTypes][listPayType.SelectedIndices[i]].DefNum); } PatPayList = Payments.GetForDeposit(dateStart, clinicNum, payTypes); ClaimPayList = ClaimPayments.GetForDeposit(dateStart, clinicNum); } else { PatPayList = Payments.GetForDeposit(DepositCur.DepositNum); ClaimPayList = ClaimPayments.GetForDeposit(DepositCur.DepositNum); } //Fill Patient Payment Grid--------------------------------------- List <long> patNums = new List <long>(); for (int i = 0; i < PatPayList.Count; i++) { patNums.Add(PatPayList[i].PatNum); } Patient[] pats = Patients.GetMultPats(patNums); gridPat.BeginUpdate(); gridPat.Columns.Clear(); ODGridColumn col = new ODGridColumn(Lan.g("TableDepositSlipPat", "Date"), 80); gridPat.Columns.Add(col); col = new ODGridColumn(Lan.g("TableDepositSlipPat", "Patient"), 130); gridPat.Columns.Add(col); col = new ODGridColumn(Lan.g("TableDepositSlipPat", "Type"), 90); gridPat.Columns.Add(col); col = new ODGridColumn(Lan.g("TableDepositSlipPat", "Check Number"), 95); gridPat.Columns.Add(col); col = new ODGridColumn(Lan.g("TableDepositSlipPat", "Bank-Branch"), 80); gridPat.Columns.Add(col); col = new ODGridColumn(Lan.g("TableDepositSlipPat", "Amount"), 80); gridPat.Columns.Add(col); gridPat.Rows.Clear(); OpenDental.UI.ODGridRow row; for (int i = 0; i < PatPayList.Count; i++) { row = new OpenDental.UI.ODGridRow(); row.Cells.Add(PatPayList[i].PayDate.ToShortDateString()); row.Cells.Add(Patients.GetOnePat(pats, PatPayList[i].PatNum).GetNameLF()); row.Cells.Add(DefC.GetName(DefCat.PaymentTypes, PatPayList[i].PayType)); row.Cells.Add(PatPayList[i].CheckNum); row.Cells.Add(PatPayList[i].BankBranch); row.Cells.Add(PatPayList[i].PayAmt.ToString("F")); gridPat.Rows.Add(row); } gridPat.EndUpdate(); //Fill Insurance Payment Grid------------------------------------- gridIns.BeginUpdate(); gridIns.Columns.Clear(); col = new ODGridColumn(Lan.g("TableDepositSlipIns", "Date"), 80); gridIns.Columns.Add(col); col = new ODGridColumn(Lan.g("TableDepositSlipIns", "Carrier"), 220); gridIns.Columns.Add(col); col = new ODGridColumn(Lan.g("TableDepositSlipIns", "Check Number"), 95); gridIns.Columns.Add(col); col = new ODGridColumn(Lan.g("TableDepositSlipIns", "Bank-Branch"), 80); gridIns.Columns.Add(col); col = new ODGridColumn(Lan.g("TableDepositSlipIns", "Amount"), 90); gridIns.Columns.Add(col); gridIns.Rows.Clear(); for (int i = 0; i < ClaimPayList.Length; i++) { row = new OpenDental.UI.ODGridRow(); row.Cells.Add(ClaimPayList[i].CheckDate.ToShortDateString()); row.Cells.Add(ClaimPayList[i].CarrierName); row.Cells.Add(ClaimPayList[i].CheckNum); row.Cells.Add(ClaimPayList[i].BankBranch); row.Cells.Add(ClaimPayList[i].CheckAmt.ToString("F")); gridIns.Rows.Add(row); } gridIns.EndUpdate(); }
private void FillGrid() { List <Procedure> entireList = Procedures.Refresh(AptCur.PatNum); ProcList = new List <Procedure>(); bool isPlanned = AptCur.AptStatus == ApptStatus.Planned; ApptStatus apptStatus = AptCur.AptStatus; for (int i = 0; i < entireList.Count; i++) { //We want all unattached completed procs with same date as appt. //but only if one of these types if (apptStatus == ApptStatus.Scheduled || apptStatus == ApptStatus.Complete || apptStatus == ApptStatus.ASAP || apptStatus == ApptStatus.Broken) { if (entireList[i].AptNum == 0 && entireList[i].ProcStatus == ProcStat.C && entireList[i].ProcDate.Date == AptCur.AptDateTime.Date) { ProcList.Add(entireList[i]); } } //otherwise, we only want TP procs that are not attached to this appointment. //As for TP procs attached to other appointments, we will show this to the user and warn them about it, //but we won't filter them out. if (entireList[i].ProcStatus != ProcStat.TP) { continue; } if (isPlanned) { if (entireList[i].PlannedAptNum == AptCur.AptNum) { continue; } } else { if (entireList[i].AptNum == AptCur.AptNum) { continue; } } ProcList.Add(entireList[i]); } gridMain.BeginUpdate(); gridMain.Columns.Clear(); ODGridColumn col; col = new ODGridColumn(Lan.g("TableProcSelect", "OtherAppt"), 70, HorizontalAlignment.Center); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableProcSelect", "Code"), 55); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableProcSelect", "Priority"), 55); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableProcSelect", "Tooth"), 50); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableProcSelect", "Description"), 250); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableProcSelect", "Fee"), 60, HorizontalAlignment.Right); gridMain.Columns.Add(col); gridMain.Rows.Clear(); ODGridRow row; for (int i = 0; i < ProcList.Count; i++) { row = new ODGridRow(); if (ProcList[i].ProcStatus == ProcStat.C) //so unattached { row.Cells.Add(""); } else if (isPlanned && ProcList[i].PlannedAptNum != 0) { row.Cells.Add("X"); } else if (!isPlanned && ProcList[i].AptNum != 0) { row.Cells.Add("X"); } else { row.Cells.Add(""); } row.Cells.Add(ProcedureCodes.GetStringProcCode(ProcList[i].CodeNum)); row.Cells.Add(DefC.GetName(DefCat.TxPriorities, ProcList[i].Priority)); row.Cells.Add(Tooth.ToInternat(ProcList[i].ToothNum)); row.Cells.Add(ProcedureCodes.GetLaymanTerm(ProcList[i].CodeNum)); row.Cells.Add(ProcList[i].ProcFee.ToString("F")); gridMain.Rows.Add(row); } gridMain.EndUpdate(); }
/// <summary> Empties listSupply and adds to it all elements that contain items in the search field. Matches on all columns simultaneously.</summary> private void filterListSupply() { ListSupply.Clear(); ListSupplyAll.Sort(sortSupplyListByCategoryOrderThenItemOrder); long supplier = 0; if (SelectedSupplierNum != 0) //Use supplier num if it is provided, usually when IsSelectMode is also true { supplier = SelectedSupplierNum; } else if (comboSupplier.SelectedIndex < 1) //this includes selecting All or not having anything selected. { supplier = 0; } else { supplier = ListSupplier[comboSupplier.SelectedIndex - 1].SupplierNum; //SelectedIndex-1 because All is added before all the other items in the list. } foreach (Supply supply in ListSupplyAll) { if (!checkShowHidden.Checked && supply.IsHidden) { continue; //skip hidden supplies if show hidden is not checked } if (supplier != 0 && supply.SupplierNum != supplier) { continue; //skip supplies that do not match selected supplier } if (textFind.Text == "") //Start filtering based on findText { ListSupply.Add(supply); continue; } else if (supply.CatalogNumber.ToString().ToUpper().Contains(textFind.Text.ToUpper())) //Check each field to see if it matches the search text field. If it does then add it and move on. { ListSupply.Add(supply); continue; } else if (DefC.GetName(DefCat.SupplyCats, supply.Category).ToUpper().Contains(textFind.Text.ToUpper())) { ListSupply.Add(supply); continue; } else if (supply.Descript.ToString().ToUpper().Contains(textFind.Text.ToUpper())) { ListSupply.Add(supply); continue; } //else if(supply.ItemOrder.ToString().Contains(textFind.Text)) { // listSupply.Add(supply); // continue; //} else if (supply.LevelDesired.ToString().Contains(textFind.Text)) { ListSupply.Add(supply); continue; } else if (supply.Price.ToString().ToUpper().Contains(textFind.Text.ToUpper())) { ListSupply.Add(supply); continue; } else if (supply.SupplierNum.ToString().Contains(textFind.Text)) { ListSupply.Add(supply); continue; } //else if(supply.SupplyNum.ToString().Contains(textFind.Text)) { // listSupply.Add(supply); // continue; //} //end of filter, item not added, move to next supply item. } return; }
private void FillGridSupplyMain() { long supplier = 0; if (comboSupplier.SelectedIndex != -1) { supplier = listSupplier[comboSupplier.SelectedIndex].SupplierNum; } listSupply = Supplies.CreateObjects(checkShowHidden.Checked, supplier, textFind.Text); gridSupplyMain.BeginUpdate(); gridSupplyMain.Columns.Clear(); ODGridColumn col = new ODGridColumn(Lan.g(this, "Category"), 130); gridSupplyMain.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Catalog #"), 80); gridSupplyMain.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Description"), 340); gridSupplyMain.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Price"), 60, HorizontalAlignment.Right); gridSupplyMain.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "StockQty"), 60, HorizontalAlignment.Center); gridSupplyMain.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "IsHidden"), 40, HorizontalAlignment.Center); gridSupplyMain.Columns.Add(col); gridSupplyMain.Rows.Clear(); ODGridRow row; for (int i = 0; i < listSupply.Count; i++) { row = new ODGridRow(); if (i == 0 || listSupply[i].Category != listSupply[i - 1].Category) { row.Cells.Add(DefC.GetName(DefCat.SupplyCats, listSupply[i].Category)); } else { row.Cells.Add(""); } row.Cells.Add(listSupply[i].CatalogNumber); row.Cells.Add(listSupply[i].Descript); if (listSupply[i].Price == 0) { row.Cells.Add(""); } else { row.Cells.Add(listSupply[i].Price.ToString("n")); } if (listSupply[i].LevelDesired == 0) { row.Cells.Add(""); } else { row.Cells.Add(listSupply[i].LevelDesired.ToString()); } if (listSupply[i].IsHidden) { row.Cells.Add("X"); } else { row.Cells.Add(""); } //row.Cells.Add(listSupply[i].ItemOrder.ToString()); gridSupplyMain.Rows.Add(row); } gridSupplyMain.EndUpdate(); }
public static void FillPtInfo(OpenDental.ContrChart sender, Patient PatCur) { //first, get all the objects we need. Because they are by ref, the original gets altered. ODGrid gridPtInfo = (ODGrid)sender.Controls.Find("gridPtInfo", true)[0]; TabControl tabControlImages = (TabControl)sender.Controls.Find("tabControlImages", true)[0]; TextBox textTreatmentNotes = (TextBox)sender.Controls.Find("textTreatmentNotes", true)[0]; //bool TreatmentNoteChanged=sender.TreatmentNoteChanged;//might have to do a by ref here? //Then get some data that we need Family fam = null; PatientNote PatientNoteCur = null; List <PatPlan> PatPlanList = null; List <InsSub> SubList = null; List <InsPlan> PlanList = null; if (PatCur != null) { fam = Patients.GetFamily(PatCur.PatNum); PatientNoteCur = PatientNotes.Refresh(PatCur.PatNum, PatCur.Guarantor); PatPlanList = PatPlans.Refresh(PatCur.PatNum); SubList = InsSubs.RefreshForFam(fam); PlanList = InsPlans.RefreshForSubList(SubList); } //Then, continue with the slightly altered original method. gridPtInfo.Height = tabControlImages.Top - gridPtInfo.Top; textTreatmentNotes.Text = ""; if (PatCur != null) { textTreatmentNotes.Text = PatientNoteCur.Treatment; textTreatmentNotes.Enabled = true; textTreatmentNotes.Select(textTreatmentNotes.Text.Length + 2, 1); textTreatmentNotes.ScrollToCaret(); sender.TreatmentNoteChanged = false; } gridPtInfo.BeginUpdate(); gridPtInfo.Columns.Clear(); ODGridColumn col = new ODGridColumn("", 100); //Lan.g("TableChartPtInfo",""),); gridPtInfo.Columns.Add(col); col = new ODGridColumn("", 300); gridPtInfo.Columns.Add(col); gridPtInfo.Rows.Clear(); if (PatCur == null) { gridPtInfo.EndUpdate(); return; } ODGridRow row; //Age row = new ODGridRow(); row.Cells.Add("Age"); row.Cells.Add(PatientLogic.DateToAgeString(PatCur.Birthdate)); row.Tag = null; gridPtInfo.Rows.Add(row); //Credit type row = new ODGridRow(); row.Cells.Add(Lan.g("TableChartPtInfo", "ABC0")); row.Cells.Add(PatCur.CreditType); row.Tag = null; gridPtInfo.Rows.Add(row); //Billing type row = new ODGridRow(); row.Cells.Add(Lan.g("TableChartPtInfo", "Billing Type")); row.Cells.Add(DefC.GetName(DefCat.BillingTypes, PatCur.BillingType)); row.Tag = null; gridPtInfo.Rows.Add(row); //Referrals RefAttach[] RefAttachList = RefAttaches.Refresh(PatCur.PatNum); for (int i = 0; i < RefAttachList.Length; i++) { row = new ODGridRow(); row.ColorBackG = Color.Aquamarine; if (RefAttachList[i].IsFrom) { row.Cells.Add("Referred From"); } else { row.Cells.Add("Referred To"); } row.Cells.Add(Referrals.GetNameLF(RefAttachList[i].ReferralNum)); row.Tag = null; gridPtInfo.Rows.Add(row); } //Date First Visit row = new ODGridRow(); row.Cells.Add(Lan.g("TableChartPtInfo", "Date First Visit")); if (PatCur.DateFirstVisit.Year < 1880) { row.Cells.Add("??"); } else if (PatCur.DateFirstVisit == DateTime.Today) { row.Cells.Add(Lan.g("TableChartPtInfo", "NEW PAT")); } else { row.Cells.Add(PatCur.DateFirstVisit.ToShortDateString()); } row.Tag = null; gridPtInfo.Rows.Add(row); //Prov - Pri & Sec row = new ODGridRow(); row.Cells.Add(Lan.g("TableChartPtInfo", "Prov. (Pri, Sec)")); if (PatCur.SecProv != 0) { row.Cells.Add(Providers.GetAbbr(PatCur.PriProv) + ", " + Providers.GetAbbr(PatCur.SecProv)); } else { row.Cells.Add(Providers.GetAbbr(PatCur.PriProv) + ", " + "None"); } row.Tag = null; gridPtInfo.Rows.Add(row); //PriIns row = new ODGridRow(); row.Cells.Add(Lan.g("TableChartPtInfo", "Pri Ins")); string name; if (PatPlanList.Count > 0) { name = InsPlans.GetCarrierName(PatPlans.GetPlanNum(PatPlanList, 1), PlanList); if (PatPlanList[0].IsPending) { name += Lan.g("TableChartPtInfo", " (pending)"); } row.Cells.Add(name); } else { row.Cells.Add(""); } row.Tag = null; gridPtInfo.Rows.Add(row); //SecIns row = new ODGridRow(); row.Cells.Add(Lan.g("TableChartPtInfo", "Sec Ins")); if (PatPlanList.Count > 1) { name = InsPlans.GetCarrierName(PatPlans.GetPlanNum(PatPlanList, 2), PlanList); if (PatPlanList[1].IsPending) { name += Lan.g("TableChartPtInfo", " (pending)"); } row.Cells.Add(name); } else { row.Cells.Add(""); } row.Tag = null; gridPtInfo.Rows.Add(row); //Registration keys------------------------------------------------------------------------------------------- if (PrefC.GetBool(PrefName.DistributorKey)) { RegistrationKey[] keys = RegistrationKeys.GetForPatient(PatCur.PatNum); for (int i = 0; i < keys.Length; i++) { row = new ODGridRow(); row.Cells.Add(Lan.g("TableChartPtInfo", "Registration Key")); string str = keys[i].RegKey.Substring(0, 4) + "-" + keys[i].RegKey.Substring(4, 4) + "-" + keys[i].RegKey.Substring(8, 4) + "-" + keys[i].RegKey.Substring(12, 4); if (keys[i].IsForeign) { str += "\r\nForeign"; } else { str += "\r\nUSA"; } str += "\r\nStarted: " + keys[i].DateStarted.ToShortDateString(); if (keys[i].DateDisabled.Year > 1880) { str += "\r\nDisabled: " + keys[i].DateDisabled.ToShortDateString(); } if (keys[i].DateEnded.Year > 1880) { str += "\r\nEnded: " + keys[i].DateEnded.ToShortDateString(); } if (keys[i].Note != "") { str += keys[i].Note; } row.Cells.Add(str); row.Tag = keys[i].Copy(); gridPtInfo.Rows.Add(row); } } ODGridCell cell; //medical fields----------------------------------------------------------------- bool showMed = true; if (Programs.IsEnabled(ProgramName.eClinicalWorks) && ProgramProperties.GetPropVal(ProgramName.eClinicalWorks, "IsStandalone") == "0") { showMed = false; } if (showMed) { //premed flag. if (PatCur.Premed) { row = new ODGridRow(); row.Cells.Add(""); cell = new ODGridCell(); cell.Text = Lan.g("TableChartPtInfo", "Premedicate"); cell.ColorText = Color.Red; cell.Bold = YN.Yes; row.Cells.Add(cell); row.ColorBackG = DefC.Long[(int)DefCat.MiscColors][3].ItemColor; row.Tag = "med"; gridPtInfo.Rows.Add(row); } //diseases Disease[] DiseaseList = Diseases.Refresh(PatCur.PatNum); row = new ODGridRow(); cell = new ODGridCell(Lan.g("TableChartPtInfo", "Diseases")); cell.Bold = YN.Yes; row.Cells.Add(cell); if (DiseaseList.Length > 0) { row.Cells.Add(""); } else { row.Cells.Add(Lan.g("TableChartPtInfo", "none")); } row.ColorBackG = DefC.Long[(int)DefCat.MiscColors][3].ItemColor; row.Tag = "med"; gridPtInfo.Rows.Add(row); for (int i = 0; i < DiseaseList.Length; i++) { row = new ODGridRow(); cell = new ODGridCell(DiseaseDefs.GetName(DiseaseList[i].DiseaseDefNum)); cell.ColorText = Color.Red; cell.Bold = YN.Yes; row.Cells.Add(cell); row.Cells.Add(DiseaseList[i].PatNote); row.ColorBackG = DefC.Long[(int)DefCat.MiscColors][3].ItemColor; row.Tag = "med"; gridPtInfo.Rows.Add(row); } //MedUrgNote row = new ODGridRow(); row.Cells.Add(Lan.g("TableChartPtInfo", "Med Urgent")); cell = new ODGridCell(); cell.Text = PatCur.MedUrgNote; cell.ColorText = Color.Red; cell.Bold = YN.Yes; row.Cells.Add(cell); row.ColorBackG = DefC.Long[(int)DefCat.MiscColors][3].ItemColor; row.Tag = "med"; gridPtInfo.Rows.Add(row); //Medical row = new ODGridRow(); row.Cells.Add(Lan.g("TableChartPtInfo", "Medical Summary")); row.Cells.Add(PatientNoteCur.Medical); row.ColorBackG = DefC.Long[(int)DefCat.MiscColors][3].ItemColor; row.Tag = "med"; gridPtInfo.Rows.Add(row); //Service row = new ODGridRow(); row.Cells.Add(Lan.g("TableChartPtInfo", "Service Notes")); row.Cells.Add(PatientNoteCur.Service); row.ColorBackG = DefC.Long[(int)DefCat.MiscColors][3].ItemColor; row.Tag = "med"; gridPtInfo.Rows.Add(row); //medications Medications.Refresh(); MedicationPats.Refresh(PatCur.PatNum); row = new ODGridRow(); cell = new ODGridCell(Lan.g("TableChartPtInfo", "Medications")); cell.Bold = YN.Yes; row.Cells.Add(cell); if (MedicationPats.List.Length > 0) { row.Cells.Add(""); } else { row.Cells.Add(Lan.g("TableChartPtInfo", "none")); } row.ColorBackG = DefC.Long[(int)DefCat.MiscColors][3].ItemColor; row.Tag = "med"; gridPtInfo.Rows.Add(row); string text; Medication med; for (int i = 0; i < MedicationPats.List.Length; i++) { row = new ODGridRow(); med = Medications.GetMedication(MedicationPats.List[i].MedicationNum); text = med.MedName; if (med.MedicationNum != med.GenericNum) { text += "(" + Medications.GetMedication(med.GenericNum).MedName + ")"; } row.Cells.Add(text); text = MedicationPats.List[i].PatNote + "(" + Medications.GetGeneric(MedicationPats.List[i].MedicationNum).Notes + ")"; row.Cells.Add(text); row.ColorBackG = DefC.Long[(int)DefCat.MiscColors][3].ItemColor; row.Tag = "med"; gridPtInfo.Rows.Add(row); } } //if !eCW.enabled gridPtInfo.EndUpdate(); }
private void FillGrid() { Cursor = Cursors.WaitCursor; string order = ""; switch (comboOrder.SelectedIndex) { case 0: order = "status"; break; case 1: order = "alph"; break; case 2: order = "date"; break; } long provNum = 0; if (comboProv.SelectedIndex != 0) { provNum = ProviderC.ListShort[comboProv.SelectedIndex - 1].ProvNum; } long siteNum = 0; if (!PrefC.GetBool(PrefName.EasyHidePublicHealth) && comboSite.SelectedIndex != 0) { siteNum = SiteC.List[comboSite.SelectedIndex - 1].SiteNum; } long clinicNum = 0; if (comboClinic.SelectedIndex > 0) { clinicNum = Clinics.List[comboClinic.SelectedIndex - 1].ClinicNum; } AptList = Appointments.RefreshPlannedTracker(order, provNum, siteNum, clinicNum); gridMain.BeginUpdate(); gridMain.Columns.Clear(); ODGridColumn col = new ODGridColumn(Lan.g(this, "Patient"), 140); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Date"), 65); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Status"), 110); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Prov"), 50); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Procedures"), 150); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Notes"), 200); gridMain.Columns.Add(col); gridMain.Rows.Clear(); ODGridRow row; for (int i = 0; i < AptList.Count; i++) { row = new ODGridRow(); row.Cells.Add(patientNames[AptList[i].PatNum]); if (AptList[i].AptDateTime.Year < 1880) { row.Cells.Add(""); } else { row.Cells.Add(AptList[i].AptDateTime.ToShortDateString()); } row.Cells.Add(DefC.GetName(DefCat.RecallUnschedStatus, AptList[i].UnschedStatus)); if (AptList[i].IsHygiene) { row.Cells.Add(Providers.GetAbbr(AptList[i].ProvHyg)); } else { row.Cells.Add(Providers.GetAbbr(AptList[i].ProvNum)); } row.Cells.Add(AptList[i].ProcDescript); row.Cells.Add(AptList[i].Note); gridMain.Rows.Add(row); } gridMain.EndUpdate(); Cursor = Cursors.Default; }
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 FillGrid() { //We don't refresh ListSupplyAll here because we are frequently using FillGrid with a search filter. filterListSupply(); ListSupply.Sort(sortSupplyListByCategoryOrderThenItemOrder); gridMain.BeginUpdate(); gridMain.Columns.Clear(); ODGridColumn col = new ODGridColumn(Lan.g(this, "Category"), 130); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Catalog #"), 80); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Supplier"), 100); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Description"), 240); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Price"), 60, HorizontalAlignment.Right); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "StockQty"), 60, HorizontalAlignment.Center); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "IsHidden"), 40, HorizontalAlignment.Center); gridMain.Columns.Add(col); gridMain.Rows.Clear(); ODGridRow row; for (int i = 0; i < ListSupply.Count; i++) { row = new ODGridRow(); if (i == 0 || ListSupply[i].Category != ListSupply[i - 1].Category) { row.Cells.Add(DefC.GetName(DefCat.SupplyCats, ListSupply[i].Category)); } else { row.Cells.Add(""); } row.Cells.Add(ListSupply[i].CatalogNumber); row.Cells.Add(Suppliers.GetName(ListSupplier, ListSupply[i].SupplierNum)); row.Cells.Add(ListSupply[i].Descript); if (ListSupply[i].Price == 0) { row.Cells.Add(""); } else { row.Cells.Add(ListSupply[i].Price.ToString("n")); } if (ListSupply[i].LevelDesired == 0) { row.Cells.Add(""); } else { row.Cells.Add(ListSupply[i].LevelDesired.ToString()); } if (ListSupply[i].IsHidden) { row.Cells.Add("X"); } else { row.Cells.Add(""); } row.Tag = ListSupply[i].SupplyNum; //row.Cells.Add(listSupply[i].ItemOrder.ToString()); gridMain.Rows.Add(row); } gridMain.EndUpdate(); for (int i = 0; i < ListSupply.Count; i++) { if (SelectedGridItems.Contains(ListSupply[i].SupplyNum)) { gridMain.SetSelected(i, true); } } }
private void butOK_Click(object sender, System.EventArgs e) { long feeSched = FeeSchedC.ListShort[listFeeSched.SelectedIndex].FeeSchedNum; string catName = ""; //string to hold current category name Fees fee = new Fees(); ReportSimpleGrid report = new ReportSimpleGrid(); report.Query = "SELECT procedurecode.ProcCode,fee.Amount,' ',procedurecode.Descript," + "procedurecode.AbbrDesc FROM procedurecode,fee " + "WHERE procedurecode.CodeNum=fee.CodeNum AND fee.FeeSched='" + feeSched.ToString() + "' ORDER BY procedurecode.ProcCode"; FormQuery2 = new FormQuery(report); FormQuery2.IsReport = true; if (radioCode.Checked == true) { FormQuery2.SubmitReportQuery(); report.Title = "Procedure Codes"; report.SubTitle.Add(PrefC.GetString(PrefName.PracticeTitle)); report.SubTitle.Add(FeeScheds.GetDescription(feeSched)); report.SetColumn(this, 0, "Code", 70); report.SetColumn(this, 1, "Fee Amount", 70, HorizontalAlignment.Right); report.SetColumn(this, 2, " ", 80); //otherwise, the amount gets bunched up next to the description. report.SetColumn(this, 3, "Description", 200); report.SetColumn(this, 4, "Abbr Description", 200); FormQuery2.ShowDialog(); DialogResult = DialogResult.OK; } else //categories //report.SubmitTemp();//create TableTemp which is not actually used { ProcedureCode[] ProcList = ProcedureCodes.GetProcList(); report.TableQ = new DataTable(null); for (int i = 0; i < 5; i++) //add columns { report.TableQ.Columns.Add(new System.Data.DataColumn()); //blank columns } report.InitializeColumns(); DataRow row = report.TableQ.NewRow();//add first row by hand to get value for temp row[0] = DefC.GetName(DefCat.ProcCodeCats, ProcList[0].ProcCat); catName = row[0].ToString(); row[1] = ProcList[0].ProcCode; row[2] = ProcList[0].Descript; row[3] = ProcList[0].AbbrDesc; row[4] = ((double)Fees.GetAmount0(ProcList[0].CodeNum, feeSched)).ToString("F"); report.ColTotal[4] += PIn.Decimal(row[4].ToString()); report.TableQ.Rows.Add(row); for (int i = 1; i < ProcList.Length; i++) //loop through data rows { row = report.TableQ.NewRow(); //create new row called 'row' based on structure of TableQ row[0] = DefC.GetName(DefCat.ProcCodeCats, ProcList[i].ProcCat); if (catName == row[0].ToString()) { row[0] = ""; } else { catName = row[0].ToString(); } row[1] = ProcList[i].ProcCode.ToString(); row[2] = ProcList[i].Descript; row[3] = ProcList[i].AbbrDesc.ToString(); row[4] = ((double)Fees.GetAmount0(ProcList[i].CodeNum, feeSched)).ToString("F"); //report.ColTotal[4]+=PIn.PDouble(row[4].ToString()); report.TableQ.Rows.Add(row); } FormQuery2.ResetGrid(); //this is a method in FormQuery2; report.Title = "Procedure Codes"; report.SubTitle.Add(PrefC.GetString(PrefName.PracticeTitle)); report.SubTitle.Add(FeeScheds.GetDescription(feeSched)); report.ColPos[0] = 20; report.ColPos[1] = 120; report.ColPos[2] = 270; report.ColPos[3] = 470; report.ColPos[4] = 620; report.ColPos[5] = 770; report.ColCaption[0] = "Category"; report.ColCaption[1] = "Code"; report.ColCaption[2] = "Description"; report.ColCaption[3] = "Abbr Description"; report.ColCaption[4] = "Fee Amount"; report.ColAlign[4] = HorizontalAlignment.Right; FormQuery2.ShowDialog(); DialogResult = DialogResult.OK; } }
///<summary>Adds the xml for one statement.</summary> public static void GenerateOneStatement(XmlWriter writer, Statement stmt, Patient pat, Family fam, DataSet dataSet) { writer.WriteStartElement("Statement"); writer.WriteStartElement("RecipientAddress"); Patient guar = fam.ListPats[0]; writer.WriteElementString("Name", guar.GetNameFLFormal()); writer.WriteElementString("Account", guar.ChartNumber); //.PatNum.ToString());//Only one customer is using this, so no need to give option. writer.WriteElementString("Address1", guar.Address); writer.WriteElementString("Address2", guar.Address2); writer.WriteElementString("City", guar.City); writer.WriteElementString("State", guar.State); writer.WriteElementString("Zip", guar.Zip); string email = ""; Def billingDef = DefC.GetDef(DefCat.BillingTypes, guar.BillingType); if (billingDef.ItemValue == "E") { email = guar.Email; } writer.WriteElementString("EMail", email); writer.WriteEndElement(); //RecipientAddress //Account summary----------------------------------------------------------------------- if (stmt.DateRangeFrom.Year < 1880) //make up a statement date. { writer.WriteElementString("PriorStatementDate", DateTime.Today.AddMonths(-1).ToString("MM/dd/yyyy")); } else { writer.WriteElementString("PriorStatementDate", stmt.DateRangeFrom.AddDays(-1).ToString("MM/dd/yyyy")); } DateTime dueDate; if (PrefC.GetLong(PrefName.StatementsCalcDueDate) == -1) { dueDate = DateTime.Today.AddDays(10); } else { dueDate = DateTime.Today.AddDays(PrefC.GetLong(PrefName.StatementsCalcDueDate)); } writer.WriteElementString("DueDate", dueDate.ToString("MM/dd/yyyy")); writer.WriteElementString("StatementDate", stmt.DateSent.ToString("MM/dd/yyyy")); double balanceForward = 0; for (int r = 0; r < dataSet.Tables["misc"].Rows.Count; r++) { if (dataSet.Tables["misc"].Rows[r]["descript"].ToString() == "balanceForward") { balanceForward = PIn.Double(dataSet.Tables["misc"].Rows[r]["value"].ToString()); } } writer.WriteElementString("PriorBalance", balanceForward.ToString("F2")); DataTable tableAccount = null; for (int i = 0; i < dataSet.Tables.Count; i++) { if (dataSet.Tables[i].TableName.StartsWith("account")) { tableAccount = dataSet.Tables[i]; } } double credits = 0; for (int i = 0; i < tableAccount.Rows.Count; i++) { credits += PIn.Double(tableAccount.Rows[i]["creditsDouble"].ToString()); } writer.WriteElementString("Credits", credits.ToString("F2")); decimal payPlanDue = 0; double amountDue = guar.BalTotal; for (int m = 0; m < dataSet.Tables["misc"].Rows.Count; m++) { if (dataSet.Tables["misc"].Rows[m]["descript"].ToString() == "payPlanDue") { payPlanDue += PIn.Decimal(dataSet.Tables["misc"].Rows[m]["value"].ToString()); //This will be an option once more users are using it. } } writer.WriteElementString("PayPlanDue", payPlanDue.ToString("F2")); if (PrefC.GetBool(PrefName.BalancesDontSubtractIns)) { writer.WriteElementString("EstInsPayments", ""); //optional. } else //this is typical { writer.WriteElementString("EstInsPayments", guar.InsEst.ToString("F2")); //optional. amountDue -= guar.InsEst; } InstallmentPlan installPlan = InstallmentPlans.GetOneForFam(guar.PatNum); if (installPlan != null) { //show lesser of normal total balance or the monthly payment amount. if (installPlan.MonthlyPayment < amountDue) { amountDue = installPlan.MonthlyPayment; } } writer.WriteElementString("AmountDue", amountDue.ToString("F2")); writer.WriteElementString("PastDue30", guar.Bal_31_60.ToString("F2")); //optional writer.WriteElementString("PastDue60", guar.Bal_61_90.ToString("F2")); //optional writer.WriteElementString("PastDue90", guar.BalOver90.ToString("F2")); //optional //Notes----------------------------------------------------------------------------------- writer.WriteStartElement("Notes"); if (stmt.NoteBold != "") { writer.WriteStartElement("Note"); writer.WriteAttributeString("FgColor", "Red"); writer.WriteCData(stmt.NoteBold); writer.WriteEndElement(); //Note } if (stmt.Note != "") { writer.WriteStartElement("Note"); writer.WriteCData(stmt.Note); writer.WriteEndElement(); //Note } writer.WriteEndElement(); //Notes //Detail items------------------------------------------------------------------------------ writer.WriteStartElement("DetailItems"); //string note; string descript; string fulldesc; string procCode; string tth; //string linedesc; string[] lineArray; List <string> lines; DateTime date; int seq = 0; for (int i = 0; i < tableAccount.Rows.Count; i++) { procCode = tableAccount.Rows[i]["ProcCode"].ToString(); tth = tableAccount.Rows[i]["tth"].ToString(); descript = tableAccount.Rows[i]["description"].ToString(); fulldesc = procCode + " " + tth + " " + descript; lineArray = fulldesc.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries); lines = new List <string>(lineArray); //The specs say that the line limit is 30 char. But in testing, it will take 50 char. //We will use 40 char to be safe. if (lines[0].Length > 40) { string newline = lines[0].Substring(40); lines[0] = lines[0].Substring(0, 40); //first half lines.Insert(1, newline); //second half } for (int li = 0; li < lines.Count; li++) { writer.WriteStartElement("DetailItem"); //has a child item. We won't add optional child note writer.WriteAttributeString("sequence", seq.ToString()); writer.WriteStartElement("Item"); if (li == 0) { date = (DateTime)tableAccount.Rows[i]["DateTime"]; writer.WriteElementString("Date", date.ToString("MM/dd/yyyy")); writer.WriteElementString("PatientName", tableAccount.Rows[i]["patient"].ToString()); } else { writer.WriteElementString("Date", ""); writer.WriteElementString("PatientName", ""); } writer.WriteElementString("Description", lines[li]); if (li == 0) { writer.WriteElementString("Charges", tableAccount.Rows[i]["charges"].ToString()); writer.WriteElementString("Credits", tableAccount.Rows[i]["credits"].ToString()); writer.WriteElementString("Balance", tableAccount.Rows[i]["balance"].ToString()); } else { writer.WriteElementString("Charges", ""); writer.WriteElementString("Credits", ""); writer.WriteElementString("Balance", ""); } writer.WriteEndElement(); //Item writer.WriteEndElement(); //DetailItem seq++; } } writer.WriteEndElement(); //DetailItems writer.WriteEndElement(); //Statement }
private void FillGrid() { Recalls.Synch(PatNum); RecallList = Recalls.GetList(PatNum); gridMain.BeginUpdate(); gridMain.Columns.Clear(); ODGridColumn col = new ODGridColumn(Lan.g("TableRecallsPat", "Type"), 90); gridMain.Columns.Add(col); //col=new ODGridColumn(Lan.g("TableRecallsPat","Disabled"),60,HorizontalAlignment.Center); //gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableRecallsPat", "PreviousDate"), 80); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableRecallsPat", "Due Date"), 80); gridMain.Columns.Add(col); //col=new ODGridColumn(Lan.g("TableRecallsPat","Sched Date"),80); //gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableRecallsPat", "Interval"), 70); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableRecallsPat", "Status"), 80); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableRecallsPat", "Note"), 100); gridMain.Columns.Add(col); gridMain.Rows.Clear(); ODGridRow row; ODGridCell cell; IsPerio = false; butPerio.Text = Lan.g(this, "Set Perio"); string cellStr; for (int i = 0; i < RecallList.Count; i++) { if (PrefC.GetLong(PrefName.RecallTypeSpecialPerio) == RecallList[i].RecallTypeNum) { IsPerio = true; butPerio.Text = Lan.g(this, "Set Prophy"); } row = new ODGridRow(); row.Cells.Add(RecallTypes.GetDescription(RecallList[i].RecallTypeNum)); //if(RecallList[i].IsDisabled){ // row.Cells.Add("X"); //} //else{ // row.Cells.Add(""); //} if (RecallList[i].DatePrevious.Year < 1880) { row.Cells.Add(""); } else { row.Cells.Add(RecallList[i].DatePrevious.ToShortDateString()); } if (RecallList[i].DateDue.Year < 1880) { row.Cells.Add(""); } else { cell = new ODGridCell(RecallList[i].DateDue.ToShortDateString()); if (RecallList[i].DateDue < DateTime.Today) { cell.Bold = YN.Yes; cell.ColorText = Color.Firebrick; } row.Cells.Add(cell); } //row.Cells.Add("");//sched row.Cells.Add(RecallList[i].RecallInterval.ToString()); row.Cells.Add(DefC.GetValue(DefCat.RecallUnschedStatus, RecallList[i].RecallStatus)); cellStr = ""; if (RecallList[i].IsDisabled) { cellStr += Lan.g(this, "Disabled"); } if (RecallList[i].DisableUntilDate.Year > 1880) { if (cellStr != "") { cellStr += ", "; } cellStr += Lan.g(this, "Disabled until ") + RecallList[i].DisableUntilDate.ToShortDateString(); } if (RecallList[i].DisableUntilBalance > 0) { if (cellStr != "") { cellStr += ", "; } cellStr += Lan.g(this, "Disabled until balance ") + RecallList[i].DisableUntilBalance.ToString("c"); } if (RecallList[i].Note != "") { if (cellStr != "") { cellStr += ", "; } cellStr += RecallList[i].Note; } row.Cells.Add(cellStr); gridMain.Rows.Add(row); } gridMain.EndUpdate(); }
private void FillGrid() { this.Cursor = Cursors.WaitCursor; /*string order=""; * switch(comboOrder.SelectedIndex) { * case 0: * order="status"; * break; * case 1: * order="alph"; * break; * case 2: * order="date"; * break; * }*/ long provNum = 0; if (comboProv.SelectedIndex != 0) { provNum = ProviderC.ListShort[comboProv.SelectedIndex - 1].ProvNum; } long siteNum = 0; if (!PrefC.GetBool(PrefName.EasyHidePublicHealth) && comboSite.SelectedIndex != 0) { siteNum = SiteC.List[comboSite.SelectedIndex - 1].SiteNum; } long clinicNum = 0; if (comboClinic.SelectedIndex > 0) { clinicNum = Clinics.List[comboClinic.SelectedIndex - 1].ClinicNum; } ListASAP = Appointments.RefreshASAP(provNum, siteNum, clinicNum); int scrollVal = grid.ScrollValue; grid.BeginUpdate(); grid.Columns.Clear(); ODGridColumn col = new ODGridColumn(Lan.g("TableASAP", "Patient"), 140); grid.Columns.Add(col); col = new ODGridColumn(Lan.g("TableASAP", "Date"), 65); grid.Columns.Add(col); col = new ODGridColumn(Lan.g("TableASAP", "Status"), 110); grid.Columns.Add(col); col = new ODGridColumn(Lan.g("TableASAP", "Prov"), 50); grid.Columns.Add(col); col = new ODGridColumn(Lan.g("TableASAP", "Procedures"), 150); grid.Columns.Add(col); col = new ODGridColumn(Lan.g("TableASAP", "Notes"), 200); grid.Columns.Add(col); grid.Rows.Clear(); ODGridRow row; for (int i = 0; i < ListASAP.Count; i++) { row = new ODGridRow(); row.Cells.Add(patientNames[ListASAP[i].PatNum]); if (ListASAP[i].AptDateTime.Year < 1880) //shouldn't be possible. { row.Cells.Add(""); } else { row.Cells.Add(ListASAP[i].AptDateTime.ToShortDateString()); } row.Cells.Add(DefC.GetName(DefCat.RecallUnschedStatus, ListASAP[i].UnschedStatus)); if (ListASAP[i].IsHygiene) { row.Cells.Add(Providers.GetAbbr(ListASAP[i].ProvHyg)); } else { row.Cells.Add(Providers.GetAbbr(ListASAP[i].ProvNum)); } row.Cells.Add(ListASAP[i].ProcDescript); row.Cells.Add(ListASAP[i].Note); grid.Rows.Add(row); } grid.EndUpdate(); grid.ScrollValue = scrollVal; Cursor = Cursors.Default; }