/** * Returns true if <code>this</code> Coding has the same {@link #getCodeElement() Code} and {@link #getSystemElement() system} (as compared by simple equals comparison). Does not compare other * Codes (e.g. getUseElement()) or any extensions. */ public boolean matchesSystemAndCode(BaseCodingDt theCoding) { if (theCoding == null) { return false; } return getCodeElement().equals(theCoding.getCodeElement()) && getSystemElement().equals(theCoding.getSystemElement()); }
@Override public boolean isEmpty() { return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( mySystem, myVersion, myCode, myDisplay, myUserSelected); }
/** * returns true if <code>this</code> Coding matches a search for the coding specified by <code>theSearchParam</code>, according * to the following: * <ul> * <li>[parameter]=[namespace]|[code] matches a code/value in the given system namespace</li> * <li>[parameter]=[code] matches a code/value irrespective of it's system namespace</li> * <li>[parameter]=|[code] matches a code/value that has no system namespace</li> * </ul> * @param theSearchParam - coding to test <code>this</code> against * @return true if the coding matches, false otherwise */ public boolean matchesToken(BaseCodingDt theSearchParam) { if (theSearchParam.isSystemPresent()) { if (theSearchParam.isSystemBlank()) { // [parameter]=|[code] matches a code/value that has no system namespace if (isSystemPresent() && !isSystemBlank()) return false; } else { // [parameter]=[namespace]|[code] matches a code/value in the given system namespace if (!isSystemPresent()) return false; if (!getSystemElement().equals(theSearchParam.getSystemElement())) return false; } } else { // [parameter]=[code] matches a code/value irrespective of it's system namespace // (nothing to do for system for this case) } return getCodeElement().equals(theSearchParam.getCodeElement()); }
private boolean isSystemBlank() { return isSystemPresent() && getSystemElement().getValueAsString().equals(""); }
if (securityLabels != null) { for (BaseCodingDt next : securityLabels) { TagDefinition def = getTagOrNull(TagTypeEnum.SECURITY_LABEL, next.getSystemElement().getValue(), next.getCodeElement().getValue(), next.getDisplayElement().getValue()); if (def != null) { ResourceTag tag = theEntity.addTag(def);
private boolean isSystemPresent() { return !getSystemElement().isEmpty(); }
@Override public List<? extends IBaseCoding> getSecurity() { ArrayList<CodingDt> retVal = new ArrayList<CodingDt>(); List<BaseCodingDt> labelsList = ResourceMetadataKeyEnum.SECURITY_LABELS.get(BaseResource.this); if (labelsList == null) { return Collections.emptyList(); } for (BaseCodingDt next : labelsList) { retVal.add(new CodingDt(next.getSystemElement().getValue(), next.getCodeElement().getValue()).setDisplay(next.getDisplayElement().getValue())); } return Collections.unmodifiableList(retVal); }
private boolean isSystemBlank() { return isSystemPresent() && getSystemElement().getValueAsString().equals(""); }
private boolean isSystemPresent() { return !getSystemElement().isEmpty(); }
/** * 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()); }
if (securityLabels != null) { for (BaseCodingDt next : securityLabels) { TagDefinition def = getTagOrNull(TagTypeEnum.SECURITY_LABEL, next.getSystemElement().getValue(), next.getCodeElement().getValue(), next.getDisplayElement().getValue()); if (def != null) { ResourceTag tag = theEntity.addTag(def);
/** * returns true if <code>this</code> Coding matches a search for the coding specified by <code>theSearchParam</code>, according * to the following: * <ul> * <li>[parameter]=[namespace]|[code] matches a code/value in the given system namespace</li> * <li>[parameter]=[code] matches a code/value irrespective of it's system namespace</li> * <li>[parameter]=|[code] matches a code/value that has no system namespace</li> * </ul> * @param theSearchParam - coding to test <code>this</code> against * @return true if the coding matches, false otherwise */ public boolean matchesToken(BaseCodingDt theSearchParam) { if (theSearchParam.isSystemPresent()) { if (theSearchParam.isSystemBlank()) { // [parameter]=|[code] matches a code/value that has no system namespace if (isSystemPresent() && !isSystemBlank()) return false; } else { // [parameter]=[namespace]|[code] matches a code/value in the given system namespace if (!isSystemPresent()) return false; if (!getSystemElement().equals(theSearchParam.getSystemElement())) return false; } } else { // [parameter]=[code] matches a code/value irrespective of it's system namespace // (nothing to do for system for this case) } return getCodeElement().equals(theSearchParam.getCodeElement()); }
@Override public boolean isEmpty() { return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( mySystem, myVersion, myCode, myDisplay, myUserSelected); }
/** * 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()); }
coding.setSystem(auditableResource.getSensitivity().getSystemElement().getValue()); coding.setCode(auditableResource.getSensitivity().getCodeElement().getValue()); coding.setDisplay(auditableResource.getSensitivity().getDisplayElement().getValue());
@Override public boolean isEmpty() { return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(mySystem, myVersion, myCode, myDisplay, myPrimary); }
/** * Constructor which copies the {@link InternalCodingDt#getSystemElement() system} and * {@link InternalCodingDt#getCodeElement() code} from a {@link InternalCodingDt} instance and adds it as a parameter * * @param theCodingDt The coding */ public TokenParam(BaseCodingDt theCodingDt) { this(toSystemValue(theCodingDt.getSystemElement()), theCodingDt.getCodeElement().getValue()); }
@Override public boolean isEmpty() { return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( mySystem, myVersion, myCode, myDisplay, myUserSelected); }
/** * {@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()); }
@Override public boolean isEmpty() { return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(mySystem, myVersion, myCode, myDisplay, myPrimary); }