public void EmptyTheBed_ShouldUpdateOccupancyStatusToFalse()
        {
            Patients _patient = new Patients()
            {
                PatientName = "Nikita Kumari", Age = 23, BedId = 1, ContactNo = "9826376268", MonitoringStatus = 0, PatientId = 1
            };
            var _bedAllotment = new BedAllotment();

            _bedAllotment.EmptyTheBed(_patient);
            var _allBeds = _bedAllotment.GetAvailableBeds();

            foreach (var bed in _allBeds)
            {
                Assert.True(bed.BedId == 1);
                break;
            }
        }
Ejemplo n.º 2
0
 public IActionResult DischargingPatient(int patientId)
 {
     try
     {
         BedAllotment bedAllotment          = new BedAllotment();
         var          patientStore          = _context.Patients.ToList();
         var          patientToBeDischarged = patientStore.FirstOrDefault(item => item.PatientId == patientId);
         if (patientToBeDischarged == null)
         {
             return(BadRequest("No Patient With The Given Patient Id Exists"));
         }
         bedAllotment.EmptyTheBed(patientToBeDischarged);
         PatientInfoValidator.DeleteVitalLogsForDischargedPatient(patientId);
         _context.Remove(patientToBeDischarged);
         _context.SaveChanges();
         return(Ok());
     }
     catch (Exception)
     {
         return(StatusCode(500));
     }
 }