Example #1
0
        /// <summary>
        /// Insert a patient
        /// </summary>
        /// <param name="newPatient"></param>
        /// <returns></returns>
        public PatientEntity AddPatient(PatientEntity newPatient)
        {
            if (newPatient == null)
            {
                throw new ArgumentNullException();
            }
            try
            {
                var daPatient = _dataAccessService.AddPatient(DTOMapper.Convert(newPatient));

                if (daPatient == null)
                {
                    throw new Exception("Create patient failed");
                }

                return(DTOMapper.Convert(daPatient));
            }
            catch
            {
                //log the error
                throw;
            }
        }