Class Base

java.lang.Object
org.hl7.fhir.r5.model.Base
All Implemented Interfaces:
ca.uhn.fhir.model.api.IElement, Serializable, org.hl7.fhir.instance.model.api.IBase
Direct Known Subclasses:
BaseResource, Element, Element, FHIRPathUtilityClasses.ClassTypeInfo, FHIRPathUtilityClasses.FHIRConstant, GraphQLEngine.SearchEdge, GraphQLEngine.SearchWrapper, Tuple

public abstract class Base extends Object implements Serializable, org.hl7.fhir.instance.model.api.IBase, ca.uhn.fhir.model.api.IElement
See Also:
  • Constructor Details

    • Base

      public Base()
  • Method Details

    • isCopyUserData

      public static boolean isCopyUserData()
    • setCopyUserData

      public static void setCopyUserData(boolean value)
    • getUserData

      public Object getUserData(String name)
      Specified by:
      getUserData in interface org.hl7.fhir.instance.model.api.IBase
    • setUserData

      public void setUserData(String name, Object value)
      Specified by:
      setUserData in interface org.hl7.fhir.instance.model.api.IBase
    • clearUserData

      public void clearUserData(String name)
    • setUserDataINN

      public void setUserDataINN(String name, Object value)
    • hasUserData

      public boolean hasUserData(String name)
    • getUserString

      public String getUserString(String name)
    • getUserInt

      public int getUserInt(String name)
    • copyUserData

      public void copyUserData(Base other)
    • hasFormatComment

      public boolean hasFormatComment()
      Specified by:
      hasFormatComment in interface org.hl7.fhir.instance.model.api.IBase
    • hasFormatCommentPre

      public boolean hasFormatCommentPre()
    • hasFormatCommentPost

      public boolean hasFormatCommentPost()
    • getFormatCommentsPre

      Specified by:
      getFormatCommentsPre in interface org.hl7.fhir.instance.model.api.IBase
    • getFormatCommentsPost

      Specified by:
      getFormatCommentsPost in interface org.hl7.fhir.instance.model.api.IBase
    • copyFormatComments

      public void copyFormatComments(Base other)
    • addFormatCommentsPre

      public void addFormatCommentsPre(List<String> comments)
    • addFormatCommentsPost

      public void addFormatCommentsPost(List<String> comments)
    • isPrimitive

      public boolean isPrimitive()
      Returns:
      true if the data type is a primitive type and might have a primitive value (which will be accessed as a string, irrespective of the stated value)
    • isBooleanPrimitive

      public boolean isBooleanPrimitive()
      Returns:
      true if the type is boolean, and the primitive value can only be 'true' or 'false'
    • hasPrimitiveValue

      public boolean hasPrimitiveValue()
      Returns:
      true if the type is primitive, and there's value (e.g. no Data-Absent-Reason extension etc)
    • canHavePrimitiveValue

      public boolean canHavePrimitiveValue()
      Returns:
      true if the type is primitive, and there could be a value (irrespective of whether it's present e.g. no Data-Absent-Reason extension etc)
    • primitiveValue

      Returns:
      the primitive value if there is one, as a string irrespective of the actual type (e.g. dates converted to their FHIR string representation) return null if the value is not a primitive or there is no value (might be extensions instead)
    • isDateTime

      public boolean isDateTime()
      Returns:
      true if the type is date|dateTime|instant, and the primitive value is a date/time of some precision
    • dateTimeValue

      Returns:
      the date/time value if there is one, or null
    • fhirType

      public abstract String fhirType()
      Specified by:
      fhirType in interface org.hl7.fhir.instance.model.api.IBase
      Returns:
      the FHIR type name of the instance (not the java class name)
    • hasType

      public boolean hasType(String... name)
      Note that this is potentially misleading on ElementDefinition that has a 'type' property - don't mistakenly use this thinking it's going to look at ElementDefinition.type
      Parameters:
      name - - fhir type name
    • listChildren

      protected void listChildren(List<Property> result)
    • setProperty

      public Base setProperty(String name, Base value) throws org.hl7.fhir.exceptions.FHIRException
      Throws:
      org.hl7.fhir.exceptions.FHIRException
    • addChild

      public Base addChild(String name) throws org.hl7.fhir.exceptions.FHIRException
      Throws:
      org.hl7.fhir.exceptions.FHIRException
    • removeChild

      public void removeChild(String name, Base value) throws org.hl7.fhir.exceptions.FHIRException
      Throws:
      org.hl7.fhir.exceptions.FHIRException
    • children

      public List<Property> children()
      Supports iterating the children elements in some generic processor or browser All defined children will be listed, even if they have no value on this instance Note that the actual content of primitive or xhtml elements is not iterated explicitly. To find these, the processing code must recognise the element as a primitive, typecast the value to a DataType, and examine the value
      Returns:
      a list of all the children defined for this element
    • getChildByName

    • listChildrenByName

      public List<Base> listChildrenByName(String name) throws org.hl7.fhir.exceptions.FHIRException
      Throws:
      org.hl7.fhir.exceptions.FHIRException
    • getChildValueByName

    • listChildrenByName

      public Base[] listChildrenByName(String name, boolean checkValid) throws org.hl7.fhir.exceptions.FHIRException
      Throws:
      org.hl7.fhir.exceptions.FHIRException
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface org.hl7.fhir.instance.model.api.IBase
    • equalsDeep

      public boolean equalsDeep(Base other)
    • equalsShallow

      public boolean equalsShallow(Base other)
    • compareDeep

      public static boolean compareDeep(String s1, String s2, boolean allowNull)
    • compareDeep

      public static boolean compareDeep(List<? extends Base> e1, List<? extends Base> e2, boolean allowNull)
    • compareDeep

      public static boolean compareDeep(Base e1, Base e2, boolean allowNull)
    • compareDeep

      public static boolean compareDeep(org.hl7.fhir.utilities.xhtml.XhtmlNode div1, org.hl7.fhir.utilities.xhtml.XhtmlNode div2, boolean allowNull)
    • compareValues

      public static boolean compareValues(List<? extends PrimitiveType> e1, List<? extends PrimitiveType> e2, boolean allowNull)
    • compareValues

      public static boolean compareValues(PrimitiveType e1, PrimitiveType e2, boolean allowNull)
    • isMetadataBased

      protected boolean isMetadataBased()
    • getProperty

      public Base[] getProperty(int hash, String name, boolean checkValid) throws org.hl7.fhir.exceptions.FHIRException
      Throws:
      org.hl7.fhir.exceptions.FHIRException
    • setProperty

      public Base setProperty(int hash, String name, Base value) throws org.hl7.fhir.exceptions.FHIRException
      Throws:
      org.hl7.fhir.exceptions.FHIRException
    • makeProperty

      public Base makeProperty(int hash, String name) throws org.hl7.fhir.exceptions.FHIRException
      Throws:
      org.hl7.fhir.exceptions.FHIRException
    • getTypesForProperty

      public String[] getTypesForProperty(int hash, String name) throws org.hl7.fhir.exceptions.FHIRException
      Throws:
      org.hl7.fhir.exceptions.FHIRException
    • equals

      public static boolean equals(String v1, String v2)
    • isResource

      public boolean isResource()
    • getIdBase

      public abstract String getIdBase()
    • setIdBase

      public abstract void setIdBase(String value)
    • getNamedProperty

      public Property getNamedProperty(String _name) throws org.hl7.fhir.exceptions.FHIRException
      Throws:
      org.hl7.fhir.exceptions.FHIRException
    • getNamedProperty

      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws org.hl7.fhir.exceptions.FHIRException
      Throws:
      org.hl7.fhir.exceptions.FHIRException
    • copy

      public abstract Base copy()
    • copyValues

      public void copyValues(Base dst)
    • getXhtml

      public org.hl7.fhir.utilities.xhtml.XhtmlNode getXhtml()
      return XHTML if this is an XHTML node, else null
      Returns:
    • hasValidationInfo

      public boolean hasValidationInfo()
    • getValidationInfo

      A list of definitions that the validator matched this element to. Note that the element doesn't have to conform to these definitions - check whether they're valid Some of the definitions will be noted because of slice matching
      Returns:
    • addDefinition

    • hasValidated

    • addValidationMessage

      public Base addValidationMessage(org.hl7.fhir.utilities.validation.ValidationMessage msg)
    • hasValidationMessages

      public boolean hasValidationMessages()
    • getValidationMessages

      public List<org.hl7.fhir.utilities.validation.ValidationMessage> getValidationMessages()
    • getFHIRPublicationVersion

      public abstract org.hl7.fhir.utilities.FhirPublication getFHIRPublicationVersion()