<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="ehrsrle-auditevent" />
  <text>
    <status value="generated" />
    <div xmlns="http://www.w3.org/1999/xhtml">
      <p>The narrative has been removed to reduce the size of the distribution of the Hl7.Fhir.Specification library</p>
    </div>
  </text>
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-wg">
    <valueCode value="ehr" />
  </extension>
  <url value="http://hl7.org/fhir/StructureDefinition/ehrsrle-auditevent" />
  <name value="EHRS FM Record Lifecycle Event - Audit Event" />
  <status value="draft" />
  <experimental value="false" />
  <publisher value="Health Level Seven International (Electronic Health Record)" />
  <contact>
    <telecom>
      <system value="url" />
      <value value="http://hl7.org/special/committees/ehr.html" />
    </telecom>
  </contact>
  <description value="Defines the elements to be supported within the AuditEvent resource in order to conform with the Electronic Health Record System Functional Model Record Lifecycle Event standard" />
  <fhirVersion value="3.0.0" />
  <mapping>
    <identity value="rim" />
    <uri value="http://hl7.org/v3" />
    <name value="RIM Mapping" />
  </mapping>
  <mapping>
    <identity value="dicom" />
    <uri value="http://nema.org/dicom" />
    <name value="DICOM Tag Mapping" />
  </mapping>
  <mapping>
    <identity value="w5" />
    <uri value="http://hl7.org/fhir/w5" />
    <name value="W5 Mapping" />
  </mapping>
  <mapping>
    <identity value="w3c.prov" />
    <uri value="http://www.w3.org/ns/prov" />
    <name value="W3C PROV" />
  </mapping>
  <mapping>
    <identity value="fhirprovenance" />
    <uri value="http://hl7.org/fhir/provenance" />
    <name value="FHIR Provenance" />
  </mapping>
  <kind value="resource" />
  <abstract value="false" />
  <type value="AuditEvent" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/AuditEvent" />
  <derivation value="constraint" />
  <snapshot>
    <element id="AuditEvent">
      <path value="AuditEvent" />
      <short value="Event record kept for security purposes" />
      <definition value="A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage." />
      <comment value="Based on ATNA (RFC 3881)." />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Resource" />
        <min value="0" />
        <max value="*" />
      </base>
      <constraint>
        <key value="dom-2" />
        <severity value="error" />
        <human value="If the resource is contained in another resource, it SHALL NOT contain nested Resources" />
        <expression value="contained.contained.empty()" />
        <xpath value="not(parent::f:contained and f:contained)" />
        <source value="http://hl7.org/fhir/StructureDefinition/DomainResource" />
      </constraint>
      <constraint>
        <key value="dom-1" />
        <severity value="error" />
        <human value="If the resource is contained in another resource, it SHALL NOT contain any narrative" />
        <expression value="contained.text.empty()" />
        <xpath value="not(parent::f:contained and f:text)" />
        <source value="http://hl7.org/fhir/StructureDefinition/DomainResource" />
      </constraint>
      <constraint>
        <key value="dom-4" />
        <severity value="error" />
        <human value="If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated" />
        <expression value="contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()" />
        <xpath value="not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))" />
        <source value="http://hl7.org/fhir/StructureDefinition/DomainResource" />
      </constraint>
      <constraint>
        <key value="dom-3" />
        <severity value="error" />
        <human value="If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource" />
        <expression value="contained.where(('#'+id in %resource.descendants().reference).not()).empty()" />
        <xpath value="not(exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))]))" />
        <source value="http://hl7.org/fhir/StructureDefinition/DomainResource" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="Entity. Role, or Act" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="ControlAct[moodCode=EVN]" />
      </mapping>
      <mapping>
        <identity value="dicom" />
        <map value="Message" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="infrastructure.information" />
      </mapping>
    </element>
    <element id="AuditEvent.id">
      <path value="AuditEvent.id" />
      <short value="Logical id of this artifact" />
      <definition value="The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes." />
      <comment value="The only time that a resource does not have an id is when it is being submitted to the server using a create operation." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Resource.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="id" />
      </type>
      <isSummary value="true" />
    </element>
    <element id="AuditEvent.meta">
      <path value="AuditEvent.meta" />
      <short value="Metadata about the resource" />
      <definition value="The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Resource.meta" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Meta" />
      </type>
      <isSummary value="true" />
    </element>
    <element id="AuditEvent.implicitRules">
      <path value="AuditEvent.implicitRules" />
      <short value="A set of rules under which this content was created" />
      <definition value="A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content." />
      <comment value="Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. &#xA;&#xA;This element is labelled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies it's meaning or interpretation." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Resource.implicitRules" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="uri" />
      </type>
      <isModifier value="true" />
      <isSummary value="true" />
    </element>
    <element id="AuditEvent.language">
      <path value="AuditEvent.language" />
      <short value="Language of the resource content" />
      <definition value="The base language in which the resource is written." />
      <comment value="Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies  to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource  Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute)." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Resource.language" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="code" />
      </type>
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet">
          <valueReference>
            <reference value="http://hl7.org/fhir/ValueSet/all-languages" />
          </valueReference>
        </extension>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="Language" />
        </extension>
        <strength value="extensible" />
        <description value="A human language." />
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/languages" />
        </valueSetReference>
      </binding>
    </element>
    <element id="AuditEvent.text">
      <path value="AuditEvent.text" />
      <short value="Text summary of the resource, for human interpretation" />
      <definition value="A human-readable narrative that contains a summary of the resource, and may be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it &quot;clinically safe&quot; for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety." />
      <comment value="Contained resources do not have narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied).  This may be necessary for data from legacy systems where information is captured as a &quot;text blob&quot; or where text is additionally entered raw or narrated and encoded in formation is added later." />
      <alias value="narrative" />
      <alias value="html" />
      <alias value="xhtml" />
      <alias value="display" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="DomainResource.text" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Narrative" />
      </type>
      <condition value="dom-1" />
      <mapping>
        <identity value="rim" />
        <map value="Act.text?" />
      </mapping>
    </element>
    <element id="AuditEvent.contained">
      <path value="AuditEvent.contained" />
      <short value="Contained, inline Resources" />
      <definition value="These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope." />
      <comment value="This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again." />
      <alias value="inline resources" />
      <alias value="anonymous resources" />
      <alias value="contained resources" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="DomainResource.contained" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Resource" />
      </type>
      <mapping>
        <identity value="rim" />
        <map value="Entity. Role, or Act" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="AuditEvent.extension">
      <path value="AuditEvent.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional Content defined by implementations" />
      <definition value="May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension." />
      <comment value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone." />
      <alias value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="DomainResource.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="AuditEvent.modifierExtension">
      <path value="AuditEvent.modifierExtension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Extensions that cannot be ignored" />
      <definition value="May be used to represent additional information that is not part of the basic definition of the resource, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions." />
      <comment value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone." />
      <alias value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="DomainResource.modifierExtension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <isModifier value="true" />
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="AuditEvent.type">
      <path value="AuditEvent.type" />
      <short value="Type/identifier of event" />
      <definition value="Identifier for a family of the event.  For example, a menu item, program, rule, policy, function code, application name or URL. It identifies the performed function." />
      <requirements value="This identifies the performed function. For &quot;Execute&quot; Event Action Code audit records, this identifies the application function performed." />
      <min value="1" />
      <max value="1" />
      <base>
        <path value="AuditEvent.type" />
        <min value="1" />
        <max value="1" />
      </base>
      <type>
        <code value="Coding" />
      </type>
      <mustSupport value="true" />
      <isSummary value="true" />
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="AuditEventType" />
        </extension>
        <strength value="extensible" />
        <description value="Type of event." />
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/audit-event-type" />
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="rim" />
        <map value=".code (type, subtype and action are pre-coordinated or sent as translations)" />
      </mapping>
      <mapping>
        <identity value="dicom" />
        <map value="EventId" />
      </mapping>
      <mapping>
        <identity value="w3c.prov" />
        <map value="Activity" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="what" />
      </mapping>
    </element>
    <element id="AuditEvent.subtype">
      <path value="AuditEvent.subtype" />
      <short value="More specific type/id for the event" />
      <definition value="Identifier for the category of event." />
      <requirements value="This field enables queries of messages by implementation-defined event categories." />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="AuditEvent.subtype" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Coding" />
      </type>
      <mustSupport value="true" />
      <isSummary value="true" />
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="AuditEventSubType" />
        </extension>
        <strength value="extensible" />
        <description value="Sub-type of event." />
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/audit-event-sub-type" />
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="rim" />
        <map value=".code (type, subtype and action are pre-coordinated or sent as translations)" />
      </mapping>
      <mapping>
        <identity value="dicom" />
        <map value="EventTypeCode" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="what" />
      </mapping>
    </element>
    <element id="AuditEvent.action">
      <path value="AuditEvent.action" />
      <short value="Type of action performed during the event" />
      <definition value="Indicator for type of action performed during the event that generated the audit." />
      <requirements value="This broadly indicates what kind of action was done on the AuditEvent.entity by the AuditEvent.agent." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="AuditEvent.action" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="code" />
      </type>
      <mustSupport value="true" />
      <isSummary value="true" />
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="AuditEventAction" />
        </extension>
        <strength value="required" />
        <description value="Indicator for type of action performed during the event that generated the event" />
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/audit-event-action" />
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="rim" />
        <map value=".code (type, subtype and action are pre-coordinated or sent as translations)" />
      </mapping>
      <mapping>
        <identity value="dicom" />
        <map value="EventActionCode" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="what" />
      </mapping>
    </element>
    <element id="AuditEvent.recorded">
      <path value="AuditEvent.recorded" />
      <short value="Time when the event occurred on source" />
      <definition value="The time when the event occurred on the source." />
      <comment value="In a distributed system, some sort of common time base (e.g. an NTP [RFC1305] server) is a good implementation tactic." />
      <requirements value="This ties an event to a specific date and time. Security audits typically require a consistent time base (e.g. UTC), to eliminate time-zone issues arising from geographical distribution." />
      <min value="1" />
      <max value="1" />
      <base>
        <path value="AuditEvent.recorded" />
        <min value="1" />
        <max value="1" />
      </base>
      <type>
        <code value="instant" />
      </type>
      <mustSupport value="true" />
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value=".effectiveTime" />
      </mapping>
      <mapping>
        <identity value="dicom" />
        <map value="EventDateTime" />
      </mapping>
      <mapping>
        <identity value="w3c.prov" />
        <map value="Activity.when" />
      </mapping>
      <mapping>
        <identity value="fhirprovenance" />
        <map value="Provenance.recorded" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="when.recorded" />
      </mapping>
    </element>
    <element id="AuditEvent.outcome">
      <path value="AuditEvent.outcome" />
      <short value="Whether the event succeeded or failed" />
      <definition value="Indicates whether the event succeeded or failed." />
      <comment value="In some cases a &quot;success&quot; may be partial, for example, an incomplete or interrupted transfer of a radiological study. For the purpose of establishing accountability, these distinctions are not relevant." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="AuditEvent.outcome" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="code" />
      </type>
      <isSummary value="true" />
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="AuditEventOutcome" />
        </extension>
        <strength value="required" />
        <description value="Indicates whether the event succeeded or failed" />
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/audit-event-outcome" />
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="rim" />
        <map value=".actionNegationInd" />
      </mapping>
      <mapping>
        <identity value="dicom" />
        <map value="EventOutcomeIndicator" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="what" />
      </mapping>
    </element>
    <element id="AuditEvent.outcomeDesc">
      <path value="AuditEvent.outcomeDesc" />
      <short value="Description of the event outcome" />
      <definition value="A free text description of the outcome of the event." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="AuditEvent.outcomeDesc" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value=".outboundRelationship[typeCode=OUT].target.text" />
      </mapping>
      <mapping>
        <identity value="dicom" />
        <map value="EventOutcomeDescription" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="what" />
      </mapping>
    </element>
    <element id="AuditEvent.purposeOfEvent">
      <path value="AuditEvent.purposeOfEvent" />
      <short value="The purposeOfUse of the event" />
      <definition value="The purposeOfUse (reason) that was used during the event being recorded." />
      <comment value="Use AuditEvent.agent.purposeOfUse when you know that it is specific to the agent, otherwise use AuditEvent.purposeOfEvent. For example, during a machine-to-machine transfer it might not be obvious to the audit system who caused the event, but it does know why." />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="AuditEvent.purposeOfEvent" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="CodeableConcept" />
      </type>
      <mustSupport value="true" />
      <isSummary value="true" />
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="AuditPurposeOfUse" />
        </extension>
        <strength value="extensible" />
        <description value="The reason the activity took place." />
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/v3-PurposeOfUse" />
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="rim" />
        <map value="* .reasonCode [ControlActReason when Act.class = CACT Control Act]&#xA;*.outboundRelationship[typeCode=RSON].target" />
      </mapping>
      <mapping>
        <identity value="dicom" />
        <map value="EventPurposeOfUse" />
      </mapping>
      <mapping>
        <identity value="w3c.prov" />
        <map value="Activity.Activity" />
      </mapping>
      <mapping>
        <identity value="fhirprovenance" />
        <map value="Provenance.reason, Provenance.activity" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="why" />
      </mapping>
    </element>
    <element id="AuditEvent.agent">
      <path value="AuditEvent.agent" />
      <short value="Actor involved in the event" />
      <definition value="An actor taking an active role in the event or activity that is logged." />
      <comment value="Several agents may be associated (i.e. have some responsibility for an activity) with an event or activity.&#xA;&#xA;For example, an activity may be initiated by one user for other users or involve more than one user. However, only one user may be the initiator/requestor for the activity." />
      <requirements value="An agent can be a person, an organization, software, device, or other actors that may be ascribed responsibility." />
      <alias value="ActiveParticipant" />
      <min value="1" />
      <max value="*" />
      <base>
        <path value="AuditEvent.agent" />
        <min value="1" />
        <max value="*" />
      </base>
      <type>
        <code value="BackboneElement" />
      </type>
      <mustSupport value="true" />
      <mapping>
        <identity value="rim" />
        <map value=".participation" />
      </mapping>
      <mapping>
        <identity value="dicom" />
        <map value="ActiveParticipant" />
      </mapping>
      <mapping>
        <identity value="w3c.prov" />
        <map value="Agent" />
      </mapping>
      <mapping>
        <identity value="fhirprovenance" />
        <map value="Provenance.agent" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="who" />
      </mapping>
    </element>
    <element id="AuditEvent.source">
      <path value="AuditEvent.source" />
      <short value="Audit Event Reporter" />
      <definition value="The system that is reporting the event." />
      <comment value="Since multi-tier, distributed, or composite applications make source identification ambiguous, this collection of fields may repeat for each application or process actively involved in the event. For example, multiple value-sets can identify participating web servers, application processes, and database server threads in an n-tier distributed application. Passive event participants (e.g. low-level network transports) need not be identified." />
      <requirements value="The event is reported by one source." />
      <min value="1" />
      <max value="1" />
      <base>
        <path value="AuditEvent.source" />
        <min value="1" />
        <max value="1" />
      </base>
      <type>
        <code value="BackboneElement" />
      </type>
      <mustSupport value="true" />
      <mapping>
        <identity value="rim" />
        <map value=".participation[typeCode=INF].role[classCode=ASSIGN].player[classCode=DEV, determinerCode=INSTANCE]" />
      </mapping>
      <mapping>
        <identity value="dicom" />
        <map value="AuditSourceIdentification" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="who.witness" />
      </mapping>
    </element>
    <element id="AuditEvent.entity">
      <path value="AuditEvent.entity" />
      <short value="Data or objects used" />
      <definition value="Specific instances of data or objects that have been accessed." />
      <comment value="Required unless the values for event identification, agent identification, and audit source identification are sufficient to document the entire auditable event. Because events may have more than one entity, this group can be a repeating set of values." />
      <requirements value="The event may have other entities involved." />
      <alias value="ParticipantObject" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="AuditEvent.entity" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="BackboneElement" />
      </type>
      <constraint>
        <key value="sev-1" />
        <severity value="error" />
        <human value="Either a name or a query (NOT both)" />
        <expression value="name.empty() or query.empty()" />
        <xpath value="not(exists(f:name)) or not(exists(f:query))" />
        <source value="http://hl7.org/fhir/StructureDefinition/AuditEvent" />
      </constraint>
      <mustSupport value="true" />
      <mapping>
        <identity value="rim" />
        <map value=".outboundRelationship[typeCode=SUBJ].target  or  .participation[typeCode=SBJ].role" />
      </mapping>
      <mapping>
        <identity value="dicom" />
        <map value="ParticipantObjectIdentification" />
      </mapping>
      <mapping>
        <identity value="w3c.prov" />
        <map value="Entity" />
      </mapping>
      <mapping>
        <identity value="fhirprovenance" />
        <map value="Provenance.target, Provenance.entity" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="what" />
      </mapping>
    </element>
  </snapshot>
  <differential>
    <element id="AuditEvent">
      <path value="AuditEvent" />
      <min value="0" />
      <max value="*" />
    </element>
    <element id="AuditEvent.type">
      <path value="AuditEvent.type" />
      <mustSupport value="true" />
    </element>
    <element id="AuditEvent.subtype">
      <path value="AuditEvent.subtype" />
      <mustSupport value="true" />
    </element>
    <element id="AuditEvent.action">
      <path value="AuditEvent.action" />
      <mustSupport value="true" />
    </element>
    <element id="AuditEvent.recorded">
      <path value="AuditEvent.recorded" />
      <mustSupport value="true" />
    </element>
    <element id="AuditEvent.purposeOfEvent">
      <path value="AuditEvent.purposeOfEvent" />
      <mustSupport value="true" />
    </element>
    <element id="AuditEvent.agent">
      <path value="AuditEvent.agent" />
      <mustSupport value="true" />
    </element>
    <element id="AuditEvent.agent.role">
      <path value="AuditEvent.agent.role" />
      <mustSupport value="true" />
    </element>
    <element id="AuditEvent.agent.reference">
      <path value="AuditEvent.agent.reference" />
      <mustSupport value="true" />
    </element>
    <element id="AuditEvent.agent.userId">
      <path value="AuditEvent.agent.userId" />
      <mustSupport value="true" />
    </element>
    <element id="AuditEvent.agent.requestor">
      <path value="AuditEvent.agent.requestor" />
      <mustSupport value="true" />
    </element>
    <element id="AuditEvent.agent.location">
      <path value="AuditEvent.agent.location" />
      <mustSupport value="true" />
    </element>
    <element id="AuditEvent.agent.policy">
      <path value="AuditEvent.agent.policy" />
      <mustSupport value="true" />
    </element>
    <element id="AuditEvent.agent.network">
      <path value="AuditEvent.agent.network" />
      <mustSupport value="true" />
    </element>
    <element id="AuditEvent.agent.network.address">
      <path value="AuditEvent.agent.network.address" />
      <mustSupport value="true" />
    </element>
    <element id="AuditEvent.agent.network.type">
      <path value="AuditEvent.agent.network.type" />
      <mustSupport value="true" />
    </element>
    <element id="AuditEvent.agent.purposeOfUse">
      <path value="AuditEvent.agent.purposeOfUse" />
      <mustSupport value="true" />
    </element>
    <element id="AuditEvent.source">
      <path value="AuditEvent.source" />
      <mustSupport value="true" />
    </element>
    <element id="AuditEvent.source.site">
      <path value="AuditEvent.source.site" />
      <mustSupport value="true" />
    </element>
    <element id="AuditEvent.source.identifier">
      <path value="AuditEvent.source.identifier" />
      <mustSupport value="true" />
    </element>
    <element id="AuditEvent.source.type">
      <path value="AuditEvent.source.type" />
      <mustSupport value="true" />
    </element>
    <element id="AuditEvent.entity">
      <path value="AuditEvent.entity" />
      <mustSupport value="true" />
    </element>
    <element id="AuditEvent.entity.identifier">
      <path value="AuditEvent.entity.identifier" />
      <mustSupport value="true" />
    </element>
    <element id="AuditEvent.entity.reference">
      <path value="AuditEvent.entity.reference" />
      <mustSupport value="true" />
    </element>
    <element id="AuditEvent.entity.type">
      <path value="AuditEvent.entity.type" />
      <mustSupport value="true" />
    </element>
    <element id="AuditEvent.entity.role">
      <path value="AuditEvent.entity.role" />
      <mustSupport value="true" />
    </element>
    <element id="AuditEvent.entity.lifecycle">
      <path value="AuditEvent.entity.lifecycle" />
      <mustSupport value="true" />
    </element>
    <element id="AuditEvent.entity.securityLabel">
      <path value="AuditEvent.entity.securityLabel" />
      <mustSupport value="true" />
    </element>
  </differential>
</StructureDefinition>