Beispiel #1
0
        // where do we get our sql?
        // how do we encapsulate a PatientModel instance

        public double?CalculateOutcome(int patientId, string modelId)
        {
            Dictionary <string, double?> outcomes = new Dictionary <string, double?>();

            PatientOutcomesDa db = new PatientOutcomesDa();
            DataTable         dt = db.GetCombinedResults(patientId);

            if (dt.Rows.Count > 1)
            {
                return(null);
            }

            return(CalculateOutcome(dt.Rows[0], modelId));
        }
Beispiel #2
0
        public IDictionary <string, double?> CalculateOutcomes(int patientId)
        {
            Dictionary <string, double?> outcomes = new Dictionary <string, double?>();

            PatientOutcomesDa db = new PatientOutcomesDa();
            DataTable         dt = db.GetCombinedResults(patientId);

            int rowCount = dt.Rows.Count;

            if (rowCount != 1)
            {
                return(outcomes); // imprecise data -> no results (don't we want stubs for all the models?)
            }
            IEnumerable <string> modelids = _model.ModelIds;

            foreach (string id in modelids)
            {
                outcomes[id] = CalculateOutcome(dt.Rows[0], id);
            }

            return(outcomes);
        }