public async Task <IActionResult> GetAllPatientJournals([FromBody] GetAllPatientJournalslWithCapViewModel model, [FromHeader] string authorization)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            HttpParameters httpParameters =
                HttpParametersService
                .GetHttpParameters(
                    model,
                    ConfigHelper.AppSetting(Constants.ServerUrls, Constants.GetAllPatientJournals),
                    HttpMethod.Post,
                    string.Empty,
                    authorization);

            GetAllPatientJournalsResponse getPatientJournalsResult =
                await _gWService.PostTo <GetAllPatientJournalsResponse>(httpParameters);


            if (getPatientJournalsResult.StatusCode == 422)
            {
                return(await ResponseService
                       .GetResponse <UnprocessableEntityObjectResult, GetAllPatientJournalsResponse>(getPatientJournalsResult, ModelState));
            }

            return(new OkObjectResult(getPatientJournalsResult));
        }
        public static GetAllPatientJournalsResponse WrapPatientJournalsResponse(AllPatientJournals patientJournals)
        {
            GetAllPatientJournalsResponse listViewModel =
                new GetAllPatientJournalsResponse()
            {
                PatientJournals = patientJournals.PatentJournals,
                StatusCode      = 200,
                Error           = "No error",
                Description     = "All existing patient journals",
                Code            = "no_error"
            };

            return(listViewModel);
        }
        public async Task <IActionResult> GetAllPatientJournals(GetAllPatientJournalslWithCapViewModel model, [FromHeader] string authorization)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            HttpParameters httpParameters =
                HttpParametersService.GetHttpParameters(
                    model,
                    ConfigHelper.AppSetting(AerendeConstants.ServerUrls, AerendeConstants.PatientJournals),
                    HttpMethod.Post,
                    string.Empty,
                    authorization
                    );

            GetAllPatientJournalsResponse getPatientJournalsResult = await _aerendeService.PostTo <GetAllPatientJournalsResponse>(httpParameters);

            return(new JsonResult(getPatientJournalsResult));
        }