fix decimal conversion

This commit is contained in:
Grahame Grieve 2019-01-18 04:54:41 +11:00
parent 1cf5093ff7
commit 8d747a9d2c
1 changed files with 2 additions and 0 deletions

View File

@ -326,6 +326,8 @@ private Map<String, Object> 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");
}