Example #1
0
 public async Task <ActionResult <Clinician> > GetByID(int id)
 {
     try
     {
         return(await _clinicianRepo.GetByID(id));
     }
     catch (Exception)
     {
         return(StatusCode(500, "Internal Server Error"));
     }
 }
Example #2
0
        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));
        }
Example #3
0
        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"));
            }
        }