/** * This setting may be used to advise the server that any references found in * resources that have any of the base URLs given here will be treated as logical * references instead of being treated as real references. * <p> * A logical reference is a reference which is treated as an identifier, and * does not neccesarily resolve. See <a href="http://hl7.org/fhir/references.html">references</a> for * a description of logical references. For example, the valueset * <a href="http://hl7.org/fhir/valueset-quantity-comparator.html">valueset-quantity-comparator</a> is a logical * reference. * </p> * <p> * Values for this field may take either of the following forms: * </p> * <ul> * <li><code>http://example.com/some-url</code> <b>(will be matched exactly)</b></li> * <li><code>http://example.com/some-base*</code> <b>(will match anything beginning with the part before the *)</b></li> * </ul> * * @see ModelConfig#DEFAULT_LOGICAL_BASE_URLS Default values for this property */ public Set<String> getTreatReferencesAsLogical() { return myModelConfig.getTreatReferencesAsLogical(); }
public static boolean isLogicalReference(ModelConfig myConfig, IIdType theId) { Set<String> treatReferencesAsLogical = myConfig.getTreatReferencesAsLogical(); if (treatReferencesAsLogical != null) { for (String nextLogicalRef : treatReferencesAsLogical) { nextLogicalRef = trim(nextLogicalRef); if (nextLogicalRef.charAt(nextLogicalRef.length() - 1) == '*') { if (theId.getValue().startsWith(nextLogicalRef.substring(0, nextLogicalRef.length() - 1))) { return true; } } else { if (theId.getValue().equals(nextLogicalRef)) { return true; } } } } return false; }
/** * This setting may be used to advise the server that any references found in * resources that have any of the base URLs given here will be treated as logical * references instead of being treated as real references. * <p> * A logical reference is a reference which is treated as an identifier, and * does not neccesarily resolve. See <a href="http://hl7.org/fhir/references.html">references</a> for * a description of logical references. For example, the valueset * <a href="http://hl7.org/fhir/valueset-quantity-comparator.html">valueset-quantity-comparator</a> is a logical * reference. * </p> * <p> * Values for this field may take either of the following forms: * </p> * <ul> * <li><code>http://example.com/some-url</code> <b>(will be matched exactly)</b></li> * <li><code>http://example.com/some-base*</code> <b>(will match anything beginning with the part before the *)</b></li> * </ul> * * @see ModelConfig#DEFAULT_LOGICAL_BASE_URLS Default values for this property */ public Set<String> getTreatReferencesAsLogical() { return myModelConfig.getTreatReferencesAsLogical(); }