public async Task <ActionResult <Clinician> > GetByID(int id) { try { return(await _clinicianRepo.GetByID(id)); } catch (Exception) { return(StatusCode(500, "Internal Server Error")); } }
public async Task <ActionResult <int> > InsertAppointment(InsertAppointment app) { var patientInfo = await _patientRepo.GetByID(app.PatientID); var clinicianInfo = await _clinicianRepo.GetByID(app.ClinicianID); var fullApp = (Appointment)app; fullApp.ClinicianName = clinicianInfo.FirstName + " " + clinicianInfo.LastName; fullApp.ClinicianPicture = "picture"; fullApp.PatientName = patientInfo.FirstName + " " + patientInfo.LastName; fullApp.PatientPicture = "picture"; return(await _appointmentRepo.InsertAppointment(fullApp)); }
public async Task <ActionResult <Patient> > GetByID(Guid id) { try { var patient = await _patientRepo.GetByID(id); patient.Emergency = await _emergencyRepo.GetByUserID(patient.ID); patient.Clinician = await _clinicianRepo.GetByID(patient.ClinicianID); return(patient); } catch (Exception) { return(StatusCode(500, "Internal Server Error")); } }