<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="pr-provenance" />
  <meta>
    <source value="https://www.icanbwell.com/fhir_profile_definitions" />
    <security>
      <system value="https://www.icanbwell.com/owner" />
      <code value="bwell" />
    </security>
    <security>
      <system value="https://www.icanbwell.com/access" />
      <code value="bwell" />
    </security>
  </meta>
  <url value="https://fhir.icanbwell.com/4_0_0/StructureDefinition/pr-provenance" />
  <version value="1.02" />
  <name value="Provenance" />
  <title value="Profile: Provenance" />
  <status value="active" />
  <experimental value="false" />
  <date value="2022-06-02" />
  <publisher value="b.Well Connected Health" />
  <description value="Provenance" />
  <jurisdiction>
    <coding>
      <system value="urn:iso:std:iso:3166" />
      <code value="US" />
      <display value="United States of America" />
    </coding>
    <text value="United States of America" />
  </jurisdiction>
  <fhirVersion value="4.0.0" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="Provenance" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Provenance" />
  <derivation value="constraint" />
  <differential>
    <element id="Provenance">
      <path value="Provenance" />
    </element>
    <element id="Provenance.id">
      <path value="Provenance.id" />
    </element>
    <element id="Provenance.meta">
      <path value="Provenance.meta" />
      <label value="meta" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Meta" />
      </type>
    </element>
    <element id="Provenance.meta.source">
      <path value="Provenance.meta.source" />
      <sliceName value="meta-source" />
      <label value="meta" />
      <short value="uri of the data source" />
      <definition value="Typically the data owner's URL followed by a source/file description" />
      <requirements value="mandatory for all resources in bWell's FHIR Server" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="uri" />
      </type>
      <example>
        <label value="example of meta.source" />
        <valueUri value="https://www.icanbwell.com/provider-directory" />
      </example>
    </element>
    <element id="Provenance.meta.security">
      <path value="Provenance.meta.security" />
      <sliceName value="meta-security" />
      <label value="meta" />
      <short value="security tags representing the data's owner, vendor, and accessibility" />
      <definition value="data owner: &#xA; &#xA; data vendor: &#xA; &#xA; data access:" />
      <requirements value="/owner &amp; /access are mandatory for all resources in bWell's FHIR Server" />
      <min value="1" />
      <max value="*" />
      <type>
        <code value="Coding" />
      </type>
      <example>
        <label value="example of data owner security tag" />
        <valueCoding>
          <system value="https://www.icanbwell.com/owner" />
          <code value="bwell" />
        </valueCoding>
      </example>
      <example>
        <label value="example of data access security tag" />
        <valueCoding>
          <system value="https://www.icanbwell.com/access" />
          <code value="bwell" />
        </valueCoding>
      </example>
      <example>
        <label value="example of data vendor security tag" />
        <valueCoding>
          <system value="https://www.icanbwell.com/vendor" />
          <code value="bwell" />
        </valueCoding>
      </example>
    </element>
    <element id="Provenance.target">
      <path value="Provenance.target" />
      <short value="Link to EnrollmentRequest" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.icanbwell.com/4_0_0/StructureDefinition/pr-enrollment-request" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Provenance.recorded">
      <path value="Provenance.recorded" />
      <mustSupport value="true" />
    </element>
    <element id="agent">
      <path value="Provenance.agent" />
      <label value="agent" />
      <slicing>
        <description value="slice by type" />
        <rules value="open" />
      </slicing>
      <min value="1" />
      <max value="*" />
      <type>
        <code value="BackboneElement" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="agent.id">
      <path value="Provenance.agent.id" />
      <label value="agent" />
      <short value="set to type code" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="agent.type">
      <path value="Provenance.agent.type" />
      <label value="agent" />
      <type>
        <code value="CodeableConcept" />
      </type>
      <patternCodeableConcept>
        <coding>
          <system value="http://terminology.hl7.org/CodeSystem/contractsignertypecodes" />
          <code value="VERF" />
        </coding>
      </patternCodeableConcept>
      <mustSupport value="true" />
      <binding>
        <strength value="extensible" />
        <valueSet value="http://terminology.hl7.org/CodeSystem/contractsignertypecodes" />
      </binding>
    </element>
    <element id="agent.who">
      <path value="Provenance.agent.who" />
      <label value="agent" />
      <min value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.icanbwell.com/4_0_0/StructureDefinition/pr-patient" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="de-signature">
      <path value="Provenance.signature" />
      <label value="signature" />
      <slicing>
        <description value="slice by type" />
        <rules value="open" />
      </slicing>
      <min value="0" />
      <max value="*" />
      <type>
        <code value="CodeableConcept" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="de-signature.id">
      <path value="Provenance.signature.id" />
      <label value="signature" />
      <short value="signature" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="string" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="de-signature.type">
      <path value="Provenance.signature.type" />
      <label value="signature" />
      <min value="1" />
      <type>
        <code value="Coding" />
      </type>
      <patternCoding>
        <system value="urn:iso-astm:E1762-95:2013" />
        <code value="1.2.840.10065.1.12.1.5" />
        <display value="Verification Signature" />
      </patternCoding>
      <mustSupport value="true" />
      <binding>
        <strength value="example" />
        <valueSet value="urn:iso-astm:E1762-95:2013" />
      </binding>
    </element>
    <element id="de-signature.when">
      <path value="Provenance.signature.when" />
      <label value="signature" />
      <short value="When the signature was created" />
      <min value="1" />
      <type>
        <code value="instant" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="de-signature.who">
      <path value="Provenance.signature.who" />
      <label value="signature" />
      <short value="Who signed" />
      <min value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.icanbwell.com/4_0_0/StructureDefinition/pr-patient" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="de-signature.targetFormat">
      <path value="Provenance.signature.targetFormat" />
      <label value="signature" />
      <short value="The technical format of the signed resources" />
      <type>
        <code value="code" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="de-signature.data">
      <path value="Provenance.signature.data" />
      <label value="signature" />
      <short value="The actual signature content (xml, picture, etc)" />
      <min value="1" />
      <type>
        <code value="base64Binary" />
      </type>
      <mustSupport value="true" />
    </element>
  </differential>
</StructureDefinition>