protected void Filldata(int pat_ID) { objNLog.Info("Function started with patID as argument..."); try { tabContainer.ActiveTabIndex = 0; PatientInfoDAL objPat_Info = new PatientInfoDAL(); DataTable dtPatientDetails = new DataTable(); string patFulName = txtPatientName1.Text; if (patFulName.IndexOf(",") < 0 && pat_ID == 0) { SetlblVisibility(0); string script = @"if(confirm('Patient does not exist. Do you want to add a new Patient?')) { window.location.href='PatientProfile.aspx?patname=" + txtPatientName1.Text + "';}"; ScriptManager.RegisterStartupScript(this, this.GetType(), "jsCall", script, true); } else { tabContainer.Enabled = true; if (pat_ID == 0) { lblMsg.Text = string.Empty; string[] arInfo = new string[2]; char[] splitter = { ',' }; arInfo = patFulName.Split(splitter); dtPatientDetails = objPat_Info.get_Patient_Details(arInfo[1], arInfo[0]); } else dtPatientDetails = objPat_Info.get_Patient_Details(pat_ID.ToString()); if (dtPatientDetails.Rows.Count > 0) { if (dtPatientDetails.Rows[0][1].ToString() != null) { lblPhone1.Text = FormatUSPhone(dtPatientDetails.Rows[0]["Pat_Phone"].ToString()); } else { } if (dtPatientDetails.Rows[0]["Pat_Gender"].ToString() == "M") { lblGender1.Text = "Male"; } else { lblGender1.Text = "Female"; } lblWPhone1.Text = FormatUSPhone(dtPatientDetails.Rows[0]["Pat_WorkPhone"].ToString()); lblCell1.Text = FormatUSPhone(dtPatientDetails.Rows[0]["Pat_CellPhone"].ToString()); lblDOB1.Text = ((DateTime)dtPatientDetails.Rows[0]["Pat_DOB"]).ToShortDateString(); String contRel = ""; switch (dtPatientDetails.Rows[0]["econtact_relation"].ToString().Trim()) { case "M": contRel = "Mother"; break; case "F": contRel = "Father"; break; case "B": contRel = "Brother"; break; case "S": contRel = "Sister"; break; case "P": contRel = "Spouse"; break; case "A": contRel = "GrandFather"; break; case "G": contRel = "GrandMother"; break; case "O": contRel = "Other"; break; } lbleContactName.Text = dtPatientDetails.Rows[0]["econtact_fname"].ToString().Trim() + " " + dtPatientDetails.Rows[0]["econtact_lname"].ToString().Trim(); if (contRel != "") lbleContactName.Text = lbleContactName.Text.Trim() + "(" + contRel + ")"; if (dtPatientDetails.Rows[0]["econtact_phone"].ToString().Trim() != "") lbleContactName.Text = lbleContactName.Text.Trim() + " <B>Phone: </B>" + FormatUSPhone(dtPatientDetails.Rows[0]["econtact_phone"].ToString().Trim()); if (dtPatientDetails.Rows[0]["Pat_Primary_Ins_ID"].ToString() != "") lblPrimIns1.Text = dtPatientDetails.Rows[0]["Ins_Name"].ToString(); else lblPrimIns1.Text = "N/A"; lblSSN1.Text = FormatUSSSN(dtPatientDetails.Rows[0]["Pat_SSN"].ToString()); if (dtPatientDetails.Rows[0]["Balance"] != DBNull.Value) { lblBalance1.Text = dtPatientDetails.Rows[0]["Balance"].ToString(); } string address = ""; if (dtPatientDetails.Rows[0]["Pat_Address1"].ToString().Trim() != "") { address = address + dtPatientDetails.Rows[0]["Pat_Address1"].ToString().Trim() + ", "; } if (dtPatientDetails.Rows[0]["Pat_Address2"].ToString().Trim() != "") { address = address + dtPatientDetails.Rows[0]["Pat_Address2"].ToString().Trim() + ", "; } if (dtPatientDetails.Rows[0]["Pat_City"].ToString().Trim() != "") { address = address + dtPatientDetails.Rows[0]["Pat_City"].ToString().Trim() + ","; } string Saddress = ""; if (dtPatientDetails.Rows[0]["Pat_Ship_Address1"].ToString().Trim() != "") { Saddress = Saddress + dtPatientDetails.Rows[0]["Pat_Ship_Address1"].ToString().Trim() + ", "; } if (dtPatientDetails.Rows[0]["Pat_Ship_Address2"].ToString().Trim() != "") { Saddress = Saddress + dtPatientDetails.Rows[0]["Pat_Ship_Address2"].ToString().Trim() + ", "; } if (dtPatientDetails.Rows[0]["Pat_Ship_City"].ToString().Trim() != "") { Saddress = Saddress + dtPatientDetails.Rows[0]["Pat_Ship_City"].ToString().Trim() + ","; } lblAddress12.Text = address + dtPatientDetails.Rows[0]["Pat_State"].ToString() + " " + dtPatientDetails.Rows[0]["Pat_Zip"].ToString(); lblSAddress12.Text = Saddress + dtPatientDetails.Rows[0]["Pat_Ship_State"].ToString() + " " + dtPatientDetails.Rows[0]["Pat_Ship_Zip"].ToString(); lblPatientContact1.Text = dtPatientDetails.Rows[0]["Pat_Address1"].ToString() + "," + dtPatientDetails.Rows[0]["Pat_Address2"].ToString() + ", " + dtPatientDetails.Rows[0]["Pat_City"].ToString() + ", " + dtPatientDetails.Rows[0]["Pat_State"].ToString() + " " + dtPatientDetails.Rows[0]["Pat_Zip"].ToString() + ", " + FormatUSPhone(dtPatientDetails.Rows[0]["Pat_Phone"].ToString()); lblPatAccountName.Text = txtPatientName1.Text; patID = (int)(dtPatientDetails.Rows[0]["Pat_ID"]); Session["Pat_ID"] = patID; patFacID = int.Parse(dtPatientDetails.Rows[0]["Facility_ID"].ToString()); txtCallLogDoctor.Text = dtPatientDetails.Rows[0]["Pat_PDoc"].ToString(); lblDoctor1.Text = dtPatientDetails.Rows[0]["Pat_PDoc"].ToString(); lblCliniFacility1.Text = objPat_Info.Get_Facility(patFacID)[0].ToString(); string[] Diagn = new string[3]; char[] split = { ',' }; string Data = dtPatientDetails.Rows[0][18].ToString(); lbldcode1.Text = Data; Diagn = Data.Split(','); if (dtPatientDetails.Rows[0][19].ToString() == "Y") lblAutofill1.Text = "Yes"; else lblAutofill1.Text = "No"; hidPatID.Value = dtPatientDetails.Rows[0]["Pat_ID"].ToString(); AutoCompleteExtender3.ContextKey = dtPatientDetails.Rows[0]["Pat_ID"].ToString(); ACE_CLOG_Doctor.ContextKey = dtPatientDetails.Rows[0]["Pat_ID"].ToString(); if (Session["Role"].ToString() == "D") btnEdit.Visible = false; else { btnEdit.Visible = true; btnAppointments.Visible = true; } if (dtPatientDetails.Rows[0]["HIPPA"].ToString() == "Y") { lblHippa1.Text = "Yes ( " + dtPatientDetails.Rows[0]["HIPPADate"].ToString() + " )"; } else lblHippa1.Text = "No"; //Hipaa End PatientLastprescription(dtPatientDetails.Rows[0]["Pat_ID"].ToString()); PatientLastVisit(dtPatientDetails.Rows[0]["Pat_ID"].ToString()); String mname = ""; if (dtPatientDetails.Rows[0]["Pat_MName"].ToString().Trim() != mname) mname = " " + dtPatientDetails.Rows[0]["Pat_MName"].ToString().Trim() + "."; txtPatientName1.Text = dtPatientDetails.Rows[0]["Pat_LName"].ToString() + "," + dtPatientDetails.Rows[0]["Pat_FName"].ToString(); //Added Patient Appointments - START. DataSet dsAppts = objPat_Info.Get_Appt(patID.ToString()); if (dsAppts != null && dsAppts.Tables.Count > 0) { if (dsAppts.Tables[0].Rows.Count > 0) { ContentPlaceHolder mpContentPlaceHolder; mpContentPlaceHolder = (ContentPlaceHolder)Master.FindControl("ContentPlaceHolder1"); if (mpContentPlaceHolder != null) { HtmlContainerControl divAppt = (HtmlContainerControl)mpContentPlaceHolder.FindControl("divAppt"); if (divAppt != null) { DataGrid grdAppts = new DataGrid(); grdAppts.AutoGenerateColumns = false; grdAppts.HeaderStyle.CssClass = "medication_info_th1"; grdAppts.ItemStyle.CssClass = "medication_info_tr-odd"; grdAppts.ItemStyle.Font.Bold = false; grdAppts.AlternatingItemStyle.Font.Bold = false; grdAppts.AlternatingItemStyle.CssClass = "medication_info_tr-even"; BoundColumn nameColumn = new BoundColumn(); nameColumn = new BoundColumn(); nameColumn.HeaderText = "Time"; nameColumn.DataField = "APPT_Time"; nameColumn.ItemStyle.Width = 100; grdAppts.Columns.Add(nameColumn); nameColumn = new BoundColumn(); nameColumn.HeaderText = "Doctor"; nameColumn.DataField = "Doctor_Name"; nameColumn.ItemStyle.Width = 100; grdAppts.Columns.Add(nameColumn); grdAppts.DataSource = dsAppts; grdAppts.DataBind(); System.IO.StringWriter sw = new System.IO.StringWriter(); System.Web.UI.HtmlTextWriter htw = new System.Web.UI.HtmlTextWriter(sw); grdAppts.RenderControl(htw); StringBuilder sb = new StringBuilder(); sb.Append("<a onmouseout=popUp(event,'divPatAppt') onmouseover=popUp(event,'divPatAppt') style='cursor:hand' title='Appointments'><img src='../Images/pat_appt.gif' width='32px' height='32px' alt=''/></a>"); sb.Append("<div id='divPatAppt' class='tip' style='width:auto;'>"); sb.Append(sw.ToString()); sb.Append("</div>"); divAppt.InnerHtml = sb.ToString(); } } } } ShowPatientAllergies(pat_ID); ClearAllPatientTabs(); FillgridPriscrition(); } // //Added Patient Appointments - END. else { SetlblVisibility(0); hidPatID.Value = ""; string script = @"if(confirm('Patient does not exist, Do you want to add a new Patient!')) { window.location.href='PatientProfile.aspx?patname=" + txtPatientName1.Text + "';}"; ScriptManager.RegisterStartupScript(this, this.GetType(), "jsCall", script, true); } } } catch (Exception ex) { objNLog.Error("Error : " + ex.Message); } objNLog.Info("Function completed..."); }