{
  "resourceType": "StructureDefinition",
  "id": "profile-documentReference",
  "url": "http://ontariohealth.ca/fhir/ehr/StructureDefinition/profile-documentReference",
  "version": "1.0.0",
  "name": "DocumentReferenceEHR",
  "status": "active",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "DocumentReference",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/DocumentReference",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "DocumentReference.identifier",
        "path": "DocumentReference.identifier",
        "mustSupport": true
      },
      {
        "id": "DocumentReference.status",
        "path": "DocumentReference.status",
        "mustSupport": true
      },
      {
        "id": "DocumentReference.docStatus",
        "path": "DocumentReference.docStatus",
        "mustSupport": true
      },
      {
        "id": "DocumentReference.type",
        "path": "DocumentReference.type",
        "min": 1,
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "description": "contains all document type codes used to represent clinical documents and/or medical record reports in the EHR",
          "valueSet": "http://ontariohealth.ca/fhir/ehr/ValueSet/document-reference-type"
        }
      },
      {
        "id": "DocumentReference.category",
        "path": "DocumentReference.category",
        "min": 1,
        "mustSupport": true,
        "binding": {
          "extension": [
            {
              "extension": [
                {
                  "url": "purpose",
                  "valueCode": "candidate"
                },
                {
                  "url": "valueSet",
                  "valueCanonical": "http://ontariohealth.ca/fhir/ehr/ValueSet/document-class"
                },
                {
                  "url": "documentation",
                  "valueMarkdown": "This value set defines the codes representing document class from LOINC as defined in the LOINC Manual, excluding class = RAD. The class codes from LOINC is intended to be used for report categorization based on the type of study performed. Radiology class type is excluded from this value set it will be contributed using DiagnosticReport resource."
                },
                {
                  "url": "key",
                  "valueId": "documentClass"
                }
              ],
              "url": "http://hl7.org/fhir/tools/StructureDefinition/additional-binding"
            },
            {
              "extension": [
                {
                  "url": "purpose",
                  "valueCode": "candidate"
                },
                {
                  "url": "valueSet",
                  "valueCanonical": "http://ontariohealth.ca/fhir/ehr/ValueSet/document-subject-matter-domain"
                },
                {
                  "url": "documentation",
                  "valueMarkdown": "The document-subject-matter-domain property in LOINC characterizes the general focus or domain of knowledge represented within the content of the note."
                },
                {
                  "url": "key",
                  "valueId": "documentSMD"
                }
              ],
              "url": "http://hl7.org/fhir/tools/StructureDefinition/additional-binding"
            },
            {
              "extension": [
                {
                  "url": "purpose",
                  "valueCode": "candidate"
                },
                {
                  "url": "valueSet",
                  "valueCanonical": "http://ontariohealth.ca/fhir/ehr/ValueSet/document-type-of-service"
                },
                {
                  "url": "documentation",
                  "valueMarkdown": "The document-type-of-service property in LOINC characterizes the healthcare service or activity provided to/for the patient (or other subject of the service) that is described in the document."
                },
                {
                  "url": "key",
                  "valueId": "DocumentTOS"
                }
              ],
              "url": "http://hl7.org/fhir/tools/StructureDefinition/additional-binding"
            },
            {
              "extension": [
                {
                  "url": "purpose",
                  "valueCode": "candidate"
                },
                {
                  "url": "valueSet",
                  "valueCanonical": "http://ontariohealth.ca/fhir/ehr/ValueSet/document-kind"
                },
                {
                  "url": "documentation",
                  "valueMarkdown": "The document-kind property in LOINC Characterizes the general structure of the document at a macro level."
                },
                {
                  "url": "key",
                  "valueId": "DocumentKOD"
                }
              ],
              "url": "http://hl7.org/fhir/tools/StructureDefinition/additional-binding"
            },
            {
              "extension": [
                {
                  "url": "purpose",
                  "valueCode": "candidate"
                },
                {
                  "url": "valueSet",
                  "valueCanonical": "http://ontariohealth.ca/fhir/ehr/ValueSet/document-role"
                },
                {
                  "url": "documentation",
                  "valueMarkdown": "The document-role property in LOINC characterizes the general function, responsibility, or capabilities of the author in relation to a document."
                },
                {
                  "url": "key",
                  "valueId": "DocumentRole"
                }
              ],
              "url": "http://hl7.org/fhir/tools/StructureDefinition/additional-binding"
            },
            {
              "extension": [
                {
                  "url": "purpose",
                  "valueCode": "candidate"
                },
                {
                  "url": "valueSet",
                  "valueCanonical": "http://ontariohealth.ca/fhir/ehr/ValueSet/document-setting"
                },
                {
                  "url": "documentation",
                  "valueMarkdown": "The document-setting property in LOINC is a coarse definition of the Care Setting."
                },
                {
                  "url": "key",
                  "valueId": "DocumentSetting"
                }
              ],
              "url": "http://hl7.org/fhir/tools/StructureDefinition/additional-binding"
            },
            {
              "extension": [
                {
                  "url": "purpose",
                  "valueCode": "candidate"
                },
                {
                  "url": "valueSet",
                  "valueCanonical": "http://dicom.nema.org/medical/dicom/current/output/chtml/part16/sect_CID_29.html"
                },
                {
                  "url": "documentation",
                  "valueMarkdown": "Transitive closure of CID 29 AcquisitionModality"
                },
                {
                  "url": "key",
                  "valueId": "dicomModality"
                }
              ],
              "url": "http://hl7.org/fhir/tools/StructureDefinition/additional-binding"
            },
            {
              "extension": [
                {
                  "url": "purpose",
                  "valueCode": "candidate"
                },
                {
                  "url": "valueSet",
                  "valueCanonical": "http://ontariohealth.ca/fhir/ehr/ValueSet/procedure-service-type"
                },
                {
                  "url": "documentation",
                  "valueMarkdown": "A code that classifies the service type of an MI procedure. This is used for searching, sorting and display purposes."
                },
                {
                  "url": "key",
                  "valueId": "procedureServiceType"
                }
              ],
              "url": "http://hl7.org/fhir/tools/StructureDefinition/additional-binding"
            },
            {
              "extension": [
                {
                  "url": "purpose",
                  "valueCode": "candidate"
                },
                {
                  "url": "valueSet",
                  "valueCanonical": "http://ontariohealth.ca/fhir/ehr/ValueSet/procedure-body-part"
                },
                {
                  "url": "documentation",
                  "valueMarkdown": "A code that classifies a body part of an MI procedure using SNOMED CT codes. This is used for searching, sorting and display purposes."
                },
                {
                  "url": "key",
                  "valueId": "procedureBodyPart"
                }
              ],
              "url": "http://hl7.org/fhir/tools/StructureDefinition/additional-binding"
            },
            {
              "extension": [
                {
                  "url": "purpose",
                  "valueCode": "candidate"
                },
                {
                  "url": "valueSet",
                  "valueCanonical": "http://ontariohealth.ca/fhir/ehr/ValueSet/procedure-laterality"
                },
                {
                  "url": "documentation",
                  "valueMarkdown": "A code that classifies a laterality of an MI procedure using SNOMED CT codes. This is used for searching, sorting and display purposes."
                },
                {
                  "url": "key",
                  "valueId": "procedureLaterality"
                }
              ],
              "url": "http://hl7.org/fhir/tools/StructureDefinition/additional-binding"
            },
            {
              "extension": [
                {
                  "url": "purpose",
                  "valueCode": "candidate"
                },
                {
                  "url": "valueSet",
                  "valueCanonical": "http://ontariohealth.ca/fhir/ehr/ValueSet/procedure-contrast-used"
                },
                {
                  "url": "documentation",
                  "valueMarkdown": "A code that classifies a use of Contrast for an MI procedure. This is used for searching, sorting and display purposes."
                },
                {
                  "url": "key",
                  "valueId": "procedureContrastUsed"
                }
              ],
              "url": "http://hl7.org/fhir/tools/StructureDefinition/additional-binding"
            }
          ],
          "strength": "example"
        }
      },
      {
        "id": "DocumentReference.subject",
        "path": "DocumentReference.subject",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://ontariohealth.ca/fhir/ehr/StructureDefinition/profile-patient"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "DocumentReference.subject.reference",
        "path": "DocumentReference.subject.reference",
        "min": 1
      },
      {
        "id": "DocumentReference.date",
        "path": "DocumentReference.date",
        "mustSupport": true
      },
      {
        "id": "DocumentReference.author",
        "path": "DocumentReference.author",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://ontariohealth.ca/fhir/ehr/StructureDefinition/profile-organization",
              "http://ontariohealth.ca/fhir/ehr/StructureDefinition/profile-practitioner",
              "http://ontariohealth.ca/fhir/ehr/StructureDefinition/profile-practitionerRole"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "DocumentReference.author.reference",
        "path": "DocumentReference.author.reference",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "DocumentReference.authenticator",
        "path": "DocumentReference.authenticator",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://ontariohealth.ca/fhir/ehr/StructureDefinition/profile-organization",
              "http://ontariohealth.ca/fhir/ehr/StructureDefinition/profile-practitioner",
              "http://ontariohealth.ca/fhir/ehr/StructureDefinition/profile-practitionerRole"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "DocumentReference.custodian",
        "path": "DocumentReference.custodian",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://ontariohealth.ca/fhir/ehr/StructureDefinition/profile-organization"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "DocumentReference.custodian.reference",
        "path": "DocumentReference.custodian.reference",
        "min": 1
      },
      {
        "id": "DocumentReference.relatesTo",
        "path": "DocumentReference.relatesTo",
        "mustSupport": true
      },
      {
        "id": "DocumentReference.relatesTo.code",
        "path": "DocumentReference.relatesTo.code",
        "mustSupport": true
      },
      {
        "id": "DocumentReference.relatesTo.target",
        "path": "DocumentReference.relatesTo.target",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://ontariohealth.ca/fhir/ehr/StructureDefinition/profile-documentReference"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "DocumentReference.description",
        "path": "DocumentReference.description",
        "mustSupport": true
      },
      {
        "id": "DocumentReference.content",
        "path": "DocumentReference.content",
        "mustSupport": true
      },
      {
        "id": "DocumentReference.content.attachment",
        "path": "DocumentReference.content.attachment",
        "mustSupport": true
      },
      {
        "id": "DocumentReference.content.attachment.contentType",
        "path": "DocumentReference.content.attachment.contentType",
        "mustSupport": true
      },
      {
        "id": "DocumentReference.content.attachment.url",
        "path": "DocumentReference.content.attachment.url",
        "mustSupport": true
      },
      {
        "id": "DocumentReference.context",
        "path": "DocumentReference.context",
        "mustSupport": true
      },
      {
        "id": "DocumentReference.context.encounter",
        "path": "DocumentReference.context.encounter",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://ontariohealth.ca/fhir/ehr/StructureDefinition/profile-encounter"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "DocumentReference.context.encounter.reference",
        "path": "DocumentReference.context.encounter.reference",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "DocumentReference.context.event",
        "path": "DocumentReference.context.event",
        "mustSupport": true,
        "binding": {
          "strength": "extensible",
          "valueSet": "http://ontariohealth.ca/fhir/ehr/ValueSet/encounter-class"
        }
      },
      {
        "id": "DocumentReference.context.event.coding",
        "path": "DocumentReference.context.event.coding",
        "min": 1,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "DocumentReference.context.event.coding.system",
        "path": "DocumentReference.context.event.coding.system",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "DocumentReference.context.event.coding.code",
        "path": "DocumentReference.context.event.coding.code",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "DocumentReference.context.event.coding.display",
        "path": "DocumentReference.context.event.coding.display",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "DocumentReference.context.period",
        "path": "DocumentReference.context.period",
        "mustSupport": true
      },
      {
        "id": "DocumentReference.context.period.start",
        "path": "DocumentReference.context.period.start",
        "mustSupport": true
      },
      {
        "id": "DocumentReference.context.period.end",
        "path": "DocumentReference.context.period.end",
        "mustSupport": true
      },
      {
        "id": "DocumentReference.context.facilityType",
        "path": "DocumentReference.context.facilityType",
        "mustSupport": true,
        "binding": {
          "strength": "extensible",
          "description": "Type of provider organization role",
          "valueSet": "http://ontariohealth.ca/fhir/ehr/ValueSet/provider-organization-role-type"
        }
      },
      {
        "id": "DocumentReference.context.facilityType.coding",
        "path": "DocumentReference.context.facilityType.coding",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "DocumentReference.context.facilityType.coding.system",
        "path": "DocumentReference.context.facilityType.coding.system",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "DocumentReference.context.facilityType.coding.code",
        "path": "DocumentReference.context.facilityType.coding.code",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "DocumentReference.context.facilityType.coding.display",
        "path": "DocumentReference.context.facilityType.coding.display",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "DocumentReference.context.practiceSetting",
        "path": "DocumentReference.context.practiceSetting",
        "mustSupport": true,
        "binding": {
          "strength": "extensible",
          "description": "Broad categorization of the service that is to be provided.",
          "valueSet": "http://cihi.ca/fhir/ValueSet/aac-hospital-service"
        }
      },
      {
        "id": "DocumentReference.context.practiceSetting.coding",
        "path": "DocumentReference.context.practiceSetting.coding",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "DocumentReference.context.practiceSetting.coding.system",
        "path": "DocumentReference.context.practiceSetting.coding.system",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "DocumentReference.context.practiceSetting.coding.code",
        "path": "DocumentReference.context.practiceSetting.coding.code",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "DocumentReference.context.practiceSetting.coding.display",
        "path": "DocumentReference.context.practiceSetting.coding.display",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "DocumentReference.context.sourcePatientInfo",
        "path": "DocumentReference.context.sourcePatientInfo",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://ontariohealth.ca/fhir/ehr/StructureDefinition/profile-patient"
            ]
          }
        ]
      },
      {
        "id": "DocumentReference.context.related",
        "path": "DocumentReference.context.related",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://ontariohealth.ca/fhir/ehr/StructureDefinition/profile-serviceRequest",
              "http://ontariohealth.ca/fhir/ehr/StructureDefinition/profile-diagnosticReport-imaging",
              "http://ontariohealth.ca/fhir/ehr/StructureDefinition/profile-imagingStudy"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "DocumentReference.context.related.reference",
        "path": "DocumentReference.context.related.reference",
        "min": 1,
        "mustSupport": true
      }
    ]
  }
}