<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="81dbe8fb-4349-4467-a554-15b2d32d2b8c" />
  <url value="https://health.gov.on.ca/sadie/fhir/StructureDefinition/ClientData" />
  <version value="1.0.0" />
  <name value="ClientData" />
  <status value="draft" />
  <description value="Profile for storing data client loads.  Example: Store ODSP reference and member numbers." />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="DocumentReference" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/DocumentReference" />
  <derivation value="constraint" />
  <differential>
    <element id="DocumentReference.masterIdentifier">
      <path value="DocumentReference.masterIdentifier" />
      <max value="0" />
    </element>
    <element id="DocumentReference.identifier">
      <path value="DocumentReference.identifier" />
      <definition value="#### **_`FOR SADIE USE:  These are the client identifiers that will be used by the search. For ODSP this will be the Referral ID and Membership ID.`_**&#xA;&#xA;Other identifiers associated with the document, including version independent identifiers." />
    </element>
    <element id="DocumentReference.status">
      <path value="DocumentReference.status" />
      <definition value="#### **_`FOR SADIE USE:  Required.  current = active.`_**&#xA;&#xA;The status of this document reference." />
    </element>
    <element id="DocumentReference.docStatus">
      <path value="DocumentReference.docStatus" />
      <definition value="#### **_`FOR SADIE USE:  Might want to use this record the fact the code was used to create a request.`_**&#xA;&#xA;The status of the underlying document." />
      <max value="0" />
    </element>
    <element id="DocumentReference.type">
      <path value="DocumentReference.type" />
      <definition value="#### **_`FOR SADIE USE:  This would link to ValueSet,  it will only have one entry to start ODSP-Referral-Load`_**&#xA;&#xA;Specifies the particular kind of document referenced  (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the document referenced." />
    </element>
    <element id="DocumentReference.category">
      <path value="DocumentReference.category" />
      <definition value="#### **_`FOR SADIE USE:  This would link to ValueSet,  it will only have one entry to start ODSP-Referral-Load`_**&#xA;&#xA;A categorization for the type of document referenced - helps for indexing and searching. This may be implied by or derived from the code specified in the DocumentReference.type." />
      <max value="0" />
    </element>
    <element id="DocumentReference.subject">
      <path value="DocumentReference.subject" />
      <max value="0" />
    </element>
    <element id="DocumentReference.author">
      <path value="DocumentReference.author" />
      <definition value="#### **_`FOR SADIE USE:  Reference to the client`_**&#xA;&#xA;Identifies who is responsible for adding the information to the document." />
      <type>
        <code value="Reference" />
        <targetProfile value="https://health.gov.on.ca/sadie/fhir/StructureDefinition/ProgramArea" />
      </type>
    </element>
    <element id="DocumentReference.authenticator">
      <path value="DocumentReference.authenticator" />
      <max value="0" />
    </element>
    <element id="DocumentReference.custodian">
      <path value="DocumentReference.custodian" />
      <max value="0" />
    </element>
    <element id="DocumentReference.relatesTo">
      <path value="DocumentReference.relatesTo" />
      <definition value="#### **_`FOR SADIE USE:  Reference to the DocumentReference the client sent.`_**&#xA;&#xA;Relationships that this document has with other document references that already exist." />
      <max value="0" />
    </element>
    <element id="DocumentReference.relatesTo.code">
      <path value="DocumentReference.relatesTo.code" />
      <definition value="#### **_`FOR SADIE USE:  Always transforms.`_**&#xA;&#xA;The type of relationship that this document has with anther document." />
    </element>
    <element id="DocumentReference.relatesTo.target">
      <path value="DocumentReference.relatesTo.target" />
      <definition value="#### **_`FOR SADIE USE:  Reference to the DocumentReference the client sent.`_**&#xA;The target document of this relationship." />
    </element>
    <element id="DocumentReference.description">
      <path value="DocumentReference.description" />
      <max value="0" />
    </element>
    <element id="DocumentReference.securityLabel">
      <path value="DocumentReference.securityLabel" />
      <max value="0" />
    </element>
    <element id="DocumentReference.content">
      <path value="DocumentReference.content" />
      <definition value="#### **_`FOR SADIE USE:  This is required but if it's just the two IDs then just create attachment with only a title 'No Attachment'.  If in the future they add the patient names then that would go in the data OR all the information can go in the data including the IDs so a function can generically pro cess it.`_**&#xA;&#xA;The document and format referenced. There may be multiple content element repetitions, each with a different format." />
    </element>
    <element id="DocumentReference.content.attachment.title">
      <path value="DocumentReference.content.attachment.title" />
      <definition value="#### **_`FOR SADIE USE:  For ODSP either leave it completely empty of set this to No Attachment`_**&#xA;&#xA;A label or set of text to display in place of the data." />
    </element>
    <element id="DocumentReference.context">
      <path value="DocumentReference.context" />
      <definition value="#### **_`FOR SADIE USE:  This is a reference to the client communication record.`_**&#xA;&#xA;The clinical context in which the document was prepared." />
    </element>
    <element id="DocumentReference.context.encounter">
      <path value="DocumentReference.context.encounter" />
      <max value="0" />
    </element>
    <element id="DocumentReference.context.event">
      <path value="DocumentReference.context.event" />
      <max value="0" />
    </element>
    <element id="DocumentReference.context.period">
      <path value="DocumentReference.context.period" />
      <max value="0" />
    </element>
    <element id="DocumentReference.context.facilityType">
      <path value="DocumentReference.context.facilityType" />
      <max value="0" />
    </element>
    <element id="DocumentReference.context.practiceSetting">
      <path value="DocumentReference.context.practiceSetting" />
      <max value="0" />
    </element>
    <element id="DocumentReference.context.sourcePatientInfo">
      <path value="DocumentReference.context.sourcePatientInfo" />
      <max value="0" />
    </element>
    <element id="DocumentReference.context.related">
      <path value="DocumentReference.context.related" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://health.gov.on.ca/sadie/fhir/StructureDefinition/ClientCommunication" />
      </type>
    </element>
  </differential>
</StructureDefinition>