Exemple #1
0
        public static Dictionary <Episode, Dictionary <string, List <ProDomainResultSet> > > GetProDomainResultSetForPatient(string patientId, int episodeId, out Dictionary <Episode, Dictionary <string, Dictionary <string, object> > > viewData)
        {
            ProClient proClient = new ProClient();

            viewData = new Dictionary <Episode, Dictionary <string, Dictionary <string, object> > >();

            var result = proClient.GetProDomainResults(patientId, episodeId);

            if (!result.Succeeded)
            {
                return(new Dictionary <Episode, Dictionary <string, List <ProDomainResultSet> > >());
            }
            Dictionary <Episode, Dictionary <string, List <ProDomainResultSet> > > sets = result.ProDomainResultSets;

            return(ProResults.Calculate(sets, ref viewData));
        }
Exemple #2
0
        private static Dictionary <Episode, Dictionary <string, List <ProDomainResultSet> > > Calculate(Dictionary <Episode, Dictionary <string, List <ProDomainResultSet> > > sets, ref Dictionary <Episode, Dictionary <string, Dictionary <string, object> > > viewData)
        {
            Dictionary <Episode, Dictionary <string, List <ProDomainResultSet> > > result = new Dictionary <Episode, Dictionary <string, List <ProDomainResultSet> > >();

            foreach (Episode e in sets.Keys)
            {
                result.Add(e, new Dictionary <string, List <ProDomainResultSet> >());
                viewData.Add(e, new Dictionary <string, Dictionary <string, object> >());
                foreach (string questionnaire in sets[e].Keys)
                {
                    Dictionary <string, object> viewDataValues = new Dictionary <string, object>();
                    result[e].Add(questionnaire, ProResults.Calculate(sets[e][questionnaire], ref viewDataValues));
                    viewData[e].Add(questionnaire, viewDataValues);
                }
            }

            return(result);
        }