use of org.hl7.fhir.r4.model.RiskAssessment in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeRiskAssessment.
protected void composeRiskAssessment(Complex parent, String parentType, String name, RiskAssessment element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeDomainResource(t, "RiskAssessment", name, element, index);
if (element.hasSubject())
composeReference(t, "RiskAssessment", "subject", element.getSubject(), -1);
if (element.hasDateElement())
composeDateTime(t, "RiskAssessment", "date", element.getDateElement(), -1);
if (element.hasCondition())
composeReference(t, "RiskAssessment", "condition", element.getCondition(), -1);
if (element.hasEncounter())
composeReference(t, "RiskAssessment", "encounter", element.getEncounter(), -1);
if (element.hasPerformer())
composeReference(t, "RiskAssessment", "performer", element.getPerformer(), -1);
if (element.hasIdentifier())
composeIdentifier(t, "RiskAssessment", "identifier", element.getIdentifier(), -1);
if (element.hasMethod())
composeCodeableConcept(t, "RiskAssessment", "method", element.getMethod(), -1);
for (int i = 0; i < element.getBasis().size(); i++) composeReference(t, "RiskAssessment", "basis", element.getBasis().get(i), i);
for (int i = 0; i < element.getPrediction().size(); i++) composeRiskAssessmentRiskAssessmentPredictionComponent(t, "RiskAssessment", "prediction", element.getPrediction().get(i), i);
if (element.hasMitigationElement())
composeString(t, "RiskAssessment", "mitigation", element.getMitigationElement(), -1);
}
use of org.hl7.fhir.r4.model.RiskAssessment in project org.hl7.fhir.core by hapifhir.
the class FluentPathTests method testDecimalRA.
@Test
public void testDecimalRA() throws FileNotFoundException, IOException, FHIRException {
RiskAssessment r = new RiskAssessment();
SimpleQuantity sq = new SimpleQuantity();
sq.setValue(0.2);
sq.setUnit("%");
sq.setCode("%");
sq.setSystem("http://unitsofmeasure.org");
SimpleQuantity sq1 = new SimpleQuantity();
sq1.setValue(0.4);
sq1.setUnit("%");
sq1.setCode("%");
sq1.setSystem("http://unitsofmeasure.org");
r.addPrediction().setProbability(new Range().setLow(sq).setHigh(sq1));
testBoolean(r, r.getPrediction().get(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().get(0), "RiskAssessment.prediction", "probability is decimal implies probability.as(decimal) <= 100", true);
r.getPrediction().get(0).setProbability(new DecimalType(80));
testBoolean(r, r.getPrediction().get(0), "RiskAssessment.prediction", "probability.as(decimal) <= 100", true);
}
use of org.hl7.fhir.r4.model.RiskAssessment in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeRiskAssessmentRiskAssessmentPredictionComponent.
protected void composeRiskAssessmentRiskAssessmentPredictionComponent(Complex parent, String parentType, String name, RiskAssessment.RiskAssessmentPredictionComponent element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeBackboneElement(t, "prediction", name, element, index);
if (element.hasOutcome())
composeCodeableConcept(t, "RiskAssessment", "outcome", element.getOutcome(), -1);
if (element.hasProbability())
composeType(t, "RiskAssessment", "probability", element.getProbability(), -1);
if (element.hasQualitativeRisk())
composeCodeableConcept(t, "RiskAssessment", "qualitativeRisk", element.getQualitativeRisk(), -1);
if (element.hasRelativeRiskElement())
composeDecimal(t, "RiskAssessment", "relativeRisk", element.getRelativeRiskElement(), -1);
if (element.hasWhen())
composeType(t, "RiskAssessment", "when", element.getWhen(), -1);
if (element.hasRationaleElement())
composeString(t, "RiskAssessment", "rationale", element.getRationaleElement(), -1);
}
Aggregations