/// <summary> /// Refreshes the PatientPool static property with all patients who have /// medication administration records logged from the simulation whose id /// is passed and on the date specified by date. /// </summary> /// <param name="simId">A long value containing the simulation id to scan patients for.</param> /// <param name="date">A DateTime object holding the date to check MAR records for.</param> public static void refreshPatientPoolFromMars(long simId, DateTime date) { if (MySqlHelper.connect() == false) return; DBConnection dbCon = MySqlHelper.dbCon; ArrayList response = dbCon.selectQuery(string.Format("CALL patients_from_mars_by_sim({0}, '{1}')", simId, date.ToString("yyyy-MM-dd"))); MySqlHelper.disconnect(); PatientPool.Clear(); foreach (ArrayList arrayList in response) PatientPool.Add(fromArrayList(arrayList)); }
/// <summary> /// Refreshes the PatientPool static property with all patients in the database /// that are associated with the simulation identified by the passed simId. /// </summary> /// <param name="simId">A long value holding the simulation id to get /// patients associated with.</param> public static void refreshPatientPool(long simId) { if (MySqlHelper.connect() == false) return; DBConnection dbCon = MySqlHelper.dbCon; ArrayList response = dbCon.selectQuery( "SELECT * FROM tblPatient AS p WHERE p.id = (SELECT pp.pat_id FROM tblPatientPool AS pp WHERE pp.pat_id=p.id AND pp.sim_id=" + simId + ") ORDER BY name"); MySqlHelper.disconnect(); PatientPool.Clear(); foreach (ArrayList arrayList in response) PatientPool.Add(fromArrayList(arrayList)); }