private static DecimalDt getDecimalFromMetadataOrNullIfNone(Map<ResourceMetadataKeyEnum<?>, Object> theResourceMetadata, ResourceMetadataKeyEnum<DecimalDt> theKey) { Object retValObj = theResourceMetadata.get(theKey); if (retValObj == null) { return null; } else if (retValObj instanceof DecimalDt) { if (((DecimalDt) retValObj).isEmpty()) { return null; } return (DecimalDt) retValObj; } else if (retValObj instanceof String) { if (StringUtils.isBlank((String) retValObj)) { return null; } return new DecimalDt((String) retValObj); } else if (retValObj instanceof Double) { return new DecimalDt((Double) retValObj); } throw new InternalErrorException("Found an object of type '" + retValObj.getClass().getCanonicalName() + "' in resource metadata for key " + theKey.name() + " - Expected " + InstantDt.class.getCanonicalName()); }
@Override public String getValueAsQueryToken(FhirContext theContext) { StringBuilder b= new StringBuilder(); if (getComparatorElement() != null) { b.append(getComparatorElement().getValue()); } if (!getValueElement().isEmpty()) { b.append(getValueElement().getValueAsString()); } b.append('|'); if (!getSystemElement().isEmpty()) { b.append(getSystemElement().getValueAsString()); } b.append('|'); if (!getUnitsElement().isEmpty()) { b.append(getUnitsElement().getValueAsString()); } return b.toString(); }
if (nextValue.getValueElement().isEmpty()) { continue;
private static DecimalDt getDecimalFromMetadataOrNullIfNone(Map<ResourceMetadataKeyEnum<?>, Object> theResourceMetadata, ResourceMetadataKeyEnum<DecimalDt> theKey) { Object retValObj = theResourceMetadata.get(theKey); if (retValObj == null) { return null; } else if (retValObj instanceof DecimalDt) { if (((DecimalDt) retValObj).isEmpty()) { return null; } return (DecimalDt) retValObj; } else if (retValObj instanceof String) { if (StringUtils.isBlank((String) retValObj)) { return null; } return new DecimalDt((String) retValObj); } else if (retValObj instanceof Double) { return new DecimalDt((Double) retValObj); } throw new InternalErrorException("Found an object of type '" + retValObj.getClass().getCanonicalName() + "' in resource metadata for key " + theKey.name() + " - Expected " + InstantDt.class.getCanonicalName()); }
@Override public String getValueAsQueryToken(FhirContext theContext) { StringBuilder b= new StringBuilder(); if (getComparatorElement() != null) { b.append(getComparatorElement().getValue()); } if (!getValueElement().isEmpty()) { b.append(getValueElement().getValueAsString()); } b.append('|'); if (!getSystemElement().isEmpty()) { b.append(getSystemElement().getValueAsString()); } b.append('|'); if (!getUnitsElement().isEmpty()) { b.append(getUnitsElement().getValueAsString()); } return b.toString(); }