Exemplo n.º 1
0
        public RemovePCMFromCohortPatientViewDataResponse Delete(RemovePCMFromCohortPatientViewDataRequest request)
        {
            var response = new RemovePCMFromCohortPatientViewDataResponse();

            try
            {
                if (string.IsNullOrEmpty(request.UserId))
                {
                    throw new UnauthorizedAccessException("PatientDD:RemovePCMFromCohortPatientViewDataRequest()::Unauthorized Access");
                }

                var managerResponse = PatientManager.RemovePcmFromCohortPatientView(request);
                response.IsSuccessful = managerResponse.IsSuccessful;
                response.Version      = request.Version;
            }
            catch (Exception ex)
            {
                response.IsSuccessful = false;
                CommonFormatterUtil.FormatExceptionResponse(response, base.Response, ex);

                var aseProcessID = ConfigurationManager.AppSettings.Get("ASEProcessID") ?? "0";
                Helpers.LogException(int.Parse(aseProcessID), ex);
            }
            return(response);
        }
        public bool RemovePCMFromCohortPatientView(RemovePCMFromCohortPatientViewDataRequest request)
        {
            try
            {
                using (PatientMongoContext ctx = new PatientMongoContext(_dbName))
                {
                    var q = MB.Query <MECohortPatientView> .EQ(b => b.PatientID, ObjectId.Parse(request.Id));

                    var cohort = ctx.CohortPatientViews.Collection.FindOne(q);

                    if (cohort != null)
                    {
                        var fields   = cohort.SearchFields;
                        var PcmField = fields.FirstOrDefault(f => f.FieldName == Constants.PCM);

                        if (PcmField != null)

                        {
                            PcmField.Value  = null;
                            PcmField.Active = true;
                            ctx.CohortPatientViews.Collection.Save(cohort);

                            AuditHelper.LogDataAudit(this.UserId,
                                                     MongoCollectionName.CohortPatientView.ToString(),
                                                     request.Id.ToString(),
                                                     Common.DataAuditType.Update,
                                                     request.ContractNumber);
                        }

                        AuditHelper.LogDataAudit(this.UserId,
                                                 MongoCollectionName.CohortPatientView.ToString(),
                                                 request.Id.ToString(),
                                                 Common.DataAuditType.Update,
                                                 request.ContractNumber);

                        cohort.LastUpdatedOn = DateTime.UtcNow;
                        cohort.UpdatedBy     = ObjectId.Parse(request.UserId);
                    }



                    return(true);
                }
            }
            catch (Exception) { throw; }
        }
Exemplo n.º 3
0
 public RemovePCMFromCohortPatientViewDataResponse RemovePcmFromCohortPatientView(RemovePCMFromCohortPatientViewDataRequest request)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 4
0
        public RemovePCMFromCohortPatientViewDataResponse RemovePcmFromCohortPatientView(RemovePCMFromCohortPatientViewDataRequest request)
        {
            var response = new RemovePCMFromCohortPatientViewDataResponse();

            try
            {
                var repo         = Factory.GetRepository(request, RepositoryType.CohortPatientView);
                var isSuccessful = repo.RemovePCMFromCohortPatientView(request);

                response.IsSuccessful = isSuccessful;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(response);
        }