public async Task <List <ProviderCategoryListEntity> > GetAllFacilityList(string collectionName, bool refresh) { try { if (ProviderCategoryListTempDB.Count() == 0 || refresh) { List <ProviderCategoryList> providerCategoryList = await _context.ProviderCategoryCollection(collectionName) .Find(m => m.Code != string.Empty).ToListAsync(); if (providerCategoryList.Count > 0) { var groupDBList = ProviderEntityMapper <ProviderCategoryList, ProviderCategoryListEntity> .MapEntityCollection(providerCategoryList); ProviderCategoryListTempDB = groupDBList; return(groupDBList); } return(null); } else { return(ProviderCategoryListTempDB.ToList()); } } catch (Exception ex) { loggers.Error(ex, $"Failed to fetch the dropdown details for the facility with the collectionName: {collectionName} - {ex.Message}"); return(null); } }
public async Task <List <SpecialityListEntity> > GetAllSpecialityList(string collectionName, bool refresh) { try { if (SpecialityTempDB.Count() == 0 || refresh) { List <SpecialityList> specialityList = await _context.SpecialityCollection(collectionName) .Find(m => true).ToListAsync(); if (specialityList.Count > 0) { var groupDBList = ProviderEntityMapper <SpecialityList, SpecialityListEntity> .MapEntityCollection(specialityList); SpecialityTempDB = groupDBList; return(groupDBList); } return(null); } else { return(SpecialityTempDB.ToList()); } } catch (Exception ex) { loggers.Error(ex, $"Failed to fetch the dropdown details for the speciality with the collectionName: {collectionName} - {ex.Message}"); return(null); } }
public async Task <List <PEntity> > GetAllOrganizationDetails(bool refresh, string collectionName) { try { if (ProviderTempDB.Count() == 0 || refresh) { if (collectionName != null) { List <P> genericList = await _context.EliteCollection(collectionName) .Find(m => true).ToListAsync(); if (genericList.Any()) { int number = 0; var eliteDBList = ProviderEntityMapper <P, PEntity> .MapEntityCollection(genericList); List <PEntity> providerList = eliteDBList.Select(c => { c.IdGeneratedNumber = number++; return(c); }).ToList(); ProviderTempDB = providerList; return(providerList); } return(null); } return(null); } else { return(ProviderTempDB.ToList()); } } catch (Exception ex) { loggers.Error(ex, $"An exception occurred while trying to get all the Organization details for the collection: {collectionName} - {ex.Message}"); return(null); } }
public async Task <IEnumerable <ProviderModel> > GetFilteredOrganizationDetails(string networkCode, string zipCode, int miles, int pageNumber, string specialization, string facility, string providerOrFacilityName, int providerId) { List <ProviderResultDetails> providerList = await _planService.GetFilteredOrganizationDetails(networkCode, zipCode, miles, pageNumber, specialization, facility, providerOrFacilityName, providerId); IEnumerable <ProviderModel> providerModelList = ProviderEntityMapper <ProviderResultDetails, ProviderModel> .MapEntityCollection(providerList); return(providerModelList); }
public async Task <IEnumerable <ProviderModel> > GetAllOrganizationDetails(int pageNumber, string networkCode) { List <ProviderResultDetails> groupAllList = await _planService.GetAllOrganizationDetails(pageNumber, networkCode); if (groupAllList != null) { IEnumerable <ProviderModel> groupModelList = ProviderEntityMapper <ProviderResultDetails, ProviderModel> .MapEntityCollection(groupAllList); return(groupModelList); } return(null); }
public async Task <List <PlanEntity> > GetAllPlanDetails() { try { List <Group> planList = await _context.GroupCollection .Find(m => true).ToListAsync(); var planDBList = ProviderEntityMapper <Group, PlanEntity> .MapEntityCollection(planList); return(planDBList); } catch (Exception ex) { loggers.Error(ex, $"Failed to get all the plan details - {ex.Message}"); return(null); } }
public async Task <List <GroupEntity> > GetGroupDetailsByNameOrNumber(string nameOrNumber) { try { var filter = Builders <Group> .Filter.Regex(s => s.Number, new BsonRegularExpression(nameOrNumber, "i")) | Builders <Group> .Filter.Regex(s => s.Name, new BsonRegularExpression(nameOrNumber, "i")); List <Group> groupByName = await _context.GroupCollection.Find(filter).ToListAsync(); var groupDBList = ProviderEntityMapper <Group, GroupEntity> .MapEntityCollection(groupByName); return(groupDBList); } catch (Exception ex) { loggers.Error(ex, $"An exception occurred while trying to get group details by name or number for {nameOrNumber} - {ex.Message}"); return(null); } }
public async Task <List <GroupEntity> > GetPlanDetailsByName(string name) { try { var bQuery = "{'Plans':{$elemMatch:{Name: /.*" + name + ".*/i}}}"; var filter = MongoDB.Bson.Serialization.BsonSerializer.Deserialize <BsonDocument>(bQuery); List <Group> planList = await _context.GroupCollection.Find (filter).ToListAsync(); var planDetailList = ProviderEntityMapper <Group, GroupEntity> .MapEntityCollection(planList); return(planDetailList); } catch (Exception ex) { loggers.Error(ex, $"An exception occurred while trying to get plan details by name for {name} - {ex.Message}"); return(null); } }
private IEnumerable <GroupModel> getGroupList(List <ConfirmationEntity> groupEntityList) { IEnumerable <GroupModel> groupModelList = ProviderEntityMapper <ConfirmationEntity, GroupModel> .MapEntityCollection(groupEntityList); return(groupModelList); }