001package org.hl7.fhir.r5.utils.validation.constants;
002
003import org.hl7.fhir.utilities.MarkedToMoveToAdjunctPackage;
004
005/**
006 * whether to validate a reference, if the reference is resolvable (for external links, that there is some way to try resolving it)
007 */
008@MarkedToMoveToAdjunctPackage
009public enum ReferenceValidationPolicy {
010  IGNORE,  // don't validate anything about the reference 
011  CHECK_TYPE_IF_EXISTS, // if the reference can be resolved, check that the type of the target is correct
012  CHECK_EXISTS, // check that the reference can be resolved, but don't check anything else
013  CHECK_EXISTS_AND_TYPE, // check that the reference be resolved, and check that the type of the target is correct
014  CHECK_VALID; // check the the reference can be resolved, and then check that it conforms to applicable profiles etc
015
016  public boolean ignore() {
017    return this == IGNORE;
018  }
019
020  public boolean checkExists() {
021    return this == CHECK_EXISTS_AND_TYPE || this == CHECK_EXISTS || this == CHECK_VALID || this == CHECK_TYPE_IF_EXISTS;
022  }
023
024  public boolean checkType() {
025    return this == CHECK_TYPE_IF_EXISTS || this == CHECK_EXISTS_AND_TYPE || this == CHECK_VALID;
026  }
027
028  public boolean checkValid() {
029    return this == CHECK_VALID;
030  }
031}