public static void InitializeOnStartup(ContrChart contrChart,TabControl tabProc,ODGrid gridProg,Panel panelEcw, TabControl tabControlImages,Size ClientSize, ODGrid gridPtInfo,ToothChartWrapper toothChart,RichTextBox textTreatmentNotes,OpenDental.UI.Button butECWup, OpenDental.UI.Button butECWdown,TabPage tabPatInfo) { tabProc.SelectedIndex=0; tabProc.Height=259; if(UsingEcwTightOrFull()) { toothChart.Location=new Point(524+2,26); textTreatmentNotes.Location=new Point(524+2,toothChart.Bottom+1); textTreatmentNotes.Size=new Size(411,40);//make it a bit smaller than usual gridPtInfo.Visible=false; panelEcw.Visible=true; panelEcw.Location=new Point(524+2,textTreatmentNotes.Bottom+1); panelEcw.Size=new Size(411,tabControlImages.Top-panelEcw.Top+1); butECWdown.Location=butECWup.Location;//they will be at the same location, but just hide one or the other. butECWdown.Visible=false; tabProc.Location=new Point(0,28); gridProg.Location=new Point(0,tabProc.Bottom+2); gridProg.Height=ClientSize.Height-gridProg.Location.Y-2; } else {//normal: toothChart.Location=new Point(0,26); textTreatmentNotes.Location=new Point(0,toothChart.Bottom+1); textTreatmentNotes.Size=new Size(411,71); gridPtInfo.Visible=true; gridPtInfo.Location=new Point(0,textTreatmentNotes.Bottom+1); panelEcw.Visible=false; tabProc.Location=new Point(415,28); gridProg.Location=new Point(415,tabProc.Bottom+2); gridProg.Height=ClientSize.Height-gridProg.Location.Y-2; } if(Programs.UsingOrion) { textTreatmentNotes.Visible=false; contrChart.Controls.Remove(gridPtInfo); gridPtInfo.Visible=true; gridPtInfo.Location=new Point(0,0); gridPtInfo.Size=new Size(tabPatInfo.ClientSize.Width,tabPatInfo.ClientSize.Height); gridPtInfo.Anchor=AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom; tabPatInfo.Controls.Add(gridPtInfo); tabProc.SelectedTab=tabPatInfo; tabProc.Height=toothChart.Height-1; gridProg.Location=new Point(0,toothChart.Bottom+2); gridProg.HScrollVisible=true; gridProg.Height=ClientSize.Height-gridProg.Location.Y-2; gridProg.Width=ClientSize.Width-gridProg.Location.X-1;//full width } else { tabProc.TabPages.Remove(tabPatInfo); } }
///<summary></summary> public FormOpenDental(string[] cla) { Logger.openlog.Log("Initializing Open Dental...",Logger.Severity.INFO); CommandLineArgs=cla; Splash=new FormSplash(); if(CommandLineArgs.Length==0) { Splash.Show(); } InitializeComponent(); SystemEvents.SessionSwitch+=new SessionSwitchEventHandler(SystemEvents_SessionSwitch); //toolbar ToolBarMain=new ODToolBar(); ToolBarMain.Location=new Point(51,0); ToolBarMain.Size=new Size(931,25); ToolBarMain.Dock=DockStyle.Top; ToolBarMain.ImageList=imageListMain; ToolBarMain.ButtonClick+=new ODToolBarButtonClickEventHandler(ToolBarMain_ButtonClick); this.Controls.Add(ToolBarMain); //outlook bar myOutlookBar=new OutlookBar(); myOutlookBar.Location=new Point(0,0); myOutlookBar.Size=new Size(51,626); myOutlookBar.ImageList=imageList32; myOutlookBar.Dock=DockStyle.Left; myOutlookBar.ButtonClicked+=new ButtonClickedEventHandler(myOutlookBar_ButtonClicked); this.Controls.Add(myOutlookBar); //contrAppt ContrAppt2=new ContrAppt(); ContrAppt2.Visible=false; ContrAppt2.PatientSelected+=new PatientSelectedEventHandler(Contr_PatientSelected); this.Controls.Add(ContrAppt2); //contrFamily ContrFamily2=new ContrFamily(); ContrFamily2.Visible=false; ContrFamily2.PatientSelected+=new PatientSelectedEventHandler(Contr_PatientSelected); this.Controls.Add(ContrFamily2); //contrFamilyEcw ContrFamily2Ecw=new ContrFamilyEcw(); ContrFamily2Ecw.Visible=false; //ContrFamily2Ecw.PatientSelected+=new PatientSelectedEventHandler(Contr_PatientSelected); this.Controls.Add(ContrFamily2Ecw); //contrAccount ContrAccount2=new ContrAccount(); ContrAccount2.Visible=false; ContrAccount2.PatientSelected+=new PatientSelectedEventHandler(Contr_PatientSelected); this.Controls.Add(ContrAccount2); //contrTreat ContrTreat2=new ContrTreat(); ContrTreat2.Visible=false; ContrTreat2.PatientSelected+=new PatientSelectedEventHandler(Contr_PatientSelected); this.Controls.Add(ContrTreat2); //contrChart ContrChart2=new ContrChart(); ContrChart2.Visible=false; ContrChart2.PatientSelected+=new PatientSelectedEventHandler(Contr_PatientSelected); this.Controls.Add(ContrChart2); //contrImages ContrImages2=new ContrImages(); ContrImages2.Visible=false; ContrImages2.PatientSelected+=new PatientSelectedEventHandler(Contr_PatientSelected); this.Controls.Add(ContrImages2); //contrManage ContrManage2=new ContrStaff(); ContrManage2.Visible=false; ContrManage2.PatientSelected+=new PatientSelectedEventHandler(Contr_PatientSelected); this.Controls.Add(ContrManage2); //userControlTasks userControlTasks1=new UserControlTasks(); userControlTasks1.Visible=false; userControlTasks1.GoToChanged+=new EventHandler(userControlTasks1_GoToChanged); GotoModule.ModuleSelected+=new ModuleEventHandler(GotoModule_ModuleSelected); this.Controls.Add(userControlTasks1); panelSplitter.ContextMenu=menuSplitter; menuItemDockBottom.Checked=true; phoneSmall=new UserControlPhoneSmall(); phoneSmall.GoToChanged += new System.EventHandler(this.phoneSmall_GoToChanged); phoneSmall.Visible=false; this.Controls.Add(phoneSmall); //phonePanel=new UserControlPhonePanel(); //phonePanel.Visible=false; //this.Controls.Add(phonePanel); //phonePanel.GoToChanged += new System.EventHandler(this.phonePanel_GoToChanged); Logger.openlog.Log("Open Dental initialization complete.",Logger.Severity.INFO); //Plugins.HookAddCode(this,"FormOpenDental.Constructor_end");//Can't do this because no plugins loaded. }
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(); }