This page is part of the FHIR Specification (v4.2.0: R5 Preview #1). The current version which supercedes this version is 5.0.0. For a full list of available versions, see the Directory of published versions . Page versions: R5R4B
This page has been approved as part of an ANSI standard.
See the Infrastructure Package for further details.
2.6.5.1 UML
The UML diagrams represent the Resource and Type defined in this specification in UML.
Each type is represented as a class with a name and an ancestor class (except for Base, which has no ancestor).
In addition, types may be marked as abstract, aor assigned stereotypes that describe how they used.
Classes also have a zero or
more attributes defined, where each attribute has the following properties:
name: the name of the attribute
type: the type of the attribute - either another type defined in the speification, or (for primitive types) a type from XML Schema
[cardinality]: [min..max] control over the attribute cardinality. Attributes with Max cardinality >1 (usually *) are ordered, though
the meaning of the order might not be known or defined
« stereotypes »: these provide additional detail about the element - see below
In addition, classes have zero or more associations, which are always aggregations, and have the following properties:
name: the name of the association (which is the name of the element that represents it in XML/JSON)
[cardinality]: [min..max] control over the association cardinality. Associations with Max cardinality >1 (usually *) are ordered, though
the meaning of the order might not be known or defined
The elements and the data types are hyperlinks to the formal definitions of the parts.
Note that the order of elements in XML (the only serialization where order is required to be correct)
cannot be inferred from the UML diagram - the attributes will be in the order presented, but the
order in which the associations are serialized, which are interspersed with the attributes, cannotbe determined.
Also, it cannot be determined whether a UML property becomes an element or an attribute in the XML representation.
2.6.5.2 Abstract Classes
Some resources and types are labeled as abstract. Such classes are never instantiated with being specialized.
This is the usual meaning of an abstract class in UML. In the diagrams, a class that is abstract has the class name in italics.
This class diagram includes all the abstract types:
2.6.5 Stereotypes - Class
This specification uses a number of stereotypes to further define the types and resources.
The following stereotypes are used on classes.
2.6.5.1 Interface
Some of the abstract types are labeled with the stereotype «Interface». This indicates that in addition
to being abstract, the definitions associated with the class have no implementation. As such:
There is no implementation of the interface described by the definition
Any classes the implement the interface redeclare any attributes and associations that are on the interface, and gives them an order
Such re-declarations will be consistent with the interface but may be a subset of the value domain e.g. the cardinality of an attribute may be 0..* on the interface, and 0..1 on a particular resource
In addition, the resource might not implement the attribute at all - this is equivalent to constraining the attribute to a cardinality of 0..0 - not used with this resource
Since the interface supports both read and write, the interface is described using attributes not operations
The interface resources also define search parameters, invariants and other information about the resources that are all inherited by the resources the implement these interfaces
Notes for implementers:
The interfaces are declared as part of a single hierarchy. This specification itself does not define any multiple inheritance
Some reference implementations may wish to represent the interfaces as classes internally - the best way to handle this depends on language features
2.6.5.2 Pattern
Some of types are labeled with the stereotype «Pattern». This indicates that in addition
to being abstract, and an interface, classes that follow the interface do so loosely. As such:
There is no direct implementation of the interfaces
The relationship between the attributes and associations may be indirect - e.g. attributes may be renamed, restructured, or have different value domains
Such patterns are there primarily to provide document general design intentions, which are subject to ongoing harmonization with observed real world requirements
The relationship between the patterns and the resources that follow them is found in the mappings for the resources
Notes for implementers:
It is possible to implement these interfaces, but in general implementers should expect to write code manually to implement the mappings, and have arrangements for dealing with differences such as adding 'canDoX' to the interface
2.6.5 Stereotypes - Attributes
There are three stereotypes for attributes, both of which constrain the value domain of the assigned data type. These three
stereotypes can be differentiated by examining the contents of the stereotype.
Note that where these stereotypes are allowed, they are usually present and populated.
2.6.5.1 Type Choice
If the data type assigned to an attribute is abstract, then a stereotype may be provided that
indicates which concrete sub-types are allowed to be used for this particular element. If this stereotype is provided, only the specified
types are allowed. Note: as such, this is equivalent to an OCL constraint on the attribute.
The format of this stereotype is a list of types defined within this specification (concrete specializations of DataType)
separated by the | character.
2.6.5.2 Target Reference Type
If the data type assigned to an attribute is a reference to another resource (one of
Reference, canonical or CodeableReference),
then a stereotype may be provided that indicates which kinds of resources the references are allowed to refer to. If this stereotype is provided, only the specified
resources are allowed to be referenced. Note: as such, this is conceptually equivalent to an OCL constraint on the attribute, but the rules can only be evaluated by
fetching the target of the reference from the specified URL and examining it's content.
The format of this stereotype is a list of resource types defined within this specification (concrete specializations of Resource)
separated by the | character.
2.6.5.3 Vocabulary Binding
If the data type associated with the attribute is one of the data types that can be bound to a value set,
then a stereotype may be provided that restricts the codes that may be present in the attribute. If this stereotype is provided, the rules as defined
by the binding must be followed. Note: there is no OCL equivalent for this stereotype.
This stereotype has two parts: the value set name (which is a link to the value set),
and a symbol that denotes the strength of the binding: