/// <summary> /// Gets the last LengthOfStay entry for the hospital. The last entry is the most recent quarter for which data is available. /// </summary> /// <param name="hospital"></param> /// <param name="lengthsOfStay"></param> /// <returns></returns> private double? GetLengthOfStay(myhospitals_contact_data hospital, List<emergencydept4hourlengthofstaymetadata> lengthsOfStay) { var los = lengthsOfStay.LastOrDefault(a => a.MyHospitalsId == hospital.Id); if (los != null && los.LessThan4HrsPct.HasValue) { return (double)los.LessThan4HrsPct.Value; } return null; }
private static Location GetLocation(myhospitals_contact_data hospital) { return new Location { Address = hospital.Street_address, Suburb = hospital.Suburb, Postcode = hospital.Postcode, Latitude = hospital.Latitude.ToString(), Longitude = hospital.Longitude.ToString() }; }
private EmergencyDepartmentStatus GetEDStatus(myhospitals_contact_data hospital, List<ED001_HospitalStatus> emergencyStats) { var status = emergencyStats.LastOrDefault(a => a.HospitalCode == hospital.HospitalCode); if (status != null) { return new EmergencyDepartmentStatus { AvgWaitTimeMinsExclHigh = (double)status.AvgWaitTimeMinsExclHigh, Capacity = (int)status.Capacity, CommencedTreatment = (int)status.EdCommenced, ExpectedArrivals = (int)status.ExpectedArrivals, Waiting = (int)status.EdWaiting }; } return null; }