public void testDecimalRA() { Model.RiskAssessment r = new Model.RiskAssessment(); Model.SimpleQuantity sq = new Model.SimpleQuantity(); sq.setValue(0.2); sq.setUnit("%"); sq.setCode("%"); sq.setSystem("http://unitsofmeasure.org"); Model.SimpleQuantity sq1 = new Model.SimpleQuantity(); sq1.setValue(0.4); sq1.setUnit("%"); sq1.setCode("%"); sq1.setSystem("http://unitsofmeasure.org"); r.addPrediction().setProbability(new Model.Range().setLow(sq).setHigh(sq1)); testBoolean(r, r.getPrediction()[0].getProbability(), "RiskAssessment.prediction.probabilityRange", "(low.empty() or ((low.code = '%') and (low.system = %ucum))) and (high.empty() or ((high.code = '%') and (high.system = %ucum)))", true); testBoolean(r, r.getPrediction()[0], "RiskAssessment.prediction", "probability is decimal implies probability.as(decimal) <= 100", true); r.getPrediction()[0].setProbability(new DecimalType(80)); testBoolean(r, r.getPrediction()[0], "RiskAssessment.prediction", "probability.as(decimal) <= 100", true); }
public static Model.Range setHigh(this Model.Range me, Model.SimpleQuantity value) { me.High = value; return(me); }
public static Model.Range setLow(this Model.Range me, Model.SimpleQuantity value) { me.Low = value; return(me); }