{
  "resourceType": "StructureDefinition",
  "id": "DocumentReferenceABeOrderLab",
  "url": "https://www.alberta.ca/fhir/ab-eorder-lab/StructureDefinition/DocumentReferenceABeOrderLab",
  "version": "1.1.0",
  "name": "DocumentReferenceABeOrderLab",
  "title": "DocumentReference (AB:eOrder-Lab)",
  "status": "draft",
  "description": "This profile defines a set of constraints to the FHIR DocumentReference resource for use in Alberta eOrder Laboratory (AB:eOrder-Lab). It profiles the R4 DocumentReference and it includes relevant constraints from CA:eReC that represent the minimum expectations for the DocumentReference resource when used in the AB:eOrder-Lab.",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "DocumentReference",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/DocumentReference",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "DocumentReference",
        "path": "DocumentReference",
        "comment": "DocumentReference resources included in Alberta eOrder Laboratory Bundles have rules that certain attributes are not to be contained in DocumentReference resources. These are mechanically enforced through invariants at the AB:eOrder-Lab Bundle level."
      },
      {
        "id": "DocumentReference.identifier",
        "path": "DocumentReference.identifier",
        "mustSupport": true
      },
      {
        "id": "DocumentReference.identifier.system",
        "path": "DocumentReference.identifier.system",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "DocumentReference.identifier.value",
        "path": "DocumentReference.identifier.value",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "DocumentReference.status",
        "path": "DocumentReference.status",
        "patternCode": "current",
        "mustSupport": true
      },
      {
        "id": "DocumentReference.type",
        "path": "DocumentReference.type",
        "mustSupport": true
      },
      {
        "id": "DocumentReference.subject",
        "path": "DocumentReference.subject",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://www.alberta.ca/fhir/ab-eorder-lab/StructureDefinition/PatientABeOrderLab"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "DocumentReference.subject.reference",
        "path": "DocumentReference.subject.reference",
        "mustSupport": true
      },
      {
        "id": "DocumentReference.subject.identifier",
        "path": "DocumentReference.subject.identifier",
        "mustSupport": true
      },
      {
        "id": "DocumentReference.subject.identifier.system",
        "path": "DocumentReference.subject.identifier.system",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "DocumentReference.subject.identifier.value",
        "path": "DocumentReference.subject.identifier.value",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "DocumentReference.date",
        "path": "DocumentReference.date",
        "mustSupport": true
      },
      {
        "id": "DocumentReference.author",
        "path": "DocumentReference.author",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://www.alberta.ca/fhir/ab-eorder-lab/StructureDefinition/PractitionerABeOrderLab",
              "https://www.alberta.ca/fhir/ab-eorder-lab/StructureDefinition/PractitionerRoleABeOrderLab"
            ]
          }
        ]
      },
      {
        "id": "DocumentReference.author.reference",
        "path": "DocumentReference.author.reference",
        "mustSupport": true
      },
      {
        "id": "DocumentReference.author.identifier",
        "path": "DocumentReference.author.identifier",
        "mustSupport": true
      },
      {
        "id": "DocumentReference.author.identifier.system",
        "path": "DocumentReference.author.identifier.system",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "DocumentReference.author.identifier.value",
        "path": "DocumentReference.author.identifier.value",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "DocumentReference.content",
        "path": "DocumentReference.content",
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "DocumentReference.content.attachment",
        "path": "DocumentReference.content.attachment",
        "mustSupport": true
      },
      {
        "id": "DocumentReference.context",
        "path": "DocumentReference.context",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "DocumentReference.context.related",
        "path": "DocumentReference.context.related",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://www.alberta.ca/fhir/ab-eorder-lab/StructureDefinition/ServiceRequestABeOrderLab"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "DocumentReference.context.related.reference",
        "path": "DocumentReference.context.related.reference",
        "mustSupport": true
      },
      {
        "id": "DocumentReference.context.related.identifier",
        "path": "DocumentReference.context.related.identifier",
        "mustSupport": true
      },
      {
        "id": "DocumentReference.context.related.identifier.use",
        "path": "DocumentReference.context.related.identifier.use",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "DocumentReference.context.related.identifier.system",
        "path": "DocumentReference.context.related.identifier.system",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "DocumentReference.context.related.identifier.value",
        "path": "DocumentReference.context.related.identifier.value",
        "min": 1,
        "mustSupport": true
      }
    ]
  }
}