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"); }