Esempio n. 1
0
    protected void CheckModuleGroupStatus(BaseMaster BaseMstr)
    {
        CPatientEvent evt = new CPatientEvent(BaseMstr);

        CEncounter enc    = new CEncounter();
        DataSet    dsGrps = enc.GetModuleGroupStatusDS(BaseMstr);
        DataSet    dsEvts = evt.GetPatientEventsDS();
        bool       bRedirectToBaselineScreen = false;

        if (dsGrps != null)
        {
            foreach (DataTable dt in dsGrps.Tables)
            {
                foreach (DataRow dr in dt.Rows)
                {
                    long lEventID = 0;
                    long lPending = 1;

                    if (!dr.IsNull("EVENT_ID"))
                    {
                        lEventID = Convert.ToInt32(dr["EVENT_ID"]);
                    }

                    if (!dr.IsNull("PENDING"))
                    {
                        lPending = Convert.ToInt32(dr["PENDING"]);
                    }

                    if (lPending == 0 && lEventID != 0)
                    {
                        if (lEventID == _BASELINE_INTAKES_EVENT)
                        {
                            bRedirectToBaselineScreen = !IsBaselineMarkedCompleted(dsEvts, _BASELINE_INTAKES_EVENT);
                        }
                        evt.CompletedEvent(lEventID);
                    }
                }
            }

            if (bRedirectToBaselineScreen)
            {
                Response.Redirect("portal_start.aspx");
            }
        }
    }
Esempio n. 2
0
    protected bool HasPendingModules(BaseMaster BaseMstr)
    {
        long       lPending = 0;
        CEncounter enc      = new CEncounter();
        DataSet    dsEnc    = enc.GetModuleGroupStatusDS(BaseMstr);

        if (dsEnc != null)
        {
            foreach (DataTable dt in dsEnc.Tables)
            {
                foreach (DataRow dr in dt.Rows)
                {
                    if (!dr.IsNull("PENDING"))
                    {
                        lPending += Convert.ToInt32(dr["PENDING"]);
                    }
                }
            }
        }
        return(lPending > 0);
    }
Esempio n. 3
0
    protected void HasCompletedFollowUp()
    {
        Session["COMPLETED_FOLLOWUP"] = null;
        Regex reREF = new Regex("mid\\d*.aspx", RegexOptions.IgnoreCase);

        if (reREF.IsMatch(Request.UrlReferrer.ToString()))
        {
            string strPath  = Request.UrlReferrer.ToString();
            string strGroup = strPath.Substring(strPath.IndexOf("grp=") + 4);

            string strFollowUpGrps = ",3,5,7,";
            string strCSQGrps      = ",2,4,6,8,";

            CPatientEvent evt    = new CPatientEvent(Master);
            CEncounter    enc    = new CEncounter();
            DataSet       dsGrps = enc.GetModuleGroupStatusDS(Master);

            if (dsGrps != null)
            {
                foreach (DataTable dt in dsGrps.Tables)
                {
                    foreach (DataRow dr in dt.Rows)
                    {
                        long lMIDGRP  = 0;
                        long lPending = 1;

                        if (!dr.IsNull("MODULE_GROUP_ID"))
                        {
                            lMIDGRP = Convert.ToInt32(dr["MODULE_GROUP_ID"]);
                        }

                        if (!dr.IsNull("PENDING"))
                        {
                            lPending = Convert.ToInt32(dr["PENDING"]);
                        }

                        if (lPending == 0 && lMIDGRP != 0)
                        {
                            if (strGroup.Length > 0)
                            {
                                string strCurrGroup = "," + strGroup + ",";

                                if (lMIDGRP == Convert.ToInt32(strGroup) && (strFollowUpGrps.IndexOf(strCurrGroup) > -1))
                                {
                                    Session["COMPLETED_FOLLOWUP"] = 1;
                                    Response.Redirect("portal_start.aspx");
                                }
                                else if (lMIDGRP == Convert.ToInt32(strGroup) && (strCSQGrps.IndexOf(strCurrGroup) > -1))
                                {
                                    Session["COMPLETED_FOLLOWUP"] = 2;
                                    Response.Redirect("portal_start.aspx");
                                }
                            }
                        }
                    }
                }
            }

            if (!HasPendingModules(Master))
            {
                Response.Redirect("portal_start.aspx");
            }
        }
    }