{
  "resourceType": "StructureDefinition",
  "id": "eeea9cf7-b152-467b-aa42-57676a51dbab",
  "meta": {
    "versionId": "10",
    "lastUpdated": "2017-10-30T08:06:01.85+00:00"
  },
  "url": "http://phr.kanta.fi/StructureDefinition/fiphr-consent-stu3",
  "name": "Finnish PHR Consent profile",
  "title": "Finnish PHR Consent profile",
  "status": "draft",
  "experimental": true,
  "date": "2017-08-28T06:29:32.854+00:00",
  "publisher": "Kela",
  "description": "Finnish PHR: A consumer’s consent choice to permit healtcare professionals to access owner's resources.",
  "fhirVersion": "3.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Consent",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Consent",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Consent",
        "path": "Consent",
        "short": "Finnish PHR Consent profile",
        "definition": "Finnish PHR: A consumer’s consent choice to permit healtcare professionals to access owner's resources.",
        "comment": "."
      },
      {
        "id": "Consent.meta.profile",
        "path": "Consent.meta.profile",
        "definition": "FinnishPHR: Profile required. The URL is a reference to [StructureDefinition.url]().",
        "min": 1,
        "max": "1",
        "fixedUri": "http://phr.kanta.fi/StructureDefinition/fiphr-consent-stu3"
      },
      {
        "id": "Consent.language",
        "path": "Consent.language",
        "definition": "The base language  in which the resource is written.",
        "min": 1,
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet",
              "valueReference": {
                "reference": "http://hl7.org/fhir/ValueSet/all-languages"
              }
            },
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "Language"
            },
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding",
              "valueBoolean": true
            }
          ],
          "strength": "required",
          "description": "A code of human language."
        }
      },
      {
        "id": "Consent.text",
        "path": "Consent.text",
        "min": 1
      },
      {
        "id": "Consent.extension",
        "path": "Consent.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Consent.extension:creatingApplication",
        "path": "Consent.extension",
        "sliceName": "creatingApplication",
        "type": [
          {
            "code": "Extension",
            "profile": "http://phr.kanta.fi/StructureDefinition/fiphr-ext-creatingapplication"
          }
        ]
      },
      {
        "id": "Consent.identifier",
        "path": "Consent.identifier",
        "min": 1
      },
      {
        "id": "Consent.identifier.use",
        "path": "Consent.identifier.use",
        "max": "0"
      },
      {
        "id": "Consent.identifier.type",
        "path": "Consent.identifier.type",
        "max": "0"
      },
      {
        "id": "Consent.identifier.system",
        "path": "Consent.identifier.system",
        "min": 1,
        "fixedUri": "urn:ietf:rfc:3986"
      },
      {
        "id": "Consent.identifier.value",
        "path": "Consent.identifier.value",
        "definition": "Finnish PHR: Uuid identfying the resource uniquely. The portion of the identifier typically relevant to the user and which is unique within the context of the system.",
        "min": 1
      },
      {
        "id": "Consent.identifier.period",
        "path": "Consent.identifier.period",
        "max": "0"
      },
      {
        "id": "Consent.identifier.assigner",
        "path": "Consent.identifier.assigner",
        "max": "0"
      },
      {
        "id": "Consent.status",
        "path": "Consent.status",
        "short": "Current state of consent",
        "definition": "active|inactive\nDefinition: Indicates the current state of this consent. FinnishPHR: only values active and inactive allowed."
      },
      {
        "id": "Consent.category",
        "path": "Consent.category",
        "comment": ".",
        "min": 1,
        "max": "1",
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "ConsentCategory"
            }
          ],
          "strength": "required",
          "valueSetReference": {
            "reference": "http://phr.kanta.fi/ValueSet/fiphr-vs-consentcategory"
          }
        }
      },
      {
        "id": "Consent.category.coding.id",
        "path": "Consent.category.coding.id",
        "max": "0"
      },
      {
        "id": "Consent.category.coding.system",
        "path": "Consent.category.coding.system",
        "min": 1,
        "fixedUri": "http://phr.kanta.fi/fiphr-cs-consentcategory"
      },
      {
        "id": "Consent.category.coding.version",
        "path": "Consent.category.coding.version",
        "max": "0"
      },
      {
        "id": "Consent.category.coding.code",
        "path": "Consent.category.coding.code",
        "min": 1
      },
      {
        "id": "Consent.category.coding.display",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "Consent.category.coding.display",
        "max": "0"
      },
      {
        "id": "Consent.category.coding.userSelected",
        "path": "Consent.category.coding.userSelected",
        "max": "0"
      },
      {
        "id": "Consent.category.text",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "Consent.category.text",
        "max": "0"
      },
      {
        "id": "Consent.patient",
        "path": "Consent.patient",
        "definition": "Reference(fiphr-patient-stu3), \"referenced\"",
        "comment": ".",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "http://phr.kanta.fi/StructureDefinition/fiphr-patient-stu3",
            "aggregation": [
              "referenced"
            ]
          }
        ]
      },
      {
        "id": "Consent.patient.identifier",
        "path": "Consent.patient.identifier",
        "max": "0"
      },
      {
        "id": "Consent.patient.display",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "Consent.patient.display",
        "max": "0"
      },
      {
        "id": "Consent.period",
        "path": "Consent.period",
        "max": "0"
      },
      {
        "id": "Consent.dateTime",
        "path": "Consent.dateTime",
        "min": 1
      },
      {
        "id": "Consent.consentingParty",
        "path": "Consent.consentingParty",
        "definition": "Reference(fiphr-patient-stu3), \"referenced\"",
        "comment": ".",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "http://phr.kanta.fi/StructureDefinition/fiphr-patient-stu3",
            "aggregation": [
              "referenced"
            ]
          }
        ]
      },
      {
        "id": "Consent.consentingParty.reference",
        "path": "Consent.consentingParty.reference",
        "min": 1
      },
      {
        "id": "Consent.consentingParty.identifier",
        "path": "Consent.consentingParty.identifier",
        "max": "0"
      },
      {
        "id": "Consent.consentingParty.display",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "Consent.consentingParty.display",
        "max": "0"
      },
      {
        "id": "Consent.actor",
        "path": "Consent.actor",
        "max": "0"
      },
      {
        "id": "Consent.action",
        "path": "Consent.action",
        "max": "0"
      },
      {
        "id": "Consent.organization",
        "path": "Consent.organization",
        "max": "0"
      },
      {
        "id": "Consent.source[x]",
        "path": "Consent.source[x]",
        "max": "0"
      },
      {
        "id": "Consent.policy",
        "path": "Consent.policy",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Consent.policy.uri",
        "path": "Consent.policy.uri",
        "min": 1
      },
      {
        "id": "Consent.policyRule",
        "path": "Consent.policyRule",
        "max": "0"
      },
      {
        "id": "Consent.securityLabel",
        "path": "Consent.securityLabel",
        "max": "0"
      },
      {
        "id": "Consent.purpose",
        "path": "Consent.purpose",
        "max": "0"
      },
      {
        "id": "Consent.dataPeriod",
        "path": "Consent.dataPeriod",
        "max": "0"
      },
      {
        "id": "Consent.data",
        "path": "Consent.data",
        "max": "0"
      },
      {
        "id": "Consent.except",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name",
            "valueString": "Except"
          }
        ],
        "path": "Consent.except",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Consent.except.type",
        "path": "Consent.except.type",
        "short": "Fixed: deny",
        "definition": "Action  to take - deny - when the exception conditions are met.",
        "fixedCode": "deny"
      },
      {
        "id": "Consent.except.period",
        "path": "Consent.except.period",
        "max": "0"
      },
      {
        "id": "Consent.except.actor",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name",
            "valueString": "ExceptActor"
          }
        ],
        "path": "Consent.except.actor",
        "max": "0"
      },
      {
        "id": "Consent.except.action",
        "path": "Consent.except.action",
        "max": "0"
      },
      {
        "id": "Consent.except.securityLabel",
        "path": "Consent.except.securityLabel",
        "definition": "Finnish PHR: A security label that define which resources are controlled by this exception.",
        "min": 1,
        "max": "1",
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "SecurityLabels"
            },
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding",
              "valueBoolean": true
            }
          ],
          "strength": "required",
          "description": "Security Labels from the FHIR Healthcare Privacy and Security Classification System."
        }
      },
      {
        "id": "Consent.except.securityLabel.system",
        "path": "Consent.except.securityLabel.system",
        "min": 1,
        "fixedUri": "http://hl7.org/fhir/v3/Confidentiality"
      },
      {
        "id": "Consent.except.securityLabel.version",
        "path": "Consent.except.securityLabel.version",
        "max": "0"
      },
      {
        "id": "Consent.except.securityLabel.code",
        "path": "Consent.except.securityLabel.code",
        "min": 1
      },
      {
        "id": "Consent.except.securityLabel.display",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "Consent.except.securityLabel.display",
        "min": 1
      },
      {
        "id": "Consent.except.securityLabel.userSelected",
        "path": "Consent.except.securityLabel.userSelected",
        "max": "0"
      },
      {
        "id": "Consent.except.purpose",
        "path": "Consent.except.purpose",
        "max": "0"
      },
      {
        "id": "Consent.except.class",
        "path": "Consent.except.class",
        "max": "0"
      },
      {
        "id": "Consent.except.code",
        "path": "Consent.except.code",
        "max": "0"
      },
      {
        "id": "Consent.except.dataPeriod",
        "path": "Consent.except.dataPeriod",
        "max": "0"
      },
      {
        "id": "Consent.except.data",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name",
            "valueString": "ExceptData"
          }
        ],
        "path": "Consent.except.data",
        "max": "0"
      }
    ]
  }
}