Package com.ibm.fhir.model.type
Class Reference
- java.lang.Object
-
- com.ibm.fhir.model.visitor.AbstractVisitable
-
- com.ibm.fhir.model.type.Element
-
- com.ibm.fhir.model.type.Reference
-
- All Implemented Interfaces:
Visitable
@Generated("com.ibm.fhir.tools.CodeGenerator") public class Reference extends Element
A reference from one resource to another.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classReference.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(String elementName, int elementIndex, Visitor visitor)Accept a Visitor and invoke the appropriate visit methods.static Reference.Builderbuilder()booleanequals(Object obj)StringgetDisplay()Plain text narrative that identifies the resource in addition to the resource reference.IdentifiergetIdentifier()An identifier for the target resource.StringgetReference()A reference to a location at which the other resource is found.UrigetType()The expected type of the target of the reference.booleanhasChildren()inthashCode()Reference.BuildertoBuilder()Create a new Builder from the contents of this Element
-
-
-
Method Detail
-
getReference
public String getReference()
A reference to a location at which the other resource is found. The reference may be a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources.- Returns:
- An immutable object of type
Stringthat may be null.
-
getType
public Uri getType()
The expected type of the target of the reference. If both Reference.type and Reference.reference are populated and Reference.reference is a FHIR URL, both SHALL be consistent.The type is the Canonical URL of Resource Definition that is the type this reference refers to. References are URLs that are relative to http://hl7.org/fhir/StructureDefinition/ e.g. "Patient" is a reference to http://hl7. org/fhir/StructureDefinition/Patient. Absolute URLs are only allowed for logical models (and can only be used in references in logical models, not resources).
- Returns:
- An immutable object of type
Urithat may be null.
-
getIdentifier
public Identifier getIdentifier()
An identifier for the target resource. This is used when there is no way to reference the other resource directly, either because the entity it represents is not available through a FHIR server, or because there is no way for the author of the resource to convert a known identifier to an actual location. There is no requirement that a Reference. identifier point to something that is actually exposed as a FHIR instance, but it SHALL point to a business concept that would be expected to be exposed as a FHIR instance, and that instance would need to be of a FHIR resource type allowed by the reference.- Returns:
- An immutable object of type
Identifierthat may be null.
-
getDisplay
public String getDisplay()
Plain text narrative that identifies the resource in addition to the resource reference.- Returns:
- An immutable object of type
Stringthat may be null.
-
hasChildren
public boolean hasChildren()
- Overrides:
hasChildrenin classElement
-
accept
public void accept(String elementName, int elementIndex, Visitor visitor)
Description copied from interface:VisitableAccept a Visitor and invoke the appropriate visit methods. A typical implementation would look like this:if (visitor.preVisit(this)) { visitor.visitStart(elementName, elementIndex, this); if (visitor.visit(elementName, elementIndex, this)) { // visit children } visitor.visitEnd(elementName, elementIndex, this); visitor.postVisit(this); }- Specified by:
acceptin interfaceVisitable- Specified by:
acceptin classAbstractVisitable- Parameters:
elementName- the name of the element in the context of this visitelementIndex- the index of the element in a list or -1 if it is not contained within a Listvisitor- the visitor to use
-
toBuilder
public Reference.Builder toBuilder()
Description copied from class:ElementCreate a new Builder from the contents of this Element
-
builder
public static Reference.Builder builder()
-
-