PackagesCanonicalsLogsProblems
    Packages
    ch.fhir.ig.ch-epr-fhir@4.0.1-ballot
    http://fhir.ch/ig/ch-epr-fhir/StructureDefinition/ch-mhd-updatedocumentmetadata-audit-source
description: Defines constraints on the AuditEvent Resource to record when a updatedocumentmetadata Transaction happens at the Source.\n- Export event\n- shall have source of itself\n- shall have a document source agent\n- shall have a document recipient agent\n- may have user, app, organization agent(s)\n- shall have a patient entity\n- shall have a submission set identity entity
package_name: ch.fhir.ig.ch-epr-fhir
derivation: constraint
name: AuditUpdateDocumentMetadataSource
type: AuditEvent
elements:
  modifierExtension: {index: 0}
  type:
    pattern:
      type: Coding
      value: {code: '110106', system: 'http://dicom.nema.org/resources/ontology/DCM', display: Export}
    index: 1
  subtype:
    index: 2
    slicing:
      rules: open
      discriminator:
      - {path: $this, type: value}
      min: 1
      slices:
        chmhd1:
          match: {code: CH-MHD-1, system: 'urn:e-health-suisse:event-type-code', display: Update Document Metadata}
          schema:
            pattern:
              type: Coding
              value: {code: CH-MHD-1, system: 'urn:e-health-suisse:event-type-code', display: Update Document Metadata}
            _required: true
            index: 3
          min: 1
          max: 1
  action:
    pattern: {type: Code, value: R}
    index: 4
  outcome: {index: 5}
  outcomeDesc: {mustSupport: true, index: 6}
  agent:
    array: true
    min: 2
    index: 7
    slicing:
      rules: open
      description: source, recipient, and possibly the user who participated
      discriminator:
      - {path: type, type: pattern}
      min: 2
      slices:
        documentSource:
          match:
            type:
              coding:
              - {code: '110153', system: 'http://dicom.nema.org/resources/ontology/DCM', display: Source Role ID}
          schema:
            short: Document Source
            constraint:
              val-audit-source: {human: The Audit Source is this agent too., source: 'http://fhir.ch/ig/ch-epr-fhir/StructureDefinition/ch-mhd-updatedocumentmetadata-audit-source', severity: error, expression: $this.who = %resource.source.observer}
            _required: true
            index: 8
            elements:
              type:
                pattern:
                  type: CodeableConcept
                  value:
                    coding:
                    - {code: '110153', system: 'http://dicom.nema.org/resources/ontology/DCM', display: Source Role ID}
                index: 9
              who: {index: 10}
              network: {index: 11}
            required: [who, network, type]
        documentRecipient:
          match:
            type:
              coding:
              - {code: '110152', system: 'http://dicom.nema.org/resources/ontology/DCM', display: Destination Role ID}
          schema:
            short: Document Recipient
            _required: true
            index: 12
            elements:
              type:
                pattern:
                  type: CodeableConcept
                  value:
                    coding:
                    - {code: '110152', system: 'http://dicom.nema.org/resources/ontology/DCM', display: Destination Role ID}
                index: 13
              who: {index: 14}
              network: {index: 15}
            required: [who, network, type]
  entity:
    array: true
    min: 2
    max: 2
    index: 16
    slicing:
      rules: closed
      description: patient and submission set involved
      discriminator:
      - {path: type, type: pattern}
      min: 2
      max: 2
      slices:
        patient:
          match:
            type: {code: '1', system: 'http://terminology.hl7.org/CodeSystem/audit-entity-type', display: Person}
          schema:
            short: Patient
            _required: true
            index: 17
            elements:
              what:
                type: Reference
                refers: ['http://hl7.org/fhir/StructureDefinition/Patient']
                index: 18
              type:
                pattern:
                  type: Coding
                  value: {code: '1', system: 'http://terminology.hl7.org/CodeSystem/audit-entity-type', display: Person}
                index: 19
              role:
                pattern:
                  type: Coding
                  value: {code: '1', system: 'http://terminology.hl7.org/CodeSystem/object-role', display: Patient}
                index: 20
            required: [what, type]
        documentReference:
          match:
            type: {code: '2', system: 'http://terminology.hl7.org/CodeSystem/audit-entity-type', display: System Object}
          schema:
            short: DocumentReference
            _required: true
            index: 21
            elements:
              what:
                type: Reference
                refers: ['http://hl7.org/fhir/StructureDefinition/DocumentReference']
                index: 22
              type:
                pattern:
                  type: Coding
                  value: {code: '2', system: 'http://terminology.hl7.org/CodeSystem/audit-entity-type', display: System Object}
                index: 23
              role:
                pattern:
                  type: Coding
                  value: {code: '20', system: 'http://terminology.hl7.org/CodeSystem/object-role', display: Job}
                index: 24
            required: [what, type]
package_version: 4.0.1-ballot
class: profile
kind: resource
url: http://fhir.ch/ig/ch-epr-fhir/StructureDefinition/ch-mhd-updatedocumentmetadata-audit-source
base: http://hl7.org/fhir/StructureDefinition/AuditEvent
version: 4.0.1-ballot
required: [subtype, outcome]