public void SetLimFinTerms(bool _limitIsNetOfDed, Value _limit, bool _limIsPerRisk, TermValueType _limType) { LimitIsNetOfDed = _limitIsNetOfDed; Value = _limit; LimIsPerRisk = _limIsPerRisk; LimType = _limType; }
public Limit(bool _limitIsNetOfDed, Value _limit, bool _limIsPerRisk, TermValueType _limType) { LimitIsNetOfDed = _limitIsNetOfDed; Value = _limit; LimIsPerRisk = _limIsPerRisk; LimType = _limType; }
public void SetFinTerms(bool _dedIsFranchise, DedInteractionType _dedInterType, Value _deductible, bool _dedIsPerRisk, TermValueType _dedBaseType) { DedIsFranchise = _dedIsFranchise; Value = _deductible; DedInterType = _dedInterType; DedIsPerRisk = _dedIsPerRisk; DedType = _dedBaseType; }
public void SetFinTerms(string name, bool _attIsFranchise, Value _attPoint, Value _limit, PercentValue _proRata, bool _unlimited, TermValueType _valType) { CoverName = name; AttIsFranchise = _attIsFranchise; AttPoint = _attPoint; Limit = _limit; ProRata = _proRata; Unlimited = _unlimited; LimitValType = _valType; }
public Cover(string name, bool _attIsFranchise, Value _attPoint, Value _limit, PercentValue _proRata, bool _unlimited, TimeBasis _attachmentTimeBasis, TimeBasis _limitTimeBasis, TermValueType _valType) { CoverName = name; AttIsFranchise = _attIsFranchise; AttPoint = _attPoint; Limit = _limit; ProRata = _proRata; Unlimited = _unlimited; LimitTimeBasis = _limitTimeBasis; AttachmentTimeBasis = _attachmentTimeBasis; LimitValType = _valType; }
private static void GetInfoFromJSONCoverExp(object obj, out Value result, out TermValueType termValType) { Dictionary <string, object> expDict = obj as Dictionary <string, object>; if (expDict != null) { GetInfoFromJSONExp(expDict, out result, out termValType); } else { throw new JSONParseException("Term/Cover dictionary not in proper format"); } }
private static void GetInfoFromJSONTermExp(object obj, out Value result, out TermValueType termValType, out TimeBasis timeBasis) { Dictionary <string, object> expDict = obj as Dictionary <string, object>; if (expDict != null) { GetInfoFromJSONExp(expDict, out result, out termValType); timeBasis = (TimeBasis)Enum.Parse(typeof(TimeBasis), expDict["TimeBasis"].ToString()); } else { throw new JSONParseException("Term/Cover dictionary not in proper format"); } }
public void SetFinTerms(string name, bool _attIsFranchise, Value _attPoint, Value _limit, PercentValue _proRata, bool _unlimited, TermValueType _valType, uint _numofReinstatements, bool _unlimitedReinstatements) { CoverName = name; AttIsFranchise = _attIsFranchise; AttPoint = _attPoint; Limit = _limit; ProRata = _proRata; Unlimited = _unlimited; LimitValType = _valType; NumofReinstatements = _numofReinstatements; UnlimitedReinstatements = _unlimitedReinstatements; }
public static Cover GetCoverForTerm(Dictionary <string, object> coverDictionary) { int index = Convert.ToInt32(coverDictionary["Index"]); //bool franchise = Convert.ToBoolean(coverDictionary["IsFranchise"]); bool unlimited = false; bool franchise = false; if (coverDictionary.ContainsKey("isFranchise")) { franchise = true; } //if (!GetValueFromJSONExp(Convert.ToBoolean(coverDictionary["IsFranchise"]), out franchise)) // throw new InvalidOperationException("IsGranchise with index " + index.ToString() + " is not coded as monetary amount in CDL, cannot be supported at this time..."); TermValueType vType = TermValueType.Numeric; Value attpoint; Value limit = null; Value proRata; string name = coverDictionary["Label"].ToString(); if (coverDictionary.ContainsKey("AttachmentSpecification")) { GetInfoFromJSONCoverExp(coverDictionary["AttachmentSpecification"], out attpoint, out vType); } else { attpoint = new MonetaryValue(0); } if (coverDictionary.ContainsKey("LimitSpecification")) { GetInfoFromJSONCoverExp(coverDictionary["LimitSpecification"], out limit, out vType); } else { unlimited = true; }; if (coverDictionary.ContainsKey("Participation")) { GetInfoFromJSONCoverExp(coverDictionary["Participation"], out proRata, out vType); } else { proRata = new PercentValue(100); } TimeBasis attTimeBasis; TimeBasis limitTimeBasis; if (coverDictionary.ContainsKey("AttachmentTimeBasis")) { attTimeBasis = (TimeBasis)Enum.Parse(typeof(TimeBasis), coverDictionary["AttachmentTimeBasis"].ToString()); } else { attTimeBasis = TimeBasis.Occurrence; } if (coverDictionary.ContainsKey("LimitTimeBasis")) { limitTimeBasis = (TimeBasis)Enum.Parse(typeof(TimeBasis), coverDictionary["LimitTimeBasis"].ToString()); } else { limitTimeBasis = TimeBasis.Occurrence; } return(new Cover(name, franchise, attpoint, limit, (PercentValue)proRata, unlimited, attTimeBasis, limitTimeBasis, vType)); }
private static void GetInfoFromJSONExp(Dictionary <string, object> expDict, out Value result, out TermValueType termValType) { Value parsedValue = RecursiveParseJSONValue(expDict); if (parsedValue is FunctionValue) { FunctionValue function = parsedValue as FunctionValue; if (function.Function == FunctionType.RCV) { string RCVarg2 = (function.Arguments[1] as SymbolicValue).Symbol; if (RCVarg2 == "Covered") { termValType = TermValueType.PercentCovered; } else if (RCVarg2 == "Affected") { termValType = TermValueType.PercentAffected; } else { throw new JSONParseException("Cannot handle RCV with second argument: " + RCVarg2); } result = (PercentValue)function.Arguments[0]; } else if (function.Function == FunctionType.Subject) { termValType = TermValueType.PercentLoss; result = (PercentValue)function.Arguments[0]; } else if (function.Function == FunctionType.Min || function.Function == FunctionType.Sum || function.Function == FunctionType.Max) { termValType = TermValueType.PayFunction; result = function; } else { throw new JSONParseException("Cannot currently process functions of type: " + function.Function.ToString()); } } else { termValType = TermValueType.Numeric; result = parsedValue; } }
private static void GetInfoFromJSONExp(Dictionary <string, object> expDict, out Value result, out TermValueType termValType) { Value parsedValue = RecursiveParseJSONValue(expDict); if (parsedValue is FunctionValue) { FunctionValue function = parsedValue as FunctionValue; if (function.Function == FunctionType.RCV) { string RCVarg2 = (function.Arguments[1] as SymbolicValue).Symbol; if (RCVarg2 == "Covered") { termValType = TermValueType.PercentCovered; } else if (RCVarg2 == "Affected") { termValType = TermValueType.PercentAffected; } else { throw new JSONParseException("Cannot handle RCV with second argument: " + RCVarg2); } result = (PercentValue)function.Arguments[0]; } else if (function.Function == FunctionType.Subject) { termValType = TermValueType.PercentLoss; result = (PercentValue)function.Arguments[0]; } else if (function.Function == FunctionType.Min || function.Function == FunctionType.Sum || function.Function == FunctionType.Max || function.Function == FunctionType.Constant) { termValType = TermValueType.PayFunction; result = function; } else if (function.Function == FunctionType.WaitingPeriod) { if (function.Arguments[1].ToString() == "Days") { termValType = TermValueType.PercentCovered; result = new PercentValue(function.Arguments[0].Amount / 365 * 100); } else { throw new NotSupportedException("Cannot handle BI waiting period that is not specified as days..."); } } else { throw new JSONParseException("Cannot currently process functions of type: " + function.Function.ToString()); } } else { termValType = TermValueType.Numeric; result = parsedValue; } }