//set the class properties using the XElement public virtual void SetHealthBenefit1Properties(XElement currentCalculationsElement) { if (Demographics == null) { Demographics = new Demog1(); } Demographics.SetDemog1Properties(currentCalculationsElement); //don't set any input properties; each calculator should set what's needed separately this.OutputCost = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cOutputCost); this.BenefitAdjustment = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cBenefitAdjustment); this.AdjustedBenefit = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cAdjustedBenefit); this.OutputEffect1Name = CalculatorHelpers.GetAttribute(currentCalculationsElement, cOutputEffect1Name); this.OutputEffect1Unit = CalculatorHelpers.GetAttribute(currentCalculationsElement, cOutputEffect1Unit); this.OutputEffect1Amount = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cOutputEffect1Amount); this.OutputEffect1Price = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cOutputEffect1Price); this.OutputEffect1Cost = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cOutputEffect1Cost); this.AverageBenefitRating = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cAverageBenefitRating); this.PhysicalHealthRating = CalculatorHelpers.GetAttributeInt(currentCalculationsElement, cPhysicalHealthRating); this.EmotionalHealthRating = CalculatorHelpers.GetAttributeInt(currentCalculationsElement, cEmotionalHealthRating); this.SocialHealthRating = CalculatorHelpers.GetAttributeInt(currentCalculationsElement, cSocialHealthRating); this.EconomicHealthRating = CalculatorHelpers.GetAttributeInt(currentCalculationsElement, cEconomicHealthRating); this.HealthCareDeliveryRating = CalculatorHelpers.GetAttributeInt(currentCalculationsElement, cHealthCareDeliveryRating); this.BeforeQOLRating = CalculatorHelpers.GetAttributeInt(currentCalculationsElement, cBeforeQOLRating); this.AfterQOLRating = CalculatorHelpers.GetAttributeInt(currentCalculationsElement, cAfterQOLRating); this.BeforeYears = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cBeforeYears); this.AfterYears = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cAfterYears); this.AfterYearsProb = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cAfterYearsProb); this.TimeTradeoffYears = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cTimeTradeoffYears); this.EquityMultiplier = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cEquityMultiplier); this.BenefitAssessment = CalculatorHelpers.GetAttribute(currentCalculationsElement, cBenefitAssessment); this.QALY = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cQALY); this.ICERQALY = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cICERQALY); this.TTOQALY = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cTTOQALY); this.WillDoSurvey = CalculatorHelpers.GetAttributeBool(currentCalculationsElement, cWillDoSurvey); }
public static bool GetDisplayFullViewOption(XElement calculationsElement) { //default is no (meaning don't display grandchildren ... elements) bool bNeedsFullView = CalculatorHelpers.GetAttributeBool(calculationsElement, Calculator1.cOption5); return(bNeedsFullView); }
public void SetOutputDiscountedProperties(CalculatorParameters calcParameters, XElement currentCalculationsElement, XElement currentElement) { //set the base output properties SetOutputProperties(calcParameters, currentCalculationsElement, currentElement); this.CompositionAmount = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, COMPOSITION_AMOUNT); this.CompositionUnit = CalculatorHelpers.GetAttribute(currentCalculationsElement, COMPOSITION_UNIT); this.IncentiveAmount = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, Constants.INCENTIVE_AMOUNT); this.IncentiveRate = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, Constants.INCENTIVE_RATE); //set the calculator properties this.IsDiscounted = CalculatorHelpers.GetAttributeBool(currentCalculationsElement, BudgetInvestment.ISDISCOUNTED); this.EndOfPeriodDate = CalculatorHelpers.GetAttributeDate(currentCalculationsElement, OperationComponent.ENDOFPERIOD_DATE); }
//set the class properties using the XElement public void SetTimePeriodProperties(CalculatorParameters calcParameters, XElement currentCalculationsElement, XElement currentElement) { //several extensions store some calculator props in base element (observations, targettype) //no harm done in setting them but never set their attributes in base element this.SetCalculatorProperties(currentCalculationsElement); this.SetSharedObjectProperties(currentElement); this.SetTotalBenefitsProperties(currentElement); this.SetTotalCostsProperties(currentElement); if (currentElement.Name.LocalName.StartsWith( DataAppHelpers.Economics1.BUDGET_TYPES.budget.ToString())) { this.Amount = CalculatorHelpers.GetAttributeDouble(currentElement, DataAppHelpers.Economics1.BUDGET_TPENTERPRISE_AMOUNT); } else { this.Amount = CalculatorHelpers.GetAttributeDouble(currentElement, DataAppHelpers.Economics1.INVEST_TPENTERPRISE_AMOUNT); } this.Unit = CalculatorHelpers.GetAttribute(currentElement, DataAppHelpers.General.UNIT); this.IsDiscounted = CalculatorHelpers.GetAttributeBool(currentElement, DataAppHelpers.Economics1.ISDISCOUNTED); this.IsCommonReference = CalculatorHelpers.GetAttributeBool(currentElement, DataAppHelpers.Economics1.ISCOMMON_REFERENCE); this.GrowthPeriods = CalculatorHelpers.GetAttributeInt(currentElement, DataAppHelpers.Economics1.GROWTH_PERIODS); this.GrowthTypeId = CalculatorHelpers.GetAttributeInt(currentElement, DataAppHelpers.Economics1.GROWTH_TYPE_ID); this.OverheadFactor = CalculatorHelpers.GetAttributeDouble(currentElement, DataAppHelpers.Economics1.OVERHEAD_FACTOR); this.IncentiveAmount = CalculatorHelpers.GetAttributeDouble(currentElement, DataAppHelpers.General.INCENTIVE_AMOUNT); this.IncentiveRate = CalculatorHelpers.GetAttributeDouble(currentElement, DataAppHelpers.General.INCENTIVE_RATE); this.AnnuityType = GetAnnuityType(currentElement); this.XmlDocElement = currentCalculationsElement; }
public void SetInputDiscountedProperties(CalculatorParameters calcParameters, XElement currentCalculationsElement, XElement currentElement) { //set the base input properties SetInputProperties(calcParameters, currentCalculationsElement, currentElement); //set the calculator properties this.IsDiscounted = CalculatorHelpers.GetAttributeBool(currentCalculationsElement, BudgetInvestment.ISDISCOUNTED); this.EndOfPeriodDate = CalculatorHelpers.GetAttributeDate(currentCalculationsElement, OperationComponent.ENDOFPERIOD_DATE); this.EffectiveLife = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, OperationComponent.EFFECTIVE_LIFE); this.SalvageValue = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, OperationComponent.SALVAGE_VALUE); this.Times = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, Input.INPUT_TIMES); this.IncentiveAmount = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, Constants.INCENTIVE_AMOUNT); this.IncentiveRate = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, Constants.INCENTIVE_RATE); }
//set the class properties using the XElement public void SetInputProperties(CalculatorParameters calcParameters, XElement currentCalculationsElement, XElement currentElement) { //several extensions store some calculator props in base element (observations, targettype) //no harm done in setting them but never set their attributes in base element this.SetCalculatorProperties(currentCalculationsElement); this.SetSharedObjectProperties(currentElement); this.SetTotalCostsProperties(currentElement); this.AnnuityType = TimePeriod.GetAnnuityType(currentElement); //input calcs can be run from group nodes if (currentElement.Name.LocalName != DataAppHelpers.Prices.INPUT_PRICE_TYPES.inputgroup.ToString()) { //set this object's specific properties this.Date = CalculatorHelpers.GetAttributeDate(currentElement, DataAppHelpers.Prices.INPUT_DATE); this.OCAmount = CalculatorHelpers.GetAttributeDouble(currentElement, DataAppHelpers.Prices.OC_AMOUNT); this.OCPrice = CalculatorHelpers.GetAttributeDouble(currentElement, DataAppHelpers.Prices.OC_PRICE); this.OCUnit = CalculatorHelpers.GetAttribute(currentElement, DataAppHelpers.Prices.OC_UNIT); this.AOHAmount = CalculatorHelpers.GetAttributeDouble(currentElement, DataAppHelpers.Prices.AOH_AMOUNT); this.AOHPrice = CalculatorHelpers.GetAttributeDouble(currentElement, DataAppHelpers.Prices.AOH_PRICE); this.AOHUnit = CalculatorHelpers.GetAttribute(currentElement, DataAppHelpers.Prices.AOH_UNIT); this.CAPAmount = CalculatorHelpers.GetAttributeDouble(currentElement, DataAppHelpers.Prices.CAP_AMOUNT); this.CAPPrice = CalculatorHelpers.GetAttributeDouble(currentElement, DataAppHelpers.Prices.CAP_PRICE); this.CAPUnit = CalculatorHelpers.GetAttribute(currentElement, DataAppHelpers.Prices.CAP_UNIT); this.IncentiveAmount = CalculatorHelpers.GetAttributeDouble(currentElement, DataAppHelpers.General.INCENTIVE_AMOUNT); this.IncentiveRate = CalculatorHelpers.GetAttributeDouble(currentElement, DataAppHelpers.General.INCENTIVE_RATE); this.InputGroupId = CalculatorHelpers.GetAttributeInt(currentElement, DataAppHelpers.Prices.INPUT_GROUP_ID); this.InputGroupName = CalculatorHelpers.GetAttribute(currentElement, DataAppHelpers.Prices.INPUT_GROUP_NAME); this.Times = CalculatorHelpers.GetAttributeDouble(currentElement, DataAppHelpers.Prices.INPUT_TIMES); this.UseAOH = CalculatorHelpers.GetAttributeBool(currentElement, DataAppHelpers.Prices.USE_AOH); this.Local = new Local(); string sCurrentNodeURIPattern = CalculatorHelpers.MakeNewURIPatternFromElement( calcParameters.ExtensionDocToCalcURI.URIPattern, currentElement); this.Local = CalculatorHelpers.GetLocal(sCurrentNodeURIPattern, calcParameters, currentCalculationsElement, currentElement); } else { //set this object's properties using calculator attributes this.Date = CalculatorHelpers.GetAttributeDate(currentCalculationsElement, INPUT_DATE); this.OCAmount = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, DataAppHelpers.Prices.OC_AMOUNT); this.OCPrice = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, DataAppHelpers.Prices.OC_PRICE); this.OCUnit = CalculatorHelpers.GetAttribute(currentCalculationsElement, DataAppHelpers.Prices.OC_UNIT); this.AOHAmount = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, DataAppHelpers.Prices.AOH_AMOUNT); this.AOHPrice = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, DataAppHelpers.Prices.AOH_PRICE); this.AOHUnit = CalculatorHelpers.GetAttribute(currentCalculationsElement, DataAppHelpers.Prices.AOH_UNIT); this.CAPAmount = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, DataAppHelpers.Prices.CAP_AMOUNT); this.CAPPrice = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, DataAppHelpers.Prices.CAP_PRICE); this.CAPUnit = CalculatorHelpers.GetAttribute(currentCalculationsElement, DataAppHelpers.Prices.CAP_UNIT); this.IncentiveAmount = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, DataAppHelpers.General.INCENTIVE_AMOUNT); this.IncentiveRate = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, DataAppHelpers.General.INCENTIVE_RATE); this.Times = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, DataAppHelpers.Prices.INPUT_TIMES); this.UseAOH = CalculatorHelpers.GetAttributeBool(currentCalculationsElement, DataAppHelpers.Prices.USE_AOH); //use the calculator params to set locals (they can be changed in calcor) this.Local = new Local(); this.Local.SetLocalProperties(calcParameters, currentCalculationsElement, currentElement); } //joint input calcs can change this element this.XmlDocElement = currentCalculationsElement; }