PackagesCanonicalsLogsProblems
    Packages
    se.electronichealth.fhir.ppdr.r5@1.0.0-beta.1
    http://electronichealth.se/fhir/NDI/StructureDefinition/restriction-re
description: Profile for restricting access to patient data
package_name: se.electronichealth.fhir.ppdr.r5
derivation: constraint
name: RestrictionRe
type: Consent
elements:
  category:
    binding: {strength: required, valueSet: 'http://electronichealth.se/fhir/NDI/ValueSet/re-restriction-categories'}
    index: 2
    elements:
      coding:
        index: 3
        elements:
          system: {index: 4}
          code: {index: 5}
        required: [system, code]
    required: [coding]
  provision:
    index: 31
    elements:
      provision:
        type: BackboneElement
        index: 32
        elements:
          purpose:
            index: 33
            elements:
              system: {index: 34}
              code: {index: 35}
            required: [system, code]
          documentType:
            short: The category of data the provision concerns
            binding: {strength: required, valueSet: 'http://hl7.eu/fhir/base-r5/ValueSet/ehdsCategories-eu'}
            index: 36
          data:
            index: 37
            elements:
              meaning: {index: 38}
              reference: {index: 39}
            slicing:
              rules: open
              ordered: false
              description: Slice data based on meaning
              discriminator:
              - {path: meaning, type: value}
              min: null
              slices:
                fromCaregiverOrUnit:
                  match: {meaning: authoredby}
                  schema:
                    array: true
                    index: 40
                    elements:
                      meaning:
                        pattern: {type: Code, value: authoredby}
                        index: 41
                      reference:
                        type: Reference
                        refers: ['http://electronichealth.se/fhir/NDI/StructureDefinition/organization-data-access']
                        index: 42
                        elements:
                          identifier:
                            constraint:
                              ndi-organization-identifier-value-1: {human: 'A Swedish organization identifier (sv: organisationsnummer) should follow format 7999000057', source: 'http://electronichealth.se/fhir/NDI/StructureDefinition/restriction-re', severity: error, expression: 'value.matches(''^\\d{6}\\d{4}$'') or system != ''urn:oid:2.5.4.97'''}
                              ndi-personal-identity-number-value-1: {human: 'A Swedish personal identity number (sv: personnummer) should follow format 198001032385', source: 'http://electronichealth.se/fhir/NDI/StructureDefinition/restriction-re', severity: error, expression: 'value.matches(''^([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|3[0-1])\\d{4}$'') or system != ''http://electronichealth.se/identifier/personnummer'''}
                              ndi-coordination-number-value-1: {human: 'A Swedish coordination number (sv: samordningsnummer) should follow format 201903682399', source: 'http://electronichealth.se/fhir/NDI/StructureDefinition/restriction-re', severity: error, expression: 'value.matches(''^([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(0[1-9]|1[0-2])([6-9][1-9])\\d{4}$'') or system != ''http://electronichealth.se/identifier/samordningsnummer'''}
                            index: 43
                            elements:
                              system: {index: 44}
                              value: {index: 45}
                            required: [value, system]
                        required: [identifier]
    required: [provision]
  date: {short: Date the restriction was created, index: 10}
  policyBasis:
    index: 28
    elements:
      url: {index: 29}
  regulatoryBasis:
    binding: {strength: required, valueSet: 'http://electronichealth.se/fhir/NDI/ValueSet/re-regulatory-bases-of-restriction'}
    index: 24
    elements:
      coding:
        index: 25
        elements:
          system: {index: 26}
          code: {index: 27}
        required: [system, code]
    required: [coding]
  grantor:
    type: Reference
    short: The individual that created the Restriction
    refers: ['http://hl7.org/fhir/StructureDefinition/Patient', 'http://hl7.org/fhir/StructureDefinition/PractitionerRole', 'http://hl7.org/fhir/StructureDefinition/RelatedPerson']
    index: 14
    elements:
      type: {index: 15}
      identifier:
        constraint:
          ndi-personal-identity-number-value-1: {human: 'A Swedish personal identity number (sv: personnummer) should follow format 198001032385', source: 'http://electronichealth.se/fhir/NDI/StructureDefinition/restriction-re', severity: error, expression: 'value.matches(''^([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|3[0-1])\\d{4}$'') or system != ''http://electronichealth.se/identifier/personnummer'''}
          ndi-coordination-number-value-1: {human: 'A Swedish coordination number (sv: samordningsnummer) should follow format 201903682399', source: 'http://electronichealth.se/fhir/NDI/StructureDefinition/restriction-re', severity: error, expression: 'value.matches(''^([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(0[1-9]|1[0-2])([6-9][1-9])\\d{4}$'') or system != ''http://electronichealth.se/identifier/samordningsnummer'''}
          ndi-hsa-identifier-value-1: {human: 'If identifier.system = urn:oid:1.2.752.29.4.19, value should follow format for HSA ID: SE1234567890-ABC1. Characters å, ä, ö, @ not valid.', source: 'http://electronichealth.se/fhir/NDI/StructureDefinition/restriction-re', severity: error, expression: 'value.matches(''^SE[0-9]{10}-[A-za-z0-9]+$'') or system != ''urn:oid:1.2.752.29.4.19'''}
        index: 16
        elements:
          system: {index: 17}
          value: {index: 18}
        required: [value, system]
    required: [identifier, type]
  status:
    short: active | inactive
    binding: {strength: required, valueSet: 'http://electronichealth.se/fhir/NDI/ValueSet/re-restriction-statuses'}
    index: 1
  id: {index: 0}
  period:
    index: 11
    elements:
      start:
        constraint:
          ndi-dateTime-1: {human: DateTime must be without timestamp, source: 'http://electronichealth.se/fhir/NDI/StructureDefinition/restriction-re', severity: error, expression: $this.toString().contains('T') = false}
        index: 12
      end:
        constraint:
          ndi-dateTime-1: {human: DateTime must be without timestamp, source: 'http://electronichealth.se/fhir/NDI/StructureDefinition/restriction-re', severity: error, expression: $this.toString().contains('T') = false}
        index: 13
    required: [start]
  grantee:
    type: Reference
    short: The organization or individual whose access is being restricted
    constraint:
      ndi-consent-grantee-1: {human: Grantee must have either identifier or reference., source: 'http://electronichealth.se/fhir/NDI/StructureDefinition/restriction-re', severity: error, expression: grantee.exists() implies (grantee.identifier.exists() != grantee.reference.exists())}
    refers: ['http://electronichealth.se/fhir/NDI/StructureDefinition/related-person-re', 'http://hl7.org/fhir/StructureDefinition/Organization', 'http://hl7.org/fhir/StructureDefinition/Patient', 'http://hl7.org/fhir/StructureDefinition/Practitioner']
    index: 19
    elements:
      reference: {index: 20}
      identifier:
        constraint:
          ndi-personal-identity-number-value-1: {human: 'A Swedish personal identity number (sv: personnummer) should follow format 198001032385', source: 'http://electronichealth.se/fhir/NDI/StructureDefinition/restriction-re', severity: error, expression: 'value.matches(''^([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|3[0-1])\\d{4}$'') or system != ''http://electronichealth.se/identifier/personnummer'''}
          ndi-coordination-number-value-1: {human: 'A Swedish coordination number (sv: samordningsnummer) should follow format 201903682399', source: 'http://electronichealth.se/fhir/NDI/StructureDefinition/restriction-re', severity: error, expression: 'value.matches(''^([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(0[1-9]|1[0-2])([6-9][1-9])\\d{4}$'') or system != ''http://electronichealth.se/identifier/samordningsnummer'''}
          ndi-organization-identifier-value-1: {human: 'A Swedish organization identifier (sv: organisationsnummer) should follow format 7999000057', source: 'http://electronichealth.se/fhir/NDI/StructureDefinition/restriction-re', severity: error, expression: 'value.matches(''^\\d{6}\\d{4}$'') or system != ''urn:oid:2.5.4.97'''}
          ndi-country-identifier-value-1: {human: 'A country identifier should follow ISO-3166 format, e.g. SE', source: 'http://electronichealth.se/fhir/NDI/StructureDefinition/restriction-re', severity: error, expression: 'value.matches(''^[A-Z]{2}$'') or system != ''urn:iso:std:iso:3166'''}
        index: 21
        elements:
          system: {index: 22}
          value: {index: 23}
        required: [value, system]
  subject:
    type: Reference
    short: The patient whom the Restriction concerns
    refers: ['http://hl7.org/fhir/StructureDefinition/Patient']
    index: 6
    elements:
      identifier:
        constraint:
          ndi-personal-identity-number-value-1: {human: 'A Swedish personal identity number (sv: personnummer) should follow format 198001032385', source: 'http://electronichealth.se/fhir/NDI/StructureDefinition/restriction-re', severity: error, expression: 'value.matches(''^([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|3[0-1])\\d{4}$'') or system != ''http://electronichealth.se/identifier/personnummer'''}
          ndi-coordination-number-value-1: {human: 'A Swedish coordination number (sv: samordningsnummer) should follow format 201903682399', source: 'http://electronichealth.se/fhir/NDI/StructureDefinition/restriction-re', severity: error, expression: 'value.matches(''^([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(0[1-9]|1[0-2])([6-9][1-9])\\d{4}$'') or system != ''http://electronichealth.se/identifier/samordningsnummer'''}
        index: 7
        elements:
          system: {index: 8}
          value: {index: 9}
        required: [value, system]
    required: [identifier]
  decision:
    short: Fixed to deny to use Consent as a Restriction
    pattern: {type: Code, value: deny}
    index: 30
package_version: 1.0.0-beta.1
class: profile
kind: resource
url: http://electronichealth.se/fhir/NDI/StructureDefinition/restriction-re
base: http://hl7.org/fhir/StructureDefinition/Consent
version: 0.1.0
required: [grantor, decision, subject, category, period]