//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); }
//attname and attvalue generally passed in from a reader public virtual void SetHealthBenefit1Properties(string attName, string attValue) { if (Demographics == null) { Demographics = new Demog1(); } Demographics.SetDemog1Properties(attName, attValue); switch (attName) { case cOutputCost: this.OutputCost = CalculatorHelpers.ConvertStringToDouble(attValue); break; case cBenefitAdjustment: this.BenefitAdjustment = CalculatorHelpers.ConvertStringToDouble(attValue); break; case cAdjustedBenefit: this.AdjustedBenefit = CalculatorHelpers.ConvertStringToDouble(attValue); break; case cOutputEffect1Name: this.OutputEffect1Name = attValue; break; case cOutputEffect1Unit: this.OutputEffect1Unit = attValue; break; case cOutputEffect1Amount: this.OutputEffect1Amount = CalculatorHelpers.ConvertStringToDouble(attValue); break; case cOutputEffect1Price: this.OutputEffect1Price = CalculatorHelpers.ConvertStringToDouble(attValue); break; case cOutputEffect1Cost: this.OutputEffect1Cost = CalculatorHelpers.ConvertStringToDouble(attValue); break; case cAverageBenefitRating: this.AverageBenefitRating = CalculatorHelpers.ConvertStringToDouble(attValue); break; case cPhysicalHealthRating: this.PhysicalHealthRating = CalculatorHelpers.ConvertStringToInt(attValue); break; case cEmotionalHealthRating: this.EmotionalHealthRating = CalculatorHelpers.ConvertStringToInt(attValue); break; case cSocialHealthRating: this.SocialHealthRating = CalculatorHelpers.ConvertStringToInt(attValue); break; case cEconomicHealthRating: this.EconomicHealthRating = CalculatorHelpers.ConvertStringToInt(attValue); break; case cHealthCareDeliveryRating: this.HealthCareDeliveryRating = CalculatorHelpers.ConvertStringToInt(attValue); break; case cBeforeQOLRating: this.BeforeQOLRating = CalculatorHelpers.ConvertStringToInt(attValue); break; case cAfterQOLRating: this.AfterQOLRating = CalculatorHelpers.ConvertStringToInt(attValue); break; case cBeforeYears: this.BeforeYears = CalculatorHelpers.ConvertStringToDouble(attValue); break; case cAfterYears: this.AfterYears = CalculatorHelpers.ConvertStringToDouble(attValue); break; case cAfterYearsProb: this.AfterYearsProb = CalculatorHelpers.ConvertStringToDouble(attValue); break; case cTimeTradeoffYears: this.TimeTradeoffYears = CalculatorHelpers.ConvertStringToDouble(attValue); break; case cEquityMultiplier: this.EquityMultiplier = CalculatorHelpers.ConvertStringToDouble(attValue); break; case cBenefitAssessment: this.BenefitAssessment = attValue; break; case cQALY: this.QALY = CalculatorHelpers.ConvertStringToDouble(attValue); break; case cICERQALY: this.ICERQALY = CalculatorHelpers.ConvertStringToDouble(attValue); break; case cTTOQALY: this.TTOQALY = CalculatorHelpers.ConvertStringToDouble(attValue); break; case cWillDoSurvey: this.WillDoSurvey = CalculatorHelpers.ConvertStringToBool(attValue); break; default: break; } }