{
  "resourceType": "StructureDefinition",
  "url": "http://phr.kanta.fi/StructureDefinition/fiphr-consent",
  "name": "FIPHRConsent",
  "title": "Consent",
  "status": "draft",
  "fhirVersion": "4.0.1",
  "mapping": [
    {
      "identity": "workflow",
      "uri": "http://hl7.org/fhir/workflow",
      "name": "Workflow Pattern"
    },
    {
      "identity": "v2",
      "uri": "http://hl7.org/v2",
      "name": "HL7 v2 Mapping"
    },
    {
      "identity": "rim",
      "uri": "http://hl7.org/v3",
      "name": "RIM Mapping"
    },
    {
      "identity": "w5",
      "uri": "http://hl7.org/fhir/fivews",
      "name": "FiveWs Pattern Mapping"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "Consent",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Consent",
  "derivation": "constraint",
  "snapshot": {},
  "differential": {
    "element": [
      {
        "id": "Consent.meta",
        "path": "Consent.meta",
        "min": 1
      },
      {
        "id": "Consent.meta.profile",
        "path": "Consent.meta.profile",
        "min": 1,
        "max": "1",
        "fixedCanonical": "http://phr.kanta.fi/StructureDefinition/fiphr-consent"
      },
      {
        "id": "Consent.language",
        "path": "Consent.language",
        "min": 1,
        "binding": {
          "strength": "required"
        }
      },
      {
        "id": "Consent.text",
        "path": "Consent.text",
        "min": 1
      },
      {
        "id": "Consent.extension:creatingApplication",
        "path": "Consent.extension",
        "sliceName": "creatingApplication",
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://phr.kanta.fi/StructureDefinition/fiphr-ext-creatingapplication"
            ]
          }
        ],
        "isModifier": false
      },
      {
        "id": "Consent.identifier",
        "path": "Consent.identifier",
        "min": 1
      },
      {
        "id": "Consent.category",
        "path": "Consent.category",
        "binding": {
          "strength": "required",
          "valueSet": "http://phr.kanta.fi/ValueSet/fiphr-vs-consentcategory"
        }
      },
      {
        "id": "Consent.category.coding",
        "path": "Consent.category.coding",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Consent.category.coding.system",
        "path": "Consent.category.coding.system",
        "min": 1,
        "fixedUri": "http://phr.kanta.fi/fiphr-cs-consentcategory"
      },
      {
        "id": "Consent.category.coding.code",
        "path": "Consent.category.coding.code",
        "min": 1
      },
      {
        "id": "Consent.category.coding.display",
        "path": "Consent.category.coding.display",
        "min": 1
      },
      {
        "id": "Consent.patient",
        "path": "Consent.patient",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://phr.kanta.fi/StructureDefinition/fiphr-sd-patient"
            ],
            "aggregation": [
              "referenced"
            ]
          }
        ]
      },
      {
        "id": "Consent.dateTime",
        "path": "Consent.dateTime",
        "min": 1
      },
      {
        "id": "Consent.performer",
        "path": "Consent.performer",
        "max": "0"
      },
      {
        "id": "Consent.verification",
        "path": "Consent.verification",
        "max": "0"
      },
      {
        "id": "Consent.provision.extension:clientId",
        "path": "Consent.provision.extension",
        "sliceName": "clientId",
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://phr.kanta.fi/StructureDefinition/fiphr-ext-clientId"
            ]
          }
        ],
        "isModifier": false
      },
      {
        "id": "Consent.provision.class",
        "path": "Consent.provision.class",
        "binding": {
          "strength": "required",
          "valueSet": "http://hl7.org/fhir/ValueSet/resource-types"
        }
      },
      {
        "id": "Consent.provision.code.extension:resourceType",
        "path": "Consent.provision.code.extension",
        "sliceName": "resourceType",
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://phr.kanta.fi/StructureDefinition/fiphr-ext-resourceType"
            ]
          }
        ],
        "isModifier": false
      },
      {
        "id": "Consent.provision.code.extension:resourceType.value[x]",
        "path": "Consent.provision.code.extension.value[x]",
        "binding": {
          "strength": "required",
          "valueSet": "http://hl7.org/fhir/ValueSet/resource-types"
        }
      },
      {
        "id": "Consent.provision.code.coding",
        "path": "Consent.provision.code.coding",
        "binding": {
          "strength": "required",
          "valueSet": "http://phr.kanta.fi/ValueSet/fiphr-vs-provisionCodes"
        }
      }
    ]
  }
}