PackagesCanonicalsLogsProblems
    Packages
    ch.fhir.ig.ch-epr-fhir@4.0.1-ballot-2
    http://fhir.ch/ig/ch-epr-fhir/StructureDefinition/ch-mhd-updatedocumentmetadata-audit-source
description: This profile is used to define the CH Audit Event for the [CH:MHD-1] transaction and the actor 'Document\nSource'.
package_name: ch.fhir.ig.ch-epr-fhir
derivation: constraint
name: ChAuditEventChMhd1Source
type: AuditEvent
elements:
  outcomeDesc: {mustSupport: true, index: 6}
  type:
    pattern:
      type: Coding
      value: {code: '110106', system: 'http://dicom.nema.org/resources/ontology/DCM', display: Export}
    index: 1
  outcome: {index: 5}
  source:
    elements:
      site: {short: The OID of the audit source, index: 27}
    required: [site]
  agent:
    array: true
    min: 3
    index: 7
    slicing:
      rules: open
      description: source, recipient, and possibly the user who participated
      discriminator:
      - {path: type, type: pattern}
      min: 3
      slices:
        documentSource:
          match:
            type:
              coding:
              - {code: '110153', system: 'http://dicom.nema.org/resources/ontology/DCM', display: Source Role ID}
          schema:
            short: The 'Document Source' actor (EPR application)
            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: The 'Document Recipient' actor (EPR API)
            _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]
        mainUser:
          match:
            type:
              coding:
              - {code: RESP, system: 'http://terminology.hl7.org/CodeSystem/v3-ParticipationType', display: responsible party}
          schema:
            short: The main user (patient, representative, healthcare professional, or administrator)
            _required: true
            index: 16
            elements:
              type:
                pattern:
                  type: CodeableConcept
                  value:
                    coding:
                    - {code: RESP, system: 'http://terminology.hl7.org/CodeSystem/v3-ParticipationType', display: responsible party}
                index: 17
              role: {index: 18}
              altId: {index: 19}
              name: {index: 20}
              purposeOfUse:
                binding: {strength: required, valueSet: 'http://fhir.ch/ig/ch-term/ValueSet/EprPurposeOfUse'}
                index: 21
            required: [role, purposeOfUse, name, type, altId]
        delegatedUser:
          match:
            type:
              coding:
              - {code: PPRF, system: 'http://terminology.hl7.org/CodeSystem/v3-ParticipationType', display: primary performer}
          schema:
            short: The person who acted on behalf of the main user (an assistant or technical user)
            index: 22
            elements:
              type:
                pattern:
                  type: CodeableConcept
                  value:
                    coding:
                    - {code: PPRF, system: 'http://terminology.hl7.org/CodeSystem/v3-ParticipationType', display: primary performer}
                index: 23
              role: {index: 24}
              altId: {index: 25}
              name: {index: 26}
            required: [role, name, type, altId]
  action:
    pattern: {type: Code, value: R}
    index: 4
  entity:
    array: true
    min: 2
    index: 28
    slicing:
      rules: closed
      description: patient and submission set involved
      discriminator:
      - {path: type, type: pattern}
      min: 2
      slices:
        patient:
          match:
            type: {code: '1', system: 'http://terminology.hl7.org/CodeSystem/audit-entity-type', display: Person}
          schema:
            short: Patient
            _required: true
            index: 29
            elements:
              what:
                type: Reference
                refers: ['http://hl7.org/fhir/StructureDefinition/Patient']
                index: 30
                elements:
                  identifier:
                    index: 31
                    elements:
                      system: {index: 32}
                      value: {index: 33}
                    required: [value, system]
                required: [identifier]
              type:
                pattern:
                  type: Coding
                  value: {code: '1', system: 'http://terminology.hl7.org/CodeSystem/audit-entity-type', display: Person}
                index: 34
              role:
                pattern:
                  type: Coding
                  value: {code: '1', system: 'http://terminology.hl7.org/CodeSystem/object-role', display: Patient}
                index: 35
            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: 36
            elements:
              what:
                type: Reference
                refers: ['http://hl7.org/fhir/StructureDefinition/DocumentReference']
                index: 37
                elements:
                  reference: {index: 38}
                required: [reference]
              type:
                pattern:
                  type: Coding
                  value: {code: '2', system: 'http://terminology.hl7.org/CodeSystem/audit-entity-type', display: System Object}
                index: 39
              role:
                pattern:
                  type: Coding
                  value: {code: '20', system: 'http://terminology.hl7.org/CodeSystem/object-role', display: Job}
                index: 40
            required: [what, type]
        traceparent:
          match:
            type: {code: '4', system: 'http://terminology.hl7.org/CodeSystem/audit-entity-type', display: Other}
          schema:
            short: The 'traceparent' header value of the transaction
            index: 41
            elements:
              what:
                index: 42
                elements:
                  identifier:
                    index: 43
                    elements:
                      value: {short: The 'traceparent' header value, index: 44}
                    required: [value]
                required: [identifier]
              type:
                pattern:
                  type: Coding
                  value: {code: '4', system: 'http://terminology.hl7.org/CodeSystem/audit-entity-type', display: Other}
                index: 45
              role:
                pattern:
                  type: Coding
                  value: {code: '26', system: 'http://terminology.hl7.org/CodeSystem/object-role', display: Processing Element}
                index: 46
            required: [what, type]
  modifierExtension: {index: 0}
  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
package_version: 4.0.1-ballot-2
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-2
required: [subtype, outcome]