public async Task <IActionResult> GetPatientJournalById([FromQuery] Guid id) { if (!ModelState.IsValid) { BadRequest(ModelState); } if (id == Guid.Empty) { return(new JsonResult(await Errors .GetGenericErrorResponse( new GetPatientJournalResponse() { PatientJournal = new PatientJournal() { Id = id }, StatusCode = 400, Error = "Id can not be empty", Description = "Id can not be empty", Code = "id_can_not_be_empty" }))); } PatientJournal patientJournal = await _aerendeService.GetPatientJournalById(id); if (patientJournal == null) { return(new JsonResult(await Errors .GetGenericErrorResponse( new GetPatientJournalResponse() { PatientJournal = new PatientJournal() { Id = id }, StatusCode = 404, Error = "Patient journal not found", Description = "Patient journal could not be found", Code = "patentJournal_not_found" }))); } return(new JsonResult(Wrappyfier.WrapGetPatientJournalResponse(patientJournal))); }