Exemplo n.º 1
0
    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() + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<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...");
    }
Exemplo n.º 2
0
    protected void Filldata()
    {
        objNLog.Info("Function Started..");
        try
        {
            PatientInfoDAL Pat_Info = new PatientInfoDAL();
            DataTable dtPatientDetails = new DataTable();

            AutoCompleteExtender1.ContextKey = Request.QueryString["patID"].ToString();
            dtPatientDetails = Pat_Info.get_Patient_Details(Request.QueryString["patID"].ToString());
            if (dtPatientDetails.Rows.Count > 0)
            {

                lblPatAccount1.Text = dtPatientDetails.Rows[0]["Pat_LName"].ToString() + ", " + dtPatientDetails.Rows[0]["Pat_FName"].ToString();

                int Pat_FacId = int.Parse(dtPatientDetails.Rows[0]["Facility_ID"].ToString());

                txtDoc.Text = dtPatientDetails.Rows[0]["Pat_PDoc"].ToString();

                hidDocID.Value = dtPatientDetails.Rows[0]["Doc_ID"].ToString();
                txtFacility.Text = Pat_Info.Get_Facility(Pat_FacId)[0].ToString();
                txtDate.Text = DateTime.Now.ToString("MM/dd/yyyy");
                fill_AppointmentsGrid(hidDocID.Value, txtDate.Text);

            }
        }
        catch (Exception ex)
        {
            objNLog.Error("Error : " + ex.Message);
        }
        objNLog.Info("Function Completed..");
    }
Exemplo n.º 3
0
    protected void Filldata()
    {
        objNLog.Info("Function Started..");
        try
        {

            PatientInfoDAL Pat_Info = new PatientInfoDAL();
            DataTable dtPatientDetails = new DataTable();
            dtPatientDetails = Pat_Info.get_Patient_Details(Request.QueryString["patID"].ToString());
            if (dtPatientDetails.Rows.Count > 0)
            {
                txtDoctor.Enabled = true;
                if (dtPatientDetails.Rows[0][1].ToString() != null)
                {
                    txtPhone.Text = dtPatientDetails.Rows[0][1].ToString();

                }
                else
                {
                    txtPhone.Text = null;
                }
                if (dtPatientDetails.Rows[0][2].ToString() == "M")
                {
                    rbtnMale.Checked = true;
                }
                else
                {
                    rbtnFeMale.Checked = true;
                }

                txtPatientFName.Text = dtPatientDetails.Rows[0]["Pat_FName"].ToString().Trim();
                txtPatientLName.Text = dtPatientDetails.Rows[0]["Pat_LName"].ToString().Trim();
                txtPatientMName.Text = dtPatientDetails.Rows[0]["Pat_MName"].ToString().Trim();

                txtDOB.Text = ((DateTime)dtPatientDetails.Rows[0]["Pat_DOB"]).ToShortDateString();
                if (ddlPrimInsurance.Enabled == true && dtPatientDetails.Rows[0]["Pat_Primary_Ins_ID"].ToString() != "")
                    ddlPrimInsurance.SelectedValue = dtPatientDetails.Rows[0]["Pat_Primary_Ins_ID"].ToString();
                txtSSN.Text = dtPatientDetails.Rows[0]["Pat_SSN"].ToString();
                //txtBalance.Text = dtPatientDetails.Rows[0][6].ToString();

                txtecontactFNAME.Text = dtPatientDetails.Rows[0]["econtact_fname"].ToString();
                txtecontactLNAME.Text = dtPatientDetails.Rows[0]["econtact_lname"].ToString();
                txtecontactPHONE.Text = dtPatientDetails.Rows[0]["econtact_phone"].ToString();
                ddlecontactREL.SelectedValue = dtPatientDetails.Rows[0]["econtact_relation"].ToString();

                txtAddress1.Text = dtPatientDetails.Rows[0]["Pat_Address1"].ToString();
                txtAddress2.Text = dtPatientDetails.Rows[0]["Pat_Address2"].ToString();
                txtCity.Text = dtPatientDetails.Rows[0]["Pat_City"].ToString();

                txtState.Text = dtPatientDetails.Rows[0]["Pat_State"].ToString();
                txtZip.Text = dtPatientDetails.Rows[0]["Pat_Zip"].ToString();
                txtWorkPhone.Text = dtPatientDetails.Rows[0]["Pat_WorkPhone"].ToString();
                txtCellPhone.Text = dtPatientDetails.Rows[0]["Pat_CellPhone"].ToString();

                hidPat_ID.Value = (dtPatientDetails.Rows[0]["Pat_ID"].ToString());
                int Pat_FacId = int.Parse(dtPatientDetails.Rows[0]["Facility_ID"].ToString());

                txtDoctor.Text = dtPatientDetails.Rows[0]["Pat_PDoc"].ToString().Trim();

                txtClinicFacility.Text = Pat_Info.Get_Facility(Pat_FacId)[0].ToString();
                txtSAddr1.Text = dtPatientDetails.Rows[0]["Pat_Ship_Address1"].ToString();
                txtSAddr2.Text = dtPatientDetails.Rows[0]["Pat_Ship_Address2"].ToString();

                txtSCity1.Text = dtPatientDetails.Rows[0]["Pat_Ship_City"].ToString();
                txtSState.Text = dtPatientDetails.Rows[0]["Pat_Ship_State"].ToString();

                txtSZIP.Text = dtPatientDetails.Rows[0]["Pat_Ship_Zip"].ToString();
                string[] Diagn = new string[3];
                char[] split = { ',' };
                string Data = dtPatientDetails.Rows[0][18].ToString();
                Diagn = Data.Split(',');
                txtDiagn1.Text = Diagn[0];
                if (Diagn.Length > 1)
                    txtDiagn2.Text = Diagn[1];
                if (Diagn.Length > 2)
                    txtDiagn3.Text = Diagn[2];
                if (Diagn.Length > 3)
                    txtDiagn4.Text = Diagn[3];
                if (Diagn.Length > 4)
                    txtDiagn5.Text = Diagn[4];

                if (dtPatientDetails.Rows[0]["Pat_Rx_Auto_Refill_Y_N"].ToString() == "Y")
                    chkAutoreFillOption.Checked = true;
                else
                    chkAutoreFillOption.Checked = false;

                if (dtPatientDetails.Rows[0]["HIPPA"].ToString() == "Y")
                {
                    chkHippa.Checked = true;
                    txtHippaDate.Text = DateTime.Parse( dtPatientDetails.Rows[0]["HIPPADate"].ToString()).ToString("MM/dd/yyyy");
                }
                else
                    chkAutoreFillOption.Checked = false;

                txtMRN.Text = dtPatientDetails.Rows[0]["Pat_MRN"].ToString();

                if (dtPatientDetails.Rows[0]["Pat_IsActive"] != System.DBNull.Value)
                {
                    if (ddlPatStatus.Enabled == true)
                    {
                        if (dtPatientDetails.Rows[0]["Pat_IsActive"].ToString() == "Y")
                            ddlPatStatus.SelectedIndex = 0;
                        else
                            ddlPatStatus.SelectedIndex = 1;
                    }
                }

            }
        }
        catch (Exception ex)
        {
            objNLog.Error("Error : " + ex.Message);
        }
        objNLog.Info("Function Completed..");
    }