예제 #1
0
        private async Task <bool> UploadSafetyConcern(bool inUpdateProcess = false)
        {
            if (string.IsNullOrEmpty(_personSought.CautionFlag) &&
                string.IsNullOrEmpty(_personSought.CautionReason) &&
                string.IsNullOrEmpty(_personSought.CautionNotes))
            {
                return(true);
            }
            SafetyConcernEntity entity = _mapper.Map <SafetyConcernEntity>(_personSought);

            entity.SearchRequest     = _uploadedSearchRequest;
            entity.InformationSource = InformationSourceType.Request.Value;
            entity.Person            = _uploadedPerson;
            entity.IsCreatedByAgency = true;
            if (inUpdateProcess)
            {
                entity.UpdateDetails = "New Safety Concern";
            }
            await _searchRequestService.CreateSafetyConcern(entity, _cancellationToken);

            _logger.LogInformation("Create Safety Concern records for SearchRequest successfully");
            return(true);
        }
예제 #2
0
        private async Task <bool> UploadSafetyConcern()
        {
            if (string.IsNullOrEmpty(_foundPerson.CautionFlag))
            {
                return(false);
            }
            try
            {
                SafetyConcernEntity entity = _mapper.Map <SafetyConcernEntity>(_foundPerson);
                entity.SearchRequest     = _searchRequest;
                entity.InformationSource = _providerDynamicsID;
                entity.Person            = _returnedPerson;
                SSG_SafetyConcernDetail safetyConcern = await _searchRequestService.CreateSafetyConcern(entity, _cancellationToken);
                await CreateResultTransaction(safetyConcern);

                _logger.LogInformation("Create Safety Concern records for SearchRequest successfully");
                return(true);
            }
            catch (Exception ex)
            {
                LogException(ex);
                return(false);
            }
        }