{
  "resourceType": "StructureDefinition",
  "id": "EPLabDispenseLine-2b0639e7-218c-47d3-815f-1a7289317fa6",
  "url": "https://www.esante.lu/fhir-spec/StructureDefinition/EPLabDispenseLine",
  "version": "1.2.0",
  "name": "EPLabDispenseLine",
  "status": "active",
  "fhirVersion": "4.0.1",
  "mapping": [
    {
      "identity": "workflow",
      "uri": "http://hl7.org/fhir/workflow",
      "name": "Workflow Pattern"
    },
    {
      "identity": "rim",
      "uri": "http://hl7.org/v3",
      "name": "RIM Mapping"
    },
    {
      "identity": "w5",
      "uri": "http://hl7.org/fhir/fivews",
      "name": "FiveWs Pattern Mapping"
    },
    {
      "identity": "v2",
      "uri": "http://hl7.org/v2",
      "name": "HL7 v2 Mapping"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "Task",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Task",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Task.id",
        "path": "Task.id",
        "definition": "The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.\r\nIs assigned by the server, do not provide a value."
      },
      {
        "id": "Task.meta",
        "path": "Task.meta",
        "min": 1
      },
      {
        "id": "Task.meta.id",
        "path": "Task.meta.id",
        "max": "0"
      },
      {
        "id": "Task.meta.versionId",
        "path": "Task.meta.versionId",
        "max": "0"
      },
      {
        "id": "Task.meta.lastUpdated",
        "path": "Task.meta.lastUpdated",
        "max": "0"
      },
      {
        "id": "Task.meta.source",
        "path": "Task.meta.source",
        "max": "0"
      },
      {
        "id": "Task.meta.profile",
        "path": "Task.meta.profile",
        "min": 1,
        "max": "1",
        "fixedCanonical": "https://www.esante.lu/fhir-spec/StructureDefinition/EPLabDispenseLine"
      },
      {
        "id": "Task.meta.security",
        "path": "Task.meta.security",
        "max": "0"
      },
      {
        "id": "Task.meta.tag",
        "path": "Task.meta.tag",
        "max": "0"
      },
      {
        "id": "Task.implicitRules",
        "path": "Task.implicitRules",
        "max": "0"
      },
      {
        "id": "Task.language",
        "path": "Task.language",
        "max": "0"
      },
      {
        "id": "Task.text",
        "path": "Task.text",
        "max": "0"
      },
      {
        "id": "Task.contained",
        "path": "Task.contained",
        "max": "0"
      },
      {
        "id": "Task.identifier",
        "path": "Task.identifier",
        "short": "Identifier of the dispense line",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Identifier",
            "profile": [
              "https://www.esante.lu/fhir-spec/StructureDefinition/EPSimpleIdentifier"
            ]
          }
        ]
      },
      {
        "id": "Task.instantiatesCanonical",
        "path": "Task.instantiatesCanonical",
        "max": "0"
      },
      {
        "id": "Task.instantiatesUri",
        "path": "Task.instantiatesUri",
        "max": "0"
      },
      {
        "id": "Task.basedOn",
        "path": "Task.basedOn",
        "short": "The linked prescription line",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://www.esante.lu/fhir-spec/StructureDefinition/EPLabPrescriptionLine"
            ],
            "aggregation": [
              "referenced"
            ]
          }
        ]
      },
      {
        "id": "Task.basedOn.id",
        "path": "Task.basedOn.id",
        "max": "0"
      },
      {
        "id": "Task.basedOn.reference",
        "path": "Task.basedOn.reference",
        "short": "Reference the prescription line by its identifier",
        "min": 1,
        "example": [
          {
            "label": "Example",
            "valueString": "ServiceRequest?identifier=urn:ietf:rfc:3986|urn:uuid:98e22ebb-b86b-41b5-9a1e-9701b07a47c3"
          }
        ],
        "condition": [
          "val-ServiceRequestByIdentifier"
        ],
        "constraint": [
          {
            "key": "val-ServiceRequestByIdentifier",
            "severity": "error",
            "human": "SHALL reference the prescription line (ServiceRequest) by its identifier",
            "expression": "startsWith('ServiceRequest?identifier=urn:ietf:rfc:3986|urn:uuid:') and length()=89",
            "source": "https://www.esante.lu/fhir-spec/StructureDefinition/EPLabDispenseLine"
          }
        ]
      },
      {
        "id": "Task.basedOn.type",
        "path": "Task.basedOn.type",
        "max": "0"
      },
      {
        "id": "Task.basedOn.identifier",
        "path": "Task.basedOn.identifier",
        "max": "0"
      },
      {
        "id": "Task.basedOn.display",
        "path": "Task.basedOn.display",
        "max": "0"
      },
      {
        "id": "Task.groupIdentifier",
        "path": "Task.groupIdentifier",
        "max": "0"
      },
      {
        "id": "Task.partOf",
        "path": "Task.partOf",
        "max": "0"
      },
      {
        "id": "Task.status",
        "path": "Task.status",
        "definition": "We consider only accepteds lines",
        "fixedCode": "accepted"
      },
      {
        "id": "Task.statusReason",
        "path": "Task.statusReason",
        "max": "0"
      },
      {
        "id": "Task.businessStatus",
        "path": "Task.businessStatus",
        "max": "0"
      },
      {
        "id": "Task.intent",
        "path": "Task.intent",
        "definition": "Constant value",
        "fixedCode": "filler-order"
      },
      {
        "id": "Task.priority",
        "path": "Task.priority",
        "max": "0"
      },
      {
        "id": "Task.code",
        "path": "Task.code",
        "min": 1,
        "patternCodeableConcept": {
          "coding": [
            {
              "code": "LAB_DISPLINE",
              "system": "https://www.esante.lu/fhir-spec/CodeSystem/EPrescCategories"
            }
          ]
        }
      },
      {
        "id": "Task.code.id",
        "path": "Task.code.id",
        "max": "0"
      },
      {
        "id": "Task.code.coding",
        "path": "Task.code.coding",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Task.code.coding.id",
        "path": "Task.code.coding.id",
        "max": "0"
      },
      {
        "id": "Task.code.coding.system",
        "path": "Task.code.coding.system",
        "min": 1
      },
      {
        "id": "Task.code.coding.version",
        "path": "Task.code.coding.version",
        "max": "0"
      },
      {
        "id": "Task.code.coding.code",
        "path": "Task.code.coding.code",
        "short": "The code",
        "min": 1
      },
      {
        "id": "Task.code.coding.display",
        "path": "Task.code.coding.display",
        "max": "0"
      },
      {
        "id": "Task.code.coding.userSelected",
        "path": "Task.code.coding.userSelected",
        "max": "0"
      },
      {
        "id": "Task.code.text",
        "path": "Task.code.text",
        "max": "0"
      },
      {
        "id": "Task.description",
        "path": "Task.description",
        "max": "0"
      },
      {
        "id": "Task.focus",
        "path": "Task.focus",
        "max": "0"
      },
      {
        "id": "Task.for",
        "path": "Task.for",
        "short": "The patient",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://www.esante.lu/fhir-spec/StructureDefinition/EPPatient"
            ],
            "aggregation": [
              "bundled"
            ]
          }
        ]
      },
      {
        "id": "Task.for.id",
        "path": "Task.for.id",
        "max": "0"
      },
      {
        "id": "Task.for.reference",
        "path": "Task.for.reference",
        "short": "Reference to a patient from the Bundle",
        "min": 1,
        "example": [
          {
            "label": "Example",
            "valueString": "urn:uuid:43b25517-9ab1-4a3b-96b0-809e7f118c41"
          }
        ],
        "condition": [
          "val-uuid"
        ],
        "constraint": [
          {
            "key": "val-uuid",
            "severity": "error",
            "human": "SHALL be a v4 UUID prefixed by urn:uuid:",
            "expression": "startsWith('urn:uuid:') and length()=45",
            "source": "https://www.esante.lu/fhir-spec/StructureDefinition/EPLabDispenseLine"
          }
        ]
      },
      {
        "id": "Task.for.type",
        "path": "Task.for.type",
        "max": "0"
      },
      {
        "id": "Task.for.identifier",
        "path": "Task.for.identifier",
        "max": "0"
      },
      {
        "id": "Task.for.display",
        "path": "Task.for.display",
        "max": "0"
      },
      {
        "id": "Task.encounter",
        "path": "Task.encounter",
        "short": "The dispense",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://www.esante.lu/fhir-spec/StructureDefinition/EPLabDispense"
            ],
            "aggregation": [
              "bundled"
            ]
          }
        ]
      },
      {
        "id": "Task.encounter.id",
        "path": "Task.encounter.id",
        "max": "0"
      },
      {
        "id": "Task.encounter.reference",
        "path": "Task.encounter.reference",
        "short": "The encounter, referenced by its fullUrl",
        "min": 1,
        "example": [
          {
            "label": "Example",
            "valueString": "urn:uuid:72c55302-2bcb-4fff-9297-35be8fa5a61d"
          }
        ],
        "condition": [
          "val-uuid"
        ],
        "constraint": [
          {
            "key": "val-uuid",
            "severity": "error",
            "human": "SHALL be a v4 UUID prefixed by urn:uuid:",
            "expression": "startsWith('urn:uuid:') and length()=45",
            "source": "https://www.esante.lu/fhir-spec/StructureDefinition/EPLabDispenseLine"
          }
        ]
      },
      {
        "id": "Task.encounter.type",
        "path": "Task.encounter.type",
        "max": "0"
      },
      {
        "id": "Task.encounter.identifier",
        "path": "Task.encounter.identifier",
        "max": "0"
      },
      {
        "id": "Task.encounter.display",
        "path": "Task.encounter.display",
        "max": "0"
      },
      {
        "id": "Task.executionPeriod",
        "path": "Task.executionPeriod",
        "max": "0"
      },
      {
        "id": "Task.authoredOn",
        "path": "Task.authoredOn",
        "short": "Dispensation date",
        "definition": "Dispensation date",
        "min": 1,
        "example": [
          {
            "label": "Example",
            "valueDateTime": "2022-03-04"
          }
        ],
        "condition": [
          "val-dateDayPrecision"
        ],
        "constraint": [
          {
            "key": "val-dateDayPrecision",
            "severity": "error",
            "human": "Shall be precise to the day",
            "expression": "toString().length()=10",
            "source": "https://www.esante.lu/fhir-spec/StructureDefinition/EPLabDispenseLine"
          }
        ]
      },
      {
        "id": "Task.lastModified",
        "path": "Task.lastModified",
        "max": "0"
      },
      {
        "id": "Task.requester",
        "path": "Task.requester",
        "max": "0"
      },
      {
        "id": "Task.performerType",
        "path": "Task.performerType",
        "max": "0"
      },
      {
        "id": "Task.owner",
        "path": "Task.owner",
        "short": "Reference to the lab",
        "definition": "Reference to the lab",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Organization"
            ],
            "aggregation": [
              "referenced"
            ]
          }
        ]
      },
      {
        "id": "Task.owner.id",
        "path": "Task.owner.id",
        "max": "0"
      },
      {
        "id": "Task.owner.reference",
        "path": "Task.owner.reference",
        "short": "The labo referenced by its eHealthID",
        "min": 1,
        "example": [
          {
            "label": "Example",
            "valueString": "Organization?identifier=urn:oid:1.3.182.4.1|1000180763"
          }
        ],
        "condition": [
          "val-orgByEhealthID"
        ],
        "constraint": [
          {
            "key": "val-orgByEhealthID",
            "severity": "error",
            "human": "SHALL reference an organization by its eHealthID",
            "expression": "startsWith('Organization?identifier=urn:oid:1.3.182.4.1|1') and length()=54",
            "source": "https://www.esante.lu/fhir-spec/StructureDefinition/EPLabDispenseLine"
          }
        ]
      },
      {
        "id": "Task.owner.type",
        "path": "Task.owner.type",
        "max": "0"
      },
      {
        "id": "Task.owner.identifier",
        "path": "Task.owner.identifier",
        "max": "0"
      },
      {
        "id": "Task.owner.display",
        "path": "Task.owner.display",
        "max": "0"
      },
      {
        "id": "Task.location",
        "path": "Task.location",
        "max": "0"
      },
      {
        "id": "Task.reasonCode",
        "path": "Task.reasonCode",
        "max": "0"
      },
      {
        "id": "Task.reasonReference",
        "path": "Task.reasonReference",
        "max": "0"
      },
      {
        "id": "Task.insurance",
        "path": "Task.insurance",
        "max": "0"
      },
      {
        "id": "Task.note",
        "path": "Task.note",
        "max": "0"
      },
      {
        "id": "Task.relevantHistory",
        "path": "Task.relevantHistory",
        "max": "0"
      },
      {
        "id": "Task.restriction",
        "path": "Task.restriction",
        "max": "0"
      },
      {
        "id": "Task.input",
        "path": "Task.input",
        "max": "0"
      },
      {
        "id": "Task.output",
        "path": "Task.output",
        "short": "Number of items dispensed",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Task.output.id",
        "path": "Task.output.id",
        "max": "0"
      },
      {
        "id": "Task.output.type.id",
        "path": "Task.output.type.id",
        "max": "0"
      },
      {
        "id": "Task.output.type.coding",
        "path": "Task.output.type.coding",
        "min": 1,
        "max": "1",
        "fixedCoding": {
          "code": "NUM_REALIZED",
          "system": "https://www.esante.lu/fhir-spec/CodeSystem/DispQuantity"
        }
      },
      {
        "id": "Task.output.type.coding.id",
        "path": "Task.output.type.coding.id",
        "max": "0"
      },
      {
        "id": "Task.output.type.coding.system",
        "path": "Task.output.type.coding.system",
        "min": 1,
        "fixedUri": "https://www.esante.lu/fhir-spec/CodeSystem/DispQuantity"
      },
      {
        "id": "Task.output.type.coding.version",
        "path": "Task.output.type.coding.version",
        "max": "0"
      },
      {
        "id": "Task.output.type.coding.code",
        "path": "Task.output.type.coding.code",
        "short": "The code",
        "min": 1,
        "fixedCode": "NUM_REALIZED"
      },
      {
        "id": "Task.output.type.coding.display",
        "path": "Task.output.type.coding.display",
        "max": "0"
      },
      {
        "id": "Task.output.type.coding.userSelected",
        "path": "Task.output.type.coding.userSelected",
        "max": "0"
      },
      {
        "id": "Task.output.type.text",
        "path": "Task.output.type.text",
        "max": "0"
      },
      {
        "id": "Task.output.value[x]",
        "path": "Task.output.value[x]",
        "short": "The value",
        "type": [
          {
            "code": "integer"
          }
        ]
      }
    ]
  }
}