{
  "resourceType": "StructureDefinition",
  "id": "KjConsent",
  "meta": {
    "lastUpdated": "2020-10-14T06:55:18.373+00:00"
  },
  "url": "http://nhn.no/kj/fhir/StructureDefinition/KjConsent",
  "name": "KjConsent",
  "status": "active",
  "date": "2020-10-07T16:39:04.882633Z",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Consent",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Consent",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Consent.extension",
        "path": "Consent.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        },
        "min": 1
      },
      {
        "id": "Consent.extension:validUntil",
        "path": "Consent.extension",
        "sliceName": "validUntil",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://nhn.no/kj/fhir/StructureDefinition/KjValidUntil"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Consent.extension:validUntil.value[x]",
        "extension": [
          null,
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version",
            "valueCode": "4.0.0"
          }
        ],
        "path": "Consent.extension.value[x]",
        "slicing": {
          "discriminator": [
            {
              "type": "type",
              "path": "$this"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Consent.extension:KjText",
        "path": "Consent.extension",
        "sliceName": "KjText",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://nhn.no/kj/fhir/StructureDefinition/KjText"
            ]
          }
        ],
        "constraint": [
          {
            "key": "kj-cos-1",
            "human": "If note is present, then text must be between 4 and 500 characters.",
            "source": "http://nhn.no/kj/fhir/StructureDefinition/KjConsent",
            "severity": "error",
            "expression": "empty() or (first().value.length() >=4 and first().value.length() <= 500)"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Consent.extension:KjText.value[x]",
        "extension": [
          null,
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version",
            "valueCode": "4.0.0"
          }
        ],
        "path": "Consent.extension.value[x]",
        "slicing": {
          "discriminator": [
            {
              "type": "type",
              "path": "$this"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Consent.extension:updater",
        "path": "Consent.extension",
        "sliceName": "updater",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://nhn.no/kj/fhir/StructureDefinition/KjUpdater"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Consent.extension:updater.value[x]",
        "extension": [
          null,
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version",
            "valueCode": "4.0.0"
          }
        ],
        "path": "Consent.extension.value[x]",
        "slicing": {
          "discriminator": [
            {
              "type": "type",
              "path": "$this"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Consent.extension:updatedDateTime",
        "path": "Consent.extension",
        "sliceName": "updatedDateTime",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://nhn.no/kj/fhir/StructureDefinition/KjUpdatedDateTime"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Consent.extension:updatedDateTime.value[x]",
        "extension": [
          null,
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version",
            "valueCode": "4.0.0"
          }
        ],
        "path": "Consent.extension.value[x]",
        "slicing": {
          "discriminator": [
            {
              "type": "type",
              "path": "$this"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Consent.status",
        "extension": [
          null,
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version",
            "valueCode": "4.0.0"
          }
        ],
        "path": "Consent.status",
        "definition": "Normalt: \"Active\", inactive hvis avkreftet og entered in error hvis slettet.",
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "http://nhn.no/kj/fhir/ValueSet/ConsentStatus"
        }
      },
      {
        "id": "Consent.scope",
        "path": "Consent.scope",
        "comment": "-",
        "mustSupport": true,
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "ConsentScope"
            }
          ],
          "strength": "required",
          "description": "The four anticipated uses for the Consent Resource.",
          "valueSet": "http://hl7.org/fhir/ValueSet/consent-scope"
        }
      },
      {
        "id": "Consent.scope.coding",
        "path": "Consent.scope.coding",
        "min": 1,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Consent.scope.coding.system",
        "extension": [
          null,
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version",
            "valueCode": "4.0.0"
          }
        ],
        "path": "Consent.scope.coding.system",
        "min": 1,
        "fixedUri": "http://terminology.hl7.org/CodeSystem/consentscope"
      },
      {
        "id": "Consent.scope.coding.code",
        "extension": [
          null,
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version",
            "valueCode": "4.0.0"
          }
        ],
        "path": "Consent.scope.coding.code",
        "min": 1,
        "fixedCode": "adr"
      },
      {
        "id": "Consent.category",
        "path": "Consent.category",
        "max": "1",
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "http://nhn.no/kj/fhir/ValueSet/ConsentCategory"
        }
      },
      {
        "id": "Consent.category.coding",
        "path": "Consent.category.coding",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Consent.patient",
        "path": "Consent.patient",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.no/fhir/StructureDefinition/no-basis-Patient"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Consent.dateTime",
        "extension": [
          null,
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version",
            "valueCode": "4.0.0"
          }
        ],
        "path": "Consent.dateTime",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Consent.performer",
        "path": "Consent.performer",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://nhn.no/kj/fhir/StructureDefinition/KjPractitionerRole"
            ],
            "aggregation": [
              "contained"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Consent.policyRule",
        "path": "Consent.policyRule",
        "min": 1,
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "http://nhn.no/kj/fhir/ValueSet/ConsentPolicyRule",
          "description": "Regulatory policy"
        }
      },
      {
        "id": "Consent.policyRule.coding",
        "path": "Consent.policyRule.coding",
        "min": 1,
        "max": "1",
        "binding": {
          "strength": "required",
          "valueSet": "http://nhn.no/kj/fhir/ValueSet/ConsentPolicyRule"
        }
      }
    ]
  }
}