Interface IResource

All Superinterfaces:
IBase, IBaseResource, ICompositeElement, IElement, Serializable
All Known Subinterfaces:
BaseConformance, BaseOperationOutcome, BaseSecurityEvent

public interface IResource extends ICompositeElement, IBaseResource
This interface is the parent interface for all FHIR Resource definition classes. Classes implementing this interface should be annotated with the @ResourceDef annotation.

Note that this class is a part of HAPI's model API, used to define structure classes. Users will often interact with this interface, but should not need to implement it directly.

  • Method Details

    • getContained

      Returns the contained resource list for this resource.

      Usage note: HAPI will generally populate and use the resources from this list automatically (placing inline resources in the contained list when encoding, and copying contained resources from this list to their appropriate references when parsing) so it is generally not neccesary to interact with this list directly. Instead, in a server you can place resource instances in reference fields (such as Patient#setManagingOrganization(ResourceReferenceDt) ) and the resource will be automatically contained. In a client, contained resources will be automatically populated into their appropriate fields by the HAPI parser.

      TODO: document contained resources and link there
    • getId

      Returns the ID of this resource. Note that this identifier is the URL (or a portion of the URL) used to access this resource, and is not the same thing as any business identifiers stored within the resource. For example, a Patient resource might have any number of medical record numbers but these are not stored here.

      This ID is specified as the "Logical ID" and "Version ID" in the FHIR specification, see here

    • getLanguage

      Gets the language of the resource itself - NOTE that this language attribute applies to the resource itself, it is not (for example) the language spoken by a practitioner or patient
    • getMeta

      Returns a view of the resource metadata map. Note that getters from this map return immutable objects, but the addFoo() and setFoo() methods may be used to modify metadata.
      Specified by:
      getMeta in interface IBaseResource
      Since:
      1.5
    • getResourceMetadata

      Returns the metadata map for this object, creating it if neccesary. Metadata entries are used to get/set feed bundle entries, such as the resource version, or the last updated timestamp.

      Keys in this map are enumerated in the ResourceMetadataKeyEnum, and each key has a specific value type that it must use.

      See Also:
      for a list of allowable keys and the object types that values of a given key must use.
    • getResourceName

      Returns a String representing the name of this Resource. This return value is not used for anything by HAPI itself, but is provided as a convenience to developers using the API.
      Returns:
      the name of this resource, e.g. "Patient", or "Observation"
    • getStructureFhirVersionEnum

      Returns the FHIR version represented by this structure
      Specified by:
      getStructureFhirVersionEnum in interface IBaseResource
    • getText

      Returns the narrative block for this resource
    • setId

      void setId(IdDt theId)
      Sets the ID of this resource. Note that this identifier is the URL (or a portion of the URL) used to access this resource, and is not the same thing as any business identifiers stored within the resource. For example, a Patient resource might have any number of medical record numbers but these are not stored here.

      This ID is specified as the "Logical ID" and "Version ID" in the FHIR specification, see here

    • setLanguage

      void setLanguage(CodeDt theLanguage)
      Sets the language of the resource itself - NOTE that this language attribute applies to the resource itself, it is not (for example) the language spoken by a practitioner or patient
    • setResourceMetadata

      Sets the metadata map for this object. Metadata entries are used to get/set feed bundle entries, such as the resource version, or the last updated timestamp.
      Throws:
      NullPointerException - The map must not be null