Enum Class Equivalence

java.lang.Object
java.lang.Enum<Equivalence>
org.openehealth.ipf.commons.map.Equivalence
All Implemented Interfaces:
Serializable, Comparable<Equivalence>, Constable

public enum Equivalence extends Enum<Equivalence>
Degree of correspondence between the key and the value of a mapping Entry.

The vocabulary and its direction are those of FHIR R4 ConceptMap (element.target.equivalence): the relation is read from the value (the target) to the key (the source). WIDER means that the value is the wider concept, as other is wider than A (adoption). R4's subsumes and specializes fold onto WIDER and NARROWER.

Its purpose here is to state which entries may be used to build the reverse index of a Mapping: only entries that assert an EQUAL or EQUIVALENT correspondence are invertible. A key whose value is WIDER does not become the canonical inverse of that value, which is what makes reverse-direction collisions detectable instead of silent.

Since:
6.0
  • Enum Constant Details

    • EQUAL

      public static final Equivalence EQUAL
      The key and the value are the same concept.
    • EQUIVALENT

      public static final Equivalence EQUIVALENT
      The key and the value are different concepts with the same meaning.
    • WIDER

      public static final Equivalence WIDER
      The value is a wider concept than the key.
    • NARROWER

      public static final Equivalence NARROWER
      The value is a narrower concept than the key.
    • INEXACT

      public static final Equivalence INEXACT
      The key and the value overlap, but neither subsumes the other.
    • DISJOINT

      public static final Equivalence DISJOINT
      The key and the value are explicitly not equivalent.
  • Method Details

    • values

      public static Equivalence[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Equivalence valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • isInvertible

      public boolean isInvertible()
      Returns:
      whether an entry with this equivalence may contribute to the reverse index
    • isTranslation

      public boolean isTranslation()
      Whether an entry with this equivalence is a translation at all, i.e. whether looking up its key should answer with its value. Everything but DISJOINT is: a value that is wider, narrower or only inexactly related to its key is still a translation of it, if an imprecise one. DISJOINT asserts the opposite - that the two are explicitly not equivalent - so answering with its value would state the reverse of what the mapping says.

      FHIR draws the same line: the result of a $translate "can only be true if at least one returned match has an equivalence which is not unmatched or disjoint".

      Returns:
      whether a lookup of this entry's key answers with its value