PackagesCanonicalsLogsProblems
    Packages
    ch.fhir.ig.ch-atc@3.2.0-ballot
    http://fhir.ch/ig/ch-atc/StructureDefinition/DocumentAuditEvent
description: This profile defines the content of the document audit events which a community has to provide for a patients audit trail.
package_name: ch.fhir.ig.ch-atc
derivation: constraint
name: DocumentAuditEvent
type: AuditEvent
elements:
  type:
    binding: {strength: extensible, valueSet: 'http://hl7.org/fhir/ValueSet/audit-event-type'}
    index: 0
  subtype:
    index: 1
    slicing:
      rules: open
      discriminator:
      - {path: system, type: value}
      min: 1
      slices:
        DocumentAuditEventType:
          match: {system: 'urn:oid:2.16.756.5.30.1.127.3.10.7'}
          schema:
            short: DocumentAuditEventType
            binding: {strength: required, valueSet: 'http://fhir.ch/ig/ch-atc/ValueSet/DocumentAuditEventType'}
            _required: true
            index: 2
            elements:
              system:
                pattern: {type: Uri, value: 'urn:oid:2.16.756.5.30.1.127.3.10.7'}
                index: 3
            required: [system]
  recorded: {index: 4}
  purposeOfEvent:
    binding: {strength: required, valueSet: 'http://fhir.ch/ig/ch-epr-term/ValueSet/EprPurposeOfUse'}
    index: 5
  agent:
    short: Participants
    index: 6
    elements:
      role:
        binding: {strength: required, valueSet: 'http://fhir.ch/ig/ch-atc/ValueSet/EprParticipant'}
        index: 7
      who:
        elements:
          identifier: {type: Identifier, index: 8}
        required: [identifier]
      name: {index: 9}
      requestor: {index: 10}
    required: [role, name]
  entity:
    index: 11
    slicing:
      rules: open
      discriminator:
      - {path: type.code, type: value}
      - {path: role.code, type: value}
      min: null
      slices:
        Patient:
          match:
            type: {code: '1'}
            role: {code: '1'}
          schema:
            short: Patient
            _required: true
            index: 12
            elements:
              what:
                elements:
                  identifier:
                    type: Identifier
                    short: Patient Id (EPR-SPID)
                    index: 13
                    elements:
                      system:
                        pattern: {type: Uri, value: 'urn:oid:2.16.756.5.30.1.127.3.10.3'}
                        index: 14
                    required: [system]
                required: [identifier]
              type:
                index: 15
                elements:
                  code:
                    pattern: {type: Code, value: '1'}
                    index: 16
                required: [code]
              role:
                index: 17
                elements:
                  code:
                    pattern: {type: Code, value: '1'}
                    index: 18
                required: [code]
            required: [role, type]
        Document:
          match:
            type: {code: '2'}
            role: {code: '3'}
          schema:
            short: Document
            index: 19
            elements:
              what:
                elements:
                  identifier: {type: Identifier, short: XDSDocumentEntry.uniqueId, index: 20}
                required: [identifier]
              type:
                index: 21
                elements:
                  code:
                    pattern: {type: Code, value: '2'}
                    index: 22
                required: [code]
              role:
                index: 23
                elements:
                  code:
                    pattern: {type: Code, value: '3'}
                    index: 24
                required: [code]
              detail:
                array: true
                min: 4
                index: 25
                slicing:
                  rules: open
                  discriminator:
                  - {path: type, type: value}
                  min: 4
                  slices:
                    repositoryUniqueId:
                      match: {type: Repository Unique Id}
                      schema:
                        short: repositoryUniqueId
                        _required: true
                        index: 26
                        elements:
                          type:
                            pattern: {type: String, value: Repository Unique Id}
                            index: 27
                          value: {type: base64Binary, index: 28}
                    homeCommunityID:
                      match: {type: homeCommunityID}
                      schema:
                        short: homeCommunityID
                        _required: true
                        index: 29
                        elements:
                          type:
                            pattern: {type: String, value: homeCommunityID}
                            index: 30
                          value: {type: base64Binary, index: 31}
                    EprDocumentTypeCode:
                      match: {type: EprDocumentTypeCode}
                      schema:
                        short: EprDocumentTypeCode
                        _required: true
                        index: 32
                        elements:
                          type:
                            pattern: {type: String, value: EprDocumentTypeCode}
                            index: 33
                          value: {type: base64Binary, index: 34}
                    title:
                      match: {type: title}
                      schema:
                        short: title
                        _required: true
                        index: 35
                        elements:
                          type:
                            pattern: {type: String, value: title}
                            index: 36
                          value: {type: base64Binary, index: 37}
            required: [role, type]
        Query:
          match:
            type: {code: '2'}
            role: {code: '24'}
          schema:
            short: Query
            index: 38
            elements:
              what:
                elements:
                  identifier: {type: Identifier, short: Query ID (UUID), index: 39}
                required: [identifier]
              type:
                index: 40
                elements:
                  code:
                    pattern: {type: Code, value: '2'}
                    index: 41
                required: [code]
              role:
                index: 42
                elements:
                  code:
                    pattern: {type: Code, value: '24'}
                    index: 43
                required: [code]
            required: [role, type]
package_version: 3.2.0-ballot
class: profile
kind: resource
url: http://fhir.ch/ig/ch-atc/StructureDefinition/DocumentAuditEvent
base: http://hl7.org/fhir/StructureDefinition/AuditEvent
version: 3.2.0-ballot
required: [subtype, purposeOfEvent]