protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                bool isItNewSession;
                try
                {
                    isItNewSession = (bool)Session["NewSessionFor" + ConsentType.ToString()];
                }
                catch (Exception)
                {
                    isItNewSession = true;
                }

                for (int i = 0; i < 7; i++)
                {
                    ViewState["Signature" + i] = string.Empty;
                }

                var    formHandlerServiceClient = new FormHandlerServiceClient();
                string patientId;
                try
                {
                    patientId = Session["PatientID"].ToString();
                }
                catch (Exception)
                {
                    try
                    {
                        patientId = Request.QueryString["PatientId"];
                    }
                    catch (Exception)
                    {
                        patientId = string.Empty;
                    }
                }
                if (!isItNewSession)
                {
                    // Loading Signatures based on the selected patient
                    ViewState["Signature1"] = formHandlerServiceClient.GetPatientSignature(patientId, ConsentType.ToString(), "signature1");
                    ViewState["Signature2"] = formHandlerServiceClient.GetPatientSignature(patientId, ConsentType.ToString(), "signature2");
                    ViewState["Signature3"] = formHandlerServiceClient.GetPatientSignature(patientId, ConsentType.ToString(), "signature3");
                    ViewState["Signature4"] = formHandlerServiceClient.GetPatientSignature(patientId, ConsentType.ToString(), "signature4");
                    ViewState["Signature5"] = formHandlerServiceClient.GetPatientSignature(patientId, ConsentType.ToString(), "signature5");
                }
            }
            catch (Exception)
            {
                Response.Redirect("/PatientConsent.aspx");
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                bool isItNewSession;
                try
                {
                    isItNewSession = (bool)Session["NewSessionFor" + ConsentType.ToString()];
                }
                catch (Exception)
                {
                    isItNewSession = true;
                }

                for (int i = 0; i < 7; i++)
                    ViewState["Signature" + i] = string.Empty;

                var formHandlerServiceClient = new FormHandlerServiceClient();
                string patientId;
                try
                {
                    patientId = Session["PatientID"].ToString();
                }
                catch (Exception)
                {
                    try
                    {
                        patientId = Request.QueryString["PatientId"];
                    }
                    catch (Exception)
                    {
                        patientId = string.Empty;
                    }
                }
                if (!isItNewSession)
                {
                    // Loading Signatures based on the selected patient
                    ViewState["Signature1"] = formHandlerServiceClient.GetPatientSignature(patientId, ConsentType.ToString(), "signature1");
                    ViewState["Signature2"] = formHandlerServiceClient.GetPatientSignature(patientId, ConsentType.ToString(), "signature2");
                    ViewState["Signature3"] = formHandlerServiceClient.GetPatientSignature(patientId, ConsentType.ToString(), "signature3");
                    ViewState["Signature4"] = formHandlerServiceClient.GetPatientSignature(patientId, ConsentType.ToString(), "signature4");
                    ViewState["Signature5"] = formHandlerServiceClient.GetPatientSignature(patientId, ConsentType.ToString(), "signature5");
                }
            }
            catch (Exception)
            {
                Response.Redirect("/PatientConsent.aspx");
            }
        }
Exemple #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                DdLProcedures.Attributes["multiple"] = "multiple";
                bool isItNewSession = true;
                try
                {
                    isItNewSession = (bool)Session["NewSession"];
                }
                catch (Exception)
                { }

                for (int i = 0; i < 7; i++)
                {
                    ViewState["Signature" + i] = string.Empty;
                }

                var formHandlerServiceClient = new FormHandlerServiceClient();
                if (!IsPostBack)
                {
                    DdLProcedures.Items.Clear();

                    //DdLProcedures.Items.Add("--------Selected Procedures--------");
                    foreach (string procedureName in formHandlerServiceClient.GetProcedurenameList())
                    {
                        DdLProcedures.Items.Add(procedureName.Trim());
                    }
                }
                string patientId = string.Empty;
                try
                {
                    patientId = Session["PatientID"].ToString();
                }
                catch (Exception)
                {
                    try
                    {
                        patientId = Request.QueryString["PatientId"];
                    }
                    catch (Exception)
                    {
                        // Response.Redirect("/PatientConsent.aspx");
                    }
                }
                if (!IsPostBack)
                {
                    DdlPrimaryDoctors.Items.Add("----Select Primary Doctor----");
                    var physicians = formHandlerServiceClient.GetPrimaryPhysiciansList();
                    if (physicians != null)
                    {
                        foreach (DataRow row in physicians.Rows)
                        {
                            DdlPrimaryDoctors.Items.Add(new System.Web.UI.WebControls.ListItem(row["Lname"] + ", " + row["Fname"], row["PhysicianId"].ToString()));
                        }
                    }
                    if (!string.IsNullOrEmpty(patientId))
                    {
                        var patientDetail = formHandlerServiceClient.GetPatientDetail(patientId);
                        if (patientDetail != null)
                        {
                            LblPatientName.Text = patientDetail.name;
                            LblDate.Text        = patientDetail.AdmDate.ToString("MMM dd yyyy");
                            LblPatientMRId.Text = patientDetail.MRHash;
                            LblTime.Text        = DateTime.Now.ToShortTimeString();

                            if (!isItNewSession)
                            {
                                //var primaryDoctor = formHandlerServiceClient.GetPrimaryDoctorDetail(patientDetail.PrimaryDoctorId);
                                //DdlPrimaryDoctors.SelectedValue = primaryDoctor.Lname + ", " + primaryDoctor.Fname;
                                LoadAssociatedDoctors(patientDetail.PrimaryDoctorId);

                                //var associatedDoctor = formHandlerServiceClient.GetAssociateDoctorDetail(patientDetail.AssociatedDoctorId);
                                // DdlAssociatedDoctors.SelectedValue = associatedDoctor.Lname + ", " + associatedDoctor.Fname;
                                if (!string.IsNullOrEmpty(patientDetail.PrimaryDoctorId))
                                {
                                    DdlPrimaryDoctors.Items.FindByValue(patientDetail.PrimaryDoctorId).Selected = true;
                                }

                                //if (!string.IsNullOrEmpty(patientDetail.AssociatedDoctorId))
                                //    DdlAssociatedDoctors.Items.FindByValue(patientDetail.AssociatedDoctorId).Selected = true;

                                //if (!string.IsNullOrEmpty(patientDetail.ProcedureName))
                                //    DdLProcedures.Items.FindByText(patientDetail.ProcedureName.Trim()).Selected = true;
                                if (!string.IsNullOrEmpty(patientDetail.ProcedureName))
                                {
                                    HdnSelectedProcedures.Value = patientDetail.ProcedureName;
                                }
                            }
                        }
                        else
                        {
                            DdlPrimaryDoctors.SelectedIndex = 0;
                        }
                    }
                }
                if (!isItNewSession)
                {
                    // Loading Signatures based on the selected patient
                    ViewState["Signature1"] = formHandlerServiceClient.GetPatientSignature(patientId, "SurgicalConsent",
                                                                                           "signature1");
                    ViewState["Signature2"] = formHandlerServiceClient.GetPatientSignature(patientId, "SurgicalConsent",
                                                                                           "signature2");
                    ViewState["Signature3"] = formHandlerServiceClient.GetPatientSignature(patientId, "SurgicalConsent",
                                                                                           "signature3");
                    ViewState["Signature4"] = formHandlerServiceClient.GetPatientSignature(patientId, "SurgicalConsent",
                                                                                           "signature4");
                    ViewState["Signature5"] = formHandlerServiceClient.GetPatientSignature(patientId, "SurgicalConsent",
                                                                                           "signature5");
                }
            }
            catch (Exception)
            {
                Response.Redirect("/PatientConsent.aspx");
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                DdLProcedures.Attributes["multiple"] = "multiple";
                bool isItNewSession = true;
                try
                {
                    isItNewSession = (bool)Session["NewSession"];
                }
                catch (Exception)
                { }

                for (int i = 0; i < 7; i++)
                    ViewState["Signature" + i] = string.Empty;

                var formHandlerServiceClient = new FormHandlerServiceClient();
                if (!IsPostBack)
                {
                    DdLProcedures.Items.Clear();

                    //DdLProcedures.Items.Add("--------Selected Procedures--------");
                    foreach (string procedureName in formHandlerServiceClient.GetProcedurenameList())
                        DdLProcedures.Items.Add(procedureName.Trim());
                }
                string patientId = string.Empty;
                try
                {
                    patientId = Session["PatientID"].ToString();
                }
                catch (Exception)
                {
                    try
                    {
                        patientId = Request.QueryString["PatientId"];
                    }
                    catch (Exception)
                    {
                        // Response.Redirect("/PatientConsent.aspx");
                    }
                }
                if (!IsPostBack)
                {
                    DdlPrimaryDoctors.Items.Add("----Select Primary Doctor----");
                    var physicians = formHandlerServiceClient.GetPrimaryPhysiciansList();
                    if (physicians != null)
                    {
                        foreach (DataRow row in physicians.Rows)
                        {
                            DdlPrimaryDoctors.Items.Add(new System.Web.UI.WebControls.ListItem(row["Lname"] + ", " + row["Fname"], row["PhysicianId"].ToString()));
                        }
                    }
                    if (!string.IsNullOrEmpty(patientId))
                    {
                        var patientDetail = formHandlerServiceClient.GetPatientDetail(patientId);
                        if (patientDetail != null)
                        {
                            LblPatientName.Text = patientDetail.name;
                            LblDate.Text = patientDetail.AdmDate.ToString("MMM dd yyyy");
                            LblPatientMRId.Text = patientDetail.MRHash;
                            LblTime.Text = DateTime.Now.ToShortTimeString();

                            if (!isItNewSession)
                            {
                                //var primaryDoctor = formHandlerServiceClient.GetPrimaryDoctorDetail(patientDetail.PrimaryDoctorId);
                                //DdlPrimaryDoctors.SelectedValue = primaryDoctor.Lname + ", " + primaryDoctor.Fname;
                                LoadAssociatedDoctors(patientDetail.PrimaryDoctorId);

                                //var associatedDoctor = formHandlerServiceClient.GetAssociateDoctorDetail(patientDetail.AssociatedDoctorId);
                                // DdlAssociatedDoctors.SelectedValue = associatedDoctor.Lname + ", " + associatedDoctor.Fname;
                                if (!string.IsNullOrEmpty(patientDetail.PrimaryDoctorId))
                                    DdlPrimaryDoctors.Items.FindByValue(patientDetail.PrimaryDoctorId).Selected = true;

                                //if (!string.IsNullOrEmpty(patientDetail.AssociatedDoctorId))
                                //    DdlAssociatedDoctors.Items.FindByValue(patientDetail.AssociatedDoctorId).Selected = true;

                                //if (!string.IsNullOrEmpty(patientDetail.ProcedureName))
                                //    DdLProcedures.Items.FindByText(patientDetail.ProcedureName.Trim()).Selected = true;
                                if (!string.IsNullOrEmpty(patientDetail.ProcedureName))
                                {
                                    HdnSelectedProcedures.Value = patientDetail.ProcedureName;
                                }
                            }
                        }
                        else
                            DdlPrimaryDoctors.SelectedIndex = 0;
                    }
                }
                if (!isItNewSession)
                {
                    // Loading Signatures based on the selected patient
                    ViewState["Signature1"] = formHandlerServiceClient.GetPatientSignature(patientId, "SurgicalConsent",
                                                                                           "signature1");
                    ViewState["Signature2"] = formHandlerServiceClient.GetPatientSignature(patientId, "SurgicalConsent",
                                                                                           "signature2");
                    ViewState["Signature3"] = formHandlerServiceClient.GetPatientSignature(patientId, "SurgicalConsent",
                                                                                           "signature3");
                    ViewState["Signature4"] = formHandlerServiceClient.GetPatientSignature(patientId, "SurgicalConsent",
                                                                                           "signature4");
                    ViewState["Signature5"] = formHandlerServiceClient.GetPatientSignature(patientId, "SurgicalConsent",
                                                                                           "signature5");
                }
            }
            catch (Exception)
            {
                Response.Redirect("/PatientConsent.aspx");
            }
        }