private static String toSystemValue(UriDt theSystem) { return theSystem.getValueAsString(); }
private static String toSystemValue(UriDt theSystem) { return theSystem.getValueAsString(); }
/** * Compares the given string to the string representation of this URI. In many cases it is preferable to use this * instead of the standard {@link #equals(Object)} method, since that method returns <code>false</code> unless it is * passed an instance of {@link UriDt} */ public boolean equals(String theString) { return StringUtils.equals(getValueAsString(), theString); }
/** * Creates an ID based on a given URL */ public IdDt(UriDt theUrl) { setValue(theUrl.getValueAsString()); }
private boolean isSystemBlank() { return isSystemPresent() && getSystemElement().getValueAsString().equals(""); }
/** * {@inheritDoc} */ @Override public String getValueAsQueryToken(FhirContext theContext) { UriDt system = getSystemElement(); StringDt value = getValueElement(); if (system.getValueAsString() != null) { return ParameterUtil.escape(StringUtils.defaultString(system.getValueAsString())) + '|' + ParameterUtil.escape(value.getValueAsString()); } return ParameterUtil.escape(value.getValueAsString()); }
@Override public IBaseResource read(UriDt theUrl) { IdDt id = new IdDt(theUrl); String resourceType = id.getResourceType(); if (isBlank(resourceType)) { throw new IllegalArgumentException(myContext.getLocalizer().getMessage(I18N_INCOMPLETE_URI_FOR_READ, theUrl.getValueAsString())); } RuntimeResourceDefinition def = myContext.getResourceDefinition(resourceType); if (def == null) { throw new IllegalArgumentException(myContext.getLocalizer().getMessage(I18N_CANNOT_DETEMINE_RESOURCE_TYPE, theUrl.getValueAsString())); } return read(def.getImplementingClass(), id); }
/** * Copy constructor: Creates a new Coding with the system and code copied out of the given coding */ public CodingDt(BaseCodingDt theCoding) { this(theCoding.getSystemElement().getValueAsString(), theCoding.getCodeElement().getValue()); }
/** * Copy constructor: Creates a new Coding with the system and code copied out of the given coding */ public CodingDt(BaseCodingDt theCoding) { this(theCoding.getSystemElement().getValueAsString(), theCoding.getCodeElement().getValue()); }
public TokenCriterion(String theParamName, List<BaseIdentifierDt> theValue) { myName=theParamName; StringBuilder b = new StringBuilder(); for (BaseIdentifierDt next : theValue) { if (next.getSystemElement().isEmpty() && next.getValueElement().isEmpty()) { continue; } if (b.length() > 0) { b.append(','); } b.append(toValue(next.getSystemElement().getValueAsString(), next.getValueElement().getValue())); } myValue = b.toString(); }
/** * Loops through the {@link #getCoding() codings} in this codeable concept * and returns the first bound enumerated type that matches. <b>Use * caution</b> using this method, see the return description for more * information. * * @return Returns the bound enumerated type, or <code>null</code> if none * are found. Note that a null return value doesn't neccesarily * imply that this Codeable Concept has no codes, only that it has * no codes that match the enum. */ public Set<T> getValueAsEnum() { Validate.notNull(myBinder, "This object does not have a binder. Constructor BoundCodeableConceptDt() should not be called!"); Set<T> retVal = new HashSet<T>(); for (CodingDt next : getCoding()) { if (next == null) { continue; } T nextT = myBinder.fromCodeString(defaultString(next.getCodeElement().getValue()), defaultString(next.getSystemElement().getValueAsString())); if (nextT != null) { retVal.add(nextT); } else { // TODO: throw special exception type? } } return retVal; }
/** * {@inheritDoc} */ @Override public String getValueAsQueryToken(FhirContext theContext) { if (getSystemElement().getValueAsString() != null) { return ParameterUtil.escape(StringUtils.defaultString(getSystemElement().getValueAsString())) + '|' + ParameterUtil.escape(getCodeElement().getValueAsString()); } return ParameterUtil.escape(getCodeElement().getValueAsString()); }
private void extractTokensFromCoding(List<String> theSystems, List<String> theCodes, ResourceTable theEntity, Set<BaseResourceIndexedSearchParam> theListToPopulate, RuntimeSearchParam theParameterDef, CodingDt nextCoding) { if (nextCoding != null && !nextCoding.isEmpty()) { String nextSystem = nextCoding.getSystemElement().getValueAsString(); String nextCode = nextCoding.getCodeElement().getValue(); if (isNotBlank(nextSystem) || isNotBlank(nextCode)) { theSystems.add(nextSystem); theCodes.add(nextCode); } if (!nextCoding.getDisplayElement().isEmpty()) { addStringParam(theEntity, theListToPopulate, theParameterDef, nextCoding.getDisplayElement().getValue()); } } }
@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(); }
@Override public ICriterion<TokenClientParam> identifier(BaseIdentifierDt theIdentifier) { return new TokenCriterion(getParamName(), theIdentifier.getSystemElement().getValueAsString(), theIdentifier.getValueElement().getValue()); }
continue; String system = StringUtils.defaultIfBlank(nextValue.getSystemElement().getValueAsString(), null); String value = nextValue.getValueElement().getValue(); if (isNotBlank(value)) {
String system = define.getSystemElement().getValueAsString(); for (CodeSystemConcept nextConcept : define.getConcept()) { addDefinedConcept(vs, system, nextConcept); String system = nextInclude.getSystemElement().getValueAsString(); for (ComposeIncludeConcept nextConcept : nextInclude.getConcept()) { String nextCodeValue = nextConcept.getCode();
ResourceIndexedSearchParamQuantity nextEntity = new ResourceIndexedSearchParamQuantity(resourceName, nextValue.getValueElement().getValue(), nextValue.getSystemElement().getValueAsString(), nextValue.getCode()); nextEntity.setResource(theEntity); retVal.add(nextEntity);
} else if (theParameter instanceof BaseIdentifierDt) { BaseIdentifierDt id = (BaseIdentifierDt) theParameter; system = id.getSystemElement().getValueAsString(); code = (id.getValueElement().getValue()); } else if (theParameter instanceof BaseCodingDt) { BaseCodingDt id = (BaseCodingDt) theParameter; system = id.getSystemElement().getValueAsString(); code = (id.getCodeElement().getValue()); } else if (theParameter instanceof NumberParam) {
systemValue = param.getSystemElement().getValueAsString(); unitsValue = param.getUnitsElement().getValueAsString(); cmpValue = ParamPrefixEnum.forValue(param.getComparatorElement().getValueAsString());