{
  "resourceType": "StructureDefinition",
  "url": "http://apiframework.dedalus.eu/fhir/StructureDefinition/Task",
  "name": "Task",
  "title": "API Framework Task",
  "status": "active",
  "experimental": false,
  "description": "Dedalus API Framework Core Profile for Task",
  "fhirVersion": "3.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Task",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Task",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Task.meta",
        "path": "Task.meta",
        "min": 1,
        "type": [
          {
            "code": "Meta",
            "profile": "http://apiframework.dedalus.eu/fhir/StructureDefinition/Meta-ForCommonConformance"
          }
        ]
      },
      {
        "id": "Task.meta.tag:locking-keepAliveInterval",
        "path": "Task.meta.tag",
        "sliceName": "locking-keepAliveInterval",
        "max": "1"
      },
      {
        "id": "Task.meta.tag:locking-keepAliveInterval.system",
        "path": "Task.meta.tag.system",
        "min": 1,
        "fixedUri": "http://apiframework.dedalus.eu/tag/locking-keepAliveInterval"
      },
      {
        "id": "Task.meta.tag:locking-keepAliveInterval.code",
        "path": "Task.meta.tag.code",
        "definition": "Interval - IN SECONDS - that the locker should use to update the Task-ForKeepAlive",
        "min": 1,
        "constraint": [
          {
            "key": "interval-is-integer",
            "severity": "error",
            "human": "The interval shall be an integer value (representing seconds)",
            "expression": "toInteger()"
          }
        ]
      },
      {
        "id": "Task.meta.tag:locking-keepAliveExpireInterval",
        "path": "Task.meta.tag",
        "sliceName": "locking-keepAliveExpireInterval",
        "max": "1"
      },
      {
        "id": "Task.meta.tag:locking-keepAliveExpireInterval.system",
        "path": "Task.meta.tag.system",
        "min": 1,
        "fixedUri": "http://apiframework.dedalus.eu/tag/locking-keepAliveExpireInterval"
      },
      {
        "id": "Task.meta.tag:locking-keepAliveExpireInterval.code",
        "path": "Task.meta.tag.code",
        "definition": "Interval - IN SECONDS - between the current time and the met.lastUpdated of the Task-ForKeepAlive, after which the Keep-Alive task shall be considered expired and the lock released.",
        "min": 1,
        "constraint": [
          {
            "key": "expire-interval-is-integer",
            "severity": "error",
            "human": "The interval shall be an integer value (representing seconds)",
            "expression": "toInteger()"
          }
        ]
      },
      {
        "id": "Task.text",
        "path": "Task.text",
        "mustSupport": true
      },
      {
        "id": "Task.status",
        "path": "Task.status",
        "mustSupport": true
      },
      {
        "id": "Task.statusReason",
        "path": "Task.statusReason",
        "mustSupport": true
      },
      {
        "id": "Task.statusReason.text",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "Task.statusReason.text",
        "mustSupport": true
      },
      {
        "id": "Task.intent",
        "path": "Task.intent",
        "mustSupport": true
      },
      {
        "id": "Task.priority",
        "path": "Task.priority",
        "mustSupport": true
      },
      {
        "id": "Task.code",
        "path": "Task.code",
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSetUri": "http://apiframework.dedalus.eu/fhir/ValueSet/TaskCodes"
        }
      },
      {
        "id": "Task.description",
        "path": "Task.description",
        "mustSupport": true
      },
      {
        "id": "Task.focus",
        "path": "Task.focus",
        "definition": "Reference to a different resource involved in task executin (e.g a MedicationRequest)",
        "mustSupport": true
      },
      {
        "id": "Task.for",
        "path": "Task.for",
        "mustSupport": true
      },
      {
        "id": "Task.context",
        "path": "Task.context",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "http://apiframework.dedalus.eu/fhir/StructureDefinition/Encounter"
          },
          {
            "code": "Reference",
            "targetProfile": "http://apiframework.dedalus.eu/fhir/StructureDefinition/EpisodeOfCare"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Task.executionPeriod",
        "path": "Task.executionPeriod",
        "mustSupport": true
      },
      {
        "id": "Task.authoredOn",
        "path": "Task.authoredOn",
        "mustSupport": true
      },
      {
        "id": "Task.requester",
        "path": "Task.requester",
        "mustSupport": true
      },
      {
        "id": "Task.requester.agent",
        "path": "Task.requester.agent",
        "definition": "Practitioner or Ward requesting the Task.",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "http://apiframework.dedalus.eu/fhir/StructureDefinition/Organization"
          },
          {
            "code": "Reference",
            "targetProfile": "http://apiframework.dedalus.eu/fhir/StructureDefinition/Practitioner"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Task.requester.onBehalfOf",
        "path": "Task.requester.onBehalfOf",
        "definition": "The organization the device or practitioner was acting on behalf of when they initiated the task.\r\nIn API Framework, it referes to the Ward requesting the Task when the requester.agent is a Practitioner.",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "http://apiframework.dedalus.eu/fhir/StructureDefinition/Organization"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Task.owner",
        "path": "Task.owner",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "http://hl7.org/fhir/StructureDefinition/Device"
          },
          {
            "code": "Reference",
            "targetProfile": "http://hl7.org/fhir/StructureDefinition/Organization"
          },
          {
            "code": "Reference",
            "targetProfile": "http://hl7.org/fhir/StructureDefinition/Practitioner"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Task.relevantHistory",
        "path": "Task.relevantHistory",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "http://apiframework.dedalus.eu/fhir/StructureDefinition/Provenance"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Task.restriction",
        "path": "Task.restriction",
        "mustSupport": true
      },
      {
        "id": "Task.restriction.period",
        "path": "Task.restriction.period",
        "mustSupport": true
      },
      {
        "id": "Task.restriction.recipient",
        "path": "Task.restriction.recipient",
        "mustSupport": true
      }
    ]
  }
}