{
  "resourceType": "StructureDefinition",
  "id": "pt-lm-Task",
  "text": {
    "status": "empty",
    "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">No narrative is provided for definitional resources. A human-readable rendering can be found in the implementation guide(s) where this resource is used.</div>"
  },
  "url": "http://medmij.nl/fhir/StructureDefinition/pt-lm-Task",
  "name": "LmTask",
  "title": "Task",
  "status": "active",
  "publisher": "MedMij",
  "contact": [
    {
      "name": "MedMij",
      "telecom": [
        {
          "system": "email",
          "value": "info@medmij.nl",
          "use": "work"
        }
      ]
    }
  ],
  "description": "Patient-specific task that tells a patient what to do as part of a digital care activity. A Task is shown in the patient’s task list and supports tracking progress and completion over time.",
  "purpose": "To represent a patient-facing task for a digital activity, so the patient can see what is expected, when it should be done, and whether it is open or completed. A Task can represent either a main task or a subtask within the same activity.",
  "copyright": "Copyright and related rights waived via CC0, https://creativecommons.org/publicdomain/zero/1.0/. This does not apply to information from third parties, for example a medical terminology system. The implementer alone is responsible for identifying and obtaining any necessary licenses or authorizations to utilize third party IP in connection with the specification or otherwise.",
  "fhirVersion": "4.0.1",
  "mapping": [
    {
      "identity": "pt-dataset-100-alpha1-20260511",
      "name": "Dataset Aanbiedertaken MedMij 1.0.0-alpha.1 20260511"
    }
  ],
  "kind": "logical",
  "abstract": true,
  "type": "http://medmij.nl/fhir/StructureDefinition/pt-lm-Task",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Element",
  "derivation": "specialization",
  "snapshot": {
    "element": [
      {
        "id": "pt-lm-Task",
        "path": "pt-lm-Task",
        "short": "Task",
        "definition": "Patient-specific task that tells a patient what to do as part of a digital care activity. A Task is shown in the patient’s task list and supports tracking progress and completion over time.",
        "alias": [
          "Taak"
        ],
        "min": 0,
        "max": "*",
        "base": {
          "path": "pt-lm-Task",
          "min": 0,
          "max": "*"
        },
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "pt-dataset-100-alpha1-20260511",
            "map": "pt-dataelement-1",
            "comment": "Task"
          }
        ]
      },
      {
        "id": "pt-lm-Task.id",
        "path": "pt-lm-Task.id",
        "representation": [
          "xmlAttr"
        ],
        "short": "Unique id for inter-element referencing",
        "definition": "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Element.id",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type",
                "valueUrl": "string"
              }
            ],
            "code": "http://hl7.org/fhirpath/System.String"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          }
        ]
      },
      {
        "id": "pt-lm-Task.extension",
        "path": "pt-lm-Task.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "description": "Extensions are always sliced by (at least) url",
          "rules": "open"
        },
        "short": "Additional content defined by implementations",
        "definition": "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.",
        "comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.",
        "alias": [
          "extensions",
          "user content"
        ],
        "min": 0,
        "max": "*",
        "base": {
          "path": "Element.extension",
          "min": 0,
          "max": "*"
        },
        "type": [
          {
            "code": "Extension"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          },
          {
            "key": "ext-1",
            "severity": "error",
            "human": "Must have either extensions or value[x], not both",
            "expression": "extension.exists() != value.exists()",
            "xpath": "exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])",
            "source": "http://hl7.org/fhir/StructureDefinition/Extension"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "rim",
            "map": "N/A"
          }
        ]
      },
      {
        "id": "pt-lm-Task.ActivityDefinition",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status",
            "valueCode": "normative"
          },
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version",
            "valueCode": "4.0.0"
          }
        ],
        "path": "pt-lm-Task.ActivityDefinition",
        "short": "Reference to the digital activity definition associated with this task.",
        "definition": "Reference to the digital activity definition associated with this task.",
        "comment": "References SHALL be a reference to an actual FHIR resource, and SHALL be resolveable (allowing for access control, temporary unavailability, etc.). Resolution can be either by retrieval from the URL, or, where applicable by resource type, by treating an absolute reference as a canonical URL and looking it up in a local registry/repository.",
        "alias": [
          "DigitaleActiviteit"
        ],
        "min": 0,
        "max": "1",
        "base": {
          "path": "pt-lm-Task.ActivityDefinition",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://medmij.nl/fhir/StructureDefinition/pt-lm-Activity"
            ]
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          },
          {
            "key": "ref-1",
            "severity": "error",
            "human": "SHALL have a contained resource if a local reference is provided",
            "expression": "reference.startsWith('#').not() or (reference.substring(1).trace('url') in %rootResource.contained.id.trace('ids'))",
            "xpath": "not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])",
            "source": "http://hl7.org/fhir/StructureDefinition/Reference"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "rim",
            "map": "The target of a resource reference is a RIM entry point (Act, Role, or Entity)"
          },
          {
            "identity": "pt-dataset-100-alpha1-20260511",
            "map": "pt-dataelement-2",
            "comment": "ActivityDefinition"
          }
        ]
      },
      {
        "id": "pt-lm-Task.BasedOn",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status",
            "valueCode": "normative"
          },
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version",
            "valueCode": "4.0.0"
          }
        ],
        "path": "pt-lm-Task.BasedOn",
        "short": "Clinical order that triggered this patient task. May include patient-specific instructions and the requested schedule.",
        "definition": "Clinical order that triggered this patient task. May include patient-specific instructions and the requested schedule.",
        "comment": "References SHALL be a reference to an actual FHIR resource, and SHALL be resolveable (allowing for access control, temporary unavailability, etc.). Resolution can be either by retrieval from the URL, or, where applicable by resource type, by treating an absolute reference as a canonical URL and looking it up in a local registry/repository.",
        "alias": [
          "GebaseerdOp"
        ],
        "min": 0,
        "max": "1",
        "base": {
          "path": "pt-lm-Task.BasedOn",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://medmij.nl/fhir/StructureDefinition/pt-lm-ServiceRequest"
            ]
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          },
          {
            "key": "ref-1",
            "severity": "error",
            "human": "SHALL have a contained resource if a local reference is provided",
            "expression": "reference.startsWith('#').not() or (reference.substring(1).trace('url') in %rootResource.contained.id.trace('ids'))",
            "xpath": "not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])",
            "source": "http://hl7.org/fhir/StructureDefinition/Reference"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "rim",
            "map": "The target of a resource reference is a RIM entry point (Act, Role, or Entity)"
          },
          {
            "identity": "pt-dataset-100-alpha1-20260511",
            "map": "pt-dataelement-3",
            "comment": "BasedOn"
          }
        ]
      },
      {
        "id": "pt-lm-Task.Status",
        "path": "pt-lm-Task.Status",
        "short": "Current state of the Task in the workflow (e.g., requested, received, accepted, in-progress, completed, cancelled).",
        "definition": "Current state of the Task in the workflow (e.g., requested, received, accepted, in-progress, completed, cancelled).",
        "comment": "Note that FHIR strings SHALL NOT exceed 1MB in size",
        "alias": [
          "Status"
        ],
        "min": 0,
        "max": "1",
        "base": {
          "path": "pt-lm-Task.Status",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "code"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "pt-dataset-100-alpha1-20260511",
            "map": "pt-dataelement-4",
            "comment": "Status"
          }
        ]
      },
      {
        "id": "pt-lm-Task.Priority",
        "path": "pt-lm-Task.Priority",
        "short": "Indicates how urgent it is to perform the activity (e.g., routine, urgent, asap).",
        "definition": "Indicates how urgent it is to perform the activity (e.g., routine, urgent, asap).",
        "comment": "Note that FHIR strings SHALL NOT exceed 1MB in size",
        "alias": [
          "Prioriteit"
        ],
        "min": 0,
        "max": "1",
        "base": {
          "path": "pt-lm-Task.Priority",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "code"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "pt-dataset-100-alpha1-20260511",
            "map": "pt-dataelement-5",
            "comment": "Priority"
          }
        ]
      },
      {
        "id": "pt-lm-Task.Description",
        "path": "pt-lm-Task.Description",
        "short": "Short instruction for the patient describing what to do. Keep the text concise and readable on mobile.",
        "definition": "Short instruction for the patient describing what to do. Keep the text concise and readable on mobile.",
        "comment": "Note that FHIR strings SHALL NOT exceed 1MB in size",
        "alias": [
          "Omschrijving"
        ],
        "min": 0,
        "max": "1",
        "base": {
          "path": "pt-lm-Task.Description",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "string"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "pt-dataset-100-alpha1-20260511",
            "map": "pt-dataelement-6",
            "comment": "Description"
          }
        ]
      },
      {
        "id": "pt-lm-Task.ExecutionPeriod",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status",
            "valueCode": "normative"
          },
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version",
            "valueCode": "4.0.0"
          }
        ],
        "path": "pt-lm-Task.ExecutionPeriod",
        "short": "Time window in which the task should be performed (start/end), if applicable.",
        "definition": "Time window in which the task should be performed (start/end), if applicable.",
        "comment": "A Period specifies a range of time; the context of use will specify whether the entire range applies (e.g. \"the patient was an inpatient of the hospital for this time range\") or one value from the range applies (e.g. \"give to the patient between these two times\").\n\nPeriod is not used for a duration (a measure of elapsed time). See [Duration](datatypes.html#Duration).",
        "alias": [
          "Periode"
        ],
        "min": 0,
        "max": "1",
        "base": {
          "path": "pt-lm-Task.ExecutionPeriod",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "Period"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          },
          {
            "key": "per-1",
            "severity": "error",
            "human": "If present, start SHALL have a lower value than end",
            "expression": "start.hasValue().not() or end.hasValue().not() or (start <= end)",
            "xpath": "not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) <= xs:dateTime(f:end/@value))",
            "source": "http://hl7.org/fhir/StructureDefinition/Period"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "v2",
            "map": "DR"
          },
          {
            "identity": "rim",
            "map": "IVL<TS>[lowClosed=\"true\" and highClosed=\"true\"] or URG<TS>[lowClosed=\"true\" and highClosed=\"true\"]"
          },
          {
            "identity": "pt-dataset-100-alpha1-20260511",
            "map": "pt-dataelement-7",
            "comment": "ExecutionPeriod"
          }
        ]
      },
      {
        "id": "pt-lm-Task.Requester",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status",
            "valueCode": "normative"
          },
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version",
            "valueCode": "4.0.0"
          }
        ],
        "path": "pt-lm-Task.Requester",
        "short": "The person or role who requested or initiated this Task.",
        "definition": "The person or role who requested or initiated this Task.",
        "comment": "References SHALL be a reference to an actual FHIR resource, and SHALL be resolveable (allowing for access control, temporary unavailability, etc.). Resolution can be either by retrieval from the URL, or, where applicable by resource type, by treating an absolute reference as a canonical URL and looking it up in a local registry/repository.",
        "alias": [
          "Aanvrager"
        ],
        "min": 0,
        "max": "1",
        "base": {
          "path": "pt-lm-Task.Requester",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://medmij.nl/fhir/StructureDefinition/medmij-core-lm-HealthProfessional"
            ]
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          },
          {
            "key": "ref-1",
            "severity": "error",
            "human": "SHALL have a contained resource if a local reference is provided",
            "expression": "reference.startsWith('#').not() or (reference.substring(1).trace('url') in %rootResource.contained.id.trace('ids'))",
            "xpath": "not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])",
            "source": "http://hl7.org/fhir/StructureDefinition/Reference"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "rim",
            "map": "The target of a resource reference is a RIM entry point (Act, Role, or Entity)"
          },
          {
            "identity": "pt-dataset-100-alpha1-20260511",
            "map": "pt-dataelement-8",
            "comment": "Requester"
          }
        ]
      }
    ]
  },
  "differential": {
    "element": [
      {
        "id": "pt-lm-Task",
        "path": "pt-lm-Task",
        "short": "Task",
        "definition": "Patient-specific task that tells a patient what to do as part of a digital care activity. A Task is shown in the patient’s task list and supports tracking progress and completion over time.",
        "alias": [
          "Taak"
        ],
        "mapping": [
          {
            "identity": "pt-dataset-100-alpha1-20260511",
            "map": "pt-dataelement-1",
            "comment": "Task"
          }
        ]
      },
      {
        "id": "pt-lm-Task.ActivityDefinition",
        "path": "pt-lm-Task.ActivityDefinition",
        "short": "Reference to the digital activity definition associated with this task.",
        "definition": "Reference to the digital activity definition associated with this task.",
        "alias": [
          "DigitaleActiviteit"
        ],
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://medmij.nl/fhir/StructureDefinition/pt-lm-Activity"
            ]
          }
        ],
        "mapping": [
          {
            "identity": "pt-dataset-100-alpha1-20260511",
            "map": "pt-dataelement-2",
            "comment": "ActivityDefinition"
          }
        ]
      },
      {
        "id": "pt-lm-Task.BasedOn",
        "path": "pt-lm-Task.BasedOn",
        "short": "Clinical order that triggered this patient task. May include patient-specific instructions and the requested schedule.",
        "definition": "Clinical order that triggered this patient task. May include patient-specific instructions and the requested schedule.",
        "alias": [
          "GebaseerdOp"
        ],
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://medmij.nl/fhir/StructureDefinition/pt-lm-ServiceRequest"
            ]
          }
        ],
        "mapping": [
          {
            "identity": "pt-dataset-100-alpha1-20260511",
            "map": "pt-dataelement-3",
            "comment": "BasedOn"
          }
        ]
      },
      {
        "id": "pt-lm-Task.Status",
        "path": "pt-lm-Task.Status",
        "short": "Current state of the Task in the workflow (e.g., requested, received, accepted, in-progress, completed, cancelled).",
        "definition": "Current state of the Task in the workflow (e.g., requested, received, accepted, in-progress, completed, cancelled).",
        "alias": [
          "Status"
        ],
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "code"
          }
        ],
        "mapping": [
          {
            "identity": "pt-dataset-100-alpha1-20260511",
            "map": "pt-dataelement-4",
            "comment": "Status"
          }
        ]
      },
      {
        "id": "pt-lm-Task.Priority",
        "path": "pt-lm-Task.Priority",
        "short": "Indicates how urgent it is to perform the activity (e.g., routine, urgent, asap).",
        "definition": "Indicates how urgent it is to perform the activity (e.g., routine, urgent, asap).",
        "alias": [
          "Prioriteit"
        ],
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "code"
          }
        ],
        "mapping": [
          {
            "identity": "pt-dataset-100-alpha1-20260511",
            "map": "pt-dataelement-5",
            "comment": "Priority"
          }
        ]
      },
      {
        "id": "pt-lm-Task.Description",
        "path": "pt-lm-Task.Description",
        "short": "Short instruction for the patient describing what to do. Keep the text concise and readable on mobile.",
        "definition": "Short instruction for the patient describing what to do. Keep the text concise and readable on mobile.",
        "alias": [
          "Omschrijving"
        ],
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "string"
          }
        ],
        "mapping": [
          {
            "identity": "pt-dataset-100-alpha1-20260511",
            "map": "pt-dataelement-6",
            "comment": "Description"
          }
        ]
      },
      {
        "id": "pt-lm-Task.ExecutionPeriod",
        "path": "pt-lm-Task.ExecutionPeriod",
        "short": "Time window in which the task should be performed (start/end), if applicable.",
        "definition": "Time window in which the task should be performed (start/end), if applicable.",
        "alias": [
          "Periode"
        ],
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Period"
          }
        ],
        "mapping": [
          {
            "identity": "pt-dataset-100-alpha1-20260511",
            "map": "pt-dataelement-7",
            "comment": "ExecutionPeriod"
          }
        ]
      },
      {
        "id": "pt-lm-Task.Requester",
        "path": "pt-lm-Task.Requester",
        "short": "The person or role who requested or initiated this Task.",
        "definition": "The person or role who requested or initiated this Task.",
        "alias": [
          "Aanvrager"
        ],
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://medmij.nl/fhir/StructureDefinition/medmij-core-lm-HealthProfessional"
            ]
          }
        ],
        "mapping": [
          {
            "identity": "pt-dataset-100-alpha1-20260511",
            "map": "pt-dataelement-8",
            "comment": "Requester"
          }
        ]
      }
    ]
  }
}