<StructureDefinition xmlns="http://hl7.org/fhir">
  <url value="https://cgm.com/fhir/his/medico/r4/sd/pip/DocumentReference_PiPDocument_1" />
  <name value="DocumentReference_PiPDocument_1" />
  <status value="draft" />
  <description value="This profile describes document relevant data exchanged with Patient Portal" />
  <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.id">
      <path value="DocumentReference.id" />
      <definition value="The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.&#xD;&#xA;Format will be Document-#####&#xD;&#xA;where #### is the document id (medico x1350dre.dre)" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.meta">
      <path value="DocumentReference.meta" />
      <min value="1" />
    </element>
    <element id="DocumentReference.meta.lastUpdated">
      <path value="DocumentReference.meta.lastUpdated" />
      <definition value="When the resource last changed - e.g. when the version changed.&#xD;&#xA;Life: Modified&#xD;&#xA;Medico: LastUpdated" />
      <min value="1" />
    </element>
    <element id="DocumentReference.meta.profile">
      <path value="DocumentReference.meta.profile" />
      <min value="1" />
      <max value="1" />
      <fixedCanonical value="https://cgm.com/fhir/his/medico/r4/sd/pip/DocumentReference_PiPDocument_1" />
    </element>
    <element id="DocumentReference.extension">
      <path value="DocumentReference.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="0" />
    </element>
    <element id="DocumentReference.extension:uploadInformation">
      <path value="DocumentReference.extension" />
      <sliceName value="uploadInformation" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://cgm.com/fhir/his/medico/r4/sd/pip/ext/DocumentReference_UploadInformation_1" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.extension:uploadInformation.value[x]">
      <path value="DocumentReference.extension.value[x]" />
      <definition value="Value of extension - must be one of a constrained set of the data types (see [Extensibility](extensibility.html) for a list).&#xD;&#xA;Life: TransmissionDate&#xD;&#xA;Medico: Upload date" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.identifier">
      <path value="DocumentReference.identifier" />
      <slicing>
        <discriminator>
          <type value="pattern" />
          <path value="$this" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="DocumentReference.identifier:medicoIdentifier">
      <path value="DocumentReference.identifier" />
      <sliceName value="medicoIdentifier" />
      <definition value="Other identifiers associated with the document, including version independent identifiers.&#xD;&#xA;&#xD;&#xA;represents the identifier within CGM MEDICO. Is always present if this document is uploaded to Life, will not be present at the moment this document is downloaded to CGM MEDICO." />
      <max value="1" />
      <patternIdentifier>
        <type>
          <coding>
            <system value="https://cgm.com/fhir/his/medico/cs/identifier-type" />
            <code value="MedicoDocument" />
          </coding>
        </type>
      </patternIdentifier>
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.identifier:medicoIdentifier.system">
      <path value="DocumentReference.identifier.system" />
      <comment value="Dynamically resolved for validation&#xD;&#xA;--FixedValue=https://cgm.com/fhir/his/medico/%KUNDE%/sid1/Document" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.identifier:medicoIdentifier.value">
      <path value="DocumentReference.identifier.value" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.identifier:lifeIdentifier">
      <path value="DocumentReference.identifier" />
      <sliceName value="lifeIdentifier" />
      <definition value="Other identifiers associated with the document, including version independent identifiers.&#xD;&#xA;&#xD;&#xA;represents the identifier within Life. It is present after it was downloaded from Life or uploaded to Life." />
      <max value="1" />
      <patternIdentifier>
        <type>
          <coding>
            <system value="https://cgm.com/fhir/his/medico/cs/identifier-type" />
            <code value="LifeDocument" />
          </coding>
        </type>
      </patternIdentifier>
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.identifier:lifeIdentifier.system">
      <path value="DocumentReference.identifier.system" />
      <fixedUri value="https://cgm.com/ns/life/document" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.identifier:lifeIdentifier.value">
      <path value="DocumentReference.identifier.value" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.type">
      <path value="DocumentReference.type" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.type.coding">
      <path value="DocumentReference.type.coding" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.type.coding.system">
      <path value="DocumentReference.type.coding.system" />
      <mustSupport value="true" />
      <binding>
        <strength value="preferred" />
        <valueSet value="http://ihe-d.de/ValueSets/IHEXDStypeCode" />
      </binding>
    </element>
    <element id="DocumentReference.type.coding.version">
      <path value="DocumentReference.type.coding.version" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.type.coding.code">
      <path value="DocumentReference.type.coding.code" />
      <definition value="A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination).&#xD;&#xA;Life: Category&#xD;&#xA;Medico: tbd." />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.subject">
      <path value="DocumentReference.subject" />
      <definition value="Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (e.g. a machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure).&#xD;&#xA;&#xD;&#xA;Life: Owner&#xD;&#xA;Medico: PatientId" />
      <min value="1" />
    </element>
    <element id="DocumentReference.subject.identifier">
      <path value="DocumentReference.subject.identifier" />
      <min value="1" />
      <mustSupport value="false" />
    </element>
    <element id="DocumentReference.subject.identifier.system">
      <path value="DocumentReference.subject.identifier.system" />
      <comment value="Dynamically resolved for validation&#xD;&#xA;--FixedValue=https://cgm.com/fhir/his/medico/%KUNDE%/sid1/Patient" />
      <min value="1" />
    </element>
    <element id="DocumentReference.subject.identifier.value">
      <path value="DocumentReference.subject.identifier.value" />
      <min value="1" />
    </element>
    <element id="DocumentReference.author">
      <path value="DocumentReference.author" />
      <definition value="Identifies who is responsible for adding the information to the document.&#xD;&#xA;at least a department is required" />
      <min value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://cgm.com/fhir/his/medico/r4/sd/pip/Location_PiPWard_1" />
        <targetProfile value="https://cgm.com/fhir/his/medico/r4/sd/pip/Organization_PipDepartment_1" />
        <targetProfile value="https://cgm.com/fhir/his/medico/r4/sd/pip/Patient_PiPPatient_1" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.author.identifier">
      <path value="DocumentReference.author.identifier" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.author.identifier.system">
      <path value="DocumentReference.author.identifier.system" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.author.identifier.value">
      <path value="DocumentReference.author.identifier.value" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.description">
      <path value="DocumentReference.description" />
      <definition value="Human-readable description of the source document.&#xD;&#xA;&#xD;&#xA;Life: Comment&#xD;&#xA;Medico: Comment" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.content">
      <path value="DocumentReference.content" />
      <max value="1" />
    </element>
    <element id="DocumentReference.content.attachment.contentType">
      <path value="DocumentReference.content.attachment.contentType" />
      <definition value="Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.&#xD;&#xA;Life: mimetype&#xD;&#xA;Medico: mimetype" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.content.attachment.data">
      <path value="DocumentReference.content.attachment.data" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.content.attachment.title">
      <path value="DocumentReference.content.attachment.title" />
      <definition value="A label or set of text to display in place of the data.&#xD;&#xA;Life: Name&#xD;&#xA;Medico: Title (x1350dre.info)" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.context">
      <path value="DocumentReference.context" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.context.encounter">
      <path value="DocumentReference.context.encounter" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.context.encounter.reference">
      <path value="DocumentReference.context.encounter.reference" />
      <mustSupport value="true" />
    </element>
  </differential>
</StructureDefinition>