Ejemplo n.º 1
1
        public static void prjTb(System.Data.DataTable fnlCnsInput, System.Data.DataTable newPrmInput, InputOptionsPage projectionOptions, Excel.Workbook inputOwb)
        {
            oWB = inputOwb;
            prjNme = projectionOptions.projName;
            fnlCns = fnlCnsInput;
            nwPrm = newPrmInput;

            Tuple<List<string>, DataTable, List<double>, List<string>, DataTable, List<double>> projectionResultsData
                = PrepareSummaryAndDetailResultsForOutput();
            CheckIfResultsExist();

            ProjectionSummaryTab projectionSummaryResults = new ProjectionSummaryTab(projectionResultsData, oWB, projectionNameOfSummaryTabs);
            ProjectionRatesTab projectionRatesGrid = new ProjectionRatesTab(oWB, nwPrm, projectionNameOfSummaryTabs);
            ProjectionDetailTab projectedDetailResults = new ProjectionDetailTab(fnlCns, oWB, projectionNameOfSummaryTabs);
            ProjectionAssumptionResults projectedAssumptionResults = new ProjectionAssumptionResults(projectionOptions, oWB, projectionNameOfSummaryTabs);

            FinalizeResults();

        }
Ejemplo n.º 2
0
 public static DataTable CalcBaseSubsidy(DataTable optimalRatesAndFactors, DataTable anchoredPlans, InputOptionsPage inputOptions)
 {
     internalInputOptions = inputOptions;
     
     InitializeSubsidyVariablesAndSelectedOption(optimalRatesAndFactors, internalInputOptions.modalAdj, internalInputOptions.subsidyOption);
     return SubsidyCalcEngine(optimalRatesAndFactors, anchoredPlans, internalInputOptions.modalAdj);
 }
Ejemplo n.º 3
0
        public static System.Data.DataTable mrgCnsPrm(System.Data.DataTable census, System.Data.DataTable prPrm, System.Data.DataTable nwPrm, ref InputOptionsPage inputOptions)
        {
            Init(census);
            IsManualMigrationOverrideOptionTurnedOn();
            SetupOldPremiumColumns(prPrm);
            SetupNewPremiumColumns(nwPrm);
            System.Data.DataTable censusWithAllPremiums = MergePremiums(prPrm, nwPrm, count);
            DataTable migrationTableCopy = MigrateScenarios(censusWithAllPremiums, inputOptions.mgOpt, count);
            SetMgOptIfManualOverrideSet(ref inputOptions);
            

            return FinalizeMigrationTable(migrationTableCopy);
        }
        public ProjectionAssumptionResults(InputOptionsPage inputOptions, Excel.Workbook oWB, string prjNme)
        {
            this.inputOptions = inputOptions;
            this.projectionNameOfSummaryTabs = prjNme;
            this.shts = (Excel.Sheets)oWB.Sheets;
            this.oSheet = (Excel.Worksheet)this.shts.Add();

            SetupSheetNameAndLocationInWorkbook();
            OutputAndFormatInputAssumptions();

            FinalizeSheetName();

        }
Ejemplo n.º 5
0
        public static void runScenarioSummary()
        {
            runCalcAction( ()=>{
                shts = oWB.Worksheets;
                oSheet = (Worksheet) shts["Projection Input Options"];
                InputOptionsPage userOptionsAndVerification = new InputOptionsPage(oSheet);

                RatingGroups groups = new RatingGroups("Rating Groups", true);
                PriorSurcharge priorSurcharge = new PriorSurcharge("Rating Groups", userOptionsAndVerification.modalAdj);
                NewSurcharge newSurcharge = new NewSurcharge("Rating Groups", userOptionsAndVerification.modalAdj);
                PriorPremiums priorPremiums = new PriorPremiums("Prior Premiums");
                NewPremiums newPremiums = new NewPremiums("New Premiums");
                Census census = new Census("Census");

                System.Data.DataTable rfTableMultipliers = groups.RFactors;
                System.Data.DataTable newPrm = Utility.ConvertListToDataTable(newPremiums.NewPrmLst);
                System.Data.DataTable oldPrm = Utility.ConvertListToDataTable(priorPremiums.OldPrmLst);
                newPrm = Utility.mdlPrm(newPrm, userOptionsAndVerification.modalAdj);
                oldPrm = Utility.mdlPrm(oldPrm, userOptionsAndVerification.modalAdj);
                System.Data.DataTable cns = Utility.ConvertListToDataTable(census.CnLst);
                List<System.Data.DataTable> prSurChrg = priorSurcharge.PSCharge;
                List<System.Data.DataTable> nwSurChrg = newSurcharge.NSCharge;


                //Code works in following way
                //1) optimalCarrierRates chooses best CARRIER rates for MIGRATION ONLY
                //2) ratesToAnchorOffOf is the CARRIER rates to anchor off of (this could be the same as 1) or it could be the second lowest cost carrier)
                //      these are all metallic levels at this point, the anchor plan level is selected later                    
                //3) optimalRatesAndFactors joins the subsidy factors to the optimal rates
                //4) anchoredPlans takes ratesToAnchorOffOf and only keeps the correct metallic level that the user selected
                //5) nwPrm uses the Anchored plans, calcs the subsidy based on the user selected subsidy option and then applies this to the optimalCarrierRates
                //6) fnlCns migrates the population to the correct plan level, then attaches surcharge amounts to the premiums
                //7) finalRateGrid simply attaches the non lowest cost carriers to the rates to provide a complete set of carrier rates. These are treated as a 
                //      buy up with the EE shouldering any burden of buying a non anchored plan.
                //8) prjTb produces exhibit output tabs
                //9) sendCalcLog logs the model use with the model logger

                System.Data.DataTable optimalCarrierRates = FindOptimalCarrierPremiums.FindPremiumCarrier(newPrm, userOptionsAndVerification.defaultAnchorPlan);  //Finds optimal rates
                System.Data.DataTable ratesToAnchorOffOf = FindOptimalCarrierPremiums.FindPremiumCarrier(newPrm, userOptionsAndVerification.ancPln);     //Allows the anchored plan to be different than optimal carrier
                System.Data.DataTable optimalRatesAndFactors = Utility.Join(rfTableMultipliers, optimalCarrierRates);     //Join on factors to optimal rates
                System.Data.DataTable anchoredPlans = AnchorPlans.GetAnchorPlans(ratesToAnchorOffOf, userOptionsAndVerification.ancPln, groups.baselineCoverageTier);     //Get anchor plan and join onto optimal rates and factors
                System.Data.DataTable nwPrm = SubsidyCalculation.CalcBaseSubsidy(optimalRatesAndFactors, anchoredPlans, userOptionsAndVerification);   //calculate Subsidy
                System.Data.DataTable fnlCns = SurchargeCombine.SurChrgCombine(MigrationEngine.mrgCnsPrm(cns, oldPrm, nwPrm, ref userOptionsAndVerification), prSurChrg, nwSurChrg);
                System.Data.DataTable finalRateGrid = Utility.CreateCombinedPremiumExhibit(newPrm, nwPrm);

                ProjectionResults.prjTb(fnlCns, finalRateGrid, userOptionsAndVerification, oWB);
                AxCalcEngineAPI.sendCalcLog(userOptionsAndVerification, urlName, modVersion);
            });
        }
Ejemplo n.º 6
0
        public static void sendCalcLog(InputOptionsPage userInputOptions, string urlName, string modVersion)
        {

            var sb = new StringBuilder();
            sb.Append(urlName)
                .Append("?DisplayName=").Append(_user.DisplayName)
                .Append("&DistinguishedName=").Append(_user.DistinguishedName)
                .Append("&EmailAddress=").Append(_user.Email)
                .Append("&GivenName=").Append(_user.GivenName)
                .Append("&Surname=").Append(_user.Surname)
                .Append("&Name=").Append(_user.Username)
                .Append("&ClientName=").Append(userInputOptions.clientName)
                .Append("&ClientID=").Append(userInputOptions.clientID)
                .Append("&ModelVersion=").Append(modVersion)
                .Append("&ProjectionName=").Append(userInputOptions.projName)
                .Append("&PeerReviewerName=").Append(userInputOptions.reviewerName)
                .Append("&FinalModel=").Append(userInputOptions.finalModelIndicator);
            string urlKey = sb.ToString();
            HttpGet(urlKey);


        }
Ejemplo n.º 7
0
 private static void SetMgOptIfManualOverrideSet(ref InputOptionsPage inputOptions)
 {
     if (migrationManualOverrideTurnedOn == true)
     {
         inputOptions.mgOpt = "Manual Override";
     }
 }