<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="nfdi4health-pr-mds-provenance" />
  <url value="https://www.nfdi4health.de/fhir/metadataschema/StructureDefinition/nfdi4health-pr-mds-provenance" />
  <version value="0.9" />
  <name value="NFDI4Health_PR_MDS_Provenance" />
  <title value="NFDI4Health PR MDS Provenance" />
  <status value="draft" />
  <publisher value="NFDI4Health" />
  <contact>
    <telecom>
      <system value="url" />
      <value value="https://www.nfdi4health.de" />
    </telecom>
  </contact>
  <description value="Profile to collect information how data was collected - manually v.s. automatically - and the activities related to a resource - e.g., when it was uploaded, when it was published, when it was updated, etc. - and the persons or devices involved." />
  <fhirVersion value="4.0.1" />
  <mapping>
    <identity value="workflow" />
    <uri value="http://hl7.org/fhir/workflow" />
    <name value="Workflow Pattern" />
  </mapping>
  <mapping>
    <identity value="rim" />
    <uri value="http://hl7.org/v3" />
    <name value="RIM Mapping" />
  </mapping>
  <mapping>
    <identity value="w3c.prov" />
    <uri value="http://www.w3.org/ns/prov" />
    <name value="W3C PROV" />
  </mapping>
  <mapping>
    <identity value="w5" />
    <uri value="http://hl7.org/fhir/fivews" />
    <name value="FiveWs Pattern Mapping" />
  </mapping>
  <mapping>
    <identity value="fhirauditevent" />
    <uri value="http://hl7.org/fhir/auditevent" />
    <name value="FHIR AuditEvent Mapping" />
  </mapping>
  <mapping>
    <identity value="NFDI4Health" />
    <name value="NFDI4Health to FHIR Mapping" />
  </mapping>
  <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" />
      <short value="Provenance aspects of data entry" />
      <definition value="Group of items providing information about provenance aspects of the data entry on this portal." />
      <mapping>
        <identity value="NFDI4Health" />
        <map value="Resource.provenance" />
      </mapping>
    </element>
    <element id="Provenance.meta.versionId">
      <path value="Provenance.meta.versionId" />
      <short value="Version number" />
      <definition value="Version number of the [RESOURCE] within this portal" />
      <mapping>
        <identity value="NFDI4Health" />
        <map value="Resource.provenance.resourceVersion" />
      </mapping>
    </element>
    <element id="Provenance.target">
      <path value="Provenance.target" />
      <definition value="The Reference(s) that were generated or updated by the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity." />
      <type>
        <code value="Reference" />
        <targetProfile value="https://www.nfdi4health.de/fhir/metadataschema/StructureDefinition/nfdi4health-pr-mds-questionnaire" />
        <targetProfile value="https://www.nfdi4health.de/fhir/metadataschema/StructureDefinition/nfdi4health-pr-mds-document" />
        <targetProfile value="https://www.nfdi4health.de/fhir/metadataschema/StructureDefinition/nfdi4health-pr-mds-study" />
        <targetProfile value="https://www.nfdi4health.de/fhir/metadataschema/StructureDefinition/nfdi4health-pr-mds-registry" />
      </type>
    </element>
    <element id="Provenance.recorded">
      <path value="Provenance.recorded" />
      <short value="Last verified on | First submitted on | First posted/published on | Last update submitted on | Last update posted/published on" />
      <definition value="For verification date: Date on which the responsible party last verified the information about the [RESOURCE], even if no additional or updated information is being submitted. | For first submission date: Date when the [RESOURCE] was first submitted for publication. | For first posted date: Date when the [RESOURCE] was first posted/published. | For last update submission date: Date when the last update of the [RESOURCE] was submitted for publication. | For last update posted date: Date when the last update of the [RESOURCE] was posted/published." />
      <mapping>
        <identity value="NFDI4Health" />
        <map value="Resource.provenance.verificationDate" />
      </mapping>
      <mapping>
        <identity value="NFDI4Health" />
        <map value="Resource.provenance.firstSubmittedDate" />
      </mapping>
      <mapping>
        <identity value="NFDI4Health" />
        <map value="Resource.provenance.firstPostedDate" />
      </mapping>
      <mapping>
        <identity value="NFDI4Health" />
        <map value="Resource.provenance.lastUpdateSubmittedDate" />
      </mapping>
      <mapping>
        <identity value="NFDI4Health" />
        <map value="Resource.provenance.lastUpdatePostedDate" />
      </mapping>
    </element>
    <element id="Provenance.activity">
      <path value="Provenance.activity" />
      <min value="1" />
      <binding>
        <strength value="required" />
        <description value="Value set defining codes for activity types." />
        <valueSet value="https://www.nfdi4health.de/fhir/metadataschema/ValueSet/nfdi4health-vs-mds-provenance-activity-hl7-local" />
      </binding>
    </element>
    <element id="Provenance.agent">
      <path value="Provenance.agent" />
      <short value="Last verified by [USER] | First submitted by [USER] | First posted/published by [USER] | Last updated submitted by [USER] | Last update posted/published by [USER]" />
      <definition value="For verification user: User who last verified the information about the [RESOURCE]. | For first submission user: User who first submitted the [RESOURCE] for publication. | For first posted user: User who first posted/published the [RESOURCE]. | For last update submission user: User who submitted the last update of the [RESOURCE]. | For last update posted user: User who posted/published the last update of the [RESOURCE]." />
      <mapping>
        <identity value="NFDI4Health" />
        <map value="Resource.provenance.verificationUser" />
      </mapping>
      <mapping>
        <identity value="NFDI4Health" />
        <map value="Resource.provenance.firstSubmittedUser" />
      </mapping>
      <mapping>
        <identity value="NFDI4Health" />
        <map value="Resource.provenance.firstPostedUser" />
      </mapping>
      <mapping>
        <identity value="NFDI4Health" />
        <map value="Resource.provenance.lastUpdateSubmittedUser" />
      </mapping>
      <mapping>
        <identity value="NFDI4Health" />
        <map value="Resource.provenance.lastUpdatePostedUser" />
      </mapping>
    </element>
    <element id="Provenance.agent.who">
      <path value="Provenance.agent.who" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://www.nfdi4health.de/fhir/metadataschema/StructureDefinition/nfdi4health-pr-mds-practitioner" />
        <targetProfile value="https://www.nfdi4health.de/fhir/metadataschema/StructureDefinition/nfdi4health-pr-mds-organization" />
      </type>
    </element>
  </differential>
</StructureDefinition>