///<summary>If not using clinics then supply an empty list of clinicNums. dateStart and dateEnd can be MinVal/MaxVal to indicate "forever".</summary> public static DataTable GetActiveRecall(DateTime dateStart, DateTime dateEnd) { if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { return(Meth.GetTable(MethodBase.GetCurrentMethod(), dateStart, dateEnd)); } DataTable table = new DataTable(); table.Columns.Add("Name"); table.Columns.Add("Gender"); table.Columns.Add("Age"); table.Columns.Add("Postal Code"); table.Columns.Add("Date of Service"); table.Columns.Add("Frequency"); table.Columns.Add("Primary Provider"); DataRow row; string command = @" SELECT p.LName, p.FName, p.MiddleI, p.Gender, p.Zip, p.PriProv, p.Preferred, r.ProcDate, p.Birthdate, q.RecallInterval FROM patient p JOIN procedurelog r ON r.PatNum = p.PatNum JOIN recall q ON p.PatNum = q.PatNum WHERE r.ProcDate = (SELECT MAX(r2.ProcDate) FROM procedurelog r2 JOIN procedurecode c ON r2.CodeNum = c.CodeNum WHERE r.PatNum = r2.PatNum AND r2.PlannedAptNum > 0 AND c.ProcCode = 01202 AND r2.ProcDate BETWEEN " + POut.DateT(dateStart) + @" AND " + POut.DateT(dateEnd) + @") AND q.RecallTypeNum = 1 AND q.IsDisabled = 0 GROUP BY p.PatNum"; DataTable raw = ReportsComplex.GetTable(command); Patient pat; for (int i = 0; i < raw.Rows.Count; i++) { row = table.NewRow(); pat = new Patient(); pat.LName = raw.Rows[i]["LName"].ToString(); pat.FName = raw.Rows[i]["FName"].ToString(); pat.MiddleI = raw.Rows[i]["MiddleI"].ToString(); pat.Preferred = raw.Rows[i]["Preferred"].ToString(); row["Name"] = pat.GetNameLF(); row["Primary Provider"] = Providers.GetAbbr(PIn.Long(raw.Rows[i]["PriProv"].ToString())); Console.Write(raw.Rows[i]["Gender"].ToString()); row["Gender"] = genderFormat(raw.Rows[i]["Gender"].ToString()); row["Postal Code"] = raw.Rows[i]["Zip"].ToString(); row["Date of Service"] = raw.Rows[i]["ProcDate"].ToString().Substring(0, 10); row["Age"] = birthdate_to_age(raw.Rows[i]["Birthdate"].ToString()); Interval frequency = new Interval(Int32.Parse(raw.Rows[i]["RecallInterval"].ToString())); row["Frequency"] = frequency.ToString(); table.Rows.Add(row); } return(table); }
///<summary>If not using clinics then supply an empty list of clinicNums. dateStart and dateEnd can be MinVal/MaxVal to indicate "forever".</summary> public static DataTable GetPerioRecall(DateTime dateStart, DateTime dateEnd) { if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { return(Meth.GetTable(MethodBase.GetCurrentMethod(), dateStart, dateEnd)); } DataTable table = new DataTable(); table.Columns.Add("Name"); table.Columns.Add("Gender"); table.Columns.Add("Age"); table.Columns.Add("Postal Code"); table.Columns.Add("Date of Next Appointment"); table.Columns.Add("Frequency"); table.Columns.Add("HygienistID"); table.Columns.Add("Primary Provider"); DataRow row; //Could not find code 43400 so just assumed all procedure codes between 40000 and 50000 string command = @" SELECT p.LName, p.FName, p.MiddleI, p.Gender, p.Zip, p.PriProv, p.Preferred, p.Birthdate, r.RecallInterval, a.AptDateTime, a.ProvHyg FROM patient p JOIN procedurelog x ON x.PatNum = p.PatNum JOIN procedurecode c ON c.CodeNum = x.CodeNum JOIN appointment a ON a.AptNum = x.AptNum JOIN recall r ON r.PatNum = p.PatNum WHERE r.IsDisabled = 0 AND r.RecallTypeNum = 3 AND c.ProcCode = 43400 AND a.AptDateTime = (SELECT MAX(a2.AptDateTime) FROM appointment a2 WHERE a2.AptNum = a.AptNum AND a2.AptDateTime BETWEEN " + POut.DateT(dateStart) + @" AND " + POut.DateT(dateEnd) + @") GROUP BY p.PatNum"; DataTable raw = ReportsComplex.GetTable(command); Patient pat; for (int i = 0; i < raw.Rows.Count; i++) { row = table.NewRow(); pat = new Patient(); pat.LName = raw.Rows[i]["LName"].ToString(); pat.FName = raw.Rows[i]["FName"].ToString(); pat.MiddleI = raw.Rows[i]["MiddleI"].ToString(); pat.Preferred = raw.Rows[i]["Preferred"].ToString(); row["Name"] = pat.GetNameLF(); row["Primary Provider"] = Providers.GetAbbr(PIn.Long(raw.Rows[i]["PriProv"].ToString())); row["Gender"] = genderFormat(raw.Rows[i]["Gender"].ToString()); row["Postal Code"] = raw.Rows[i]["Zip"].ToString(); row["Date of Next Appointment"] = raw.Rows[i]["AptDateTime"].ToString().Substring(0, 10); Interval frequency = new Interval(Int32.Parse(raw.Rows[i]["RecallInterval"].ToString())); row["Frequency"] = frequency.ToString(); row["HygienistID"] = raw.Rows[i]["ProvHyg"].ToString(); row["Age"] = birthdate_to_age(raw.Rows[i]["Birthdate"].ToString()); table.Rows.Add(row); } return(table); }
///<summary>If not using clinics then supply an empty list of clinicNums. dateStart and dateEnd can be MinVal/MaxVal to indicate "forever".</summary> public static DataTable GetNoShowAppt(DateTime dateStart, DateTime dateEnd) { if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { return(Meth.GetTable(MethodBase.GetCurrentMethod(), dateStart, dateEnd)); } DataTable table = new DataTable(); table.Columns.Add("Name"); table.Columns.Add("Gender"); table.Columns.Add("Age"); table.Columns.Add("Postal Code"); table.Columns.Add("Date of Service"); table.Columns.Add("Primary Provider"); table.Columns.Add("Procedure Description"); DataRow row; string command = @" SELECT p.LName, p.FName, p.MiddleI, p.Gender, p.Zip, p.PriProv, p.Preferred, p.Birthdate, r.ProcDate, a.ProcDescript FROM patient p JOIN procedurelog r ON r.PatNum = p.PatNum JOIN procedurecode c ON r.CodeNum = c.CodeNum JOIN appointment a ON a.AptNum = r.AptNum WHERE c.ProcCode = 99999 AND r.ProcDate BETWEEN " + POut.DateT(dateStart) + @" AND " + POut.DateT(dateEnd); DataTable raw = ReportsComplex.GetTable(command); Patient pat; for (int i = 0; i < raw.Rows.Count; i++) { row = table.NewRow(); pat = new Patient(); pat.LName = raw.Rows[i]["LName"].ToString(); pat.FName = raw.Rows[i]["FName"].ToString(); pat.MiddleI = raw.Rows[i]["MiddleI"].ToString(); pat.Preferred = raw.Rows[i]["Preferred"].ToString(); row["Name"] = pat.GetNameLF(); row["Primary Provider"] = Providers.GetAbbr(PIn.Long(raw.Rows[i]["PriProv"].ToString())); row["Gender"] = genderFormat(raw.Rows[i]["Gender"].ToString()); row["Postal Code"] = raw.Rows[i]["Zip"].ToString(); row["Date of Service"] = raw.Rows[i]["ProcDate"].ToString().Substring(0, 10); row["Procedure Description"] = raw.Rows[i]["ProcDescript"].ToString(); if (birthdate_to_age(raw.Rows[i]["Birthdate"].ToString()) < 150) { row["Age"] = birthdate_to_age(raw.Rows[i]["Birthdate"].ToString()); } else { row["Age"] = "N/A"; } table.Rows.Add(row); } return(table); }
private void FillScreen() { List <ContrDashProvList_Row> ListProv = new List <ContrDashProvList_Row>(); ContrDashProvList_Row row; for (int i = 0; i < table.Rows.Count; i++) { row = new ContrDashProvList_Row(); row.ProvName = Providers.GetAbbr(PIn.Long(table.Rows[i]["ProvNum"].ToString())); System.Drawing.Color c1 = Providers.GetColor(PIn.Long(table.Rows[i]["ProvNum"].ToString())); row.ProvColor = Color.FromArgb(c1.A, c1.R, c1.G, c1.B); decimal production = PIn.Decimal(table.Rows[i]["production"].ToString()); if (production == 0) { row.Production = ""; } else { row.Production = production.ToString("c0"); } decimal income = PIn.Decimal(table.Rows[i]["income"].ToString()); if (income == 0) { row.Income = ""; } else { row.Income = income.ToString("c0"); } ListProv.Add(row); } //Style style=new Style(typeof(TextBlock)); //style.Setters.Add(new Setter(TextBlock.HorizontalAlignmentProperty,HorizontalAlignment.Right)); //((DataGridTextColumn)gridMain.Columns[2]).ElementStyle=style; //((DataGridTextColumn)gridMain.Columns[2]).Binding=new Binding("Production"); //((DataGridTextColumn)gridMain.Columns[2]).Binding.StringFormat="c0"; gridMain.ItemsSource = ListProv; }
///<summary>Sends data for Patient to a mailbox file and launches the program.</summary> public static void SendData(Program ProgramCur, Patient pat) { string path = Programs.GetProgramPath(ProgramCur); List <ProgramProperty> ForProgram = ProgramProperties.GetForProgram(ProgramCur.ProgramNum); if (pat != null) { //read file C:\sidexis\sifiledb.ini iniFile = Path.GetDirectoryName(path) + "\\sifiledb.ini"; if (!File.Exists(iniFile)) { MessageBox.Show(iniFile + " could not be found. Is Sidexis installed properly?"); return; } //read FromStation0 | File to determine location of comm file (sendBox) (siomin.sdx) //example: //[FromStation0] //File=F:\PDATA\siomin.sdx //only one sendBox on entire network. string sendBox = ReadValue("FromStation0", "File"); //read Multistations | GetRequest (=1) to determine if station can take xrays. //but we don't care at this point, so ignore //set OfficeManagement | OffManConnected = 1 to make sidexis ready to accept a message. WritePrivateProfileString("OfficeManagement", "OffManConnected", "1", iniFile); //line formats: first two bytes are the length of line including first two bytes and \r\n //each field is terminated by null (byte 0). //Append U token to siomin.sdx file StringBuilder line = new StringBuilder(); FileStream fs = new FileStream(sendBox, FileMode.Append); using (BinaryWriter bw = new BinaryWriter(fs)){ char nTerm = (char)0; //Convert.ToChar(0); line.Append("U"); //U signifies Update patient in sidexis. Gets ignored if new patient. line.Append(nTerm); line.Append(pat.LName); line.Append(nTerm); line.Append(pat.FName); line.Append(nTerm); line.Append(pat.Birthdate.ToString("dd.MM.yyyy")); line.Append(nTerm); //leave initial patient id blank. This updates sidexis to patNums used in Open Dental line.Append(nTerm); line.Append(pat.LName); line.Append(nTerm); line.Append(pat.FName); line.Append(nTerm); line.Append(pat.Birthdate.ToString("dd.MM.yyyy")); line.Append(nTerm); //Patient id: ProgramProperty PPCur = ProgramProperties.GetCur(ForProgram, "Enter 0 to use PatientNum, or 1 to use ChartNum");; if (PPCur.PropertyValue == "0") { line.Append(pat.PatNum.ToString()); } else { line.Append(pat.ChartNumber); } line.Append(nTerm); if (pat.Gender == PatientGender.Female) { line.Append("F"); } else { line.Append("M"); } line.Append(nTerm); line.Append(Providers.GetAbbr(Patients.GetProvNum(pat))); line.Append(nTerm); line.Append("OpenDental"); line.Append(nTerm); line.Append("Sidexis"); line.Append(nTerm); line.Append("\r\n"); bw.Write(IntToByteArray(line.Length + 2)); //the 2 accounts for these two chars. bw.Write(StrBuildToBytes(line)); //Append N token to siomin.sdx file //N signifies create New patient in sidexis. If patient already exists, //then it simply updates any old data. line = new StringBuilder(); line.Append("N"); line.Append(nTerm); line.Append(pat.LName); line.Append(nTerm); line.Append(pat.FName); line.Append(nTerm); line.Append(pat.Birthdate.ToString("dd.MM.yyyy")); line.Append(nTerm); //Patient id: if (PPCur.PropertyValue == "0") { line.Append(pat.PatNum.ToString()); } else { line.Append(pat.ChartNumber); } line.Append(nTerm); if (pat.Gender == PatientGender.Female) { line.Append("F"); } else { line.Append("M"); } line.Append(nTerm); line.Append(Providers.GetAbbr(Patients.GetProvNum(pat))); line.Append(nTerm); line.Append("OpenDental"); line.Append(nTerm); line.Append("Sidexis"); line.Append(nTerm); line.Append("\r\n"); bw.Write(IntToByteArray(line.Length + 2)); bw.Write(StrBuildToBytes(line)); //Append A token to siomin.sdx file //A signifies Autoselect patient. line = new StringBuilder(); line.Append("A"); line.Append(nTerm); line.Append(pat.LName); line.Append(nTerm); line.Append(pat.FName); line.Append(nTerm); line.Append(pat.Birthdate.ToString("dd.MM.yyyy")); line.Append(nTerm); if (PPCur.PropertyValue == "0") { line.Append(pat.PatNum.ToString()); } else { line.Append(pat.ChartNumber); } line.Append(nTerm); line.Append(SystemInformation.ComputerName); line.Append(nTerm); line.Append(DateTime.Now.ToString("dd.MM.yyyy")); line.Append(nTerm); line.Append(DateTime.Now.ToString("HH.mm.ss")); line.Append(nTerm); line.Append("OpenDental"); line.Append(nTerm); line.Append("Sidexis"); line.Append(nTerm); line.Append("0"); //0=no image selection line.Append(nTerm); line.Append("\r\n"); bw.Write(IntToByteArray(line.Length + 2)); bw.Write(StrBuildToBytes(line)); } fs.Close(); } //if patient is loaded //Start Sidexis.exe whether patient loaded or not. try{ Process.Start(path); } catch { MessageBox.Show(path + " is not available."); } }
///<summary> dateStart and dateEnd can be MinVal/MaxVal to indicate "forever".</summary> public static List <object> GetNonProductivePracticeTime(DateTime dateStart, DateTime dateEnd) { List <object> tableAndTotal = new List <object>(); if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { tableAndTotal.Add(Meth.GetTable(MethodBase.GetCurrentMethod(), dateStart, dateEnd)); tableAndTotal.Add(""); return(tableAndTotal); } DataTable table = new DataTable(); table.Columns.Add("Name"); table.Columns.Add("Gender"); table.Columns.Add("Age"); table.Columns.Add("Postal Code"); table.Columns.Add("Date of Service"); table.Columns.Add("Primary Provider"); table.Columns.Add("Procedure Description"); table.Columns.Add("Non-Productive Practice Time"); DataRow row; string command = @" SELECT p.LName, p.FName, p.MiddleI, p.Gender, p.Zip, p.PriProv, p.Preferred, p.Birthdate, r.ProcDate, a.ProcDescript, a.Pattern FROM patient p JOIN procedurelog r ON r.PatNum = p.PatNum JOIN procedurecode c ON r.CodeNum = c.CodeNum JOIN appointment a ON a.AptNum = r.AptNum WHERE c.ProcCode = 99999 OR 99998 AND a.AptStatus = 5 AND a.AptDateTime BETWEEN " + POut.DateT(dateStart) + @" AND " + POut.DateT(dateEnd); int runningTimeTotal = 0; DataTable raw = ReportsComplex.GetTable(command); Patient pat; for (int i = 0; i < raw.Rows.Count; i++) { runningTimeTotal = runningTimeTotal + PatternToSeconds(raw.Rows[i]["Pattern"].ToString()); row = table.NewRow(); pat = new Patient(); pat.LName = raw.Rows[i]["LName"].ToString(); pat.FName = raw.Rows[i]["FName"].ToString(); pat.MiddleI = raw.Rows[i]["MiddleI"].ToString(); pat.Preferred = raw.Rows[i]["Preferred"].ToString(); row["Name"] = pat.GetNameLF(); row["Primary Provider"] = Providers.GetAbbr(PIn.Long(raw.Rows[i]["PriProv"].ToString())); row["Gender"] = genderFormat(raw.Rows[i]["Gender"].ToString()); row["Postal Code"] = raw.Rows[i]["Zip"].ToString(); row["Date of Service"] = raw.Rows[i]["ProcDate"].ToString().Substring(0, 10); row["Procedure Description"] = raw.Rows[i]["ProcDescript"].ToString(); row["Age"] = birthdate_to_age(raw.Rows[i]["Birthdate"].ToString()); row["Non-Productive Practice Time"] = sec_to_time(PatternToSeconds(raw.Rows[i]["Pattern"].ToString())); table.Rows.Add(row); } tableAndTotal.Add(table); tableAndTotal.Add(sec_to_time(runningTimeTotal)); return(tableAndTotal); }
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() { Color needsAttnCol = OpenDental.SetupWizard.GetColor(ODSetupStatus.NeedsAttention); gridMain.BeginUpdate(); gridMain.ListGridColumns.Clear(); GridColumn col; col = new GridColumn("Clinic", 110); gridMain.ListGridColumns.Add(col); col = new GridColumn("Abbrev", 70); gridMain.ListGridColumns.Add(col); col = new GridColumn("Phone", 100); gridMain.ListGridColumns.Add(col); col = new GridColumn("Address", 120); gridMain.ListGridColumns.Add(col); col = new GridColumn("City", 90); gridMain.ListGridColumns.Add(col); col = new GridColumn("State", 50); gridMain.ListGridColumns.Add(col); col = new GridColumn("ZIP", 80); gridMain.ListGridColumns.Add(col); col = new GridColumn("Default Prov", 75); gridMain.ListGridColumns.Add(col); col = new GridColumn("IsHidden", 55, HorizontalAlignment.Center); gridMain.ListGridColumns.Add(col); gridMain.ListGridRows.Clear(); GridRow row; bool IsAllComplete = true; List <Clinic> listClins = Clinics.GetDeepCopy(); if (listClins.Count == 0) { IsAllComplete = false; } foreach (Clinic clinCur in listClins) { row = new GridRow(); row.Cells.Add(clinCur.Description); if (!clinCur.IsHidden && string.IsNullOrEmpty(clinCur.Description)) { row.Cells[row.Cells.Count - 1].ColorBackG = needsAttnCol; IsAllComplete = false; } row.Cells.Add(clinCur.Abbr); if (!clinCur.IsHidden && string.IsNullOrEmpty(clinCur.Abbr)) { row.Cells[row.Cells.Count - 1].ColorBackG = needsAttnCol; IsAllComplete = false; } row.Cells.Add(TelephoneNumbers.FormatNumbersExactTen(clinCur.Phone)); if (!clinCur.IsHidden && string.IsNullOrEmpty(clinCur.Phone)) { row.Cells[row.Cells.Count - 1].ColorBackG = needsAttnCol; IsAllComplete = false; } row.Cells.Add(clinCur.Address); if (!clinCur.IsHidden && string.IsNullOrEmpty(clinCur.Address)) { row.Cells[row.Cells.Count - 1].ColorBackG = needsAttnCol; IsAllComplete = false; } row.Cells.Add(clinCur.City); if (!clinCur.IsHidden && string.IsNullOrEmpty(clinCur.City)) { row.Cells[row.Cells.Count - 1].ColorBackG = needsAttnCol; IsAllComplete = false; } row.Cells.Add(clinCur.State); if (!clinCur.IsHidden && string.IsNullOrEmpty(clinCur.State)) { row.Cells[row.Cells.Count - 1].ColorBackG = needsAttnCol; IsAllComplete = false; } row.Cells.Add(clinCur.Zip); if (!clinCur.IsHidden && string.IsNullOrEmpty(clinCur.Zip)) { row.Cells[row.Cells.Count - 1].ColorBackG = needsAttnCol; IsAllComplete = false; } row.Cells.Add(Providers.GetAbbr(clinCur.DefaultProv)); row.Cells.Add(clinCur.IsHidden?"X":""); row.Tag = clinCur; gridMain.ListGridRows.Add(row); } gridMain.EndUpdate(); if (IsAllComplete) { IsDone = true; } else { IsDone = false; } }
private void FillGrid() { Color needsAttnCol = OpenDental.SetupWizard.GetColor(ODSetupStatus.NeedsAttention); gridMain.BeginUpdate(); gridMain.ListGridColumns.Clear(); GridColumn col; if (PrefC.HasClinicsEnabled) { col = new GridColumn(Lan.g("FormSetupWizard", "OpName"), 110); gridMain.ListGridColumns.Add(col); col = new GridColumn(Lan.g("FormSetupWizard", "Abbrev"), 110); gridMain.ListGridColumns.Add(col); col = new GridColumn(Lan.g("FormSetupWizard", "Clinic"), 110); gridMain.ListGridColumns.Add(col); col = new GridColumn(Lan.g("FormSetupWizard", "ProvDentist"), 110); gridMain.ListGridColumns.Add(col); col = new GridColumn(Lan.g("FormSetupWizard", "ProvHygienist"), 110); gridMain.ListGridColumns.Add(col); col = new GridColumn(Lan.g("FormSetupWizard", "IsHygiene"), 60, HorizontalAlignment.Center); gridMain.ListGridColumns.Add(col); col = new GridColumn(Lan.g("FormSetupWizard", "IsHidden"), 60, HorizontalAlignment.Center); gridMain.ListGridColumns.Add(col); } else { col = new GridColumn(Lan.g("FormSetupWizard", "OpName"), 135); gridMain.ListGridColumns.Add(col); col = new GridColumn(Lan.g("FormSetupWizard", "Abbrev"), 120); gridMain.ListGridColumns.Add(col); col = new GridColumn(Lan.g("FormSetupWizard", "ProvDentist"), 130); gridMain.ListGridColumns.Add(col); col = new GridColumn(Lan.g("FormSetupWizard", "ProvHygienist"), 130); gridMain.ListGridColumns.Add(col); col = new GridColumn(Lan.g("FormSetupWizard", "IsHygiene"), 80, HorizontalAlignment.Center); gridMain.ListGridColumns.Add(col); col = new GridColumn(Lan.g("FormSetupWizard", "IsHidden"), 80, HorizontalAlignment.Center); gridMain.ListGridColumns.Add(col); } //col = new ODGridColumn("Clinic",120); //gridMain.Columns.Add(col); gridMain.ListGridRows.Clear(); GridRow row; bool IsAllComplete = true; if (_listOps.Count == 0) { IsAllComplete = false; } foreach (Operatory opCur in _listOps) { row = new GridRow(); row.Cells.Add(opCur.OpName); if (string.IsNullOrEmpty(opCur.OpName)) { row.Cells[row.Cells.Count - 1].ColorBackG = needsAttnCol; IsAllComplete = false; } row.Cells.Add(opCur.Abbrev); if (string.IsNullOrEmpty(opCur.Abbrev)) { row.Cells[row.Cells.Count - 1].ColorBackG = needsAttnCol; IsAllComplete = false; } if (PrefC.HasClinicsEnabled) { row.Cells.Add(Clinics.GetAbbr(opCur.ClinicNum)); } //not a required field row.Cells.Add(Providers.GetAbbr(opCur.ProvDentist)); //not a required field row.Cells.Add(Providers.GetAbbr(opCur.ProvHygienist)); //not a required field row.Cells.Add(opCur.IsHygiene ? "X" : ""); //not a required field row.Cells.Add(opCur.IsHidden ? "X" : ""); //not a required field //row = new ODGridRow(); //row.Cells.Add(opCur.OpName); //if(string.IsNullOrEmpty(opCur.OpName)) { // row.Cells[row.Cells.Count-1].CellColor=needsAttnCol; // IsAllComplete=false; //} row.Tag = opCur; gridMain.ListGridRows.Add(row); } gridMain.EndUpdate(); if (IsAllComplete) { IsDone = true; } else { IsDone = false; } }
///<summary>Sends data for Patient to a mailbox file and launches the program.</summary> public static void SendData(Program ProgramCur, Patient pat) { OpenDentBusiness.Shared.Sirona.Lans_g = Lans.g; string path = Programs.GetProgramPath(ProgramCur); List <ProgramProperty> listProgramProperties = ProgramProperties.GetForProgram(ProgramCur.ProgramNum); List <string> listIniLines = new List <string>(); if (pat != null) { try { #region Construct ini info //line formats: first two bytes are the length of line including first two bytes and \r\n //each field is terminated by null (byte 0). //Append U token to siomin.sdx file StringBuilder line = new StringBuilder(); char nTerm = (char)0; //Convert.ToChar(0); line.Append("U"); //U signifies Update patient in sidexis. Gets ignored if new patient. line.Append(nTerm); line.Append(pat.LName); line.Append(nTerm); line.Append(pat.FName); line.Append(nTerm); line.Append(pat.Birthdate.ToString("dd.MM.yyyy")); line.Append(nTerm); //leave initial patient id blank. This updates sidexis to patNums used in Open Dental line.Append(nTerm); line.Append(pat.LName); line.Append(nTerm); line.Append(pat.FName); line.Append(nTerm); line.Append(pat.Birthdate.ToString("dd.MM.yyyy")); line.Append(nTerm); //Patient id: ProgramProperty PPCur = ProgramProperties.GetCur(listProgramProperties, "Enter 0 to use PatientNum, or 1 to use ChartNum");; if (PPCur.PropertyValue == "0") { line.Append(pat.PatNum.ToString()); } else { line.Append(pat.ChartNumber); } line.Append(nTerm); if (pat.Gender == PatientGender.Female) { line.Append("F"); } else { line.Append("M"); } line.Append(nTerm); line.Append(Providers.GetAbbr(Patients.GetProvNum(pat))); line.Append(nTerm); line.Append("OpenDental"); line.Append(nTerm); line.Append("Sidexis"); line.Append(nTerm); line.Append("\r\n"); listIniLines.Add(line.ToString()); //Append N token to siomin.sdx file //N signifies create New patient in sidexis. If patient already exists, //then it simply updates any old data. line = new StringBuilder(); line.Append("N"); line.Append(nTerm); line.Append(pat.LName); line.Append(nTerm); line.Append(pat.FName); line.Append(nTerm); line.Append(pat.Birthdate.ToString("dd.MM.yyyy")); line.Append(nTerm); //Patient id: if (PPCur.PropertyValue == "0") { line.Append(pat.PatNum.ToString()); } else { line.Append(pat.ChartNumber); } line.Append(nTerm); if (pat.Gender == PatientGender.Female) { line.Append("F"); } else { line.Append("M"); } line.Append(nTerm); line.Append(Providers.GetAbbr(Patients.GetProvNum(pat))); line.Append(nTerm); line.Append("OpenDental"); line.Append(nTerm); line.Append("Sidexis"); line.Append(nTerm); line.Append("\r\n"); listIniLines.Add(line.ToString()); //Append A token to siomin.sdx file //A signifies Autoselect patient. line = new StringBuilder(); line.Append("A"); line.Append(nTerm); line.Append(pat.LName); line.Append(nTerm); line.Append(pat.FName); line.Append(nTerm); line.Append(pat.Birthdate.ToString("dd.MM.yyyy")); line.Append(nTerm); if (PPCur.PropertyValue == "0") { line.Append(pat.PatNum.ToString()); } else { line.Append(pat.ChartNumber); } line.Append(nTerm); if (ODBuild.IsWeb()) { line.Append("{{SystemInformation.ComputerName}}"); //Will be replaced on the client side } else { line.Append(SystemInformation.ComputerName); } line.Append(nTerm); line.Append(DateTime.Now.ToString("dd.MM.yyyy")); line.Append(nTerm); line.Append(DateTime.Now.ToString("HH.mm.ss")); line.Append(nTerm); line.Append("OpenDental"); line.Append(nTerm); line.Append("Sidexis"); line.Append(nTerm); line.Append("0"); //0=no image selection line.Append(nTerm); line.Append("\r\n"); listIniLines.Add(line.ToString()); #endregion if (!ODBuild.IsWeb()) { OpenDentBusiness.Shared.Sirona.WriteToSendBoxFile(path, listIniLines); } } catch (Exception ex) { FriendlyException.Show(Lan.g("Sirona", "Error preparing Sidexis for patient message."), ex); return; } } //if patient is loaded //Start Sidexis.exe whether patient loaded or not. try { if (ODBuild.IsWeb()) { ODCloudClient.SendToSirona(path, listIniLines); } else { ODFileUtils.ProcessStart(path); } } catch (Exception ex) { FriendlyException.Show(path + " is not available.", ex); } }