Ejemplo n.º 1
0
        public static void UpdateSisAScores(IFormsRepository formsRepo, int formResultId)
        {
            try
            {
                def_Forms frm = formsRepo.GetFormByIdentifier("SIS-A");
                int       standardScoreTotal = SharedScoring.UpdateSisScoresNoSave
                                               (
                    formsRepo, frm, formResultId,
                    getSisASubscaleCatagories(),
                    (int totalRawScore, double avgRawScore, SubscaleCatagory cat) => { return(GetSisASubscaleStandardScore(totalRawScore, cat)); },
                    (int totalRawScore, double avgRawScore, SubscaleCatagory cat) => { return(GetSisASubscalePercentile(totalRawScore, cat)); }
                                               );

                //save standard scores to database
                int compositeIndex      = GetSisASupportNeedsIndex(standardScoreTotal);
                int compositePercentile = GetSisASupportNeedsPercentile(standardScoreTotal);
                SharedScoring.UpdateScoreResponseNoSave(formsRepo, formResultId, "scr_support_needs_index", compositeIndex);
                SharedScoring.UpdateScoreResponseNoSave(formsRepo, formResultId, "scr_sni_percentile_rank", compositePercentile);
                formsRepo.Save();
            }
            catch (Exception xcptn)
            {
                Debug.WriteLine("UpdateSisAScores exception: " + xcptn.Message);
            }
        }
Ejemplo n.º 2
0
        public static void UpdateSisCScores(IFormsRepository formsRepo, int formResultId, int ageInYears)
        {
            def_Forms frm = formsRepo.GetFormByIdentifier("SIS-C");

            SharedScoring.UpdateSisScoresNoSave
            (
                formsRepo, frm, formResultId,
                getSisCSubscaleCatagories(),
                (int totalRawScore, double avgRawScore, SubscaleCatagory cat) => { return(GetSisCSubscaleStandardScore(avgRawScore, cat, ageInYears)); },
                (int totalRawScore, double avgRawScore, SubscaleCatagory cat) => { return(GetSisCSubscalePercentile(avgRawScore, cat, ageInYears)); }
            );

            def_ResponseVariables rv = formsRepo.GetResponseVariablesByFormResultIdentifier(formResultId, "scr_total_rating");
            double totalRating       = Convert.ToDouble(rv.rspValue);
            double meanRating        = Math.Round(totalRating / 7, 2); //usd only for SIS-C reports

            //save standard scores to database
            double compositeIndex      = GetSisCSupportNeedsIndex(meanRating, ageInYears);
            double compositePercentile = GetSisCSupportNeedsPercentile(meanRating, ageInYears);

            SharedScoring.UpdateScoreResponseNoSave(formsRepo, formResultId, "scr_support_needs_index", compositeIndex);
            SharedScoring.UpdateScoreResponseNoSave(formsRepo, formResultId, "scr_sni_percentile_rank", compositePercentile);

            formsRepo.Save();
        }