Beispiel #1
0
        public static IEnumerable <SoaEligibility> GetEligbilityData(long[] memberNumberList)
        {
            var client = new SoaContext
            {
                MemberIdList = memberNumberList
            };
            var eligibilities = client.GetEligibilities();

            return(eligibilities);
        }
Beispiel #2
0
        public static IEnumerable <HraSoaModel> GetEligilityAndPcpData(long[] memberNumberList)
        {
            var client = new SoaContext
            {
                MemberIdList = memberNumberList
            };

            var demographicList = client.GetDemographic();
            var eligibilities   = client.GetEligibilities();

            var member =
                demographicList?.GroupJoin(eligibilities, d => d.Identity.MemberNumber, e => e.MemberNumber, ToMemberEligibility);

            // -- Exclude invalid Assigned Provider Data
            var assignedproviderList = eligibilities.SelectMany(_ => _.EligibilityDetail.AssignedProvider)
                                       .Where(_ => _.TerminationDate == DateTime.MinValue || (_.EffectiveDate < _.TerminationDate))
                                       .OrderByDescending(_ => _.TerminationDate)
                                       //.ThenByDescending(_=>_.AssignedProviderKey)
                                       .ToList();

            // -- Get Providers Data
            var providers = client.GetProviders(assignedproviderList.Select(_ => _.ProviderKey).ToArray());

            // -- Merge Providers with Assigned Providers Data
            var assignedProviders = assignedproviderList.GroupJoin(providers, a => a.ProviderKey, p => p.ProviderKey, ToProvider);

            // -- Merge Member with Assigned Provider and Provider
            var memberWithProviders = member?.GroupJoin
                                          (assignedProviders, m => m.MemberNumber, e => e.MemberNumber, ToMemberProviders);

            // -- Merge Member Provider With Contract Info
            var providerContractMaps = client.GetProviderContractMap(assignedproviderList.Select(_ => _.ContractMapKey).ToArray());
            var ret = memberWithProviders?.GroupJoin(providerContractMaps, m => m.MemberProvider.ContractMapKey, c => c.ContractMapKey, ToContractMap);

            return(ret);
        }