<?xml version=“1.0” encoding=“UTF-8”?> <Provenance xmlns=“hl7.org/fhir”>

      <id value="example"/>
      <meta>
  <security>
    <system value="http://terminology.hl7.org/CodeSystem/v3-ActReason"/>
    <code value="HTEST"/>
    <display value="test health data"/>
  </security>
</meta>

      <!--  
  where possible, provenance targets should be version specific,
  so that there is no ambiguity about which version of the 
  record this relates to
 -->
      <target>
              <reference value="Procedure/example/_history/1"/>
      </target>
      <occurredPeriod>
              <start value="2015-06-27"/>
              <end value="2015-06-28"/>
      </occurredPeriod>
      <recorded value="2015-06-27T08:39:24+10:00"/>
      <!--  reference to a patient consent to share inforamtion  -->
      <policy value="http://acme.com/fhir/Consent/25"/>
      <location>
              <reference value="Location/1"/>
      </location>
      <reason>
              <coding>
                      <system value="http://snomed.info/sct"/>
                      <code value="3457005"/>
                      <display value="Referral"/>
              </coding>
      </reason>

      <!--  author = Harold Hippocrates  -->
      <agent>
              <type>
                      <coding>
                              <system value="http://terminology.hl7.org/CodeSystem/v3-ParticipationType"/>
                              <code value="AUT"/>
                      </coding>
              </type>
              <who>
                      <reference value="Practitioner/xcda-author"/>
              </who>
              <!--  reference to other agent defined within  -->
              <!--    removed as unclear how to do this now     <onBehalfOf value="#a1"/>     -->

      </agent>
      <!--  device = software Harold used  -->
      <agent id="a1">
              <type>
                      <coding>
                              <system value="http://terminology.hl7.org/CodeSystem/v3-ParticipationType"/>
                              <code value="DEV"/>
                      </coding>
              </type>
              <who>
                      <reference value="Device/software"/>
              </who>
      </agent>
      <!--  information extract from a CCDA referral document  -->
      <entity>
              <role value="source"/>
              <!--  
    the document is in an XDS repository. 
    as a source, we're going to give an MHD 
    reference. (easier than XDS.b call with parameters!)
        Given the reference is to a FHIR DocumentReference, that resource describes the kind of content
   -->
              <what>
                      <reference value="DocumentReference/example"/>    
                      <display value="CDA Document in XDS repository"/>
              </what>
      </entity>

</Provenance>