private void clean(String theParamName, List<List<? extends IQueryParameterType>> theAndOrParams) { for (int andListIdx = 0; andListIdx < theAndOrParams.size(); andListIdx++) { List<? extends IQueryParameterType> nextOrList = theAndOrParams.get(andListIdx); for (int orListIdx = 0; orListIdx < nextOrList.size(); orListIdx++) { IQueryParameterType nextOr = nextOrList.get(orListIdx); boolean hasNoValue = false; if (nextOr.getMissing() != null) { continue; } if (nextOr instanceof QuantityParam) { if (isBlank(((QuantityParam) nextOr).getValueAsString())) { hasNoValue = true; } } if (hasNoValue) { ourLog.debug("Ignoring empty parameter: {}", theParamName); nextOrList.remove(orListIdx); orListIdx--; } } if (nextOrList.isEmpty()) { theAndOrParams.remove(andListIdx); andListIdx--; } } }
@Override String doGetValueAsQueryToken(FhirContext theContext) { StringBuilder b = new StringBuilder(); if (getPrefix() != null) { b.append(ParameterUtil.escapeWithDefault(getPrefix().getValue())); } b.append(ParameterUtil.escapeWithDefault(getValueAsString())); b.append('|'); b.append(ParameterUtil.escapeWithDefault(mySystem)); b.append('|'); b.append(ParameterUtil.escapeWithDefault(myUnits)); return b.toString(); }
@Override String doGetValueAsQueryToken(FhirContext theContext) { StringBuilder b = new StringBuilder(); if (getPrefix() != null) { b.append(ParameterUtil.escapeWithDefault(getPrefix().getValue())); } b.append(ParameterUtil.escapeWithDefault(getValueAsString())); b.append('|'); b.append(ParameterUtil.escapeWithDefault(mySystem)); b.append('|'); b.append(ParameterUtil.escapeWithDefault(myUnits)); return b.toString(); }