///<summary></summary> public static Referral CreateReferral(long patNum, bool isDoctor = true) { Referral refNew = new Referral() { IsDoctor = isDoctor }; Referrals.Insert(refNew); RefAttach refattach = new RefAttach(); refattach.ReferralNum = refNew.ReferralNum; refattach.PatNum = patNum; refattach.RefType = ReferralType.RefFrom; refattach.RefDate = DateTime.Today; refattach.IsTransitionOfCare = refNew.IsDoctor; refattach.ItemOrder = 0; RefAttaches.Insert(refattach); return(refNew); }
///<summary>Uses a VB dll to launch.</summary> public static void SendData(Program ProgramCur, Patient pat) { string path = Programs.GetProgramPath(ProgramCur); if (pat == null) { MessageBox.Show("Please select a patient first."); return; } //js This was originally added on 9/2/09, probably due to race affecting ceph proportions. But since we can't find any documentation, and since a customer is complaining, we are removing it for now. If we add it back, we will document exactly why. //if(pat.Race==PatientRace.Unknown) { // MessageBox.Show("Race must be entered first."); // return; //} //Make sure the program is running if (Process.GetProcessesByName("DrCeph").Length == 0) { try{ ODFileUtils.ProcessStart(path); } catch { MsgBox.Show("DrCeph", "Program path not set properly."); return; } Thread.Sleep(TimeSpan.FromSeconds(4)); } List <ProgramProperty> ForProgram = ProgramProperties.GetForProgram(ProgramCur.ProgramNum);; ProgramProperty PPCur = ProgramProperties.GetCur(ForProgram, "Enter 0 to use PatientNum, or 1 to use ChartNum");; string patID = ""; if (PPCur.PropertyValue == "0") { patID = pat.PatNum.ToString(); } else { patID = pat.ChartNumber; } try{ PatientRaceOld raceOld = PatientRaces.GetPatientRaceOldFromPatientRaces(pat.PatNum); List <RefAttach> referalList = RefAttaches.Refresh(pat.PatNum); Provider prov = Providers.GetProv(Patients.GetProvNum(pat)); string provName = prov.FName + " " + prov.MI + " " + prov.LName + " " + prov.Suffix; Family fam = Patients.GetFamily(pat.PatNum); Patient guar = fam.ListPats[0]; string relat = ""; if (guar.PatNum == pat.PatNum) { relat = "Self"; } else if (guar.Gender == PatientGender.Male && pat.Position == PatientPosition.Child) { relat = "Father"; } else if (guar.Gender == PatientGender.Female && pat.Position == PatientPosition.Child) { relat = "Mother"; } else { relat = "Unknown"; } VBbridges.DrCephNew.Launch(patID, pat.FName, pat.MiddleI, pat.LName, pat.Address, pat.Address2, pat.City, pat.State, pat.Zip, pat.HmPhone, pat.SSN, pat.Gender.ToString(), raceOld.ToString(), "", pat.Birthdate.ToString(), DateTime.Today.ToShortDateString(), RefAttachL.GetReferringDr(referalList), provName, guar.GetNameFL(), guar.Address, guar.Address2, guar.City, guar.State, guar.Zip, guar.HmPhone, relat); } catch { MessageBox.Show("DrCeph not responding. It might not be installed properly."); } }
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(); }
///<summary>Uses a VB dll to launch.</summary> public static void SendData(Program ProgramCur, Patient pat) { if (pat == null) { MessageBox.Show("Please select a patient first."); return; } //Make sure the program is running if (Process.GetProcessesByName("DrCeph").Length == 0) { try{ Process.Start(ProgramCur.Path); } catch { MsgBox.Show("DrCeph", "Program path not set properly."); return; } Thread.Sleep(TimeSpan.FromSeconds(4)); } ArrayList ForProgram = ProgramProperties.GetForProgram(ProgramCur.ProgramNum);; ProgramProperty PPCur = ProgramProperties.GetCur(ForProgram, "Enter 0 to use PatientNum, or 1 to use ChartNum");; string patID = ""; if (PPCur.PropertyValue == "0") { patID = pat.PatNum.ToString(); } else { patID = pat.ChartNumber; } try{ RefAttach[] referalList = RefAttaches.Refresh(pat.PatNum); Provider prov = Providers.GetProv(Patients.GetProvNum(pat)); string provName = prov.FName + " " + prov.MI + " " + prov.LName + " " + prov.Suffix; Family fam = Patients.GetFamily(pat.PatNum); Patient guar = fam.List[0]; string relat = ""; if (guar.PatNum == pat.PatNum) { relat = "Self"; } else if (guar.Gender == PatientGender.Male && pat.Position == PatientPosition.Child) { relat = "Father"; } else if (guar.Gender == PatientGender.Female && pat.Position == PatientPosition.Child) { relat = "Mother"; } else { relat = "Unknown"; } VBbridges.DrCephNew.Launch(patID, pat.FName, pat.MiddleI, pat.LName, pat.Address, pat.Address2, pat.City, pat.State, pat.Zip, pat.HmPhone, pat.SSN, pat.Gender.ToString(), pat.Race.ToString(), "", pat.Birthdate.ToString(), DateTime.Today.ToShortDateString(), RefAttaches.GetReferringDr(referalList), provName, guar.GetNameFL(), guar.Address, guar.Address2, guar.City, guar.State, guar.Zip, guar.HmPhone, relat); } catch { MessageBox.Show("DrCeph not responding. It might not be installed properly."); } }