From 8d747a9d2c1c5216dfce0fb49dc669ac5941fa34 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Fri, 18 Jan 2019 04:54:41 +1100 Subject: [PATCH] fix decimal conversion --- org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/model/Base.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/model/Base.java b/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/model/Base.java index c23f75996..b2b4e4ec4 100644 --- a/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/model/Base.java +++ b/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/model/Base.java @@ -326,6 +326,8 @@ private Map userData; public DecimalType castToDecimal(Base b) throws FHIRException { if (b instanceof DecimalType) return (DecimalType) b; + else if (b.hasPrimitiveValue()) + return new DecimalType(b.primitiveValue()); else throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Decimal"); }