Пример #1
0
        public ResponsePatient Get(string identification)
        {
            ResponsePatient ans = null;

            try
            {
                if (ValidateSecurityAPI())
                {
                    ans = PatientModel.GetPatient(identification);
                }
                else
                {
                    ans = new ResponsePatient()
                    {
                        IsSuccessful = false, ResponseMessage = AppManagement.MSG_API_Validation_Failure
                    };
                }
            }
            catch (Exception ex)
            {
                ans = new ResponsePatient()
                {
                    IsSuccessful = false, ResponseMessage = AppManagement.MSG_GenericExceptionError
                };
            }

            return(ans);
        }
Пример #2
0
        public Response SavePatient([FromBody] PatientModel patientModel)
        {
            Response ans = null;

            try
            {
                if (ValidateSecurityAPI())
                {
                    if (patientModel.IsNotNull())
                    {
                        ans = PatientModel.SavePatient(patientModel);
                    }
                }
                else
                {
                    ans = new ResponsePatient()
                    {
                        IsSuccessful = false, ResponseMessage = AppManagement.MSG_API_Validation_Failure
                    };
                }
            }
            catch (Exception ex)
            {
                ans = new ResponsePatient()
                {
                    IsSuccessful = false, ResponseMessage = AppManagement.MSG_SaveTreatment_Duplicate
                };
            }

            return(ans);
        }