Exemple #1
0
        public HttpResponseMessage Get_PatientDetails([FromUri] Guid ID, string sort_by, bool isAsc, int start_row_index)
        {
            var transaction       = new TransactionalInformation();
            var patientApiModel   = new PatientDetailsApiModel();
            var patientDetailList = new List <PatientDetailViewModelExtended>();

            var data = patientDataService.Get_PatientDetails(ID, connectionString, SessionToken, out transaction);

            patientApiModel.patient       = data.patient;
            patientApiModel.contract_list = data.ContractList;

            if (!transaction.ReturnStatus)
            {
                return(Request.CreateResponse(HttpStatusCode.InternalServerError, transaction));
            }

            var parameters = new ElasticParameterObject
            {
                isAsc           = isAsc,
                sort_by         = sort_by,
                start_row_index = start_row_index
            };

            patientDetailList = patientDataService.Get_PatientCasesAndParticipationConsents(parameters, ID, SessionToken, connectionString, out transaction);
            patientApiModel.patient_details_list = patientDetailList;
            if (!transaction.ReturnStatus)
            {
                return(Request.CreateResponse(HttpStatusCode.InternalServerError, transaction));
            }


            return(Request.CreateResponse <PatientDetailsApiModel>(HttpStatusCode.OK, patientApiModel));
        }