/** * 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(); }
/** * 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); }
/** * Return true if vaccine received for given ID, false otherwise. * */ public Boolean VaccineIsReceived(int vaccineID) { return(VaccinationHistory.HasVaccine(vaccineID)); }