@Override String doGetValueAsQueryToken(FhirContext theContext) { StringBuilder b = new StringBuilder(); if (getPrefix() != null) { b.append(ParameterUtil.escapeWithDefault(getPrefix().getValue())); } if (myValue != null) { b.append(ParameterUtil.escapeWithDefault(myValue.getValueAsString())); } return b.toString(); }
/** * Accepts values with or without a prefix (e.g. <code>gt2011-01-01</code> and <code>2011-01-01</code>). * If no prefix is provided in the given value, the {@link #getPrefix() existing prefix} is preserved */ public void setValueAsString(String theDate) { if (isNotBlank(theDate)) { ParamPrefixEnum existingPrefix = getPrefix(); myValue.setValueAsString(super.extractPrefixAndReturnRest(theDate)); if (getPrefix() == null) { setPrefix(existingPrefix); } } else { myValue.setValue(null); } }
/** * Accepts values with or without a prefix (e.g. <code>gt2011-01-01</code> and <code>2011-01-01</code>). * If no prefix is provided in the given value, the {@link #getPrefix() existing prefix} is preserved */ public void setValueAsString(String theDate) { if (isNotBlank(theDate)) { ParamPrefixEnum existingPrefix = getPrefix(); myValue.setValueAsString(super.extractPrefixAndReturnRest(theDate)); if (getPrefix() == null) { setPrefix(existingPrefix); } } else { myValue.setValue(null); } }
/** * Sets the value of the param to the given date (sets to the {@link TemporalPrecisionEnum#MILLI millisecond} * precision, and will be encoded using the system local time zone). */ public DateParam setValue(Date theValue) { myValue.setValue(theValue, TemporalPrecisionEnum.MILLI); return this; }
public InstantDt getValueAsInstantDt() { if (myValue == null) { return null; } return new InstantDt(myValue.getValue()); }
public DateTimeDt getValueAsDateTimeDt() { if (myValue == null) { return null; } return new DateTimeDt(myValue.getValue()); }
public Date getValue() { if (myValue != null) { return myValue.getValue(); } return null; }
/** * Sets the value using a FHIR Date type, such as a {@link DateDt}, or a DateTimeType. */ public void setValue(IPrimitiveType<Date> theValue) { if (theValue != null) { myValue.setValueAsString(theValue.getValueAsString()); } else { myValue.setValue(null); } }
public TemporalPrecisionEnum getPrecision() { if (myValue != null) { return myValue.getPrecision(); } return null; }
public String getValueAsString() { if (myValue != null) { return myValue.getValueAsString(); } return null; }
/** * Constructor */ public DateParam(ParamPrefixEnum thePrefix, IPrimitiveType<Date> theDate) { setPrefix(thePrefix); myValue.setValueAsString(theDate != null ? theDate.getValueAsString() : null); }
/** * Returns <code>true</code> if no date/time is specified. Note that this method does not check the comparator, so a * QualifiedDateParam with only a comparator and no date/time is considered empty. */ public boolean isEmpty() { return myValue.isEmpty(); }
/** * Constructor */ public DateParam(ParamPrefixEnum thePrefix, DateTimeDt theDate) { setPrefix(thePrefix); myValue.setValueAsString(theDate != null ? theDate.getValueAsString() : null); }
/** * Sets the value of the param to the given date (sets to the {@link TemporalPrecisionEnum#MILLI millisecond} * precision, and will be encoded using the system local time zone). */ public DateParam setValue(Date theValue) { myValue.setValue(theValue, TemporalPrecisionEnum.MILLI); return this; }
/** * Returns <code>true</code> if no date/time is specified. Note that this method does not check the comparator, so a * QualifiedDateParam with only a comparator and no date/time is considered empty. */ public boolean isEmpty() { return myValue.isEmpty(); }
@Override String doGetValueAsQueryToken(FhirContext theContext) { StringBuilder b = new StringBuilder(); if (getPrefix() != null) { b.append(ParameterUtil.escapeWithDefault(getPrefix().getValue())); } if (myValue != null) { b.append(ParameterUtil.escapeWithDefault(myValue.getValueAsString())); } return b.toString(); }
/** * Constructor */ public DateParam(ParamPrefixEnum thePrefix, IPrimitiveType<Date> theDate) { setPrefix(thePrefix); myValue.setValueAsString(theDate != null ? theDate.getValueAsString() : null); }
public Date getValue() { if (myValue != null) { return myValue.getValue(); } return null; }
public TemporalPrecisionEnum getPrecision() { if (myValue != null) { return myValue.getPrecision(); } return null; }
public DateTimeDt getValueAsDateTimeDt() { if (myValue == null) { return null; } return new DateTimeDt(myValue.getValue()); }