Esempio n. 1
0
    protected void btnSubmit_OnClick(object sender, EventArgs e)
    {
        CEncounter enc = new CEncounter();

        string strAllResponse = String.Empty;
        string strQResponse = String.Empty;
        Int32 nCount = 0;

        String strResponseCount = Request.Form["ResponseCount"];
        if (strResponseCount != null)
        {
            nCount = Convert.ToInt32(strResponseCount);
        }
        else
        {
            //ERROR
            return;
        }

        long nScore = 0;

        //loop thru the responses
        for (int a = 1; a < nCount; a++)
        {
            //get responses controls
            string strRadio = "grpRadio_" + a.ToString();

            //get radio response
            if (Request.Form[strRadio] != null)
            {
                string[] splitResponse = Request.Form[strRadio].Split(new Char[] { '|' });
                strQResponse += enc.GetRecordForInsert(splitResponse);
                nScore += Convert.ToInt64(splitResponse[2]);
            }


            strAllResponse += strQResponse;
            strQResponse = null;
        }


        // Write responses
        if (enc.WriteIntakeResponses(Master, Master.SelectedEncounterID, lEncIntakeID, lMID, lGRP, strAllResponse) == false)
        {
            return;
        }

        long lScoreType = 3002;
        if (Score(lEncIntakeID, lMID, nScore, lScoreType) == false)
        {
            return;
        }

        //mark module complete
        if (enc.CompleteModule(Master, lMID, lGRP))
        {
            Response.Redirect("patient_assessment.aspx");
        }
    }
Esempio n. 2
0
    protected void btnSubmit_OnClick(object sender, EventArgs e)
    {
        CEncounter enc = new CEncounter();

        string strAllResponse = String.Empty;
        string strQResponse = String.Empty;

        for (int a = 1; a <= nQuestionCount; a++)
        {
            // build name attribute string to retrieve selected responses
            string strRadio = "grpRadio_" + a.ToString();

            if (Request.Form[strRadio] != null)
            {
                string[] splitResponse = Request.Form[strRadio].Split(cSplitChars);
                strQResponse += enc.GetRecordForInsert(splitResponse);
            }

            strAllResponse += strQResponse;
            strQResponse = null;
        }

        if (!enc.WriteIntakeResponses(Master, Master.SelectedEncounterID, lEncIntakeID, lMID, lGRP, strAllResponse))
        {
            return;
        }

        if (!Score(lEncIntakeID, lMID, 3020))
        {
            return;
        }

        //mark module complete
        if (enc.CompleteModule(Master, lMID, lGRP))
        {
            Response.Redirect("patient_assessment.aspx");
        }
    }
Esempio n. 3
0
    protected void btnSubmit_OnClick(object sender, EventArgs e)
    {
        CEncounter enc = new CEncounter();

        string strAllResponse = String.Empty;
        string strQResponse = String.Empty;
        Int32 nCount = 0;

        String strResponseCount = Request.Form["ResponseCount"];
        if (strResponseCount != null)
        {
            nCount = Convert.ToInt32(strResponseCount);
        }
        else
        {
            //ERROR
            return;
        }

        long nScore = 0;

        //loop thru the responses
        for (int a = 1; a < nCount; a++)
        {
            String strResponse = null;
            String strRID = null;
            String strScore = null;

            int iQID = a;

            //get responses controls
            string strRadio = "grpRadio_" + iQID.ToString();
            string strCheckbox = "grpCheck_" + iQID.ToString();
            string strText = "grpCtrlText_" + iQID.ToString();
            string strHiddenText = "grpHidden_" + iQID.ToString();

            //get radio response
            if (Request.Form[strRadio] != null)
            {
                string[] splitResponse = Request.Form[strRadio].Split(new Char[] { '|' });
                strQResponse += enc.GetRecordForInsert(splitResponse);
            }

            //get checkbox response
            if (Request.Form[strCheckbox] != null)
            {
                string[] splitResponse = Request.Form[strCheckbox].Split(new Char[] { '|' });
                strQResponse += enc.GetRecordForInsert(splitResponse);
            }

            //get textbox response
            String strT = null;
            strT = Request.Form[strText];
            if (strT != null)
            {
                if (strT.Trim().Length > 0)
                {
                    String strH = null;
                    strH = Request.Form[strHiddenText];

                    if (String.IsNullOrEmpty(strH) == false)
                    {
                        string[] strHidden = Request.Form[strHiddenText].Split(new Char[] { '|' });
                        strQResponse += enc.GetRecordForInsert(strHidden, strT);
                    }
                }
            }


            strAllResponse += strQResponse;
            strQResponse = null;
        }


        // Write responses
        if (enc.WriteIntakeResponses(Master, Master.SelectedEncounterID, lEncIntakeID, lMID, lGRP, strAllResponse) == false)
        {
            return;
        }

        //mark module complete
        if (enc.CompleteModule(Master, lMID, lGRP))
        {
            Response.Redirect("patient_assessment.aspx");
        }
    }
Esempio n. 4
0
    protected void btnSubmit_OnClick(object sender, EventArgs e)
    {
        CEncounter enc = new CEncounter();

        string strAllResponse   = String.Empty,
               strQResponse     = String.Empty,
               strResponseCount = Request.Form["ResponseCount"];

        Int32 nCount = 0;

        if (strResponseCount != null)
        {
            nCount = Convert.ToInt32(strResponseCount);
        }
        else
        {
            //ERROR
            return;
        }

        //loop thru the responses
        for (int a = 1; a < nCount; a++)
        {
            int    iQID            = a;
            string strCurrResponse = String.Empty;

            //get responses controls
            string strRadio      = "grpRadio_" + iQID.ToString(),
                   strCheckbox   = "grpCheck_" + iQID.ToString(),
                   strText       = "grpCtrlText_" + iQID.ToString(),
                   strCombo      = "grpCombo_" + iQID.ToString(),
                   strHiddenText = "grpHidden_" + iQID.ToString();

            //get radio response
            if (Request.Form[strRadio] != null)
            {
                strCurrResponse = Request.Form[strRadio];
                string[] splitResponse = strCurrResponse.Split(new Char[] { '|' });
                strQResponse += enc.GetRecordForInsert(splitResponse);
            }

            //get checkbox response
            if (Request.Form[strCheckbox] != null)
            {
                strCurrResponse = Request.Form[strCheckbox];
                string[] splitResponse = strCurrResponse.Split(new Char[] { '|' });
                strQResponse += enc.GetRecordForInsert(splitResponse);
            }

            //get textbox response
            String strT = null;
            strT = Request.Form[strText];
            if (strT != null)
            {
                if (strT.Trim().Length > 0)
                {
                    strT = strT.Trim();

                    strCurrResponse = strT;

                    String strH = null;
                    strH = Request.Form[strHiddenText];

                    if (String.IsNullOrEmpty(strH) == false)
                    {
                        strCurrResponse += " " + Request.Form[strHiddenText];
                        string[] strHidden = Request.Form[strHiddenText].Split(new Char[] { '|' });
                        strQResponse += enc.GetRecordForInsert(strHidden, strT);
                    }
                }
            }

            //get combo response
            if (Request.Form[strCombo] != null)
            {
                strCurrResponse = Request.Form[strCombo];
                string[] splitResponse = strCurrResponse.Split(new Char[] { '|' });
                strQResponse += enc.GetRecordForInsert(splitResponse);
            }


            object objResponse = new { rIndex = iQID, rString = strCurrResponse };

            //start computing the individual variables
            QResponse resp = new QResponse(iQID, strCurrResponse);
            SetPSQIVariables(resp);

            strAllResponse += strQResponse;
            strQResponse    = null;
        }


        if (!enc.WriteIntakeResponses(Master, Master.SelectedEncounterID, lEncIntakeID, lMID, lGRP, strAllResponse))
        {
            return;
        }

        if (!Score(lEncIntakeID, lMID))
        {
            return;
        }

        //mark module complete
        if (enc.CompleteModule(Master, lMID, lGRP))
        {
            Response.Redirect("patient_assessment.aspx");
        }
    }
Esempio n. 5
0
    protected void btnSubmit_OnClick(object sender, EventArgs e)
    {
        CEncounter enc = new CEncounter();

        string strAllResponse = String.Empty;
        string strQResponse = String.Empty;
        Int32 nCount = 0;

        nScore = 0;
        nScore1 = 0;
        nScore2 = 0;
        nScore3 = 0;
        nScore4 = 0;
        nScore5 = 0;

        String strResponseCount = Request.Form["ResponseCount"];
        if (strResponseCount != null)
        {
            nCount = Convert.ToInt32(strResponseCount);
        }
        else
        {
            //ERROR
            return;
        }

        //loop thru the responses
        for (int a = 1; a < nCount; a++)
        {
            String strResponse = null;
            String strRID = null;
            String strScore = null;

            int iQID = a;

            //get responses controls
            string strRadio = "grpRadio_" + iQID.ToString();

            //get radio response
            if (Request.Form[strRadio] != null)
            {
                string[] splitResponse = Request.Form[strRadio].Split(new Char[] { '|' });
                strQResponse += enc.GetRecordForInsert(splitResponse);

                //comupte sections scores

                //general productivity
                if (iQID == 1 || iQID == 2)
                {
                    nScore1 += Convert.ToInt32(splitResponse[2]);
                }

                //activity level
                if (iQID == 6 || iQID == 8 || iQID == 9)
                {
                    nScore2 += Convert.ToInt32(splitResponse[2]);
                }

                //vigilance
                if (iQID == 3 || iQID == 4 || iQID == 7)
                {
                    nScore3 += Convert.ToInt32(splitResponse[2]);
                }

                //social outcome
                if (iQID == 5)
                {
                    nScore4 += Convert.ToInt32(splitResponse[2]);
                }

                //intimacy and sexual relationships
                if (iQID == 10)
                {
                    nScore5 += Convert.ToInt32(splitResponse[2]);
                }

            }

            strAllResponse += strQResponse;
            strQResponse = null;
        }


        // Write responses
        if (enc.WriteIntakeResponses(Master, Master.SelectedEncounterID, lEncIntakeID, lMID, lGRP, strAllResponse) == false)
        {
            return;
        }

        //scores
        if (WriteScores() == false) 
        {
            return;
        }
        
        //mark module complete
        if (enc.CompleteModule(Master, lMID, lGRP))
        {
            Response.Redirect("patient_assessment.aspx");
        }
    }