public object DischargePatient(string pid, string dbPath) { var bedId = GetBedIdFromPid(pid, dbPath); var patientDbObj = new PatientDbOps(dbPath); if (!patientDbObj.DeletePatientFromDatabase(pid).Equals(HttpStatusCode.OK)) { return(HttpStatusCode.InternalServerError); } var bedStatusObj = new BedDbOps(dbPath); return(bedStatusObj.ChangeBedStatusToVacant(bedId.ElementAt(0))); //if (PatientList.ContainsKey(pid)) //{ // PatientList.Remove(pid); // return "Discharged"; //} //else //{ //} //foreach (var patientTemp in PatientList.ToList().Where(patientTemp => patientTemp.Key == pid)) //{ // PatientList.Remove(patientTemp.Key); // return "Patient Discharged"; //} //return "Patient Not Found"; }
//public OccupancyService GetInstanceOfOccupancyService() //{ // return this; //} //public OccupancyService() //{ // //InitPatientList(); // //InitIcuList(); // //InitBedList(); // //InitBedLayouts(); //} //public Dictionary<string, PatientModel> PatientList; //will get data from class having accessing db //public Dictionary<int, BedModel> BedList; //public Dictionary<string, IcuModel> IcuList; ////public List<PatientVital> PatientVitalList; //public List<string> BedLayouts; public object AddNewPatient(PatientModel newPatient, string dbPath) { var dbObj = new PatientDbOps(dbPath); if (!dbObj.AddPatientToDb(newPatient).Equals(HttpStatusCode.OK)) { return(HttpStatusCode.InternalServerError); } var bedStatusDbObj = new BedDbOps(dbPath); return(bedStatusDbObj.ChangeBedStatusToOccupied(newPatient.BedId)); }
public Dictionary <string, PatientVital> CheckVitalOfAllPatients() { var patientsObj = new PatientDbOps(DbOps.GetDbPath()); Patients = patientsObj.GetAllPatientsFromDb(); var vitals = new Dictionary <string, PatientVital>(); foreach (var var1 in Patients) { var ret = GetRandomDataForPatient(var1.Key); vitals.Add(var1.Key, ret); } return(vitals); }
public Dictionary <string, PatientModel> GetPatientsDetails(string dbPath) { var patientBbObj = new PatientDbOps(dbPath); return(patientBbObj.GetAllPatientsFromDb()); }