/// <summary> /// Implementaion class for newly adding patient details /// </summary> /// <returns>true or false</returns> public void NewAdmission() { Console.WriteLine("Add Patient Details:"); Admission admission = new Admission(); Console.WriteLine("Patient Name"); admission.PatientName = Console.ReadLine(); Console.WriteLine("NHS Number"); admission.NINumber = Console.ReadLine(); Console.WriteLine("Enter Ward Type(1.Cardiology 2.Renal 3.A&E 4.Critical Care)"); admission.WardType = Console.ReadLine(); Console.WriteLine("Doctor Assigned"); admission.DoctorId = Console.ReadLine(); WardDetails wDetails = _patientsDac.GetAvailability(admission.WardType); if (wDetails != null && wDetails.AvailableBed != 0) { admission.Status = true; admission.AdmittedDate = DateTime.Now; _patientsDac.NewAdmissionDac(admission); Console.WriteLine("Patient Details Added Succesfully!!!"); } else { Console.WriteLine("No Bed available"); } }
/// <summary> /// Method to get the Bed Availability for specific ward type /// </summary> /// <param name="wardId">Ward Type</param> /// <returns>Bed Availability</returns> public WardDetails GetAvailability(string wardId) { WardDetails wDetails = null; var result = firebaseClient.Get("WardAvailability/" + wardId); if (result.Body != "null") { wDetails = result.ResultAs <WardDetails>(); } return(wDetails); }
/// <summary> /// Implementaion class for patients ward transfer /// </summary> /// <returns>true or false</returns> public void TransferWard() { //Console.WriteLine("Transfer Ward"); TransferDetails transferData = new TransferDetails(); Console.WriteLine("Patient NHS Number:"); transferData.NINumber = Console.ReadLine(); var patDetails = _patientsDac.GetPatient(transferData.NINumber); if (patDetails != null && patDetails.Status) { Console.WriteLine("Transfer Ward Type(1.Cardiology 2.Renal 3.A&E 4.Critical Care):"); transferData.CurrentWard = Console.ReadLine(); Console.WriteLine("Doctor Assigned"); transferData.CurrentDoctor = Console.ReadLine(); transferData.Date = DateTime.Now; if (patDetails.WardType == transferData.CurrentWard) { Console.WriteLine("Cannot transfer within same ward"); } else { transferData.PreviousDoctor = patDetails.DoctorId; transferData.PreviousWard = patDetails.WardType; WardDetails wDetails = _patientsDac.GetAvailability(transferData.CurrentWard); if (wDetails != null && wDetails.AvailableBed != 0) { patDetails.WardType = transferData.CurrentWard; patDetails.DoctorId = transferData.CurrentDoctor; _patientsDac.TransferWardDac(transferData, patDetails); Console.WriteLine("Patient transferred to new ward!!!"); } else { Console.WriteLine("There is no Bed availablility in this ward!!!"); } } } else { Console.WriteLine("Patient Record Not Found!!!"); } }