{
  "resourceType": "StructureDefinition",
  "id": "MyTaskMCDT",
  "meta": {
    "lastUpdated": "2019-05-23T16:02:59.7792354+00:00"
  },
  "url": "http://spms.min-saude.pt/spms/STU3/StructureDefinition/TaskMCDT",
  "name": "MyTask_MCDT",
  "status": "draft",
  "fhirVersion": "3.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Task",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Task",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Task.meta.tag.system",
        "path": "Task.meta.tag.system",
        "definition": "The identification of the code system that defines the meaning of the symbol in the code.\r\n\r\nPode ser usado para detalhar a ação relacionada à operação (evento) a ser realizado (e.g.: qual ação LAB e RAD deverá ser realizada com esta mensagem).",
        "min": 1,
        "fixedUri": "http://spms.min-saude.pt/iop/event-meta-tags"
      },
      {
        "id": "Task.meta.tag.code",
        "path": "Task.meta.tag.code",
        "min": 1
      },
      {
        "id": "Task.meta.tag.display",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "Task.meta.tag.display",
        "min": 1
      },
      {
        "id": "Task.contained",
        "path": "Task.contained",
        "type": [
          {
            "code": "Consent",
            "profile": "http://spms.min-saude.pt/spms/STU3/StructureDefinition/ConsentMCDT"
          }
        ]
      },
      {
        "id": "Task.groupIdentifier",
        "path": "Task.groupIdentifier",
        "min": 1
      },
      {
        "id": "Task.groupIdentifier.system",
        "path": "Task.groupIdentifier.system",
        "min": 1,
        "fixedUri": "http://spms.min-saude.pt/sclinicoh/identifiers/mcdt-request"
      },
      {
        "id": "Task.groupIdentifier.value",
        "path": "Task.groupIdentifier.value",
        "min": 1
      },
      {
        "id": "Task.intent",
        "path": "Task.intent",
        "fixedCode": "order"
      },
      {
        "id": "Task.focus",
        "path": "Task.focus",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": "http://spms.min-saude.pt/fhir/StructureDefinition/MyProcedureRequest_MCDT",
            "aggregation": [
              "referenced",
              "bundled"
            ]
          }
        ]
      },
      {
        "id": "Task.focus.reference",
        "path": "Task.focus.reference",
        "min": 1
      },
      {
        "id": "Task.for",
        "path": "Task.for",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": "https://spms.min-saude.pt/fhir/StructureDefinition/PatientMCDT",
            "aggregation": [
              "referenced",
              "bundled"
            ]
          }
        ]
      },
      {
        "id": "Task.for.reference",
        "path": "Task.for.reference",
        "min": 1
      },
      {
        "id": "Task.context",
        "path": "Task.context",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": "http://spms.min-saude.pt/fhir/StructureDefinition/MyEncounter_MCDT",
            "aggregation": [
              "referenced",
              "bundled"
            ]
          }
        ]
      },
      {
        "id": "Task.context.reference",
        "path": "Task.context.reference",
        "min": 1
      },
      {
        "id": "Task.requester",
        "path": "Task.requester",
        "min": 1
      },
      {
        "id": "Task.requester.agent",
        "path": "Task.requester.agent",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "http://spms.min-saude.pt/fhir/StructureDefinition/MyPractitioner_MCDT",
            "aggregation": [
              "referenced",
              "bundled"
            ]
          }
        ]
      },
      {
        "id": "Task.requester.agent.reference",
        "path": "Task.requester.agent.reference",
        "min": 1
      },
      {
        "id": "Task.requester.onBehalfOf",
        "path": "Task.requester.onBehalfOf",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": "http://spms.min-saude.pt/fhir/StructureDefinition/MyOrganization_MCDT",
            "aggregation": [
              "referenced",
              "bundled"
            ]
          }
        ]
      },
      {
        "id": "Task.requester.onBehalfOf.reference",
        "path": "Task.requester.onBehalfOf.reference",
        "min": 1
      },
      {
        "id": "Task.performerType",
        "path": "Task.performerType",
        "min": 1
      },
      {
        "id": "Task.performerType.coding.system",
        "path": "Task.performerType.coding.system",
        "min": 1,
        "fixedUri": "http://hl7.org/fhir/task-performer-type"
      },
      {
        "id": "Task.performerType.coding.code",
        "path": "Task.performerType.coding.code",
        "min": 1,
        "fixedCode": "performer"
      },
      {
        "id": "Task.performerType.coding.display",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "Task.performerType.coding.display",
        "min": 1,
        "fixedString": "performer"
      },
      {
        "id": "Task.input",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name",
            "valueString": "Parameter"
          }
        ],
        "path": "Task.input",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "type.coding.code"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Task.input:sliceInputAC",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name",
            "valueString": "Parameter"
          }
        ],
        "path": "Task.input",
        "sliceName": "sliceInputAC",
        "min": 1
      },
      {
        "id": "Task.input:sliceInputAC.type",
        "path": "Task.input.type",
        "fixedCodeableConcept": {
          "coding": [
            {
              "system": "http://spms.min-saude.pt/iop/valueset/task_input_type",
              "code": "AC",
              "display": "Aplicable Consent"
            }
          ]
        }
      },
      {
        "id": "Task.input:sliceInputAC.type.coding.system",
        "path": "Task.input.type.coding.system",
        "fixedUri": "http://spms.min-saude.pt/iop/valueset/task_input_type"
      },
      {
        "id": "Task.input:sliceInputAC.type.coding.code",
        "path": "Task.input.type.coding.code",
        "fixedCode": "AC"
      },
      {
        "id": "Task.input:sliceInputAC.type.coding.display",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "Task.input.type.coding.display",
        "fixedString": "Applicable consent"
      },
      {
        "id": "Task.input:sliceInputAC.value[x]:valueReference",
        "path": "Task.input.valueReference",
        "sliceName": "valueReference",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "http://spms.min-saude.pt/spms/STU3/StructureDefinition/ConsentMCDT",
            "aggregation": [
              "contained"
            ]
          }
        ]
      },
      {
        "id": "Task.input:sliceInputPEC",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name",
            "valueString": "Parameter"
          }
        ],
        "path": "Task.input",
        "sliceName": "sliceInputPEC"
      },
      {
        "id": "Task.input:sliceInputPEC.type.coding.system",
        "path": "Task.input.type.coding.system",
        "fixedUri": "http://spms.min-saude.pt/iop/valueset/task_input_type"
      },
      {
        "id": "Task.input:sliceInputPEC.type.coding.code",
        "path": "Task.input.type.coding.code",
        "fixedCode": "PEC"
      },
      {
        "id": "Task.input:sliceInputPEC.type.coding.display",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "Task.input.type.coding.display",
        "fixedString": "Providing Entity Coverage"
      },
      {
        "id": "Task.input:sliceInputPEC.value[x]:valueCodeableConcept",
        "path": "Task.input.valueCodeableConcept",
        "sliceName": "valueCodeableConcept",
        "type": [
          {
            "code": "CodeableConcept"
          }
        ]
      },
      {
        "id": "Task.input:sliceInputPEC.value[x]:valueCodeableConcept.coding.system",
        "path": "Task.input.valueCodeableConcept.coding.system",
        "fixedUri": "http://spms.min-saude.pt/iop/valueset/task_input_type"
      },
      {
        "id": "Task.input:sliceInputPEC.value[x]:valueCodeableConcept.coding.code",
        "path": "Task.input.valueCodeableConcept.coding.code",
        "fixedCode": "PEC"
      },
      {
        "id": "Task.input:sliceInputPEC.value[x]:valueCodeableConcept.coding.display",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "Task.input.valueCodeableConcept.coding.display",
        "fixedString": "Providing Entity Coverage"
      },
      {
        "id": "Task.input:sliceInputBEN",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name",
            "valueString": "Parameter"
          }
        ],
        "path": "Task.input",
        "sliceName": "sliceInputBEN"
      },
      {
        "id": "Task.input:sliceInputBEN.type.coding.system",
        "path": "Task.input.type.coding.system",
        "fixedUri": "http://spms.min-saude.pt/iop/valueset/task_input_type"
      },
      {
        "id": "Task.input:sliceInputBEN.type.coding.code",
        "path": "Task.input.type.coding.code",
        "fixedCode": "BEN"
      },
      {
        "id": "Task.input:sliceInputBEN.type.coding.display",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "Task.input.type.coding.display",
        "fixedString": "Benefits"
      },
      {
        "id": "Task.input:sliceInputBEN.value[x]:valueReference",
        "path": "Task.input.valueReference",
        "sliceName": "valueReference",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "http://spms.min-saude.pt/spms/STU3/StructureDefinition/CoverageMCDT"
          }
        ]
      }
    ]
  }
}