{
  "resourceType": "StructureDefinition",
  "id": "SpecimenABeOrderLab",
  "url": "https://www.alberta.ca/fhir/ab-eorder-lab/StructureDefinition/SpecimenABeOrderLab",
  "version": "1.1.0",
  "name": "SpecimenABeOrderLab",
  "title": "Specimen (AB:eOrder-Lab)",
  "status": "draft",
  "description": "This profile defines a set of constraints to the FHIR Specimen resource for use in Alberta eOrder Laboratory (AB:eOrder-Lab). It re-profiles the R4 Core Specimen resource and it includes constraints that represent the minimum expectations for the Specimen resource when used in the AB:Order-Lab.",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Specimen",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Specimen",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Specimen",
        "path": "Specimen",
        "comment": "Specimen resources included in Alberta eOrder Laboratory Bundles have rules that certain attributes are not to be contained in Specimen resources. These are mechanically enforced through invariants at the AB:eOrder-Lab Bundle level."
      },
      {
        "id": "Specimen.type",
        "path": "Specimen.type",
        "mustSupport": true
      },
      {
        "id": "Specimen.type.text",
        "path": "Specimen.type.text",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Specimen.subject",
        "path": "Specimen.subject",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://www.alberta.ca/fhir/ab-eorder-lab/StructureDefinition/PatientABeOrderLab"
            ]
          }
        ]
      },
      {
        "id": "Specimen.request",
        "path": "Specimen.request",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://www.alberta.ca/fhir/ab-eorder-lab/StructureDefinition/ServiceRequestABeOrderLab"
            ]
          }
        ]
      },
      {
        "id": "Specimen.collection",
        "path": "Specimen.collection",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Specimen.collection.collected[x]",
        "path": "Specimen.collection.collected[x]",
        "slicing": {
          "discriminator": [
            {
              "type": "type",
              "path": "$this"
            }
          ],
          "ordered": false,
          "rules": "open"
        }
      },
      {
        "id": "Specimen.collection.collected[x]:collectedDateTime",
        "path": "Specimen.collection.collected[x]",
        "sliceName": "collectedDateTime",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "dateTime"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Specimen.collection.bodySite",
        "path": "Specimen.collection.bodySite",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Specimen.collection.bodySite.text",
        "path": "Specimen.collection.bodySite.text",
        "min": 1,
        "mustSupport": true
      }
    ]
  }
}