public ActionResult getRFARequestRecords(int _rfaReferralID) { RFARequestViewModel _rfaRequestViewModel = new RFARequestViewModel(); _rfaRequestViewModel.rfaRequest = new RFARequest(); _rfaRequestViewModel.rfaRequestsDetails = Mapper.Map <IEnumerable <RFARequestsDetails> >(_intakeService.getRFARequestByReferralID(_rfaReferralID)); _rfaRequestViewModel.durationTypes = Mapper.Map <IEnumerable <DurationType> >(_commonService.getDurationTypesAll()); _rfaRequestViewModel.reqeustTypes = Mapper.Map <IEnumerable <RequestType> >(_commonService.getRequestTypeAll()); _rfaRequestViewModel.treatmentCategories = Mapper.Map <IEnumerable <TreatmentCategory> >(_commonService.getTreatmentCategoriesAll()); _rfaRequestViewModel.treatementTypes = Mapper.Map <IEnumerable <TreatmentType> >(_commonService.getTreatmentTypesAll()); //_rfaRequestViewModel.rfaReferralCPTCodes = Mapper.Map<IEnumerable<RFAReferralCPTCode>>(_intakeService.getRFAReferralCPTCodesByReferralID(_rfaReferralID)); _rfaRequestViewModel.rfaRequestsDetails.ToList().ForEach( hp => { hp.TreatmentCategoryName = _rfaRequestViewModel.treatmentCategories.ToList().Find(hp1 => hp1.TreatmentCategoryID == hp.TreatmentCategoryID).TreatmentCategoryName; hp.TreatmentTypeDesc = _rfaRequestViewModel.treatementTypes.ToList().Find(hp1 => hp1.TreatmentTypeID == hp.TreatmentTypeID).TreatmentTypeDesc; hp.RequestTypeDesc = _rfaRequestViewModel.reqeustTypes.ToList().Find(hp1 => hp1.RequestTypeID == hp.RequestTypeID).RequestTypeDesc; }); return(Json(_rfaRequestViewModel, JsonRequestBehavior.AllowGet)); }