예제 #1
0
 public IHttpActionResult GetByPatientId(int id)
 {
     try
     {
         var appointment     = _appointmentManager.GetWithWhereCondition <Appointment>($"PatientId = {id}");
         var appointmentsDTO = _appointmentFactory.CreateAppointmentDTO(appointment);
         return(Content(HttpStatusCode.OK, appointmentsDTO));
     }
     catch (Exception ex)
     {
         return(Content(HttpStatusCode.InternalServerError, ex.Message));
     }
 }
예제 #2
0
        public IHttpActionResult GetById(int id)
        {
            try
            {
                var patient          = _patientManager.GetById <Patient>(id);
                var address          = _addressManager.GetWithWhereCondition <Address>($"Patientid = {id}").FirstOrDefault();
                var emergencyContact = _emergencyContactManager.GetWithWhereCondition <EmergencyContact>($"Patientid = {id}").FirstOrDefault();
                var consultations    = _consultationManager.GetWithWhereCondition <Consultation>($"PatientId = {id}");
                var appointments     = _appointmentManager.GetWithWhereCondition <Appointment>($"PatientId = {id}");
                var patientDTO       = _patientFactory.CreatePatientDTO(patient, address, emergencyContact, consultations, appointments);

                return(Content(HttpStatusCode.OK, patientDTO));
            }
            catch (Exception ex)
            {
                return(Content(HttpStatusCode.InternalServerError, ex.Message));
            }
        }
예제 #3
0
 public IList <Appointment> GetAppointmentsByDate()
 {
     return(appointmentManager.GetWithWhereCondition <Appointment>($"cast(DesiredDateTime as date) =" +
                                                                   $" '{dateTimePickerAppointment.Value.ToString("yyyy-MM-dd")}'"));
 }