예제 #1
0
 public async Task<IHttpActionResult> GetPatientProfileTask(ILoggedInPerson loggedInPerson, int id)
 {
     return await TryAsync(async () =>
     {
         var baseByIdQuery = new BaseByIdQuery {Id = id};
         var result = await QueryDispatcher.Dispatch<BaseByIdQuery, PatientProfileQueryResult>(baseByIdQuery);
         return Ok(result.Patient);
     }, memberParameters: new object[] { loggedInPerson, id });
 }
예제 #2
0
 public async Task<IHttpActionResult> GetPatientAppointmentTask(ILoggedInPerson loggedInPerson, int appointmentId)
 {
     return await TryAsync(async () =>
     {
         var baseByIdQuery = new BaseByIdQuery { Id = appointmentId };
         var result = await QueryDispatcher.Dispatch<BaseByIdQuery, AppointmentQueryResult>(baseByIdQuery);
         return Ok(result.Appointment);
     }, memberParameters: new object[] { loggedInPerson, appointmentId });
 }
예제 #3
0
 public async Task<IHttpActionResult> GetAllStates(ILoggedInPerson loggedInPerson)
 {
     return await TryAsync(async () =>
     {
         var baseByIdQuery = new BaseByIdQuery();
         var result = await QueryDispatcher.Dispatch<BaseByIdQuery, StateQueryResult>(baseByIdQuery);
         return Ok(result.States);
     }, memberParameters: new object[] { loggedInPerson });
 }
예제 #4
0
 public async Task<IHttpActionResult> GetAllPatientProfilesTaskAdmin(ILoggedInPerson loggedInPerson)
 {
     return await TryAsync(async () =>
     {
         var baseByIdQuery = new BaseByIdQuery { UserId = "" };
         var result = await QueryDispatcher.Dispatch<BaseByIdQuery, PatientProfilesQueryResult>(baseByIdQuery);
         return new CustomOkResult<IEnumerable<Patient>>(result.Patients, this)
         {
             XInlineCount = result.TotalRecords.ToString()
         };
     }, memberParameters: new object[] { loggedInPerson });
 }
예제 #5
0
 public async Task<IHttpActionResult> GetAllPatientAppointmentsTask(ILoggedInPerson loggedInPerson, int patientId)
 {
     return await TryAsync(async () =>
     {
         var baseByIdQuery = new BaseByIdQuery{Id = patientId, UserId = loggedInPerson.Id};
         var result = await QueryDispatcher.Dispatch<BaseByIdQuery, AppointmentsQueryResult>(baseByIdQuery);
         return new CustomOkResult<IEnumerable<Appointment>>(result.Appointments, this)
         {
             XInlineCount = result.TotalRecords.ToString()
         };
     }, memberParameters: new object[] { loggedInPerson, patientId });
 }