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@ResourceDefannotation.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.
-
-
Field Summary
-
Fields inherited from interface org.hl7.fhir.instance.model.api.IBaseResource
INCLUDE_ALL, WILDCARD_ALL_SET
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description BaseContainedDtgetContained()Returns the contained resource list for this resource.IdDtgetId()Returns the ID of this resource.CodeDtgetLanguage()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 patientIBaseMetaTypegetMeta()Returns a view of theresource metadatamap.ResourceMetadataMapgetResourceMetadata()Returns the metadata map for this object, creating it if neccesary.StringgetResourceName()Returns a String representing the name of this Resource.FhirVersionEnumgetStructureFhirVersionEnum()Returns the FHIR version represented by this structureBaseNarrativeDt<?>getText()Returns the narrative block for this resourcevoidsetId(IdDt theId)Sets the ID of this resource.voidsetLanguage(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 patientvoidsetResourceMetadata(ResourceMetadataMap theMap)Sets the metadata map for this object.-
Methods inherited from interface org.hl7.fhir.instance.model.api.IBase
fhirType, getFormatCommentsPost, getFormatCommentsPre, getUserData, hasFormatComment, isEmpty, setUserData
-
Methods inherited from interface org.hl7.fhir.instance.model.api.IBaseResource
getIdElement, setId, setId
-
Methods inherited from interface ca.uhn.fhir.model.api.ICompositeElement
getAllPopulatedChildElementsOfType
-
-
-
-
Method Detail
-
getContained
BaseContainedDt 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
TODO: document contained resources and link therePatient#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.
-
getId
IdDt 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
CodeDt 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
IBaseMetaType getMeta()
Returns a view of theresource metadatamap. Note that getters from this map return immutable objects, but theaddFoo()andsetFoo()methods may be used to modify metadata.- Specified by:
getMetain interfaceIBaseResource- Since:
- 1.5
-
getResourceMetadata
ResourceMetadataMap 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.
-
getResourceName
String 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
FhirVersionEnum getStructureFhirVersionEnum()
Returns the FHIR version represented by this structure- Specified by:
getStructureFhirVersionEnumin interfaceIBaseResource
-
getText
BaseNarrativeDt<?> 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
void setResourceMetadata(ResourceMetadataMap theMap)
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
-
-