Esempio n. 1
0
        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));
        }
Esempio n. 2
0
        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));
        }