/** * Record the milestone BinaryAnswer for the given milestone ID and then remove it from the unanswered milestones list. */ public void AddOrUpdateVaccinationHistory(int vaccineID) { VaccineDatabaseAccess vaccineDatabaseAccess = new VaccineDatabaseAccess(); vaccineDatabaseAccess.InitializeSync(); Vaccine vaccine = vaccineDatabaseAccess.GetVaccineSync(vaccineID); VaccinationHistory.UpdateOrInsertToVaccineHistory(vaccineID); Boolean vaccineRemovedFromUnanswered = UnansweredVaccinations.RemoveVaccination(vaccine); vaccineDatabaseAccess.CloseSyncConnection(); }
/** * Record the milestone BinaryAnswer for the given milestone ID and then remove it from the unanswered milestones list. */ public void RemoveFromVaccinationHistory(int vaccineID) { VaccineDatabaseAccess vaccineDatabaseAccess = new VaccineDatabaseAccess(); vaccineDatabaseAccess.InitializeSync(); Vaccine vaccine = vaccineDatabaseAccess.GetVaccineSync(vaccineID); VaccinationHistory.RemoveFromVaccineHistory(vaccineID); Boolean vaccineAddedToUnanswered = UnansweredVaccinations.AddVaccination(vaccine); vaccineDatabaseAccess.CloseSyncConnection(); }
/** * Return list of due vaccines based on child age and questions answered. **/ public List <Vaccine> GetListOfDueVaccines(int childAgeInMonths) { List <int> dueVaccineIds = UnansweredVaccinations.GetDueVaccinations(childAgeInMonths); if (dueVaccineIds != null && dueVaccineIds.Count > 0) { return(GetVaccinationsByIds(dueVaccineIds)); } else { return(null); } }
/** * Calculate percentage completion of total recommended vaccines. Might want to change this to percentage of currently due vaccines. **/ public double CalculateVaccinationCompletionPercentage() { int unansweredSize = UnansweredVaccinations.GetUnansweredVaccinationsListSize(); int answeredSize = VaccinationHistory.GetVaccinationHistoryListSize(); if (unansweredSize + answeredSize == 0) { return(0); } double percentage = (double)answeredSize / (double)(unansweredSize + answeredSize); return(percentage); }