Пример #1
0
        public DeleteCareMemberByPatientIdDataResponse DeleteCareMemberByPatientId(DeleteCareMemberByPatientIdDataRequest request)
        {
            DeleteCareMemberByPatientIdDataResponse response = null;

            try
            {
                response = new DeleteCareMemberByPatientIdDataResponse();

                ICareMemberRepository repo        = Factory.GetRepository(request, RepositoryType.CareMember);
                List <CareMemberData> careMembers = repo.FindByPatientId(request.PatientId) as List <CareMemberData>;
                List <string>         deletedIds  = null;
                if (careMembers != null)
                {
                    deletedIds = new List <string>();
                    careMembers.ForEach(u =>
                    {
                        request.Id = u.Id;
                        repo.Delete(request);
                        deletedIds.Add(request.Id);
                    });
                    response.DeletedIds = deletedIds;
                }
                response.Success = true;
                return(response);
            }
            catch (Exception ex) { throw ex; }
        }
Пример #2
0
        public List <DTO.CareMemberData> GetAllCareMembers(DTO.GetAllCareMembersDataRequest request)
        {
            ICareMemberRepository repo        = Factory.GetRepository(request, RepositoryType.CareMember);
            List <CareMemberData> careMembers = repo.FindByPatientId(request.PatientId) as List <CareMemberData>;

            return(careMembers);
        }
Пример #3
0
        public DTO.CareMemberData GetPrimaryCareManager(DTO.GetPrimaryCareManagerDataRequest request)
        {
            CareMemberData        response    = null;
            ICareMemberRepository repo        = Factory.GetRepository(request, RepositoryType.CareMember);
            List <CareMemberData> careMembers = repo.FindByPatientId(request.PatientId) as List <CareMemberData>;

            if (careMembers != null)
            {
                response = careMembers.Find(c => c.Primary == true && c.TypeId == "530cd571d433231ed4ba969b");
            }
            return(response);
        }
Пример #4
0
 public List <CareMemberData> GetAllCareMembers(GetAllCareMembersDataRequest request)
 {
     try
     {
         List <CareMemberData> response = null;
         ICareMemberRepository repo     = Factory.GetRepository(request, RepositoryType.CareMember);
         response = repo.FindByPatientId(request.PatientId) as List <CareMemberData>;
         return(response);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #5
0
 public CareMemberData GetPrimaryCareManager(GetPrimaryCareManagerDataRequest request)
 {
     try
     {
         CareMemberData        response    = null;
         ICareMemberRepository repo        = Factory.GetRepository(request, RepositoryType.CareMember);
         List <CareMemberData> careMembers = repo.FindByPatientId(request.PatientId) as List <CareMemberData>;
         if (careMembers != null)
         {
             GetLookUpsDataRequest lookupDataRequest = new GetLookUpsDataRequest {
                 Context = request.Context, ContractNumber = request.ContractNumber, Name = LookUpType.CareMemberType.ToString(), UserId = request.UserId, Version = request.Version
             };
             string careManagerLookUpId = getCareManagerLookupId(lookupDataRequest);
             response = careMembers.Find(c => c.Primary == true && c.TypeId == careManagerLookUpId);
         }
         return(response);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }