public async Task <LG.Data.Models.Orders.OrderInProcess> FindItemsCompleted(LG.Data.Models.Orders.OrderInProcess entity) { mdList = await Get(); if (mdList.Any()) { entity.OrderAction = Models.Enums.OrderAction.FindConsultationsInProcessState; var result = await LG.Data.Core.Orders.OrderDataService.FindConsultationCompletedByAccountID(entity); var list = result.ConsultationsFound.Select(item => new ConsultationStatusFoundExpanded { DrName = "NA", AssignedToRID = item.AssignedToRID, DTUTC_Created = item.DTUTC_Created, ConsultationCustomLabel = item.ConsultationCustomLabel, ConsultationID = item.ConsultationID, ConsultationName = item.ConsultationName, ConsultationProcessingProcessState = item.ConsultationProcessingProcessState, ConsultationRecipientAccountID = item.ConsultationRecipientAccountID, IsTesting = item.IsTesting, ListeningForValue = item.ListeningForValue, StateCodeRecipientLocatedDuringConsultation = item.StateCodeRecipientLocatedDuringConsultation, ContactInfoOfRecipientDuringConsultation = item.ContactInfoOfRecipientDuringConsultation, ProductID = item.ProductID, DTUTC_AssignedToRID = item.DTUTC_AssignedToRID, ConsultationServicingProcessState = item.ConsultationServicingProcessState }).ToList(); list.ForEach(GetName); entity.ConsultationsFoundExpanded = list; } return(entity); }
public async Task<OrderInProcess> FindConsultsByAccountID(int Id) { OrderInProcess orderInProcess = new OrderInProcess() { AccountID = Id, ProcessState = ProcessStateEnum.Completed, OrderAction = OrderAction.FindConsultationsInProcessState }; return await (new OrderDetails()).FindItemsInProcess(orderInProcess); }
public async Task<OrderInProcess> LoadConsults() { OrderInProcess orderInProcess = new OrderInProcess() { AccountID = MembersController.UserContext.AccountInfo.AccountInfo.AccountID, ProcessState = ProcessStateEnum.Completed, OrderAction = OrderAction.FindConsultationsInProcessState }; return await Orders.FindItemsInProcess(orderInProcess); }
public static async Task <LG.Data.Models.Orders.OrderInProcess> FindItemsInProcess(LG.Data.Models.Orders.OrderInProcess entity) { IEnumerable <LG.Services.MPMS.MedicalPractitionerInfo> mdList = await OrderDetails.Get(); if (!mdList.Any()) { return(entity); } entity.OrderAction = Models.Enums.OrderAction.FindConsultationsInProcessState; var result = await LG.Data.Core.Orders.OrderDataService.FindItemsInProcess(entity); var list = result.ConsultationsFound.Select(item => new ConsultationStatusFoundExpanded { DrName = "NA", AssignedToRID = item.AssignedToRID, DTUTC_Created = item.DTUTC_Created, ConsultationCustomLabel = item.ConsultationCustomLabel, ConsultationID = item.ConsultationID, ConsultationName = item.ConsultationName, ConsultationProcessingProcessState = item.ConsultationProcessingProcessState, ConsultationRecipientAccountID = item.ConsultationRecipientAccountID, IsTesting = item.IsTesting, ListeningForValue = item.ListeningForValue, StateCodeRecipientLocatedDuringConsultation = item.StateCodeRecipientLocatedDuringConsultation, ContactInfoOfRecipientDuringConsultation = item.ContactInfoOfRecipientDuringConsultation, ProductID = item.ProductID, DTUTC_AssignedToRID = item.DTUTC_AssignedToRID, ConsultationServicingProcessState = item.ConsultationServicingProcessState }).ToList(); foreach (var item in list) { foreach (var dr in mdList.Where(dr => dr.MedicalPractitioner.RID == item.AssignedToRID)) { item.DrName = dr.MedicalPractitioner.PrintedName; } } entity.ConsultationsFoundExpanded = list; return(entity); }