Class ResourceMetadataKeyEnum<T>

java.lang.Object
ca.uhn.fhir.model.api.ResourceMetadataKeyEnum<T>
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ResourceMetadataKeyEnum.ExtensionResourceMetadataKey

public abstract class ResourceMetadataKeyEnum<T> extends Object implements Serializable
Keys in this map refer to resource metadata keys, which are keys used to access information about specific resource instances that live outside of the resource body. Typically, these are data elements which are sent/receieved in HTTP Headers along with read/create resource requests, or properties which can be found in bundle entries.

To access or set resource metadata values, every resource has a metadata map, and this class provides convenient getters/setters for interacting with that map. For example, to get a resource's UPDATED value, which is the "last updated" time for that resource, use the following code:

InstantDt updated = ResourceMetadataKeyEnum.UPDATED.get(resource);

To set this value, use the following:

InstantDt update = new InstantDt("2011-01-02T11:22:33.0000Z"); // populate with the actual time
ResourceMetadataKeyEnum.UPDATED.put(resource, update);

Note that this class is not a Java Enum, and can therefore be extended (this is why it is not actually an Enum). Users of HAPI-FHIR are able to create their own classes extending this class to define their own keys for storage in resource metadata if needed.

See Also:
  • Field Details

    • DELETED_AT

      If present and populated with a date/time (as an instance of InstantDt), this value is an indication that the resource is in the deleted state. This key is only used in a limited number of scenarios, such as POSTing transaction bundles to a server, or returning resource history.

      Values for this key are of type InstantDt

    • ENTRY_SEARCH_MODE

      If present and populated with a BundleEntrySearchModeEnum, contains the "bundle entry search mode", which is the value of the status field in the Bundle entry containing this resource. The value for this key corresponds to field Bundle.entry.search.mode. This value can be set to provide a status value of "include" for included resources being returned by a server, or to "match" to indicate that the resource was returned because it matched the given search criteria.

      Note that status is only used in FHIR DSTU2 and later.

      Values for this key are of type BundleEntrySearchModeEnum

    • ENTRY_SEARCH_SCORE

      If present and populated with a decimal value, contains the "bundle entry search score", which is the value of the status field in the Bundle entry containing this resource. The value for this key corresponds to field Bundle.entry.search.score. This value represents the search ranking score, where 1.0 is relevant and 0.0 is irrelevant.

      Note that status is only used in FHIR DSTU2 and later.

    • ENTRY_TRANSACTION_METHOD

      If present and populated with a BundleEntryTransactionMethodEnum, contains the "bundle entry transaction operation", which is the value of the status field in the Bundle entry containing this resource. The value for this key corresponds to field Bundle.entry.transaction.operation. This value can be set in resources being transmitted to a server to provide a status value of "create" or "update" to indicate behaviour the server should observe. It may also be set to similar values (or to "noop") in resources being returned by a server as a result of a transaction to indicate to the client what operation was actually performed.

      Note that status is only used in FHIR DSTU2 and later.

      Values for this key are of type BundleEntryTransactionMethodEnum

    • PROFILES

      public static final ResourceMetadataKeyEnum<List<IdDt>> PROFILES
      The value for this key represents a List of profile IDs that this resource claims to conform to.

      Values for this key are of type List<IdDt>. Note that the returned list is unmodifiable, so you need to create a new list and call put to change its value.

    • PUBLISHED

      The value for this key is the bundle entry Published time. This is defined by FHIR as "Time resource copied into the feed", which is generally best left to the current time.

      Values for this key are of type InstantDt

      Server Note: In servers, it is generally advisable to leave this value null, in which case the server will substitute the current time automatically.

      See Also:
    • SECURITY_LABELS

    • TAG_LIST

      The value for this key is the list of tags associated with this resource

      Values for this key are of type TagList

      See Also:
    • UPDATED

      The value for this key is the bundle entry Updated time. This is defined by FHIR as "Last Updated for resource". This value is also used for populating the "Last-Modified" header in the case of methods that return a single resource (read, vread, etc.)

      Values for this key are of type InstantDt

      See Also:
    • VERSION

      Deprecated.
      The IResource.getId() resource ID will now be populated with the version ID via the IdDt.getVersionIdPart() method
      The value for this key is the version ID of the resource object.

      Values for this key are of type String

    • VERSION_ID

      Deprecated.
      The IResource.getId() resource ID will now be populated with the version ID via the IdDt.getVersionIdPart() method
      The value for this key is the version ID of the resource object.

      Values for this key are of type IdDt

  • Constructor Details

  • Method Details