View raw Markdown
type: docsource: source/uml.html

[%settitle UML Definition%] [%file newheader%] [%file newnavbar%] <%fmtheader uml%>

UML definition

Responsible Owner: [[%wgt fhir%]]([%wg fhir%]) Work GroupStandards Status:Normative

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, or assigned stereotypes that describe how they used.

Classes also have a zero or more attributes defined, where each attribute has the following properties:

In addition, classes have zero or more associations, which are always aggregations, and have the following properties:

NameA Documentationelement : [type] [0..*] DocumentationnameB : CodeableConcept [0..1] « Value Set Description (Strength=Preferred)Value Set Name? » NameC Documentationvalue[x] : Type [0..1] « Type1|Type2|Type3 » Docuementationreference : Reference [0..1] « Resource1|Resource2 » DocumentationnameC [0..1]

The elements and the datatypes 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, cannot be determined. Also, it cannot be determined whether a UML property becomes an element or an attribute in the XML representation.

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:

[%diagram datatypes/abstracts.diagram 3dt%]

Stereotypes - Class

This specification uses a number of stereotypes to further define the types and resources. The following stereotypes are used on classes.

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:

Rules for referring to interface types:

Notes for implementers:

Pattern

Some of types are labeled with the stereotype «Pattern». This indicates that in addition to being abstract, and potentially an interface, classes that do follow the interface do so loosely. As such:

Notes for implementers:

Stereotypes - Attributes

There are three stereotypes for attributes, both of which constrain the value domain of the assigned datatype. 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.

Type Choice

If the datatype 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.

Target Reference Type

If the datatype 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 its content.

The format of this stereotype is a list of resource types defined within this specification (concrete specializations of Resource) separated by the | character.

Vocabulary Binding

If the datatype associated with the attribute is one of the datatypes 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:

[%file newfooter%]