public IActionResult GetPatientByID(string id) { try { var Patient = _patientData.GetPatientByID(id); return(Ok(Patient)); } catch (Exception ex) { _apiErrorHandler.CreateError(ex.Source, ex.StackTrace, ex.Message); } return(StatusCode(500)); }
public IActionResult GetPatientByID() { try { var PatientId = User.FindFirst(ClaimTypes.NameIdentifier)?.Value; var Patient = _patientData.GetPatientByID(PatientId); if (Patient.Count > 0) { return(Ok(Patient)); } return(NotFound()); } catch (Exception ex) { _apiErrorHandler.CreateError(ex.Source, ex.StackTrace, ex.Message); } return(StatusCode(500)); }