{
  "resourceType": "StructureDefinition",
  "id": "TaskABeReC",
  "url": "https://www.alberta.ca/fhir/aberec/StructureDefinition/TaskABeReC",
  "version": "1.1.0",
  "name": "TaskABeReC",
  "title": "Task (AB:eReC)",
  "status": "draft",
  "description": "This profile defines a set of constraints to the FHIR Task resource for use in Alberta eReferral and eConsult (AB:eReC). It re-profiles the CA-eReC Task profile and it includes constraints that represent the minimum expectations for the Task resource when used in the AB:eReC.",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Task",
  "baseDefinition": "http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-Task",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Task.identifier",
        "path": "Task.identifier",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Task.identifier.system",
        "path": "Task.identifier.system",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Task.identifier.value",
        "path": "Task.identifier.value",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Task.basedOn",
        "path": "Task.basedOn",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://www.alberta.ca/fhir/aberec/StructureDefinition/ServiceRequestABeReC"
            ]
          }
        ]
      },
      {
        "id": "Task.status",
        "path": "Task.status",
        "binding": {
          "strength": "required",
          "valueSet": "https://www.alberta.ca/fhir/ValueSet/task-status-ab"
        }
      },
      {
        "id": "Task.businessStatus",
        "path": "Task.businessStatus",
        "binding": {
          "strength": "extensible",
          "valueSet": "https://www.alberta.ca/fhir/ValueSet/referral-business-status-ab"
        }
      },
      {
        "id": "Task.businessStatus.extension:BusinessStatusReason",
        "path": "Task.businessStatus.extension",
        "sliceName": "BusinessStatusReason"
      },
      {
        "id": "Task.businessStatus.extension:BusinessStatusReason.value[x]",
        "path": "Task.businessStatus.extension.value[x]",
        "binding": {
          "strength": "extensible",
          "valueSet": "https://www.alberta.ca/fhir/ValueSet/referral-status-reason-ab"
        }
      },
      {
        "id": "Task.code",
        "path": "Task.code",
        "binding": {
          "strength": "extensible",
          "valueSet": "https://fhir.infoway-inforoute.ca/ValueSet/ca-taskcode"
        }
      },
      {
        "id": "Task.owner",
        "path": "Task.owner",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://www.alberta.ca/fhir/aberec/StructureDefinition/PractitionerRoleABeReC",
              "https://www.alberta.ca/fhir/aberec/StructureDefinition/HealthcareServiceABeReC"
            ]
          }
        ]
      },
      {
        "id": "Task.note.author[x]",
        "path": "Task.note.author[x]",
        "slicing": {
          "discriminator": [
            {
              "type": "type",
              "path": "$this"
            }
          ],
          "ordered": false,
          "rules": "open"
        },
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Task.note.author[x]:authorReference",
        "path": "Task.note.author[x]",
        "sliceName": "authorReference",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://www.alberta.ca/fhir/aberec/StructureDefinition/PractitionerABeReC"
            ]
          }
        ]
      },
      {
        "id": "Task.note.time",
        "path": "Task.note.time",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Task.note.text",
        "path": "Task.note.text",
        "mustSupport": true
      },
      {
        "id": "Task.output.type",
        "path": "Task.output.type",
        "binding": {
          "strength": "required",
          "valueSet": "https://www.alberta.ca/fhir/ValueSet/task-output-type-code"
        }
      },
      {
        "id": "Task.output.value[x]",
        "path": "Task.output.value[x]",
        "slicing": {
          "discriminator": [
            {
              "type": "type",
              "path": "$this"
            }
          ],
          "ordered": false,
          "rules": "open"
        }
      },
      {
        "id": "Task.output.value[x]:valueReference",
        "path": "Task.output.value[x]",
        "sliceName": "valueReference",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://www.alberta.ca/fhir/aberec/StructureDefinition/CommunicationABeReC"
            ]
          }
        ]
      }
    ]
  }
}