PackagesCanonicalsLogsProblems
    Packages
    se.electronichealth.fhir.ppdr.r5@0.1.0-alpha
    http://electronichealth.se/fhir/NDI/StructureDefinition/restriction-re
{
  "description": "Profile for restricting access to patient data",
  "_filename": "StructureDefinition-restriction-re.json",
  "package_name": "se.electronichealth.fhir.ppdr.r5",
  "date": null,
  "derivation": "constraint",
  "publisher": null,
  "fhirVersion": "5.0.0",
  "name": "RestrictionRe",
  "abstract": false,
  "type": "Consent",
  "experimental": null,
  "resourceType": "StructureDefinition",
  "title": "Restriction (RE)",
  "package_version": "0.1.0-alpha",
  "status": "active",
  "id": "104c1f18-b585-4abf-8c42-3a7150e4dcf7",
  "kind": "resource",
  "url": "http://electronichealth.se/fhir/NDI/StructureDefinition/restriction-re",
  "version": "0.1.0",
  "differential": {
    "element": [ {
      "id": "Consent",
      "path": "Consent",
      "constraint": [ {
        "key": "ndi-consent-date-2",
        "human": "If present, date SHALL have a lower or equal value than period.start",
        "source": "http://electronichealth.se/fhir/NDI/StructureDefinition/restriction-re",
        "severity": "error",
        "expression": "date.hasValue().not() or date <= period.start"
      }, {
        "key": "ndi-consent-actors-1",
        "human": "If any of category codes is \"restriction\", the person whose access is being restricted (grantee) cannot be the same person as the one whose data the restriction concerns (subject).",
        "source": "http://electronichealth.se/fhir/NDI/StructureDefinition/restriction-re",
        "severity": "error",
        "expression": "(subject.identifier != grantee.identifier) or category.coding.all(code != 'restriction')"
      }, {
        "key": "ndi-consent-actors-2",
        "human": "If any of category codes is \"restriction\", the person whose access is being restricted (grantee) cannot be the same person as the one is creating the restriction (grantor).",
        "source": "http://electronichealth.se/fhir/NDI/StructureDefinition/restriction-re",
        "severity": "error",
        "expression": "(grantor.identifier != grantee.identifier) or category.coding.all(code != 'restriction')"
      } ]
    }, {
      "id": "Consent.status",
      "path": "Consent.status",
      "short": "active | inactive",
      "binding": {
        "strength": "required",
        "valueSet": "http://electronichealth.se/fhir/NDI/ValueSet/re-restriction-statuses"
      },
      "mustSupport": true
    }, {
      "id": "Consent.category",
      "min": 1,
      "path": "Consent.category",
      "binding": {
        "strength": "required",
        "valueSet": "http://electronichealth.se/fhir/NDI/ValueSet/re-restriction-categories"
      },
      "mustSupport": true
    }, {
      "id": "Consent.category.coding",
      "max": "1",
      "min": 1,
      "path": "Consent.category.coding",
      "mustSupport": true
    }, {
      "id": "Consent.category.coding.system",
      "min": 1,
      "path": "Consent.category.coding.system",
      "mustSupport": true
    }, {
      "id": "Consent.category.coding.code",
      "min": 1,
      "path": "Consent.category.coding.code",
      "mustSupport": true
    }, {
      "id": "Consent.subject",
      "min": 1,
      "path": "Consent.subject",
      "type": [ {
        "code": "Reference",
        "targetProfile": [ "http://electronichealth.se/fhir/NDI/StructureDefinition/patient-data-access" ]
      } ],
      "short": "The patient whom the Restriction concerns",
      "mustSupport": true
    }, {
      "id": "Consent.subject.reference",
      "path": "Consent.subject.reference",
      "mustSupport": true
    }, {
      "id": "Consent.subject.identifier",
      "path": "Consent.subject.identifier",
      "constraint": [ {
        "key": "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'"
      }, {
        "key": "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'"
      } ],
      "mustSupport": true
    }, {
      "id": "Consent.subject.identifier.system",
      "min": 1,
      "path": "Consent.subject.identifier.system",
      "mustSupport": true
    }, {
      "id": "Consent.subject.identifier.value",
      "min": 1,
      "path": "Consent.subject.identifier.value",
      "mustSupport": true
    }, {
      "id": "Consent.date",
      "path": "Consent.date",
      "short": "Date the restriction was created",
      "constraint": [ {
        "key": "ndi-consent-date-1",
        "human": "Date SHALL have a lower or equal value than today's date",
        "source": "http://electronichealth.se/fhir/NDI/StructureDefinition/restriction-re",
        "severity": "error",
        "expression": "$this <= today()"
      } ],
      "definition": "The date when the grantor created the restriction. Can be before it was submitted to a server, e.g. by filling in a physical form",
      "mustSupport": true
    }, {
      "id": "Consent.period",
      "min": 1,
      "path": "Consent.period",
      "mustSupport": true
    }, {
      "id": "Consent.period.start",
      "min": 1,
      "path": "Consent.period.start",
      "constraint": [ {
        "key": "ndi-consent-period-start-1",
        "human": "Period.start SHALL have a higher or equal value than today's date",
        "source": "http://electronichealth.se/fhir/NDI/StructureDefinition/restriction-re",
        "severity": "error",
        "expression": "$this >= today()"
      }, {
        "key": "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"
      } ],
      "mustSupport": true
    }, {
      "id": "Consent.period.end",
      "path": "Consent.period.end",
      "constraint": [ {
        "key": "ndi-consent-period-end-1",
        "human": "Period.end SHALL have a higher or equal value than today's date",
        "source": "http://electronichealth.se/fhir/NDI/StructureDefinition/restriction-re",
        "severity": "error",
        "expression": "$this >= today()"
      }, {
        "key": "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"
      } ],
      "mustSupport": true
    }, {
      "id": "Consent.grantor",
      "max": "1",
      "min": 1,
      "path": "Consent.grantor",
      "type": [ {
        "code": "Reference",
        "targetProfile": [ "http://electronichealth.se/fhir/NDI/StructureDefinition/patient-data-access", "http://hl7.org/fhir/StructureDefinition/PractitionerRole", "http://hl7.org/fhir/StructureDefinition/RelatedPerson" ]
      } ],
      "short": "The individual that created the Restriction",
      "mustSupport": true
    }, {
      "id": "Consent.grantor.reference",
      "path": "Consent.grantor.reference",
      "mustSupport": true
    }, {
      "id": "Consent.grantor.type",
      "min": 1,
      "path": "Consent.grantor.type",
      "mustSupport": true
    }, {
      "id": "Consent.grantor.identifier",
      "path": "Consent.grantor.identifier",
      "constraint": [ {
        "key": "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'"
      }, {
        "key": "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'"
      }, {
        "key": "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'"
      } ],
      "mustSupport": true
    }, {
      "id": "Consent.grantor.identifier.system",
      "min": 1,
      "path": "Consent.grantor.identifier.system",
      "mustSupport": true
    }, {
      "id": "Consent.grantor.identifier.value",
      "min": 1,
      "path": "Consent.grantor.identifier.value",
      "mustSupport": true
    }, {
      "id": "Consent.grantee",
      "path": "Consent.grantee",
      "type": [ {
        "code": "Reference",
        "targetProfile": [ "http://electronichealth.se/fhir/NDI/StructureDefinition/organization-data-access", "http://electronichealth.se/fhir/NDI/StructureDefinition/patient-data-access", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Practitioner" ]
      } ],
      "short": "The organization or individual whose access is being restricted",
      "mustSupport": true
    }, {
      "id": "Consent.grantee.reference",
      "path": "Consent.grantee.reference",
      "mustSupport": true
    }, {
      "id": "Consent.grantee.type",
      "min": 1,
      "path": "Consent.grantee.type",
      "mustSupport": true
    }, {
      "id": "Consent.grantee.identifier",
      "path": "Consent.grantee.identifier",
      "constraint": [ {
        "key": "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'"
      }, {
        "key": "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'"
      }, {
        "key": "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'"
      }, {
        "key": "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'"
      } ],
      "mustSupport": true
    }, {
      "id": "Consent.grantee.identifier.system",
      "min": 1,
      "path": "Consent.grantee.identifier.system",
      "mustSupport": true
    }, {
      "id": "Consent.grantee.identifier.value",
      "min": 1,
      "path": "Consent.grantee.identifier.value",
      "mustSupport": true
    }, {
      "id": "Consent.regulatoryBasis",
      "path": "Consent.regulatoryBasis",
      "binding": {
        "strength": "required",
        "valueSet": "http://electronichealth.se/fhir/NDI/ValueSet/re-regulatory-bases-of-restriction"
      },
      "mustSupport": true
    }, {
      "id": "Consent.regulatoryBasis.coding",
      "max": "1",
      "min": 1,
      "path": "Consent.regulatoryBasis.coding",
      "mustSupport": true
    }, {
      "id": "Consent.regulatoryBasis.coding.system",
      "min": 1,
      "path": "Consent.regulatoryBasis.coding.system",
      "mustSupport": true
    }, {
      "id": "Consent.regulatoryBasis.coding.code",
      "min": 1,
      "path": "Consent.regulatoryBasis.coding.code",
      "mustSupport": true
    }, {
      "id": "Consent.policyBasis",
      "path": "Consent.policyBasis",
      "mustSupport": true
    }, {
      "id": "Consent.policyBasis.url",
      "path": "Consent.policyBasis.url",
      "mustSupport": true
    }, {
      "id": "Consent.decision",
      "min": 1,
      "path": "Consent.decision",
      "short": "Fixed to deny to use Consent as a Restriction",
      "fixedCode": "deny",
      "mustSupport": true
    }, {
      "id": "Consent.provision",
      "max": "1",
      "path": "Consent.provision",
      "mustSupport": true
    }, {
      "id": "Consent.provision.purpose",
      "path": "Consent.provision.purpose",
      "mustSupport": true
    }, {
      "id": "Consent.provision.purpose.system",
      "min": 1,
      "path": "Consent.provision.purpose.system",
      "mustSupport": true
    }, {
      "id": "Consent.provision.purpose.code",
      "min": 1,
      "path": "Consent.provision.purpose.code",
      "mustSupport": true
    }, {
      "id": "Consent.provision.documentType",
      "path": "Consent.provision.documentType",
      "short": "The category of data the provision concerns",
      "binding": {
        "strength": "required",
        "valueSet": "http://electronichealth.se/fhir/NDI/ValueSet/ndi-ehds-categories"
      },
      "mustSupport": true
    }, {
      "id": "Consent.provision.data",
      "path": "Consent.provision.data",
      "slicing": {
        "rules": "open",
        "ordered": false,
        "description": "Slice data based on meaning",
        "discriminator": [ {
          "path": "meaning",
          "type": "value"
        } ]
      },
      "mustSupport": true
    }, {
      "id": "Consent.provision.data.meaning",
      "path": "Consent.provision.data.meaning",
      "mustSupport": true
    }, {
      "id": "Consent.provision.data.reference",
      "path": "Consent.provision.data.reference",
      "mustSupport": true
    }, {
      "id": "Consent.provision.data:fromCaregiverOrUnit",
      "max": "*",
      "min": 0,
      "path": "Consent.provision.data",
      "sliceName": "fromCaregiverOrUnit",
      "mustSupport": true
    }, {
      "id": "Consent.provision.data:fromCaregiverOrUnit.meaning",
      "path": "Consent.provision.data.meaning",
      "fixedCode": "authoredby",
      "mustSupport": true
    }, {
      "id": "Consent.provision.data:fromCaregiverOrUnit.reference",
      "path": "Consent.provision.data.reference",
      "type": [ {
        "code": "Reference",
        "targetProfile": [ "http://electronichealth.se/fhir/NDI/StructureDefinition/organization-data-access" ]
      } ],
      "mustSupport": true
    }, {
      "id": "Consent.provision.data:fromCaregiverOrUnit.reference.reference",
      "path": "Consent.provision.data.reference.reference",
      "mustSupport": true
    }, {
      "id": "Consent.provision.data:fromCaregiverOrUnit.reference.identifier",
      "path": "Consent.provision.data.reference.identifier",
      "constraint": [ {
        "key": "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'"
      }, {
        "key": "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'"
      }, {
        "key": "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'"
      } ],
      "mustSupport": true
    }, {
      "id": "Consent.provision.data:fromCaregiverOrUnit.reference.identifier.system",
      "min": 1,
      "path": "Consent.provision.data.reference.identifier.system",
      "mustSupport": true
    }, {
      "id": "Consent.provision.data:fromCaregiverOrUnit.reference.identifier.value",
      "min": 1,
      "path": "Consent.provision.data.reference.identifier.value",
      "mustSupport": true
    }, {
      "id": "Consent.provision.provision",
      "path": "Consent.provision.provision",
      "mustSupport": true
    } ]
  },
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Consent"
}