public HttpResponseMessage GetPatientExamDetail(int patientId, int orderId, int examId)
        {
            try
            {
                AccessControl.VerifyPatientDataAccess(patientId, orderId, examId);
                AccessControl.VerifyUserAccessToPatient(patientId);

                PatientExamDetail patientExamDetail = this.patientExamsIt2Manager.GetNewPatientExamDetail(patientId, this.companyId, examId, orderId);

                if (patientExamDetail != null)
                {
                    var data = new List <KeyValuePair <int, DateTime> > {
                        new KeyValuePair <int, DateTime>(patientExamDetail.ExamId, DateTime.UtcNow)
                    };
                    MessageTracking.SignalAlSupportTracking(data, "Viewed");
                }

                return(this.Request.CreateResponse(HttpStatusCode.OK, patientExamDetail));
            }
            catch (Exception ex)
            {
                var error = "GetPatientExamDetail(" + string.Format("{0}", patientId) + ")\n" + ex;
                return(HandleExceptions.LogExceptions(error, Logger, ex));
            }
        }
 public HttpResponseMessage SaveExamOrder(PatientExamDetail patientExamDetail, int orderNumber)
 {
     try
     {
         var savedOrderNumber = this.patientExamsIt2Manager.SaveExamOrder(patientExamDetail, orderNumber, this.practiceLocationId, this.userId);
         return(this.Request.CreateResponse(HttpStatusCode.OK, savedOrderNumber));
     }
     catch (Exception ex)
     {
         var error = "SaveExamOrder(" + patientExamDetail.PatientId + ")\n" + ex;
         HandleExceptions.LogExceptions(error, Logger, ex);
         return(this.Request.CreateResponse(HttpStatusCode.ExpectationFailed));
     }
 }