Release 5 Preview #1

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: R4B R4

Valueset-example-hierarchical.xml

Vocabulary Work GroupMaturity Level: N/AStandards Status: InformativeCompartments: Not linked to any defined compartments

Raw XML (canonical form + also see XML Format Specification)

Jump past Narrative

ValueSet Example showing how to specify a hierarchy for UI using extensions (id = "example-hierarchical")

<?xml version="1.0" encoding="UTF-8"?>

<ValueSet xmlns="http://hl7.org/fhir">
  <id value="example-hierarchical"/> 
  <meta> 
    <!--     many expansions are not shareable, but this one is     -->
    <profile value="http://hl7.org/fhir/StructureDefinition/shareablevalueset"/> 
  </meta> 
  <text> 
    <status value="generated"/> 
    <div xmlns="http://www.w3.org/1999/xhtml">
     <table class="grid">
      <tr> <td/>  <td> (Most common)</td> </tr> 
      <tr> <td> ..login</td> <td> Login Required</td> </tr> 
      <tr> <td> ..conflict</td> <td> Edit Version Conflict</td> </tr> 
      <tr> <td> processing</td> <td> Processing Failure</td> </tr> 
      <tr> <td> ..duplicate</td> <td> Duplicate</td> </tr> 
      <tr> <td> ..not-found</td> <td> Not Found</td> </tr> 
      <tr> <td> invalid</td> <td> Invalid Content</td> </tr> 
      <tr> <td> ..structure</td> <td> Structural Issue</td> </tr> 
      <tr> <td> ..required</td> <td> Required element missing</td> </tr> 
      <tr> <td> ..value</td> <td> Element value invalid</td> </tr> 
      <tr> <td> transient</td> <td> Transient Issue</td> </tr> 
      <tr> <td> ..lock-error</td> <td> Lock Error</td> </tr> 
      <tr> <td> ..exception</td> <td> Exception</td> </tr> 
      <tr> <td> ..throttled</td> <td> Throttled</td> </tr> 
      <tr> <td> security</td> <td> Security Problem</td> </tr> 
      <tr> <td> ..login</td> <td> Login Required</td> </tr> 
      <tr> <td> ..unknown</td> <td> Unknown User</td> </tr> 
     </table> 
    </div> 
  </text> 
  <contained> 
    <!--   
      include the code system this value is derived from since it's been hacked a little,
     and for simplicity
      -->
    <CodeSystem> 
      <id value="hacked"/> 
      <url value="http://hl7.org/fhir/hacked"/>  
      <status value="draft"/> 
      <description value="Issue type in an error message - hack from real FHIR List"/>  
      <content value="complete"/>  
      <property> 
        <code value="notSelectable"/> 
        <uri value="http://hl7.org/fhir/concept-properties#notSelectable"/> 
        <type value="boolean"/> 
      </property> 
      <concept>  <!--   invalid (abstract) + structure, required, value   -->
        <code value="invalid"/>  
        <display value="Invalid Content"/>  
        <property> 
          <code value="notSelectable"/> 
          <valueBoolean value="true"/> 
        </property> 
        <concept>  
          <code value="structure"/>  
          <display value="Structural Issue"/>  
        </concept>  
        <concept>  
          <code value="required"/>  
          <display value="Required element missing"/>  
        </concept>  
        <concept>  
          <code value="value"/>  
          <display value="Element value invalid"/>  
        </concept>  
      </concept>  
      <concept>  <!--   security (abstract) + login | unknown | expired   -->
        <code value="security"/>  
        <display value="Security Problem"/>  
        <property> 
          <code value="notSelectable"/> 
          <valueBoolean value="true"/> 
        </property> 
        <concept>  
          <code value="login"/>  
          <display value="Login Required"/>  
        </concept>  
        <concept>  
          <code value="unknown"/>  
          <display value="Unknown User"/>  
        </concept>  
        <concept>  
          <code value="expired"/>  
          <display value="Session Expired"/>  
        </concept>  
      </concept>  
      <concept>  <!--   Processing + duplicate | not-found | conflict   -->
        <code value="processing"/>  
        <display value="Processing Failure"/>  
        <concept>  
          <code value="duplicate"/>  
          <display value="Duplicate"/>  
        </concept>  
        <concept>  
          <code value="not-found"/>  
          <display value="Not Found"/>  
        </concept>  
        <concept>  
          <code value="conflict"/>  
          <display value="Edit Version Conflict"/>  
        </concept>  
      </concept>  
      <concept>  <!--   transient + lock | exception | throttled   -->
        <code value="transient"/>  
        <display value="Transient Issue"/>  
        <concept>  
          <code value="lock-error"/>  
          <display value="Lock Error"/>  
        </concept>  
        <concept>  
          <code value="exception"/>  
          <display value="Exception"/>  
        </concept>  
        <concept>  
          <code value="throttled"/>  
          <display value="Throttled"/>  
        </concept>  
      </concept>  
    </CodeSystem>  
  </contained> 
  <url value="http://hl7.org/fhir/ValueSet/example-hierarchical"/> 
  <version value="4.2.0"/> 
  <name value="Example Hierarchical ValueSet"/> 
  <status value="draft"/> 
  <experimental value="true"/> 
  <date value="2018-07-20"/> 
  <publisher value="FHIR Project team"/> 
  <contact> 
    <telecom> 
      <system value="url"/> 
      <value value="http://hl7.org/fhir"/> 
    </telecom> 
  </contact> 
  <description value="Demonstration of extensions that build a hierarchical contains"/> 
  <compose> 
    <!--  
      the include by enumeration simply lists a set of codes with no structure
      
      we're going to introduce a hierarchy. There's 5 possibilities, each shown in this
     
      complex example:
       1. the grouper we are introducing isn't in the code system
       2. The grouper matches a concept in the code system, which is in the value set
         a, it isn't abstract
         b. it is abstract
       3. The grouper matches a concept in the code system, which isn't in the value set
         a, it isn't abstract
         b. it is abstract

      1# we introduce a category for concepts for (most common)
       * (most common)
          + login (also below)
          + conflict (only here)
       
      #2a we replicate processing as a structure. it's not abstract
        * processing
          + duplicate, not-found

      #2b we replicate invalid as a structure. it's abstract
        * invalid
          + structure, required, value
 
      #3a we replicate transient as a structure. it's not abstract (but not in the value
     set)
        * transient
          + lock, exception, tbrottled

      #3b we replicate security as a structure. it's abstract (but not in the value set)
        * security
          + login | unknown

      please, no argument about whether this a good domain example; the point is illustrate
     the method
      -->
    
    <include> 
      <extension url="http://hl7.org/fhir/StructureDefinition/valueset-expand-rules">
        <valueCode value="groups-only"/>  
      </extension> 
      <!--   #1   -->
      <extension url="http://hl7.org/fhir/StructureDefinition/valueset-expand-group">
        <extension url="display">
          <valueString value="(Most common)"/> 
        </extension> 
        <extension url="member">
          <valueCode value="login"/> 
        </extension> 
        <extension url="member">
          <valueCode value="conflict"/> 
        </extension> 
      </extension> 
      <!--   #2a   -->
      <extension url="http://hl7.org/fhir/StructureDefinition/valueset-expand-group">
        <extension url="code">
          <valueCode value="processing"/> 
        </extension> 
        <extension url="member">
          <valueCode value="duplicate"/> 
        </extension> 
        <extension url="member">
          <valueCode value="not-found"/> 
        </extension> 
      </extension> 
      <!--   #2b   -->
      <extension url="http://hl7.org/fhir/StructureDefinition/valueset-expand-group">
        <extension url="code">
          <valueCode value="invalid"/> 
        </extension> 
        <extension url="member">
          <valueCode value="structure"/> 
        </extension> 
        <extension url="member">
          <valueCode value="required"/> 
        </extension> 
        <extension url="member">
          <valueCode value="value"/> 
        </extension> 
      </extension> 
      <!--   #3a   -->
      <extension url="http://hl7.org/fhir/StructureDefinition/valueset-expand-group">
        <extension url="code">
          <valueCode value="transient"/> 
        </extension> 
        <extension url="member">
          <valueCode value="lock"/> 
        </extension> 
        <extension url="member">
          <valueCode value="exception"/> 
        </extension> 
        <extension url="member">
          <valueCode value="throttled"/> 
        </extension> 
      </extension> 
      <!--   #3b   -->
      <extension url="http://hl7.org/fhir/StructureDefinition/valueset-expand-group">
        <extension url="code">
          <valueCode value="security"/> 
        </extension> 
        <extension url="member">
          <valueCode value="login"/> 
        </extension> 
        <extension url="member">
          <valueCode value="unknown"/> 
        </extension> 
      </extension> 
      
      <system value="#hacked"/> 
      <!--   include the codes from the code system, no hierarchy here   -->
      <concept> 
        <code value="invalid"/> 
      </concept>       
      <concept> 
        <code value="structure"/> 
      </concept> 
      <concept> 
        <code value="required"/> 
      </concept> 
      <concept> 
        <code value="value"/> 
      </concept> 
      <concept> 
        <code value="processing"/> 
      </concept> 
      <concept> 
        <code value="duplicate"/> 
      </concept> 
      <concept> 
        <code value="not-found"/> 
      </concept> 
      <concept> 
        <code value="conflict"/> 
      </concept> 
      <concept> 
        <code value="lock"/> 
      </concept> 
      <concept> 
        <code value="exception"/> 
      </concept> 
      <concept> 
        <code value="tbrottled"/> 
      </concept> 
      <concept> 
        <code value="login"/> 
      </concept> 
      <concept> 
        <code value="unknown"/> 
      </concept> 
    </include> 
  </compose> 
  <expansion> 
    <identifier value="urn:uuid:42316ff8-2714-4680-9980-f37a6d1a71bc"/> 
    <timestamp value="2018-07-20T23:14:07+10:00"/> 
  
    <!--   snip identifier etc   -->
    <parameter>  <!--   this expansion is for a UI   -->
      <name value="excludeNotForUI"/> 
      <valueUri value="false"/>  
    </parameter> 
    <!--   other parameters snipped for brevity   -->
    
    <!--   #1 most common   -->
    <contains> 
      <!--   no system or code - it's not a concept at all   -->  
      <abstract value="true"/>       
      <display value="(Most common)"/> 
      <contains> 
        <system value="http://hl7.org/fhir/hacked"/> 
        <code value="login"/>  
        <display value="Login Required"/>  
      </contains> 
      <contains> 
        <system value="http://hl7.org/fhir/hacked"/> 
        <code value="conflict"/>  
        <display value="Edit Version Conflict"/>  
      </contains> 
    </contains> 

    <!--   #2a processing   -->
    <contains> 
      <system value="http://hl7.org/fhir/hacked"/> 
      <code value="processing"/>  
      <display value="Processing Failure"/>  
      <contains> 
        <system value="http://hl7.org/fhir/hacked"/> 
        <code value="duplicate"/>  
        <display value="Duplicate"/>  
      </contains> 
      <contains> 
        <system value="http://hl7.org/fhir/hacked"/> 
        <code value="not-found"/>  
        <display value="Not Found"/>  
      </contains> 
    </contains> 
    
    <!--   #2b invalid   -->
    <contains> 
      <system value="http://hl7.org/fhir/hacked"/> 
      <abstract value="true"/> 
      <code value="invalid"/>  
      <display value="Invalid Content"/>  
      <contains> 
        <system value="http://hl7.org/fhir/hacked"/> 
        <code value="structure"/>  
        <display value="Structural Issue"/>  
      </contains> 
      <contains> 
        <system value="http://hl7.org/fhir/hacked"/> 
        <code value="required"/>  
        <display value="Required element missing"/>  
      </contains> 
      <contains> 
        <system value="http://hl7.org/fhir/hacked"/> 
        <code value="value"/>  
        <display value="Element value invalid"/>  
      </contains> 
    </contains> 

    <!--   #3a transient   -->
    <contains> 
      <system value="http://hl7.org/fhir/hacked"/> 
      <!--   
        this entry is not in the value set, but it was introduced as a grouper. 
        So it's labelled "abstract" : user cannot select it, but the code is provided
        to tie it back to the concept   -->
      <abstract value="true"/> 
      <code value="transient"/>  
      <display value="Transient Issue"/>  
      <contains> 
        <system value="http://hl7.org/fhir/hacked"/> 
        <code value="lock-error"/>  
        <display value="Lock Error"/>  
      </contains> 
      <contains> 
        <system value="http://hl7.org/fhir/hacked"/> 
        <code value="exception"/>  
        <display value="Exception"/>  
      </contains> 
      <contains> 
        <system value="http://hl7.org/fhir/hacked"/> 
        <code value="throttled"/>  
        <display value="Throttled"/>  
      </contains> 
    </contains> 
    
    <!--   #3b security   -->
    <contains> 
      <system value="http://hl7.org/fhir/hacked"/> 
      <!--   it's abstract either way   -->
      <abstract value="true"/> 
      <code value="security"/>  
      <display value="Security Problem"/>  
      <contains> 
        <system value="http://hl7.org/fhir/hacked"/> 
        <code value="login"/>  
        <display value="Login Required"/>  
      </contains> 
      <contains> 
        <system value="http://hl7.org/fhir/hacked"/> 
        <code value="unknown"/>  
        <display value="Unknown User"/>  
      </contains> 
    </contains> 
  
  <!--   the not UI expansion is 
    <contains>
      <system value="http://hl7.org/fhir/hacked"/>
      <abstract value="true"/>
      <code value="invalid"/> 
      <display value="Invalid Content"/> 
    </contains>
    <contains>
      <system value="http://hl7.org/fhir/hacked"/>
      <code value="structure"/> 
      <display value="Structural Issue"/> 
    </contains>
    <contains>
      <system value="http://hl7.org/fhir/hacked"/>
      <code value="required"/> 
      <display value="Required element missing"/> 
    </contains>
    <contains>
      <system value="http://hl7.org/fhir/hacked"/>
      <code value="value"/> 
      <display value="Element value invalid"/> 
    </contains>
    <contains>
      <system value="http://hl7.org/fhir/hacked"/>
      <code value="processing"/> 
      <display value="Processing Failure"/> 
    </contains>
    <contains>
      <system value="http://hl7.org/fhir/hacked"/>
      <code value="duplicate"/> 
      <display value="Duplicate"/> 
    </contains>
    <contains>
      <system value="http://hl7.org/fhir/hacked"/>
      <code value="not-found"/> 
      <display value="Not Found"/> 
    </contains>
    <contains>
      <system value="http://hl7.org/fhir/hacked"/>
      <code value="conflict"/> 
      <display value="Edit Version Conflict"/> 
    </contains>
    <contains>
      <system value="http://hl7.org/fhir/hacked"/>
      <code value="lock-error"/> 
      <display value="Lock Error"/> 
    </contains>
    <contains>
      <system value="http://hl7.org/fhir/hacked"/>
      <code value="exception"/> 
      <display value="Exception"/> 
    </contains>
    <contains>
      <system value="http://hl7.org/fhir/hacked"/>
      <code value="throttled"/> 
      <display value="Throttled"/> 
    </contains>  
    <contains>
      <system value="http://hl7.org/fhir/hacked"/>
      <code value="login"/> 
      <display value="Login Required"/> 
    </contains>
    <contains>
      <system value="http://hl7.org/fhir/hacked"/>
      <code value="unknown"/> 
      <display value="Unknown User"/> 
    </contains>
    -->
  </expansion> 

</ValueSet> 

Usage note: every effort has been made to ensure that the examples are correct and useful, but they are not a normative part of the specification.