<?xml version="1.0" encoding="UTF-8"?>
<!--
Template derived pattern
===========================================
ID: 1.2.40.0.34.11.3
Name: Entlassungsbrief (Pflege)
Description: Template Spezieller Implementierungsleitfaden ELGA Entlassungsbrief (Pflege)
-->
<pattern xmlns="http://purl.oclc.org/dsdl/schematron"
         id="template-1.2.40.0.34.11.3-2011-12-19T000000">
   <title>Entlassungsbrief (Pflege)</title>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.3
Context: *[hl7:templateId/@root='1.2.40.0.34.11.3']
Item: (EntlassungsbriefPflege)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.3']"
         id="tmp-r-d335fd5d-c368-4947-81c1-e935e92e7fae">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.3-2011-12-19T000000.html"
              test="count(hl7:templateId[@root='1.2.40.0.34.11.3'])&gt;=1 ">(EntlassungsbriefPflege): Element hl7:templateId[@root='1.2.40.0.34.11.3'] ist required [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.3-2011-12-19T000000.html"
              test="count(hl7:templateId[@root='1.2.40.0.34.11.3'])&lt;=1">(EntlassungsbriefPflege): Element hl7:templateId[@root='1.2.40.0.34.11.3'] kommt zu häufig vor [max 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.3-2011-12-19T000000.html"
              test="count(hl7:templateId[@root='1.2.40.0.34.11.3.0.1' or @root='1.2.40.0.34.11.3.0.2' or @root='1.2.40.0.34.11.3.0.3'])&gt;=1 ">(EntlassungsbriefPflege): Element hl7:templateId[@root='1.2.40.0.34.11.3.0.1' or @root='1.2.40.0.34.11.3.0.2' or @root='1.2.40.0.34.11.3.0.3'] ist required [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.3-2011-12-19T000000.html"
              test="count(hl7:templateId[@root='1.2.40.0.34.11.3.0.1' or @root='1.2.40.0.34.11.3.0.2' or @root='1.2.40.0.34.11.3.0.3'])&lt;=1">(EntlassungsbriefPflege): Element hl7:templateId[@root='1.2.40.0.34.11.3.0.1' or @root='1.2.40.0.34.11.3.0.2' or @root='1.2.40.0.34.11.3.0.3'] kommt zu häufig vor [max 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.3-2011-12-19T000000.html"
              test="count(hl7:code[(@code='34745-0' and @codeSystem='2.16.840.1.113883.6.1')])&gt;=1 and not(hl7:code[(@code='34745-0' and @codeSystem='2.16.840.1.113883.6.1')]/@nullFlavor)">(EntlassungsbriefPflege): Element hl7:code[(@code='34745-0' and @codeSystem='2.16.840.1.113883.6.1')] ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.3-2011-12-19T000000.html"
              test="count(hl7:code[(@code='34745-0' and @codeSystem='2.16.840.1.113883.6.1')])&lt;=1">(EntlassungsbriefPflege): Element hl7:code[(@code='34745-0' and @codeSystem='2.16.840.1.113883.6.1')] kommt zu häufig vor [max 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.3-2011-12-19T000000.html"
              test="count(hl7:participant[@typeCode='CALLBCK'])&gt;=1 and not(hl7:participant[@typeCode='CALLBCK']/@nullFlavor)">(EntlassungsbriefPflege): Element hl7:participant[@typeCode='CALLBCK'] ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.3-2011-12-19T000000.html"
              test="count(hl7:participant[@typeCode='CALLBCK'])&lt;=1">(EntlassungsbriefPflege): Element hl7:participant[@typeCode='CALLBCK'] kommt zu häufig vor [max 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.3-2011-12-19T000000.html"
              test="count(hl7:participant[@typeCode='REF'])&lt;=1">(EntlassungsbriefPflege): Element hl7:participant[@typeCode='REF'] kommt zu häufig vor [max 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.3-2011-12-19T000000.html"
              test="count(hl7:documentationOf[hl7:serviceEvent[hl7:code[(@code='GDLSTATAUF' and @codeSystem='1.2.40.0.34.5.21') or @nullFlavor]]])&gt;=1 and not(hl7:documentationOf[hl7:serviceEvent[hl7:code[(@code='GDLSTATAUF' and @codeSystem='1.2.40.0.34.5.21') or @nullFlavor]]]/@nullFlavor)">(EntlassungsbriefPflege): Element hl7:documentationOf[hl7:serviceEvent[hl7:code[(@code='GDLSTATAUF' and @codeSystem='1.2.40.0.34.5.21') or @nullFlavor]]] ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.3-2011-12-19T000000.html"
              test="count(hl7:documentationOf[hl7:serviceEvent[hl7:code[(@code='GDLSTATAUF' and @codeSystem='1.2.40.0.34.5.21') or @nullFlavor]]])&lt;=1">(EntlassungsbriefPflege): Element hl7:documentationOf[hl7:serviceEvent[hl7:code[(@code='GDLSTATAUF' and @codeSystem='1.2.40.0.34.5.21') or @nullFlavor]]] kommt zu häufig vor [max 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.3-2011-12-19T000000.html"
              test="count(hl7:componentOf[hl7:encompassingEncounter[hl7:code[(@code='IMP' and @codeSystem='2.16.840.1.113883.5.4') or @nullFlavor]]])&gt;=1 and not(hl7:componentOf[hl7:encompassingEncounter[hl7:code[(@code='IMP' and @codeSystem='2.16.840.1.113883.5.4') or @nullFlavor]]]/@nullFlavor)">(EntlassungsbriefPflege): Element hl7:componentOf[hl7:encompassingEncounter[hl7:code[(@code='IMP' and @codeSystem='2.16.840.1.113883.5.4') or @nullFlavor]]] ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.3-2011-12-19T000000.html"
              test="count(hl7:componentOf[hl7:encompassingEncounter[hl7:code[(@code='IMP' and @codeSystem='2.16.840.1.113883.5.4') or @nullFlavor]]])&lt;=1">(EntlassungsbriefPflege): Element hl7:componentOf[hl7:encompassingEncounter[hl7:code[(@code='IMP' and @codeSystem='2.16.840.1.113883.5.4') or @nullFlavor]]] kommt zu häufig vor [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.3
Context: *[hl7:templateId/@root='1.2.40.0.34.11.3']/hl7:templateId[@root='1.2.40.0.34.11.3']
Item: (EntlassungsbriefPflege)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.3']/hl7:templateId[@root='1.2.40.0.34.11.3']"
         id="tmp-r-b14845a5-7a4b-48e0-87a8-6385f10d2480">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.3-2011-12-19T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='II' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(EntlassungsbriefPflege): Wenn eine @xsi:type Instruktion anwesend ist MUSS diese den Wert "{urn:hl7-org:v3}:II" haben, gefunden "{<value-of select="namespace-uri-from-QName(resolve-QName(@xsi:type,.))"/>}:<value-of select="local-name-from-QName(resolve-QName(@xsi:type,.))"/>"</assert>
      <extends rule="II"/>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.3-2011-12-19T000000.html"
              test="string(@root)=('1.2.40.0.34.11.3')">(EntlassungsbriefPflege): Der Wert von @root MUSS '1.2.40.0.34.11.3' sein.</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.3
Context: *[hl7:templateId/@root='1.2.40.0.34.11.3']/hl7:templateId[@root='1.2.40.0.34.11.3.0.1' or @root='1.2.40.0.34.11.3.0.2' or @root='1.2.40.0.34.11.3.0.3']
Item: (EntlassungsbriefPflege)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.3']/hl7:templateId[@root='1.2.40.0.34.11.3.0.1' or @root='1.2.40.0.34.11.3.0.2' or @root='1.2.40.0.34.11.3.0.3']"
         id="tmp-r-ac36432e-a6ae-4c8d-843c-b9643220f14f">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.3-2011-12-19T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='II' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(EntlassungsbriefPflege): Wenn eine @xsi:type Instruktion anwesend ist MUSS diese den Wert "{urn:hl7-org:v3}:II" haben, gefunden "{<value-of select="namespace-uri-from-QName(resolve-QName(@xsi:type,.))"/>}:<value-of select="local-name-from-QName(resolve-QName(@xsi:type,.))"/>"</assert>
      <extends rule="II"/>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.3-2011-12-19T000000.html"
              test="string(@root)=('1.2.40.0.34.11.3.0.1','1.2.40.0.34.11.3.0.2','1.2.40.0.34.11.3.0.3')">(EntlassungsbriefPflege): Der Wert von @root MUSS '1.2.40.0.34.11.3.0.1','1.2.40.0.34.11.3.0.2','1.2.40.0.34.11.3.0.3' sein.</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.3
Context: *[hl7:templateId/@root='1.2.40.0.34.11.3']/hl7:code[(@code='34745-0' and @codeSystem='2.16.840.1.113883.6.1')]
Item: (EntlassungsbriefPflege)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.3']/hl7:code[(@code='34745-0' and @codeSystem='2.16.840.1.113883.6.1')]"
         id="tmp-r-8346c055-95ff-4da3-9e7e-90d0ec53c111">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.3-2011-12-19T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='CE' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(EntlassungsbriefPflege): Wenn eine @xsi:type Instruktion anwesend ist MUSS diese den Wert "{urn:hl7-org:v3}:CE" haben, gefunden "{<value-of select="namespace-uri-from-QName(resolve-QName(@xsi:type,.))"/>}:<value-of select="local-name-from-QName(resolve-QName(@xsi:type,.))"/>"</assert>
      <extends rule="CE"/>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.3-2011-12-19T000000.html"
              test="@nullFlavor or (@code='34745-0' and @codeSystem='2.16.840.1.113883.6.1')">(EntlassungsbriefPflege): Der Elementinhalt MUSS einer von 'code '34745-0' codeSystem '2.16.840.1.113883.6.1'' sein.</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.3
Context: *[hl7:templateId/@root='1.2.40.0.34.11.3']/hl7:participant[@typeCode='CALLBCK']
Item: (EntlassungsbriefPflege)
-->

   <!--
Template derived rules for ID: 1.2.40.0.34.11.3
Context: *[hl7:templateId/@root='1.2.40.0.34.11.3']/hl7:participant[@typeCode='REF']
Item: (EntlassungsbriefPflege)
-->

   <!--
Template derived rules for ID: 1.2.40.0.34.11.3
Context: *[hl7:templateId/@root='1.2.40.0.34.11.3']/hl7:documentationOf[hl7:serviceEvent[hl7:code[(@code='GDLSTATAUF' and @codeSystem='1.2.40.0.34.5.21') or @nullFlavor]]]
Item: (EntlassungsbriefPflege)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.3']/hl7:documentationOf[hl7:serviceEvent[hl7:code[(@code='GDLSTATAUF' and @codeSystem='1.2.40.0.34.5.21') or @nullFlavor]]]"
         id="tmp-r-90c54b8e-2e93-432d-8aa5-d28cb7dfdb21">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.3-2011-12-19T000000.html"
              test="count(hl7:serviceEvent[hl7:code[(@code='GDLSTATAUF' and @codeSystem='1.2.40.0.34.5.21') or @nullFlavor]])&gt;=1 and not(hl7:serviceEvent[hl7:code[(@code='GDLSTATAUF' and @codeSystem='1.2.40.0.34.5.21') or @nullFlavor]]/@nullFlavor)">(EntlassungsbriefPflege): Element hl7:serviceEvent[hl7:code[(@code='GDLSTATAUF' and @codeSystem='1.2.40.0.34.5.21') or @nullFlavor]] ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.3-2011-12-19T000000.html"
              test="count(hl7:serviceEvent[hl7:code[(@code='GDLSTATAUF' and @codeSystem='1.2.40.0.34.5.21') or @nullFlavor]])&lt;=1">(EntlassungsbriefPflege): Element hl7:serviceEvent[hl7:code[(@code='GDLSTATAUF' and @codeSystem='1.2.40.0.34.5.21') or @nullFlavor]] kommt zu häufig vor [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.3
Context: *[hl7:templateId/@root='1.2.40.0.34.11.3']/hl7:documentationOf[hl7:serviceEvent[hl7:code[(@code='GDLSTATAUF' and @codeSystem='1.2.40.0.34.5.21') or @nullFlavor]]]/hl7:serviceEvent[hl7:code[(@code='GDLSTATAUF' and @codeSystem='1.2.40.0.34.5.21') or @nullFlavor]]
Item: (EntlassungsbriefPflege)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.3']/hl7:documentationOf[hl7:serviceEvent[hl7:code[(@code='GDLSTATAUF' and @codeSystem='1.2.40.0.34.5.21') or @nullFlavor]]]/hl7:serviceEvent[hl7:code[(@code='GDLSTATAUF' and @codeSystem='1.2.40.0.34.5.21') or @nullFlavor]]"
         id="tmp-r-afeb51d2-faf9-4503-95da-405c87533617">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.3-2011-12-19T000000.html"
              test="count(hl7:code[(@code='GDLSTATAUF' and @codeSystem='1.2.40.0.34.5.21') or @nullFlavor])&gt;=1 ">(EntlassungsbriefPflege): Element hl7:code[(@code='GDLSTATAUF' and @codeSystem='1.2.40.0.34.5.21') or @nullFlavor] ist required [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.3-2011-12-19T000000.html"
              test="count(hl7:code[(@code='GDLSTATAUF' and @codeSystem='1.2.40.0.34.5.21') or @nullFlavor])&lt;=1">(EntlassungsbriefPflege): Element hl7:code[(@code='GDLSTATAUF' and @codeSystem='1.2.40.0.34.5.21') or @nullFlavor] kommt zu häufig vor [max 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.3-2011-12-19T000000.html"
              test="count(hl7:performer)=0">(EntlassungsbriefPflege): Element hl7:performer DARF NICHT vorkommen.</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.3
Context: *[hl7:templateId/@root='1.2.40.0.34.11.3']/hl7:documentationOf[hl7:serviceEvent[hl7:code[(@code='GDLSTATAUF' and @codeSystem='1.2.40.0.34.5.21') or @nullFlavor]]]/hl7:serviceEvent[hl7:code[(@code='GDLSTATAUF' and @codeSystem='1.2.40.0.34.5.21') or @nullFlavor]]/hl7:code[(@code='GDLSTATAUF' and @codeSystem='1.2.40.0.34.5.21') or @nullFlavor]
Item: (EntlassungsbriefPflege)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.3']/hl7:documentationOf[hl7:serviceEvent[hl7:code[(@code='GDLSTATAUF' and @codeSystem='1.2.40.0.34.5.21') or @nullFlavor]]]/hl7:serviceEvent[hl7:code[(@code='GDLSTATAUF' and @codeSystem='1.2.40.0.34.5.21') or @nullFlavor]]/hl7:code[(@code='GDLSTATAUF' and @codeSystem='1.2.40.0.34.5.21') or @nullFlavor]"
         id="tmp-r-acedaeb8-5f06-497c-9a07-860113e4f5db">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.3-2011-12-19T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='CE' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(EntlassungsbriefPflege): Wenn eine @xsi:type Instruktion anwesend ist MUSS diese den Wert "{urn:hl7-org:v3}:CE" haben, gefunden "{<value-of select="namespace-uri-from-QName(resolve-QName(@xsi:type,.))"/>}:<value-of select="local-name-from-QName(resolve-QName(@xsi:type,.))"/>"</assert>
      <extends rule="CE"/>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.3-2011-12-19T000000.html"
              test="@nullFlavor or (@code='GDLSTATAUF' and @codeSystem='1.2.40.0.34.5.21')">(EntlassungsbriefPflege): Der Elementinhalt MUSS einer von 'code 'GDLSTATAUF' codeSystem '1.2.40.0.34.5.21'' sein.</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.3
Context: *[hl7:templateId/@root='1.2.40.0.34.11.3']/hl7:documentationOf[hl7:serviceEvent[hl7:code[(@code='GDLSTATAUF' and @codeSystem='1.2.40.0.34.5.21') or @nullFlavor]]]/hl7:serviceEvent[hl7:code[(@code='GDLSTATAUF' and @codeSystem='1.2.40.0.34.5.21') or @nullFlavor]]/hl7:performer
Item: (EntlassungsbriefPflege)
-->

   <!--
Template derived rules for ID: 1.2.40.0.34.11.3
Context: *[hl7:templateId/@root='1.2.40.0.34.11.3']/hl7:componentOf[hl7:encompassingEncounter[hl7:code[(@code='IMP' and @codeSystem='2.16.840.1.113883.5.4') or @nullFlavor]]]
Item: (EntlassungsbriefPflege)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.3']/hl7:componentOf[hl7:encompassingEncounter[hl7:code[(@code='IMP' and @codeSystem='2.16.840.1.113883.5.4') or @nullFlavor]]]"
         id="tmp-r-8cb4a24f-b2d4-41ff-8bef-e24d5f45f9ce">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.3-2011-12-19T000000.html"
              test="count(hl7:encompassingEncounter[hl7:code[(@code='IMP' and @codeSystem='2.16.840.1.113883.5.4') or @nullFlavor]])&gt;=1 and not(hl7:encompassingEncounter[hl7:code[(@code='IMP' and @codeSystem='2.16.840.1.113883.5.4') or @nullFlavor]]/@nullFlavor)">(EntlassungsbriefPflege): Element hl7:encompassingEncounter[hl7:code[(@code='IMP' and @codeSystem='2.16.840.1.113883.5.4') or @nullFlavor]] ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.3-2011-12-19T000000.html"
              test="count(hl7:encompassingEncounter[hl7:code[(@code='IMP' and @codeSystem='2.16.840.1.113883.5.4') or @nullFlavor]])&lt;=1">(EntlassungsbriefPflege): Element hl7:encompassingEncounter[hl7:code[(@code='IMP' and @codeSystem='2.16.840.1.113883.5.4') or @nullFlavor]] kommt zu häufig vor [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.3
Context: *[hl7:templateId/@root='1.2.40.0.34.11.3']/hl7:componentOf[hl7:encompassingEncounter[hl7:code[(@code='IMP' and @codeSystem='2.16.840.1.113883.5.4') or @nullFlavor]]]/hl7:encompassingEncounter[hl7:code[(@code='IMP' and @codeSystem='2.16.840.1.113883.5.4') or @nullFlavor]]
Item: (EntlassungsbriefPflege)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.3']/hl7:componentOf[hl7:encompassingEncounter[hl7:code[(@code='IMP' and @codeSystem='2.16.840.1.113883.5.4') or @nullFlavor]]]/hl7:encompassingEncounter[hl7:code[(@code='IMP' and @codeSystem='2.16.840.1.113883.5.4') or @nullFlavor]]"
         id="tmp-r-acf7c14b-512a-4ff4-b6d9-3fd13388bb26">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.3-2011-12-19T000000.html"
              test="count(hl7:id)&gt;=1 ">(EntlassungsbriefPflege): Element hl7:id ist required [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.3-2011-12-19T000000.html"
              test="count(hl7:id)&lt;=1">(EntlassungsbriefPflege): Element hl7:id kommt zu häufig vor [max 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.3-2011-12-19T000000.html"
              test="count(hl7:code[(@code='IMP' and @codeSystem='2.16.840.1.113883.5.4') or @nullFlavor])&gt;=1 ">(EntlassungsbriefPflege): Element hl7:code[(@code='IMP' and @codeSystem='2.16.840.1.113883.5.4') or @nullFlavor] ist required [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.3-2011-12-19T000000.html"
              test="count(hl7:code[(@code='IMP' and @codeSystem='2.16.840.1.113883.5.4') or @nullFlavor])&lt;=1">(EntlassungsbriefPflege): Element hl7:code[(@code='IMP' and @codeSystem='2.16.840.1.113883.5.4') or @nullFlavor] kommt zu häufig vor [max 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.3-2011-12-19T000000.html"
              test="count(hl7:responsibleParty)&lt;=1">(EntlassungsbriefPflege): Element hl7:responsibleParty kommt zu häufig vor [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.3
Context: *[hl7:templateId/@root='1.2.40.0.34.11.3']/hl7:componentOf[hl7:encompassingEncounter[hl7:code[(@code='IMP' and @codeSystem='2.16.840.1.113883.5.4') or @nullFlavor]]]/hl7:encompassingEncounter[hl7:code[(@code='IMP' and @codeSystem='2.16.840.1.113883.5.4') or @nullFlavor]]/hl7:id
Item: (EntlassungsbriefPflege)
-->

   <!--
Template derived rules for ID: 1.2.40.0.34.11.3
Context: *[hl7:templateId/@root='1.2.40.0.34.11.3']/hl7:componentOf[hl7:encompassingEncounter[hl7:code[(@code='IMP' and @codeSystem='2.16.840.1.113883.5.4') or @nullFlavor]]]/hl7:encompassingEncounter[hl7:code[(@code='IMP' and @codeSystem='2.16.840.1.113883.5.4') or @nullFlavor]]/hl7:code[(@code='IMP' and @codeSystem='2.16.840.1.113883.5.4') or @nullFlavor]
Item: (EntlassungsbriefPflege)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.3']/hl7:componentOf[hl7:encompassingEncounter[hl7:code[(@code='IMP' and @codeSystem='2.16.840.1.113883.5.4') or @nullFlavor]]]/hl7:encompassingEncounter[hl7:code[(@code='IMP' and @codeSystem='2.16.840.1.113883.5.4') or @nullFlavor]]/hl7:code[(@code='IMP' and @codeSystem='2.16.840.1.113883.5.4') or @nullFlavor]"
         id="tmp-r-5c79625b-e7eb-4fd4-91ac-314c5d8f5d9d">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.3-2011-12-19T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='CE' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(EntlassungsbriefPflege): Wenn eine @xsi:type Instruktion anwesend ist MUSS diese den Wert "{urn:hl7-org:v3}:CE" haben, gefunden "{<value-of select="namespace-uri-from-QName(resolve-QName(@xsi:type,.))"/>}:<value-of select="local-name-from-QName(resolve-QName(@xsi:type,.))"/>"</assert>
      <extends rule="CE"/>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.3-2011-12-19T000000.html"
              test="@nullFlavor or (@code='IMP' and @codeSystem='2.16.840.1.113883.5.4')">(EntlassungsbriefPflege): Der Elementinhalt MUSS einer von 'code 'IMP' codeSystem '2.16.840.1.113883.5.4'' sein.</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.3-2011-12-19T000000.html"
              test="count(hl7:originalText)&lt;=1">(EntlassungsbriefPflege): Element hl7:originalText kommt zu häufig vor [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.3
Context: *[hl7:templateId/@root='1.2.40.0.34.11.3']/hl7:componentOf[hl7:encompassingEncounter[hl7:code[(@code='IMP' and @codeSystem='2.16.840.1.113883.5.4') or @nullFlavor]]]/hl7:encompassingEncounter[hl7:code[(@code='IMP' and @codeSystem='2.16.840.1.113883.5.4') or @nullFlavor]]/hl7:code[(@code='IMP' and @codeSystem='2.16.840.1.113883.5.4') or @nullFlavor]/hl7:originalText
Item: (EntlassungsbriefPflege)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.3']/hl7:componentOf[hl7:encompassingEncounter[hl7:code[(@code='IMP' and @codeSystem='2.16.840.1.113883.5.4') or @nullFlavor]]]/hl7:encompassingEncounter[hl7:code[(@code='IMP' and @codeSystem='2.16.840.1.113883.5.4') or @nullFlavor]]/hl7:code[(@code='IMP' and @codeSystem='2.16.840.1.113883.5.4') or @nullFlavor]/hl7:originalText"
         id="tmp-r-2bebc8ad-6d40-4676-be30-b07ec6433bcb">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.3-2011-12-19T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='ED' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(EntlassungsbriefPflege): Wenn eine @xsi:type Instruktion anwesend ist MUSS diese den Wert "{urn:hl7-org:v3}:ED" haben, gefunden "{<value-of select="namespace-uri-from-QName(resolve-QName(@xsi:type,.))"/>}:<value-of select="local-name-from-QName(resolve-QName(@xsi:type,.))"/>"</assert>
      <extends rule="ED"/>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.3
Context: *[hl7:templateId/@root='1.2.40.0.34.11.3']/hl7:componentOf[hl7:encompassingEncounter[hl7:code[(@code='IMP' and @codeSystem='2.16.840.1.113883.5.4') or @nullFlavor]]]/hl7:encompassingEncounter[hl7:code[(@code='IMP' and @codeSystem='2.16.840.1.113883.5.4') or @nullFlavor]]/hl7:responsibleParty
Item: (EntlassungsbriefPflege)
-->
</pattern>
