Release 5 Preview #3

This page is part of the FHIR Specification (v4.5.0: R5 Preview #3). 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: R5 R4B R4 R3

Graphdefinition-example.xml

FHIR Infrastructure 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

GraphDefinition example (id = "example")

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

<GraphDefinition xmlns="http://hl7.org/fhir">
  <id value="example"/> 
  <text> <status value="generated"/> <div xmlns="http://www.w3.org/1999/xhtml"><p> <b> Generated Narrative</b> </p> <p> <b> id</b> : example</p> <p> <b> url</b> : <b> http://h7.org/fhir/GraphDefinition/example</b> </p> <p> <b> name</b> : Document Generation Template</p> <p> <b> status</b> : draft</p> <p> <b> date</b> : 2015-08-04</p> <p> <b> publisher</b> : FHIR Project</p> <p> <b> contact</b> : http://hl7.org/fhir</p> <p> <b> description</b> : Specify to include list references when generating a document using the $document operation</p> <p> <b> start</b> : Composition</p> <blockquote> <p> <b> link</b> </p> <p> <b> path</b> : Composition.section.entry</p> <p> <b> description</b> : Link to List</p> <blockquote> <p> <b> target</b> </p> <p> <b> type</b> : List</p> <h3> Compartments</h3> <table> <tr> <td> -</td> <td> <b> Use</b> </td> <td> <b> Code</b> </td> <td> <b> Rule</b> </td> </tr> <tr> <td> *</td> <td> requirement</td> <td> Patient</td> <td> identical</td> </tr> </table> <blockquote> <p> <b> link</b> </p> </blockquote> </blockquote> </blockquote> </div> </text> <url value="http://h7.org/fhir/GraphDefinition/example"/> 
  <name value="Document Generation Template"/> 
  <status value="draft"/> 
  <date value="2015-08-04"/> 
  <publisher value="FHIR Project"/> 
  <contact> 
    <telecom> 
      <system value="url"/> 
      <value value="http://hl7.org/fhir"/> 
    </telecom> 
  </contact> 
  <description value="Specify to include list references when generating a document using the $document operation"/> 
  <!--    
    the $document operation will include everything directly linked to by the composition
   resource.
    In our case, we want any resources referred to by lists referenced from the composition
   to 
    be included as well. 
    
    We do this by defining a 'graph' of resources - and then we'll say to the $document
   server,
    aggregate this graph as well as other resources. So we define a graph that starts
   at composition,
    goes from section to list, and includes all the resources the list includes. 
    
    While we're at it, we're going to say that all these resources must be about the same
   patient.
    Note that there are use cases for crossing patient record boundaries in documents,
   but not *this case*.
    
     -->
  
  <!--    this graph starts with a composition. We don't care what the specific profile is
     (though the statement above 'this case doesn't cross patients' implies that we do
   care a little)    -->
  <start value="Composition"/> 
  
  <!--    define the section -> list link    -->
  <link> 
    <!--    any section entry. Todo: this recurses; are we profiling this at all levels?    --> 
    <path value="Composition.section.entry"/> 
    <description value="Link to List"/> 
    <!--    
      one target. This graph is not making rules about the content of the section entries
     - that
      would be done in a profile. it's just saying, if you see a reference to a list in
     a section
      entry, these are the rules that describe the graph
       -->
    <target> 
      <type value="List"/> 
      <compartment> 
        <use value="requirement"/> 
        <code value="Patient"/> 
        <rule value="identical"/> 
      </compartment> 
      
      <!--    and inside this list, any references    -->
      <link> 
        <path value="List.entry.item"/> 
        <description value="Include any list entries"/> 
        <target> 
          <type value="Resource"/>  <!--    todo: is this the right way to do 'Any'?    -->
          <compartment> 
            <use value="requirement"/> 
            <code value="Patient"/> 
            <rule value="identical"/> 
          </compartment> 
        </target> 
      </link>       
    </target> 
  </link> 
</GraphDefinition> 

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.