{
  "resourceType": "StructureDefinition",
  "id": "EPLabPrescriptionLine-9b7a3d71-6d8c-4cb7-b750-84c0d7aa709f",
  "url": "https://www.esante.lu/fhir-spec/StructureDefinition/EPLabPrescriptionLine",
  "version": "1.2.0",
  "name": "EPLabPrescriptionLine",
  "status": "active",
  "fhirVersion": "4.0.1",
  "mapping": [
    {
      "identity": "workflow",
      "uri": "http://hl7.org/fhir/workflow",
      "name": "Workflow Pattern"
    },
    {
      "identity": "v2",
      "uri": "http://hl7.org/v2",
      "name": "HL7 v2 Mapping"
    },
    {
      "identity": "rim",
      "uri": "http://hl7.org/v3",
      "name": "RIM Mapping"
    },
    {
      "identity": "w5",
      "uri": "http://hl7.org/fhir/fivews",
      "name": "FiveWs Pattern Mapping"
    },
    {
      "identity": "quick",
      "uri": "http://siframework.org/cqf",
      "name": "Quality Improvement and Clinical Knowledge (QUICK)"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "ServiceRequest",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/ServiceRequest",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "ServiceRequest.id",
        "path": "ServiceRequest.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": "ServiceRequest.meta",
        "path": "ServiceRequest.meta",
        "min": 1
      },
      {
        "id": "ServiceRequest.meta.id",
        "path": "ServiceRequest.meta.id",
        "max": "0"
      },
      {
        "id": "ServiceRequest.meta.versionId",
        "path": "ServiceRequest.meta.versionId",
        "max": "0"
      },
      {
        "id": "ServiceRequest.meta.lastUpdated",
        "path": "ServiceRequest.meta.lastUpdated",
        "max": "0"
      },
      {
        "id": "ServiceRequest.meta.source",
        "path": "ServiceRequest.meta.source",
        "max": "0"
      },
      {
        "id": "ServiceRequest.meta.profile",
        "path": "ServiceRequest.meta.profile",
        "min": 1,
        "max": "1",
        "fixedCanonical": "https://www.esante.lu/fhir-spec/StructureDefinition/EPLabPrescriptionLine"
      },
      {
        "id": "ServiceRequest.meta.security",
        "path": "ServiceRequest.meta.security",
        "max": "0"
      },
      {
        "id": "ServiceRequest.meta.tag",
        "path": "ServiceRequest.meta.tag",
        "max": "0"
      },
      {
        "id": "ServiceRequest.implicitRules",
        "path": "ServiceRequest.implicitRules",
        "max": "0"
      },
      {
        "id": "ServiceRequest.language",
        "path": "ServiceRequest.language",
        "max": "0"
      },
      {
        "id": "ServiceRequest.text",
        "path": "ServiceRequest.text",
        "max": "0"
      },
      {
        "id": "ServiceRequest.contained",
        "path": "ServiceRequest.contained",
        "max": "0"
      },
      {
        "id": "ServiceRequest.identifier",
        "path": "ServiceRequest.identifier",
        "short": "An identifier for the prescription line",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Identifier",
            "profile": [
              "https://www.esante.lu/fhir-spec/StructureDefinition/EPSimpleIdentifier"
            ]
          }
        ]
      },
      {
        "id": "ServiceRequest.instantiatesCanonical",
        "path": "ServiceRequest.instantiatesCanonical",
        "max": "0"
      },
      {
        "id": "ServiceRequest.instantiatesUri",
        "path": "ServiceRequest.instantiatesUri",
        "max": "0"
      },
      {
        "id": "ServiceRequest.basedOn",
        "path": "ServiceRequest.basedOn",
        "max": "0"
      },
      {
        "id": "ServiceRequest.replaces",
        "path": "ServiceRequest.replaces",
        "max": "0"
      },
      {
        "id": "ServiceRequest.requisition",
        "path": "ServiceRequest.requisition",
        "max": "0"
      },
      {
        "id": "ServiceRequest.status",
        "path": "ServiceRequest.status",
        "short": "active | completed",
        "condition": [
          "val-activeOrCompleted"
        ],
        "constraint": [
          {
            "key": "val-activeOrCompleted",
            "severity": "error",
            "human": "Only active or completed is allowed",
            "expression": "($this = 'active') or ($this = 'completed')",
            "source": "https://www.esante.lu/fhir-spec/StructureDefinition/EPLabPrescriptionLine"
          }
        ]
      },
      {
        "id": "ServiceRequest.intent",
        "path": "ServiceRequest.intent",
        "definition": "Constant value",
        "fixedCode": "order"
      },
      {
        "id": "ServiceRequest.category",
        "path": "ServiceRequest.category",
        "short": "Type of ServiceRequest",
        "min": 1,
        "max": "1",
        "patternCodeableConcept": {
          "coding": [
            {
              "code": "LAB_PRESLINE",
              "system": "https://www.esante.lu/fhir-spec/CodeSystem/EPrescCategories"
            }
          ]
        }
      },
      {
        "id": "ServiceRequest.category.id",
        "path": "ServiceRequest.category.id",
        "max": "0"
      },
      {
        "id": "ServiceRequest.category.coding",
        "path": "ServiceRequest.category.coding",
        "min": 1,
        "max": "1"
      },
      {
        "id": "ServiceRequest.category.coding.id",
        "path": "ServiceRequest.category.coding.id",
        "max": "0"
      },
      {
        "id": "ServiceRequest.category.coding.system",
        "path": "ServiceRequest.category.coding.system",
        "min": 1
      },
      {
        "id": "ServiceRequest.category.coding.version",
        "path": "ServiceRequest.category.coding.version",
        "max": "0"
      },
      {
        "id": "ServiceRequest.category.coding.code",
        "path": "ServiceRequest.category.coding.code",
        "short": "The code",
        "min": 1
      },
      {
        "id": "ServiceRequest.category.coding.display",
        "path": "ServiceRequest.category.coding.display",
        "max": "0"
      },
      {
        "id": "ServiceRequest.category.coding.userSelected",
        "path": "ServiceRequest.category.coding.userSelected",
        "max": "0"
      },
      {
        "id": "ServiceRequest.category.text",
        "path": "ServiceRequest.category.text",
        "max": "0"
      },
      {
        "id": "ServiceRequest.priority",
        "path": "ServiceRequest.priority",
        "short": "routine | urgent",
        "min": 1,
        "condition": [
          "val-priority"
        ],
        "constraint": [
          {
            "key": "val-priority",
            "severity": "error",
            "human": "Only the priorities routine or urgent are used",
            "expression": "($this = 'routine') or ($this = 'urgent')",
            "source": "https://www.esante.lu/fhir-spec/StructureDefinition/EPLabPrescriptionLine"
          }
        ]
      },
      {
        "id": "ServiceRequest.doNotPerform",
        "path": "ServiceRequest.doNotPerform",
        "max": "0"
      },
      {
        "id": "ServiceRequest.code",
        "path": "ServiceRequest.code",
        "short": "The analysis to perform",
        "min": 1,
        "type": [
          {
            "code": "CodeableConcept",
            "profile": [
              "https://www.esante.lu/fhir-spec/StructureDefinition/EPCodeableConcept"
            ]
          }
        ],
        "example": [
          {
            "label": "HDL",
            "valueCodeableConcept": {
              "coding": [
                {
                  "code": "lu_bio_presc_77",
                  "system": "https://www.esante.lu/fhir-spec/CodeSystem/BioPrescCodesSystem"
                }
              ]
            }
          }
        ],
        "binding": {
          "strength": "example",
          "valueSet": "https://www.esante.lu/fhir-spec/ValueSet/BioPrescCodes",
          "description": "The analysis to do"
        }
      },
      {
        "id": "ServiceRequest.code.coding",
        "path": "ServiceRequest.code.coding",
        "binding": {
          "strength": "required",
          "valueSet": "https://www.esante.lu/fhir-spec/ValueSet/BioPrescCodes"
        }
      },
      {
        "id": "ServiceRequest.orderDetail",
        "path": "ServiceRequest.orderDetail",
        "short": "Additional order information for the lab",
        "max": "1"
      },
      {
        "id": "ServiceRequest.orderDetail.coding",
        "path": "ServiceRequest.orderDetail.coding",
        "max": "0"
      },
      {
        "id": "ServiceRequest.orderDetail.text",
        "path": "ServiceRequest.orderDetail.text",
        "min": 1
      },
      {
        "id": "ServiceRequest.quantity[x]",
        "path": "ServiceRequest.quantity[x]",
        "definition": "Total number of analysis to do",
        "min": 1,
        "type": [
          {
            "code": "Quantity"
          }
        ]
      },
      {
        "id": "ServiceRequest.quantity[x].id",
        "path": "ServiceRequest.quantity[x].id",
        "max": "0"
      },
      {
        "id": "ServiceRequest.quantity[x].value",
        "path": "ServiceRequest.quantity[x].value",
        "short": "Integer value",
        "min": 1
      },
      {
        "id": "ServiceRequest.quantity[x].comparator",
        "path": "ServiceRequest.quantity[x].comparator",
        "max": "0"
      },
      {
        "id": "ServiceRequest.quantity[x].unit",
        "path": "ServiceRequest.quantity[x].unit",
        "max": "0"
      },
      {
        "id": "ServiceRequest.quantity[x].system",
        "path": "ServiceRequest.quantity[x].system",
        "max": "0"
      },
      {
        "id": "ServiceRequest.quantity[x].code",
        "path": "ServiceRequest.quantity[x].code",
        "max": "0"
      },
      {
        "id": "ServiceRequest.subject",
        "path": "ServiceRequest.subject",
        "short": "The patient",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://www.esante.lu/fhir-spec/StructureDefinition/EPPatient"
            ],
            "aggregation": [
              "bundled"
            ]
          }
        ]
      },
      {
        "id": "ServiceRequest.subject.id",
        "path": "ServiceRequest.subject.id",
        "max": "0"
      },
      {
        "id": "ServiceRequest.subject.reference",
        "path": "ServiceRequest.subject.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/EPLabPrescriptionLine"
          }
        ]
      },
      {
        "id": "ServiceRequest.subject.type",
        "path": "ServiceRequest.subject.type",
        "max": "0"
      },
      {
        "id": "ServiceRequest.subject.identifier",
        "path": "ServiceRequest.subject.identifier",
        "max": "0"
      },
      {
        "id": "ServiceRequest.subject.display",
        "path": "ServiceRequest.subject.display",
        "max": "0"
      },
      {
        "id": "ServiceRequest.encounter",
        "path": "ServiceRequest.encounter",
        "max": "0"
      },
      {
        "id": "ServiceRequest.occurrence[x]",
        "path": "ServiceRequest.occurrence[x]",
        "short": "The posology in free text",
        "definition": "If needed, the posoology (which result in a total amount of repetition of the analysis written in quantity).",
        "type": [
          {
            "code": "Timing"
          }
        ]
      },
      {
        "id": "ServiceRequest.occurrence[x].id",
        "path": "ServiceRequest.occurrence[x].id",
        "max": "0"
      },
      {
        "id": "ServiceRequest.occurrence[x].event",
        "path": "ServiceRequest.occurrence[x].event",
        "max": "0"
      },
      {
        "id": "ServiceRequest.occurrence[x].repeat",
        "path": "ServiceRequest.occurrence[x].repeat",
        "max": "0"
      },
      {
        "id": "ServiceRequest.occurrence[x].code",
        "path": "ServiceRequest.occurrence[x].code",
        "definition": "Posology infree text",
        "min": 1
      },
      {
        "id": "ServiceRequest.occurrence[x].code.id",
        "path": "ServiceRequest.occurrence[x].code.id",
        "max": "0"
      },
      {
        "id": "ServiceRequest.occurrence[x].code.coding",
        "path": "ServiceRequest.occurrence[x].code.coding",
        "max": "0"
      },
      {
        "id": "ServiceRequest.occurrence[x].code.text",
        "path": "ServiceRequest.occurrence[x].code.text",
        "short": "The posology",
        "definition": "The posology",
        "min": 1,
        "example": [
          {
            "label": "Example",
            "valueString": "Jour 1 matin et soir, puis 2 jours après midi et soir"
          }
        ]
      },
      {
        "id": "ServiceRequest.asNeeded[x]",
        "path": "ServiceRequest.asNeeded[x]",
        "max": "0"
      },
      {
        "id": "ServiceRequest.authoredOn",
        "path": "ServiceRequest.authoredOn",
        "short": "In the ePrescription context, same date as the prescription date",
        "min": 1,
        "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/EPLabPrescriptionLine"
          }
        ]
      },
      {
        "id": "ServiceRequest.requester",
        "path": "ServiceRequest.requester",
        "short": "The prescriber",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://www.esante.lu/fhir-spec/StructureDefinition/EPPractitioner"
            ],
            "aggregation": [
              "bundled"
            ]
          }
        ]
      },
      {
        "id": "ServiceRequest.requester.id",
        "path": "ServiceRequest.requester.id",
        "max": "0"
      },
      {
        "id": "ServiceRequest.requester.reference",
        "path": "ServiceRequest.requester.reference",
        "short": "A reference to the health professional",
        "min": 1,
        "example": [
          {
            "label": "Example",
            "valueString": "urn:uuid:759d46a4-b0a2-429e-a426-ce7be8e0736e"
          }
        ],
        "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/EPLabPrescriptionLine"
          }
        ]
      },
      {
        "id": "ServiceRequest.requester.type",
        "path": "ServiceRequest.requester.type",
        "max": "0"
      },
      {
        "id": "ServiceRequest.requester.identifier",
        "path": "ServiceRequest.requester.identifier",
        "max": "0"
      },
      {
        "id": "ServiceRequest.requester.display",
        "path": "ServiceRequest.requester.display",
        "max": "0"
      },
      {
        "id": "ServiceRequest.performerType",
        "path": "ServiceRequest.performerType",
        "max": "0"
      },
      {
        "id": "ServiceRequest.performer",
        "path": "ServiceRequest.performer",
        "max": "0"
      },
      {
        "id": "ServiceRequest.locationCode",
        "path": "ServiceRequest.locationCode",
        "max": "0"
      },
      {
        "id": "ServiceRequest.locationReference",
        "path": "ServiceRequest.locationReference",
        "max": "0"
      },
      {
        "id": "ServiceRequest.reasonCode",
        "path": "ServiceRequest.reasonCode",
        "max": "0"
      },
      {
        "id": "ServiceRequest.reasonReference",
        "path": "ServiceRequest.reasonReference",
        "max": "0"
      },
      {
        "id": "ServiceRequest.insurance",
        "path": "ServiceRequest.insurance",
        "max": "0"
      },
      {
        "id": "ServiceRequest.supportingInfo",
        "path": "ServiceRequest.supportingInfo",
        "max": "0"
      },
      {
        "id": "ServiceRequest.specimen",
        "path": "ServiceRequest.specimen",
        "max": "0"
      },
      {
        "id": "ServiceRequest.bodySite",
        "path": "ServiceRequest.bodySite",
        "max": "0"
      },
      {
        "id": "ServiceRequest.note",
        "path": "ServiceRequest.note",
        "max": "0"
      },
      {
        "id": "ServiceRequest.relevantHistory",
        "path": "ServiceRequest.relevantHistory",
        "max": "0"
      }
    ]
  }
}