This page is part of the FHIR Specification (v0.01: Historical Archive Draft). The current version which supercedes this version is 5.0.0. For a full list of available versions, see the Directory of published versions

todo: conformance and realms

Constraint

This specification describes a set of base resources that are used in many different contexts in healthcare. In order to make this manageable, applications need to be able to provide a structured statement of which elements of a resource are used, and how. In addition the existing elements, the use of extensions also needs to be described. These structured statements are actually constraint statements that describe a particular pattern of usage. As a general tool, they find use in several different contexts:

The final form of these conformance descriptions is a constraint statement, which may be used at run time to assist with application to application negotiation, or it may be used at design time or even purchase time to assist implementers to understand the capabilities of the system. This specification uses the general constraint statement defined here in 4 contexts:

The constraint statement is a fixed XML format that is used to represent the core part of these various descriptions of use, which is the actual contents of a resource.

Unpicking

One common operation in a constraint statement is to take an element that may occur more than once, and describe a series of different constraints on the elements in the list. In this way, the list is split into a series of individual elements or sub-lists. In FHIR, this operation is known as "unpicking" a list. Here is an example to illustrate the process:

Resource Definition     Profile for Acme, Inc
relationship [0..*]
  type : Coding
  name : string
    parent [1..2]
  type = PAR
  name...
guardian [0..1]
  type = GUARD
  name...
child [0..6]
  type = CHILD
  name...

In this example, the resource definition defines the relationship element which may occur multiple times. The profile for Acme, Inc constrains the relationships into 3 different kinds: 1 or 2 parents, up to 6 children, and maybe a guardian. No other relationships are supported by the Acme system.

Note that in FHIR, only the resource is ever actually exchanged. The profile describes a way of using the resource, but the item profile names ("parent", etc in this list) are never exchanged. In order the unpicking to be useful, systems must be able to determine which relationships in the relationship list that is actually exchanged are parent, child, or guardian; in this particular case, the determination is achieved by fixing the value of the relationship type element. Fixing a code value is the most common way to unpick a list.

Constraint Statement

Note that the context of appearing will make it clear whether this resource constraint specification is written from the context of the resource instance, a writing or a reading application

<x xmlns="http://www.hl7.org/fhir">
  <type> mand code The Type of the resource being described</type>
  <profile> cond uri Resource Profile that supplies the constraints</profile>
  <name> opt string Name for this Constraint Statement</name>
  <purpose> opt string Human summary: why describe this resource?</purpose>
  <element> cond  <!-- Zero+ -->
   <path> mand string The path of the element (see the formal definitions)</path>
   <name> opt string Name this constraint for re-use & unrolling</name>
   <purpose> opt string Human summary: why describe this element?</purpose>
   <min> mand integer Minimum Cardinality</min>
   <max> mand code Maximum Cardinality (a number or *)</max>
   <type> opt code Type of the element</type>
   <conformance> mand code Mandatory|Conditional|Optional|Prohibited</conformance>
   <condition> cond string Condition if conformance=Conditional</condition>
   <mustSupport> opt boolean If the element must be usable</mustSupport>
   <mustUnderstand> opt boolean If the element must be understood</mustUnderstand>
   <definition> opt string More specific definition</definition>
   <mapping> opt  <!-- Zero+ -->
    <target> mand string Which mapping this is (v2, CDA, openEHR, etc)</target>
    <map> opt string Details of the mapping</map>
   </mapping>
   <resource> cond  <!-- If context includes aggregation and type=Resource() -->
    <aggregated> mand boolean Whether this resource is aggregated</aggregated>
    <profile> opt uri Reference to a Resource Profile</profile>
   </resource>
   <valueSet> opt string Value set id (only if coded)</valueSet>
   <value> opt  <!-- Zero+ -->
    <name> cond string Reference to another element by element.name</name>
    <[type]> cond Fixed value: [as defined for type]</[type]>
   </value>
  </element>
</x>

Terminology Bindings

Notes:

TODO: Is any control over narrative required?

Formal Definitions

The formal definitions for the elements above. Also available as an XML file.

Constraint
ControlMandatory, 1..1
Constraint.type
DefinitionThe Type of the resource being described
ControlMandatory, 1..1
Typecode from ResourceType
Constraint.profile
DefinitionReference to a resource profile which includes the constraint statement that applies to this resource
ControlConditional, 0..1: Provide either a profile reference or constraints on the resource elements
Typeuri
Constraint.name
DefinitionThe name of this aggregation profile
ControlOptional, 0..1
Typestring
CommentsThis field is the target for a named aggregation definition (aggregation.name)
Constraint.purpose
DefinitionHuman summary: why describe this resource?
ControlOptional, 0..1
Typestring
Constraint.element
ControlConditional, 0..*: Provide either a profile reference or constraints on the resource elements
Constraint.element.path
DefinitionThe path of the element (see the formal definitions)
ControlMandatory, 1..1
Typestring
Constraint.element.name
DefinitionName this constraint for re-use & unrolling
ControlOptional, 0..1
Typestring
Constraint.element.purpose
DefinitionHuman summary: why describe this element?
ControlOptional, 0..1
Typestring
Constraint.element.min
DefinitionMinimum Cardinality
ControlMandatory, 1..1
Typeinteger
Constraint.element.max
DefinitionMaximum Cardinality (a number or *)
ControlMandatory, 1..1
Typecode
Constraint.element.type
DefinitionType of the element
ControlOptional, 0..1
Typecode from DataType
Constraint.element.conformance
DefinitionMandatory|Conditional|Optional|Prohibited
ControlMandatory, 1..1
Typecode from ConformanceType
Constraint.element.condition
DefinitionCondition if conformance=Conditional
ControlConditional, 0..1: Required if conformance = conditional
Typestring
Constraint.element.mustSupport
DefinitionIf the element must be usable
ControlOptional, 0..1
Typeboolean
Constraint.element.mustUnderstand
DefinitionIf the element must be understood
ControlOptional, 0..1
Typeboolean
Constraint.element.definition
DefinitionMore specific definition
ControlOptional, 0..1
Typestring
Constraint.element.mapping
ControlOptional, 0..*
Constraint.element.mapping.target
DefinitionWhich mapping this is (v2, CDA, openEHR, etc)
ControlMandatory, 1..1
Typestring
Constraint.element.mapping.map
DefinitionDetails of the mapping
ControlOptional, 0..1
Typestring
Constraint.element.resource
DefinitionIf context includes aggregation and type=Resource()
ControlConditional, 0..1: If context includes aggregation and type=Resource()
Constraint.element.resource.aggregated
DefinitionWhether this resource is aggregated
ControlMandatory, 1..1
Typeboolean
Constraint.element.resource.profile
DefinitionReference to a Resource Profile
ControlOptional, 0..1
Typeuri
CommentsThe reference might be a simple name in the form #[name], which is a reference to another named constraint in a resource - where the resource contains more than one constraint, or a RUL which is a reference to a resource Profile
Constraint.element.valueSet
DefinitionValue set id (only if coded)
ControlOptional, 0..1
Typestring
Constraint.element.value
ControlOptional, 0..*
Constraint.element.value.name
DefinitionReference to another element by element.name
ControlConditional, 0..1: Either a name or a fixed value is required
Typestring
Constraint.element.value.[type]
DefinitionFixed value: [as defined for type]
ControlConditional, 0..1: Either a name or a fixed value is required
Type*

This is an old version of FHIR retained for archive purposes. Do not use for anything else
Implementers are welcome to experiment with the content defined here, but should note that the contents are subject to change without prior notice.
© HL7.org 2011 - 2012. FHIR v0.01 generated on Mon, May 14, 2012 09:48+1000.