{
  "resourceType": "StructureDefinition",
  "id": "EPLabPrescription-38f440d6-63e0-420d-9374-64f58388bb71",
  "url": "https://www.esante.lu/fhir-spec/StructureDefinition/EPLabPrescription",
  "version": "1.2.0",
  "name": "EPLabPrescription",
  "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": "CarePlan",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/CarePlan",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "CarePlan.id",
        "path": "CarePlan.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": "CarePlan.meta",
        "path": "CarePlan.meta",
        "min": 1
      },
      {
        "id": "CarePlan.meta.id",
        "path": "CarePlan.meta.id",
        "max": "0"
      },
      {
        "id": "CarePlan.meta.versionId",
        "path": "CarePlan.meta.versionId",
        "max": "0"
      },
      {
        "id": "CarePlan.meta.lastUpdated",
        "path": "CarePlan.meta.lastUpdated",
        "max": "0"
      },
      {
        "id": "CarePlan.meta.source",
        "path": "CarePlan.meta.source",
        "max": "0"
      },
      {
        "id": "CarePlan.meta.profile",
        "path": "CarePlan.meta.profile",
        "min": 1,
        "max": "1",
        "fixedCanonical": "https://www.esante.lu/fhir-spec/StructureDefinition/EPLabPrescription"
      },
      {
        "id": "CarePlan.meta.security",
        "path": "CarePlan.meta.security",
        "max": "0"
      },
      {
        "id": "CarePlan.meta.tag",
        "path": "CarePlan.meta.tag",
        "max": "0"
      },
      {
        "id": "CarePlan.implicitRules",
        "path": "CarePlan.implicitRules",
        "max": "0"
      },
      {
        "id": "CarePlan.language",
        "path": "CarePlan.language",
        "max": "0"
      },
      {
        "id": "CarePlan.text",
        "path": "CarePlan.text",
        "max": "0"
      },
      {
        "id": "CarePlan.contained",
        "path": "CarePlan.contained",
        "max": "0"
      },
      {
        "id": "CarePlan.extension",
        "path": "CarePlan.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "closed"
        }
      },
      {
        "id": "CarePlan.extension:PatientInstruction",
        "path": "CarePlan.extension",
        "sliceName": "PatientInstruction",
        "min": 0,
        "max": "*",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://www.esante.lu/fhir-spec/StructureDefinition/EPPatientInstructionText"
            ]
          }
        ]
      },
      {
        "id": "CarePlan.extension:OrderDetail",
        "path": "CarePlan.extension",
        "sliceName": "OrderDetail",
        "min": 0,
        "max": "*",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://www.esante.lu/fhir-spec/StructureDefinition/EPOrderDetail"
            ]
          }
        ]
      },
      {
        "id": "CarePlan.identifier",
        "path": "CarePlan.identifier",
        "short": "An identifier for the prescription",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Identifier",
            "profile": [
              "https://www.esante.lu/fhir-spec/StructureDefinition/EPSimpleIdentifier"
            ]
          }
        ]
      },
      {
        "id": "CarePlan.instantiatesCanonical",
        "path": "CarePlan.instantiatesCanonical",
        "max": "0"
      },
      {
        "id": "CarePlan.instantiatesUri",
        "path": "CarePlan.instantiatesUri",
        "max": "0"
      },
      {
        "id": "CarePlan.basedOn",
        "path": "CarePlan.basedOn",
        "max": "0"
      },
      {
        "id": "CarePlan.replaces",
        "path": "CarePlan.replaces",
        "max": "0"
      },
      {
        "id": "CarePlan.partOf",
        "path": "CarePlan.partOf",
        "max": "0"
      },
      {
        "id": "CarePlan.status",
        "path": "CarePlan.status",
        "definition": "Normally only active status are sent and retrieved, but a prescription itself may have another statuses",
        "condition": [
          "val-presStatus"
        ],
        "constraint": [
          {
            "key": "val-presStatus",
            "severity": "error",
            "human": "Only the statuses active, completed or revoked are used",
            "expression": "($this = 'active') or ($this = 'completed') or ($this = 'revoked') or ($this = 'entered-in-error')",
            "source": "https://www.esante.lu/fhir-spec/StructureDefinition/EPLabPrescription"
          }
        ]
      },
      {
        "id": "CarePlan.intent",
        "path": "CarePlan.intent",
        "definition": "Constant value",
        "fixedCode": "order"
      },
      {
        "id": "CarePlan.category",
        "path": "CarePlan.category",
        "short": "Type of CarePlan",
        "min": 1,
        "max": "1"
      },
      {
        "id": "CarePlan.category.id",
        "path": "CarePlan.category.id",
        "max": "0"
      },
      {
        "id": "CarePlan.category.coding",
        "path": "CarePlan.category.coding",
        "min": 1,
        "max": "1",
        "patternCoding": {
          "code": "LAB_PRESC",
          "system": "https://www.esante.lu/fhir-spec/CodeSystem/EPrescCategories"
        }
      },
      {
        "id": "CarePlan.category.coding.id",
        "path": "CarePlan.category.coding.id",
        "max": "0"
      },
      {
        "id": "CarePlan.category.coding.system",
        "path": "CarePlan.category.coding.system",
        "min": 1
      },
      {
        "id": "CarePlan.category.coding.version",
        "path": "CarePlan.category.coding.version",
        "max": "0"
      },
      {
        "id": "CarePlan.category.coding.code",
        "path": "CarePlan.category.coding.code",
        "short": "The code",
        "min": 1
      },
      {
        "id": "CarePlan.category.coding.display",
        "path": "CarePlan.category.coding.display",
        "max": "0"
      },
      {
        "id": "CarePlan.category.coding.userSelected",
        "path": "CarePlan.category.coding.userSelected",
        "max": "0"
      },
      {
        "id": "CarePlan.category.text",
        "path": "CarePlan.category.text",
        "max": "0"
      },
      {
        "id": "CarePlan.title",
        "path": "CarePlan.title",
        "max": "0"
      },
      {
        "id": "CarePlan.description",
        "path": "CarePlan.description",
        "max": "0"
      },
      {
        "id": "CarePlan.subject",
        "path": "CarePlan.subject",
        "short": "The patient",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://www.esante.lu/fhir-spec/StructureDefinition/EPPatient"
            ],
            "aggregation": [
              "bundled"
            ]
          }
        ]
      },
      {
        "id": "CarePlan.subject.id",
        "path": "CarePlan.subject.id",
        "max": "0"
      },
      {
        "id": "CarePlan.subject.reference",
        "path": "CarePlan.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/EPLabPrescription"
          }
        ]
      },
      {
        "id": "CarePlan.subject.type",
        "path": "CarePlan.subject.type",
        "max": "0"
      },
      {
        "id": "CarePlan.subject.identifier",
        "path": "CarePlan.subject.identifier",
        "max": "0"
      },
      {
        "id": "CarePlan.subject.display",
        "path": "CarePlan.subject.display",
        "max": "0"
      },
      {
        "id": "CarePlan.encounter",
        "path": "CarePlan.encounter",
        "max": "0"
      },
      {
        "id": "CarePlan.period",
        "path": "CarePlan.period",
        "short": "Start and end validity dates",
        "min": 1
      },
      {
        "id": "CarePlan.period.id",
        "path": "CarePlan.period.id",
        "max": "0"
      },
      {
        "id": "CarePlan.period.start",
        "path": "CarePlan.period.start",
        "min": 1,
        "example": [
          {
            "label": "Start",
            "valueDateTime": "2022-02-01"
          }
        ],
        "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/EPLabPrescription"
          }
        ]
      },
      {
        "id": "CarePlan.period.end",
        "path": "CarePlan.period.end",
        "short": "End time with inclusive boundary",
        "definition": "The end of the validity period.",
        "min": 1,
        "example": [
          {
            "label": "End",
            "valueDateTime": "2022-02-28"
          }
        ],
        "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/EPLabPrescription"
          }
        ]
      },
      {
        "id": "CarePlan.created",
        "path": "CarePlan.created",
        "short": "Creation date of the prescription",
        "min": 1,
        "example": [
          {
            "label": "Creation",
            "valueDateTime": "2022-02-01"
          }
        ],
        "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/EPLabPrescription"
          }
        ]
      },
      {
        "id": "CarePlan.author",
        "path": "CarePlan.author",
        "short": "The health professional",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://www.esante.lu/fhir-spec/StructureDefinition/EPPractitioner"
            ],
            "aggregation": [
              "bundled"
            ]
          }
        ]
      },
      {
        "id": "CarePlan.author.id",
        "path": "CarePlan.author.id",
        "max": "0"
      },
      {
        "id": "CarePlan.author.reference",
        "path": "CarePlan.author.reference",
        "short": "Author of the prescription",
        "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/EPLabPrescription"
          }
        ]
      },
      {
        "id": "CarePlan.author.type",
        "path": "CarePlan.author.type",
        "max": "0"
      },
      {
        "id": "CarePlan.author.identifier",
        "path": "CarePlan.author.identifier",
        "max": "0"
      },
      {
        "id": "CarePlan.author.display",
        "path": "CarePlan.author.display",
        "max": "0"
      },
      {
        "id": "CarePlan.contributor",
        "path": "CarePlan.contributor",
        "short": "The organisation responsible for the prescription",
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Organization"
            ],
            "aggregation": [
              "referenced"
            ]
          }
        ]
      },
      {
        "id": "CarePlan.contributor.id",
        "path": "CarePlan.contributor.id",
        "max": "0"
      },
      {
        "id": "CarePlan.contributor.reference",
        "path": "CarePlan.contributor.reference",
        "short": "The organization 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/EPLabPrescription"
          }
        ]
      },
      {
        "id": "CarePlan.contributor.type",
        "path": "CarePlan.contributor.type",
        "max": "0"
      },
      {
        "id": "CarePlan.contributor.identifier",
        "path": "CarePlan.contributor.identifier",
        "max": "0"
      },
      {
        "id": "CarePlan.contributor.display",
        "path": "CarePlan.contributor.display",
        "max": "0"
      },
      {
        "id": "CarePlan.careTeam",
        "path": "CarePlan.careTeam",
        "max": "0"
      },
      {
        "id": "CarePlan.addresses",
        "path": "CarePlan.addresses",
        "max": "0"
      },
      {
        "id": "CarePlan.supportingInfo",
        "path": "CarePlan.supportingInfo",
        "max": "0"
      },
      {
        "id": "CarePlan.goal",
        "path": "CarePlan.goal",
        "max": "0"
      },
      {
        "id": "CarePlan.activity",
        "path": "CarePlan.activity",
        "short": "Prescription lines",
        "min": 1
      },
      {
        "id": "CarePlan.activity.id",
        "path": "CarePlan.activity.id",
        "max": "0"
      },
      {
        "id": "CarePlan.activity.outcomeCodeableConcept",
        "path": "CarePlan.activity.outcomeCodeableConcept",
        "max": "0"
      },
      {
        "id": "CarePlan.activity.outcomeReference",
        "path": "CarePlan.activity.outcomeReference",
        "max": "0"
      },
      {
        "id": "CarePlan.activity.progress",
        "path": "CarePlan.activity.progress",
        "max": "0"
      },
      {
        "id": "CarePlan.activity.reference",
        "path": "CarePlan.activity.reference",
        "short": "Reference to prescription line",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://www.esante.lu/fhir-spec/StructureDefinition/EPLabPrescriptionLine"
            ],
            "aggregation": [
              "bundled"
            ]
          }
        ]
      },
      {
        "id": "CarePlan.activity.reference.id",
        "path": "CarePlan.activity.reference.id",
        "max": "0"
      },
      {
        "id": "CarePlan.activity.reference.reference",
        "path": "CarePlan.activity.reference.reference",
        "short": "Reference to the full URL of the ServiceRequest present in the Bundle",
        "min": 1,
        "example": [
          {
            "label": "Example",
            "valueString": "urn:uuid:ef6b85e1-3f85-4e8e-8564-64b9a47dbb94"
          }
        ],
        "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/EPLabPrescription"
          }
        ]
      },
      {
        "id": "CarePlan.activity.reference.type",
        "path": "CarePlan.activity.reference.type",
        "max": "0"
      },
      {
        "id": "CarePlan.activity.reference.identifier",
        "path": "CarePlan.activity.reference.identifier",
        "max": "0"
      },
      {
        "id": "CarePlan.activity.reference.display",
        "path": "CarePlan.activity.reference.display",
        "max": "0"
      },
      {
        "id": "CarePlan.activity.detail",
        "path": "CarePlan.activity.detail",
        "max": "0"
      },
      {
        "id": "CarePlan.note",
        "path": "CarePlan.note",
        "max": "0"
      }
    ]
  }
}