Ejemplo n.º 1
0
        protected void StatusDDL_OnSelectedIndexChanged(Object sender, EventArgs e)
        {
            foreach (RepeaterItem item in rptPatient.Items)
            {
                if (item.ItemType == ListItemType.Item || item.ItemType == ListItemType.AlternatingItem)
                {
                    DropDownList StatusDDL       = (DropDownList)item.FindControl("StatusDDL");
                    Label        StatusLBL       = (Label)item.FindControl("StatusLBL");
                    Label        StatusPatientId = (Label)item.FindControl("StatusPatientId");

                    Patient ptObj = new Patient();
                    ptObj.Get(Int32.Parse(StatusPatientId.Text));
                    if (!ptObj.IsEmpty)
                    {
                        if (!String.IsNullOrEmpty(StatusDDL.SelectedValue) && ptObj[Patient.PtContactStatus].ToString() != StatusDDL.SelectedValue)
                        {
                            ptObj[Patient.PtContactStatus] = StatusDDL.SelectedValue;

                            UserController userCt        = new UserController();
                            int            currentUserId = userCt.GetUserId();
                            UserDa         currentUserDa = new UserDa();
                            DataSet        currentUserDs = currentUserDa.GetByUserId(userCt.GetUserId());
                            ptObj[Patient.UpdatedTime] = DateTime.Today;
                            ptObj[Patient.UpdatedBy]   = (currentUserDs.Tables.Count > 0 && currentUserDs.Tables[0].Rows.Count > 0) ? currentUserDs.Tables[0].Rows[0][BOL.User.UserName].ToString() : "not specified";
                            ptObj.Save();
                        }
                    }
                }
            }
            rptPatient.Focus();
        }
Ejemplo n.º 2
0
        protected void SaveActionClick(object sender, EventArgs e)
        {
            if (PatientId != 0)
            {
                // create ActionItem = 'PtContactInfoUpdated' for patients to check
                ActionDa   actionDa  = new ActionDa();
                BOL.Action actionObj = new Caisis.BOL.Action();
                actionObj[BOL.Action.PatientId]      = PatientId;
                actionObj[BOL.Action.ActionDateText] = DateTime.Today.ToShortDateString();
                actionObj[BOL.Action.ActionDate]     = DateTime.Today;
                actionObj[BOL.Action.ActionItem]     = "PtContactInfoUpdated";

                UserController userCt        = new UserController();
                int            currentUserId = userCt.GetUserId();
                UserDa         currentUserDa = new UserDa();
                DataSet        currentUserDs = currentUserDa.GetByUserId(userCt.GetUserId());
                actionObj[BOL.Action.EnteredBy] = (currentUserDs.Tables.Count > 0 && currentUserDs.Tables[0].Rows.Count > 0) ? currentUserDs.Tables[0].Rows[0][BOL.User.UserName].ToString() : "not specified";

                actionObj[BOL.Action.EnteredTime] = DateTime.Today;

                actionObj.Save();

                // set patient status to 'current'
                Patient ptObj = new Patient();
                ptObj.Get(PatientId);
                if (!ptObj.IsEmpty)
                {
                    ptObj[Patient.PtContactStatus] = "Current";

                    ptObj[Patient.PtAddress1]   = PatientAddress1TB.Text;
                    ptObj[Patient.PtAddress2]   = PatientAddress2TB.Text;
                    ptObj[Patient.PtCity]       = PatientCityTB.Text;
                    ptObj[Patient.PtState]      = PatientStateSelect.SelectedValue;
                    ptObj[Patient.PtPostalCode] = PatientPostalCodeTB.Text;
                    ptObj[Patient.PtEmail]      = PatientEmailTB.Text;
                    ptObj[Patient.PtCountry]    = PatientCountryCB.Text;

                    ptObj[Patient.PtCompany]       = PatientCompanyTB.Text;
                    ptObj[Patient.PtBusinessCity]  = PatientBusinessCityTB.Text;
                    ptObj[Patient.PtBusinessState] = PatientBusinessStateSelect.SelectedValue;

                    ptObj[Patient.PtContactPerson]     = PatientContactPersonTB.Text;
                    ptObj[Patient.PtContactAddress1]   = PatientContactAddress1TB.Text;
                    ptObj[Patient.PtContactAddress2]   = PatientContactAddress2TB.Text;
                    ptObj[Patient.PtContactCity]       = PatientContactCityTB.Text;
                    ptObj[Patient.PtContactState]      = PatientContactStateSelect.SelectedValue;
                    ptObj[Patient.PtContactPostalCode] = PatientContactPostalCodeTB.Text;
                    ptObj[Patient.PtContactPhone]      = PatientContactPhoneTB.Text;

                    ptObj[Patient.UpdatedBy]   = (currentUserDs.Tables.Count > 0 && currentUserDs.Tables[0].Rows.Count > 0) ? currentUserDs.Tables[0].Rows[0][BOL.User.UserName].ToString() : "not specified";
                    ptObj[Patient.UpdatedTime] = DateTime.Today;

                    ptObj.Save();
                }
            }

            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "_reloadMainPage", "reloadMainPage(); ", true);
        }
Ejemplo n.º 3
0
        protected void LetterReceivedClick(object sender, EventArgs e)
        {
            if (PatientId != 0)
            {
                // create ActionItem = 'DataReceived'
                UserController userCt        = new UserController();
                int            currentUserId = userCt.GetUserId();
                UserDa         currentUserDa = new UserDa();
                DataSet        currentUserDs = currentUserDa.GetByUserId(userCt.GetUserId());

                bool actionAlreadyExists = false;

                ActionDa actionDa = new ActionDa();
                DataSet  actionDs = actionDa.ValidateActionItem(PatientId, "DataReceived");
                if (actionDs.Tables.Count > 0)
                {
                    DataView actionDv = new DataView(actionDs.Tables[0]);
                    actionDv.RowFilter = BOL.Action.ActionDateText + " = '" + DateTime.Today.ToShortDateString() + "' AND " + BOL.Action.ActionItem + " = 'DataReceived' ";
                    if (actionDv.Count > 0)
                    {
                        actionAlreadyExists = true;
                    }
                }

                // if action item does not already exist for today
                if (!actionAlreadyExists)
                {
                    BOL.Action actionObj = new Caisis.BOL.Action();
                    actionObj[BOL.Action.PatientId]      = PatientId;
                    actionObj[BOL.Action.ActionDateText] = LetterReceivedDateText.Text;
                    actionObj[BOL.Action.ActionDate]     = DateTime.Parse(LetterReceivedDate.Value).ToString();
                    actionObj[BOL.Action.ActionItem]     = "DataReceived";
                    actionObj[BOL.Action.ActionNotes]    = "Letter received";
                    actionObj[BOL.Action.EnteredBy]      = (currentUserDs.Tables.Count > 0 && currentUserDs.Tables[0].Rows.Count > 0) ? currentUserDs.Tables[0].Rows[0][BOL.User.UserName].ToString() : "not specified";
                    actionObj[BOL.Action.EnteredTime]    = DateTime.Today;

                    actionObj.Save();
                }

                // set patient status to 'NeedDataEntry'
                Patient ptObj = new Patient();
                ptObj.Get(PatientId);
                if (!ptObj.IsEmpty)
                {
                    ptObj[Patient.PtContactStatus] = "NeedDataEntry";
                    ptObj[Patient.UpdatedBy]       = (currentUserDs.Tables.Count > 0 && currentUserDs.Tables[0].Rows.Count > 0) ? currentUserDs.Tables[0].Rows[0][BOL.User.UserName].ToString() : "not specified";
                    ptObj[Patient.UpdatedTime]     = DateTime.Today;

                    ptObj.Save();
                }
            }

            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "_reloadMainPage", "reloadMainPage(); ", true);
        }
Ejemplo n.º 4
0
        protected void PrintingCompleteClick(object sender, EventArgs e)
        {
            DataView dv = new DataView(GetSelectedPatients());

            dv.RowFilter = "Mail = 1";
            int count = 0;

            foreach (DataRowView drv in dv)
            {
                // set patient status and create action items for PtAuthorizationRequested
                ActionDa   actionDa  = new ActionDa();
                BOL.Action actionObj = new Caisis.BOL.Action();
                Patient    ptObj     = new Patient();
                ptObj.Get(Int32.Parse(drv[BOL.Patient.PatientId].ToString()));

                if (!ptObj.IsEmpty)
                {
                    ptObj[Patient.PtContactStatus]   = "PtAuthorizationRequested";
                    actionObj[BOL.Action.ActionItem] = "PtAuthorizationRequested";

                    UserController userCt        = new UserController();
                    int            currentUserId = userCt.GetUserId();
                    UserDa         currentUserDa = new UserDa();
                    DataSet        currentUserDs = currentUserDa.GetByUserId(userCt.GetUserId());
                    ptObj[Patient.UpdatedBy]   = (currentUserDs.Tables.Count > 0 && currentUserDs.Tables[0].Rows.Count > 0) ? currentUserDs.Tables[0].Rows[0][BOL.User.UserName].ToString() : "not specified";
                    ptObj[Patient.UpdatedTime] = DateTime.Today;
                    ptObj.Save();

                    actionObj[BOL.Action.PatientId]      = Int32.Parse(drv[BOL.Patient.PatientId].ToString());
                    actionObj[BOL.Action.ActionDateText] = DateTime.Today.ToShortDateString();
                    actionObj[BOL.Action.ActionDate]     = DateTime.Today;
                    actionObj[BOL.Action.EnteredBy]      = (currentUserDs.Tables.Count > 0 && currentUserDs.Tables[0].Rows.Count > 0) ? currentUserDs.Tables[0].Rows[0][BOL.User.UserName].ToString() : "not specified";
                    actionObj[BOL.Action.EnteredTime]    = DateTime.Now;
                    actionObj.Save();

                    count++;
                }
            }

            if (count > 0)
            {
                Option2RB.Checked                 = false;
                Option2RB.Enabled                 = false;
                Option2Title.Text                 = "No packages to print.";
                Option2Title.ForeColor            = System.Drawing.Color.Gray;
                Option2ResultDiv.Style["display"] = "none";
                Option2Details.Text               = String.Empty;

                RemovePatientFromNeedLetterList(dv, "Mail");
            }
        }
Ejemplo n.º 5
0
        protected void AssignPhysicianClick(object sender, EventArgs e)
        {
            // assign selected physician as following physician
            if (!String.IsNullOrEmpty(FollowingPhysicianId.SelectedValue) && PatientId != 0)
            {
                Physician phObj = new Physician();
                phObj.Get(Int32.Parse(FollowingPhysicianId.SelectedValue));
                if (!phObj.IsEmpty)
                {
                    PhysicianDa pda         = new PhysicianDa();
                    int         physicianId = Int32.Parse(phObj[Physician.PhysicianId].ToString());

                    PatientPhysicianDa ptPhDa = new PatientPhysicianDa();
                    DataTable          ptphDt = ptPhDa.ValidatePatientPhysician(PatientId, physicianId).Tables[0];
                    if (VerifyUnique(ptphDt))
                    {
                        AssignPhysicianErrorLBL.Text = String.Empty;

                        // NEW CODE, insert record though middle tier
                        PatientPhysician ptPhysician = new PatientPhysician();
                        ptPhysician[PatientPhysician.PatientId]   = PatientId;
                        ptPhysician[PatientPhysician.PhysicianId] = physicianId;
                        ptPhysician[PatientPhysician.PtPhRole]    = "Following";

                        UserController userCt        = new UserController();
                        int            currentUserId = userCt.GetUserId();
                        UserDa         currentUserDa = new UserDa();
                        DataSet        currentUserDs = currentUserDa.GetByUserId(userCt.GetUserId());

                        ptPhysician[PatientPhysician.EnteredTime] = DateTime.Now;
                        ptPhysician[PatientPhysician.EnteredBy]   = (currentUserDs.Tables.Count > 0 && currentUserDs.Tables[0].Rows.Count > 0) ? currentUserDs.Tables[0].Rows[0][BOL.User.UserName].ToString() : "not specified";
                        ptPhysician.Save();

                        Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "_refreshPage", "refreshPage(); ", true);
                    }
                    else
                    {
                        AssignPhysicianErrorLBL.Text = "Physician " + phObj[Physician.PhFirstName].ToString() + " " + phObj[Physician.PhLastName].ToString() + " already assigned to patient as a(n) " + ptphDt.Rows[0][PatientPhysician.PtPhRole].ToString() + " physician.";
                    }
                }
            }
        }
Ejemplo n.º 6
0
        protected void DoNotContactPerMDClick(object sender, EventArgs e)
        {
            DataView dv = new DataView(GetSelectedPatients());

            dv.RowFilter = "DoNotContactPerMD = 1";
            int count = 0;

            foreach (DataRowView drv in dv)
            {
                // set patient status to 'DoNotContactPerPT'
                Patient ptObj = new Patient();
                ptObj.Get(Int32.Parse(drv[BOL.Patient.PatientId].ToString()));
                if (!ptObj.IsEmpty)
                {
                    ptObj[Patient.PtContactStatus] = "DoNotContactPerMD";

                    UserController userCt        = new UserController();
                    int            currentUserId = userCt.GetUserId();
                    UserDa         currentUserDa = new UserDa();
                    DataSet        currentUserDs = currentUserDa.GetByUserId(userCt.GetUserId());
                    ptObj[Patient.UpdatedBy]   = (currentUserDs.Tables.Count > 0 && currentUserDs.Tables[0].Rows.Count > 0) ? currentUserDs.Tables[0].Rows[0][BOL.User.UserName].ToString() : "not specified";
                    ptObj[Patient.UpdatedTime] = DateTime.Today;
                    ptObj.Save();
                    count++;
                }
            }

            if (count > 0)
            {
                Option3RB.Checked      = false;
                Option3RB.Enabled      = false;
                Option3Title.Text      = "No patients specified for no contact.";
                Option3Title.ForeColor = System.Drawing.Color.Gray;
                Option3Details.Text    = String.Empty;

                PopulateDoNotContactResults();
                RemovePatientFromNeedLetterList(dv, "DoNotContactPerMD");
                //PopulateResults();
            }
        }
Ejemplo n.º 7
0
        protected void SaveActionClick(object sender, EventArgs e)
        {
            if (PatientId != 0)
            {
                // create ActionItem = 'MD_Contacted' for patients to check
                ActionDa   actionDa  = new ActionDa();
                BOL.Action actionObj = new Caisis.BOL.Action();
                actionObj[BOL.Action.PatientId]      = PatientId;
                actionObj[BOL.Action.ActionDateText] = DateTime.Today.ToShortDateString();
                actionObj[BOL.Action.ActionDate]     = DateTime.Today;
                actionObj[BOL.Action.ActionItem]     = "MD_Contacted";
                actionObj[BOL.Action.ActionNotes]    = !String.IsNullOrEmpty(PersonSpokeTo.Text) ? "Spoke to " + PersonSpokeTo.Text : String.Empty;

                UserController userCt        = new UserController();
                int            currentUserId = userCt.GetUserId();
                UserDa         currentUserDa = new UserDa();
                DataSet        currentUserDs = currentUserDa.GetByUserId(userCt.GetUserId());
                actionObj[BOL.Action.EnteredBy] = (currentUserDs.Tables.Count > 0 && currentUserDs.Tables[0].Rows.Count > 0) ? currentUserDs.Tables[0].Rows[0][BOL.User.UserName].ToString() : "not specified";

                actionObj[BOL.Action.EnteredTime] = DateTime.Now;

                actionObj.Save();

                // set patient status to 'MD_Contacted'
                Patient ptObj = new Patient();
                ptObj.Get(PatientId);
                if (!ptObj.IsEmpty)
                {
                    ptObj[Patient.PtContactStatus] = "MD_Contacted";
                    ptObj[Patient.UpdatedTime]     = DateTime.Now;
                    ptObj[Patient.UpdatedBy]       = (currentUserDs.Tables.Count > 0 && currentUserDs.Tables[0].Rows.Count > 0) ? currentUserDs.Tables[0].Rows[0][BOL.User.UserName].ToString() : "not specified";

                    ptObj.Save();
                }
            }

            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "_reloadMainPage", "reloadMainPage(); ", true);
        }
Ejemplo n.º 8
0
        protected void Repeater1_ItemCommand(object o, RepeaterCommandEventArgs e)
        {
            if (Convert.ToString(e.CommandName) == "DataEntered")
            {
                string currentPatientId  = Convert.ToString(e.CommandArgument);
                string actionItemCommand = Convert.ToString(e.CommandName);

                try
                {
                    HtmlImage   DataEnteredImg = (HtmlImage)e.Item.FindControl("DataEnteredImg");
                    ImageButton DataEnteredBtn = (ImageButton)e.Item.FindControl("DataEnteredBtn");
                    Label       DataEnteredLBL = (Label)e.Item.FindControl("DataEnteredLBL");

                    DropDownList HipaaDDL        = (DropDownList)e.Item.FindControl("HipaaDDL");
                    Label        StatusLBL       = (Label)e.Item.FindControl("StatusLBL");
                    Label        StatusPatientId = (Label)e.Item.FindControl("StatusPatientId");

                    // if hipaa status has been selected
                    if (!String.IsNullOrEmpty(HipaaDDL.SelectedValue))
                    {
                        StatusLBL.Text = String.Empty;

                        if (DataEnteredBtn != null && DataEnteredImg != null)
                        {
                            DataEnteredBtn.Style["display"] = "none";
                        }
                        if (!String.IsNullOrEmpty(currentPatientId))
                        {
                            // create ActionItem = 'DataEntered' for patients to check
                            ActionDa   actionDa  = new ActionDa();
                            BOL.Action actionObj = new Caisis.BOL.Action();
                            actionObj[BOL.Action.PatientId]      = int.Parse(currentPatientId);
                            actionObj[BOL.Action.ActionDateText] = DateTime.Today.ToShortDateString();
                            actionObj[BOL.Action.ActionDate]     = DateTime.Today;
                            actionObj[BOL.Action.ActionItem]     = actionItemCommand;

                            UserController userCt        = new UserController();
                            int            currentUserId = userCt.GetUserId();
                            UserDa         currentUserDa = new UserDa();
                            DataSet        currentUserDs = currentUserDa.GetByUserId(userCt.GetUserId());
                            actionObj[BOL.Action.EnteredBy] = (currentUserDs.Tables.Count > 0 && currentUserDs.Tables[0].Rows.Count > 0) ? currentUserDs.Tables[0].Rows[0][BOL.User.UserName].ToString() : "not specified";

                            actionObj[BOL.Action.EnteredTime] = DateTime.Today;

                            actionObj.Save();

                            // set patient status to 'NeedMD_Contact' if HIPAA = 'Yes"
                            // set patient status to 'NeedPtAuthorization' if HIPAA = 'No'
                            Patient ptObj = new Patient();
                            ptObj.Get(Int32.Parse(currentPatientId));
                            if (!ptObj.IsEmpty && !String.IsNullOrEmpty(HipaaDDL.SelectedValue))
                            {
                                if (HipaaDDL.SelectedValue.ToLower() == "yes")
                                {
                                    ptObj[Patient.PtContactStatus] = "NeedMD_Contact";
                                }
                                else if (HipaaDDL.SelectedValue.ToLower() == "no")
                                {
                                    ptObj[Patient.PtContactStatus] = "NeedPtAuthorization";
                                }
                                ptObj[Patient.UpdatedTime] = DateTime.Today;
                                ptObj[Patient.UpdatedBy]   = (currentUserDs.Tables.Count > 0 && currentUserDs.Tables[0].Rows.Count > 0) ? currentUserDs.Tables[0].Rows[0][BOL.User.UserName].ToString() : "not specified";

                                ptObj.Save();
                            }

                            if (DataEnteredLBL != null && DataEnteredImg != null)
                            {
                                DataEnteredImg.Style["display"] = "";
                                DataEnteredLBL.Text             = actionItemCommand;
                            }
                        }
                    }
                    else
                    {
                        StatusLBL.Text      = "<br/>* specify HIPPA authorization";
                        StatusLBL.ForeColor = System.Drawing.Color.Red;
                    }
                }
                catch (Exception ex)
                {
                    // publish raw error
                    ExceptionHandler.Publish(ex);
                }
            }
        }
Ejemplo n.º 9
0
        protected void Repeater1_ItemCommand(object o, RepeaterCommandEventArgs e)
        {
            try
            {
                string currentPatientId  = Convert.ToString(e.CommandArgument);
                string actionItemCommand = Convert.ToString(e.CommandName);

                HtmlImage   DataReceivedImg = (HtmlImage)e.Item.FindControl("DataReceivedImg");
                ImageButton DataReceivedBtn = (ImageButton)e.Item.FindControl("DataReceivedBtn");
                Label       DataReceivedLBL = (Label)e.Item.FindControl("DataReceivedLBL");

                HtmlImage   NeedMD_ContactImg = (HtmlImage)e.Item.FindControl("NeedMD_ContactImg");
                ImageButton NeedMD_ContactBtn = (ImageButton)e.Item.FindControl("NeedMD_ContactBtn");
                Label       NeedMD_ContactLBL = (Label)e.Item.FindControl("NeedMD_ContactLBL");

                UserController userCt        = new UserController();
                int            currentUserId = userCt.GetUserId();
                UserDa         currentUserDa = new UserDa();
                DataSet        currentUserDs = currentUserDa.GetByUserId(userCt.GetUserId());

                if (actionItemCommand == "DataReceived")
                {
                    if (DataReceivedBtn != null && DataReceivedImg != null)
                    {
                        DataReceivedBtn.Style["display"] = "none";
                    }

                    if (!String.IsNullOrEmpty(currentPatientId))
                    {
                        bool actionAlreadyExists = false;

                        ActionDa actionDa = new ActionDa();
                        DataSet  actionDs = actionDa.ValidateActionItem(Int32.Parse(currentPatientId), actionItemCommand);
                        if (actionDs.Tables.Count > 0)
                        {
                            DataView actionDv = new DataView(actionDs.Tables[0]);
                            actionDv.RowFilter = BOL.Action.ActionDateText + " = '" + DateTime.Today.ToShortDateString() + "' AND " + BOL.Action.ActionItem + " = '" + actionItemCommand + "' ";
                            if (actionDv.Count > 0)
                            {
                                actionAlreadyExists = true;
                            }
                        }

                        // if action item does not already exist for today
                        if (!actionAlreadyExists)
                        {
                            // create ActionItem = 'DataReceived' for patients to check
                            BOL.Action actionObj = new Caisis.BOL.Action();
                            actionObj[BOL.Action.PatientId]      = int.Parse(currentPatientId);
                            actionObj[BOL.Action.ActionDateText] = DateTime.Today.ToShortDateString();
                            actionObj[BOL.Action.ActionDate]     = DateTime.Today;
                            actionObj[BOL.Action.ActionItem]     = actionItemCommand;

                            actionObj[BOL.Action.EnteredBy]   = (currentUserDs.Tables.Count > 0 && currentUserDs.Tables[0].Rows.Count > 0) ? currentUserDs.Tables[0].Rows[0][BOL.User.UserName].ToString() : "not specified";
                            actionObj[BOL.Action.EnteredTime] = DateTime.Today;

                            actionObj.Save();
                        }

                        // set patient status to 'NeedDataEntry'
                        Patient ptObj = new Patient();
                        ptObj.Get(Int32.Parse(currentPatientId));
                        if (!ptObj.IsEmpty)
                        {
                            ptObj[Patient.PtContactStatus] = "NeedDataEntry";
                            ptObj[Patient.UpdatedTime]     = DateTime.Today;
                            ptObj[Patient.UpdatedBy]       = (currentUserDs.Tables.Count > 0 && currentUserDs.Tables[0].Rows.Count > 0) ? currentUserDs.Tables[0].Rows[0][BOL.User.UserName].ToString() : "not specified";
                            ptObj.Save();
                        }

                        if (DataReceivedLBL != null && DataReceivedImg != null)
                        {
                            DataReceivedImg.Style["display"] = "";
                            DataReceivedLBL.Text             = actionItemCommand;
                        }

                        // show "NeedMD_Contact" btn
                        if (NeedMD_ContactBtn != null)
                        {
                            NeedMD_ContactBtn.Style["display"] = "";
                        }

                        if (NeedMD_ContactLBL != null && NeedMD_ContactImg != null)
                        {
                            NeedMD_ContactImg.Style["display"] = "none";
                            NeedMD_ContactLBL.Text             = String.Empty;
                        }
                    }
                }
                else if (actionItemCommand == "NeedMD_Contact")
                {
                    if (NeedMD_ContactBtn != null && NeedMD_ContactImg != null)
                    {
                        NeedMD_ContactBtn.Style["display"] = "none";
                    }

                    if (!String.IsNullOrEmpty(currentPatientId))
                    {
                        // if any action item was created for "DataReceived", delete

                        ActionDa actionDa = new ActionDa();
                        DataSet  actionDs = actionDa.ValidateActionItem(Int32.Parse(currentPatientId), "DataReceived");
                        if (actionDs.Tables.Count > 0)
                        {
                            DataView actionDv = new DataView(actionDs.Tables[0]);
                            actionDv.RowFilter = BOL.Action.ActionDateText + " = '" + DateTime.Today.ToShortDateString() + "' AND " + BOL.Action.ActionItem + " = 'DataReceived' ";
                            if (actionDv.Count > 0)
                            {
                                BOL.Action actionObj = new Caisis.BOL.Action();
                                actionObj.Get(Int32.Parse(actionDv[0][BOL.Action.ActionId].ToString()));
                                actionObj.Delete();
                            }
                        }


                        // set patient status to 'NeedMD_Contact'
                        Patient ptObj = new Patient();
                        ptObj.Get(Int32.Parse(currentPatientId));
                        if (!ptObj.IsEmpty)
                        {
                            ptObj[Patient.PtContactStatus] = "NeedMD_Contact";
                            ptObj[Patient.UpdatedTime]     = DateTime.Today;
                            ptObj[Patient.UpdatedBy]       = (currentUserDs.Tables.Count > 0 && currentUserDs.Tables[0].Rows.Count > 0) ? currentUserDs.Tables[0].Rows[0][BOL.User.UserName].ToString() : "not specified";
                            ptObj.Save();
                        }

                        if (NeedMD_ContactLBL != null && NeedMD_ContactImg != null)
                        {
                            NeedMD_ContactImg.Style["display"] = "";
                            NeedMD_ContactLBL.Text             = actionItemCommand;
                        }

                        // show "Data Received" btn
                        if (DataReceivedBtn != null)
                        {
                            DataReceivedBtn.Style["display"] = "";
                        }

                        if (DataReceivedLBL != null && DataReceivedImg != null)
                        {
                            DataReceivedImg.Style["display"] = "none";
                            DataReceivedLBL.Text             = String.Empty;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                // publish raw error
                ExceptionHandler.Publish(ex);
            }
        }
Ejemplo n.º 10
0
        protected override void Page_Load(object sender, System.EventArgs e)
        {
            base.Page_Load(sender, e);

            if (!string.IsNullOrEmpty(Request.QueryString["userId"]))
            {
                //admin is coming from update password or just added new user.. populate send email fieds with new password info
                userId = int.Parse(Request.QueryString["userId"]);
                string pswd = Request.QueryString["pswd"];
                if (!string.IsNullOrEmpty(EncPassword))
                {
                    pswd = Security.CustomCryptoHelper.Decrypt(EncPassword);
                }

                UserDa  user = new UserDa();
                DataSet ds   = user.GetByUserId(userId);

                //populate to address
                if (ds.Tables[0].Rows.Count > 0)
                {
                    emailAddress = ds.Tables[0].Rows[0]["UserEmail"].ToString();
                    userName     = ds.Tables[0].Rows[0]["UserName"].ToString();
                    userLast     = ds.Tables[0].Rows[0]["UserLastName"].ToString();
                    userFirst    = ds.Tables[0].Rows[0]["UserFirstName"].ToString();

                    if (!string.IsNullOrEmpty(emailAddress))
                    {
                        txtTo.Text = emailAddress;
                    }
                }

                // Default Admin Mail Address
                MailManager m = new MailManager();
                txtFrom.Text = m.AdminEmailAddress;

                if (Request.QueryString["newUser"] != null && Request.QueryString["newUser"].Equals("yes"))
                {
                    newUserBool.Value = bool.TrueString;
                    //new user default message
                    txtSubject.Text   = "Caisis Account Information";
                    txtContent.Value  = userFirst + " " + userLast + ",\n\nYour new Caisis account has been created by a system administrator. You may now use the information below to login to the system.\n\n";
                    txtContent.Value += "UserName:  "******"\n";

                    // if using LDAP
                    if (UseLDAP)
                    {
                        txtContent.Value += "Password:  Log in using your network (Windows) password.";
                    }
                    // otherwise, normal auth
                    else
                    {
                        txtContent.Value += "Password:  "******"\n\n";
                        txtContent.Value += "Please update this password on your first use of the system.  You may do this by clicking the \"Change Your Password\" button on the login page.";
                    }
                }
                else
                {
                    // only notify about valid password updates
                    if (!string.IsNullOrEmpty(pswd))
                    {
                        txtSubject.Text   = "Password Update";
                        txtContent.Value  = userFirst + " " + userLast + ",\n\nYour Caisis password has been updated by a system administrator.\n\nYour new password is:  " + pswd + "\n\n";
                        txtContent.Value += "Please update this password on your next use of the system.  You may do this by clicking the \"Change Your Password\" button on the login page.";
                    }
                }
                // append sent date to existing content
                if (!string.IsNullOrEmpty(txtSubject.Text))
                {
                    txtContent.Value += "\n\n\nThe Caisis Team";
                    txtContent.Value += "\n\nMessage Sent:  " + System.DateTime.Now.ToShortDateString() + " " + System.DateTime.Now.ToShortTimeString();
                }
            }
        }
Ejemplo n.º 11
0
        protected void Repeater1_ItemCommand(object o, RepeaterCommandEventArgs e)
        {
            if (Convert.ToString(e.CommandName) == "TumorRegistryChecked")
            {
                string currentPatientId  = Convert.ToString(e.CommandArgument);
                string actionItemCommand = Convert.ToString(e.CommandName);

                try
                {
                    HtmlImage   TumorRegCheckedImg = (HtmlImage)e.Item.FindControl("TumorRegCheckedImg");
                    ImageButton TumorRegCheckedBtn = (ImageButton)e.Item.FindControl("TumorRegCheckedBtn");
                    Label       TumorRegCheckedLBL = (Label)e.Item.FindControl("TumorRegCheckedLBL");

                    DropDownList StatusDDL       = (DropDownList)e.Item.FindControl("StatusDDL");
                    Label        StatusLBL       = (Label)e.Item.FindControl("StatusLBL");
                    Label        StatusPatientId = (Label)e.Item.FindControl("StatusPatientId");

                    if (TumorRegCheckedBtn != null && TumorRegCheckedImg != null)
                    {
                        TumorRegCheckedBtn.Style["display"] = "none";
                    }
                    if (!String.IsNullOrEmpty(currentPatientId))
                    {
                        // create ActionItem = 'TumorRegistryChecked' for patients to check
                        ActionDa   actionDa  = new ActionDa();
                        BOL.Action actionObj = new Caisis.BOL.Action();
                        actionObj[BOL.Action.PatientId]      = int.Parse(currentPatientId);
                        actionObj[BOL.Action.ActionDateText] = DateTime.Today.ToShortDateString();
                        actionObj[BOL.Action.ActionDate]     = DateTime.Today;
                        actionObj[BOL.Action.ActionItem]     = actionItemCommand;

                        UserController userCt        = new UserController();
                        int            currentUserId = userCt.GetUserId();
                        UserDa         currentUserDa = new UserDa();
                        DataSet        currentUserDs = currentUserDa.GetByUserId(userCt.GetUserId());
                        actionObj[BOL.Action.EnteredBy] = (currentUserDs.Tables.Count > 0 && currentUserDs.Tables[0].Rows.Count > 0) ? currentUserDs.Tables[0].Rows[0][BOL.User.UserName].ToString() : "not specified";

                        actionObj[BOL.Action.EnteredTime] = DateTime.Today;

                        actionObj.Save();

                        // set patient status to 'Current'
                        Patient ptObj = new Patient();
                        ptObj.Get(Int32.Parse(currentPatientId));
                        if (!ptObj.IsEmpty)
                        {
                            ptObj[Patient.PtContactStatus] = "Current";
                            ptObj[Patient.UpdatedTime]     = DateTime.Today;
                            ptObj[Patient.UpdatedBy]       = (currentUserDs.Tables.Count > 0 && currentUserDs.Tables[0].Rows.Count > 0) ? currentUserDs.Tables[0].Rows[0][BOL.User.UserName].ToString() : "not specified";

                            ptObj.Save();
                        }

                        if (TumorRegCheckedLBL != null && TumorRegCheckedImg != null)
                        {
                            TumorRegCheckedImg.Style["display"] = "";
                            TumorRegCheckedLBL.Text             = actionItemCommand;
                        }

                        // show status options
                        if (StatusDDL != null && StatusLBL != null)
                        {
                            StatusDDL.Style["display"] = "";
                            StatusDDL.Width            = Unit.Pixel(150);
                            StatusLBL.Style["display"] = "none";

                            ptObj.Get(Int32.Parse(StatusPatientId.Text));
                            if (!ptObj.IsEmpty)
                            {
                                ListItem statusLi = new ListItem(ptObj[Patient.PtContactStatus].ToString(), ptObj[Patient.PtContactStatus].ToString());
                                if (StatusDDL.Items.Contains(statusLi))
                                {
                                    StatusDDL.SelectedValue = statusLi.Value;
                                }
                                else
                                {
                                    StatusDDL.SelectedValue = "Current";
                                }
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    // publish raw error
                    ExceptionHandler.Publish(ex);
                }
            }
        }
        protected void NeedMDContactClick(object sender, EventArgs e)
        {
            if (PatientId != 0)
            {
                // create ActionItem = 'DataReceived'
                UserController userCt        = new UserController();
                int            currentUserId = userCt.GetUserId();
                UserDa         currentUserDa = new UserDa();
                DataSet        currentUserDs = currentUserDa.GetByUserId(userCt.GetUserId());

                bool actionAlreadyExists = false;

                ActionDa actionDa = new ActionDa();
                DataSet  actionDs = actionDa.ValidateActionItem(PatientId, "DataReceived");
                if (actionDs.Tables.Count > 0)
                {
                    DataView actionDv = new DataView(actionDs.Tables[0]);
                    actionDv.RowFilter = BOL.Action.ActionDateText + " = '" + DateTime.Today.ToShortDateString() + "' AND " + BOL.Action.ActionItem + " = 'DataReceived' ";
                    if (actionDv.Count > 0)
                    {
                        actionAlreadyExists = true;
                    }
                }

                // if action item does not already exist for today
                if (!actionAlreadyExists)
                {
                    BOL.Action actionObj = new Caisis.BOL.Action();
                    actionObj[BOL.Action.PatientId]      = PatientId;
                    actionObj[BOL.Action.ActionDateText] = DateTime.Today.ToShortDateString();
                    actionObj[BOL.Action.ActionDate]     = DateTime.Today;
                    actionObj[BOL.Action.ActionItem]     = "DataReceived";
                    actionObj[BOL.Action.EnteredBy]      = (currentUserDs.Tables.Count > 0 && currentUserDs.Tables[0].Rows.Count > 0) ? currentUserDs.Tables[0].Rows[0][BOL.User.UserName].ToString() : "not specified";
                    actionObj[BOL.Action.EnteredTime]    = DateTime.Today;

                    actionObj.Save();
                }

                // set patient status to 'NeedMD_ToCallPt'
                Patient ptObj = new Patient();
                ptObj.Get(PatientId);
                if (!ptObj.IsEmpty)
                {
                    ptObj[Patient.PtContactStatus] = "NeedMD_ToCallPt";
                    ptObj[Patient.UpdatedBy]       = (currentUserDs.Tables.Count > 0 && currentUserDs.Tables[0].Rows.Count > 0) ? currentUserDs.Tables[0].Rows[0][BOL.User.UserName].ToString() : "not specified";
                    ptObj[Patient.UpdatedTime]     = DateTime.Now;

                    ptObj.Save();

                    if (AddressUpdatedLBL != null && AddressUpdatedImg != null)
                    {
                        AddressUpdatedImg.Style["display"] = "none";
                        AddressUpdatedLBL.Text             = String.Empty;
                    }
                    if (NeedMDContactLBL != null && NeedMDContactImg != null)
                    {
                        NeedMDContactImg.Style["display"] = "";
                        NeedMDContactLBL.Text             = "Pt Status: " + ptObj[Patient.PtContactStatus].ToString();
                    }
                }
            }

            //Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "_reloadMainPage", "reloadMainPage(); ", true);
        }