/// <summary> /// Get all the insurance information for the MRN /// </summary> /// <param name="mrNumber"></param> /// <param name="vunetId"></param> /// <returns></returns> public List <InsuranceInformation> GetInsurances(string mrNumber, string vunetId) { List <InsuranceInformation> insuranceList = new List <InsuranceInformation>(); List <CoverageInfo> coverageresult = new List <CoverageInfo>(); coverageresult = GetCoverageAndInsurance(mrNumber, vunetId); InsuranceInformation insinfo = new InsuranceInformation(); foreach (var item in coverageresult) { foreach (var ins in item.InsuranceDetails) { insuranceList.Add(ins); } } return(insuranceList); }
/// <summary> /// Convert the DTO to coverageinfo /// </summary> /// <param name="accountRecord"></param> /// <returns></returns> private CoverageInfo ConvertToCoverageInfo(epi.AccountRecord accountRecord) { CoverageInfo coverage = new CoverageInfo() { IsActive = accountRecord.IsActive, TypeId = accountRecord.TypeId, Typename = accountRecord.TypeName, VerifiedByUser = accountRecord.VerifiedByUser, VerifiedDate = accountRecord.VerifiedDate, VerifiedStatus = accountRecord.VerifiedStatus }; List <InsuranceInformation> insuranceList = new List <InsuranceInformation>(); foreach (var coveragerec in accountRecord.CoverageRecords) { InsuranceInformation insuranceInfo = new InsuranceInformation() { EffectiveDate = coveragerec.EffectiveDate, FilingOrder = coveragerec.FilingOrder, FinancialName = coveragerec.FinancialName, Payorname = coveragerec.PayorName, MedipacPlanId = coveragerec.MedipacPlanId, PlanName = coveragerec.PlanName, PlanType = coveragerec.PayorName, SubscriberName = coveragerec.SubscriberName, TerminationDate = coveragerec.TerminationDate, PayorId = coveragerec.PayorId, PlanId = coveragerec.PlanId, InsuranceId = Convert.ToInt32(coveragerec.ID) }; insuranceList.Add(insuranceInfo); } coverage.InsuranceDetails = insuranceList; return(coverage); }