<?xml version="1.0" encoding="UTF-8"?>
<!--
Template derived pattern
===========================================
ID: 1.2.40.0.34.11.8.1
Name: eMedikation Rezept
Description: Template Spezieller Implementierungsleitfaden ELGA eMedikation Rezept
-->
<pattern xmlns="http://purl.oclc.org/dsdl/schematron"
         id="template-1.2.40.0.34.11.8.1-2014-01-31T000000">
   <title>eMedikation Rezept</title>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.8.1
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']
Item: (eMedikationRezept)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']"
         id="tmp-r-da5bea44-fd66-4766-98ec-d2536a90ed22">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.html"
              test="count(hl7:templateId[@root='1.2.40.0.34.11.8.1'])&gt;=1 and not(hl7:templateId[@root='1.2.40.0.34.11.8.1']/@nullFlavor)">(eMedikationRezept): Element hl7:templateId[@root='1.2.40.0.34.11.8.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.8.1-2014-01-31T000000.html"
              test="count(hl7:templateId[@root='1.2.40.0.34.11.8.1'])&lt;=1">(eMedikationRezept): Element hl7:templateId[@root='1.2.40.0.34.11.8.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.8.1-2014-01-31T000000.html"
              test="count(hl7:templateId[@root='1.3.6.1.4.1.19376.1.9.1.1.1'])&gt;=1 and not(hl7:templateId[@root='1.3.6.1.4.1.19376.1.9.1.1.1']/@nullFlavor)">(eMedikationRezept): Element hl7:templateId[@root='1.3.6.1.4.1.19376.1.9.1.1.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.8.1-2014-01-31T000000.html"
              test="count(hl7:templateId[@root='1.3.6.1.4.1.19376.1.9.1.1.1'])&lt;=1">(eMedikationRezept): Element hl7:templateId[@root='1.3.6.1.4.1.19376.1.9.1.1.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.8.1-2014-01-31T000000.html"
              test="count(hl7:templateId[@root='1.3.6.1.4.1.19376.1.5.3.1.1.1'])&gt;=1 and not(hl7:templateId[@root='1.3.6.1.4.1.19376.1.5.3.1.1.1']/@nullFlavor)">(eMedikationRezept): Element hl7:templateId[@root='1.3.6.1.4.1.19376.1.5.3.1.1.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.8.1-2014-01-31T000000.html"
              test="count(hl7:templateId[@root='1.3.6.1.4.1.19376.1.5.3.1.1.1'])&lt;=1">(eMedikationRezept): Element hl7:templateId[@root='1.3.6.1.4.1.19376.1.5.3.1.1.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.8.1-2014-01-31T000000.html"
              test="count(hl7:templateId[@root='1.2.40.0.34.11.2.0.3'])&gt;=1 and not(hl7:templateId[@root='1.2.40.0.34.11.2.0.3']/@nullFlavor)">(eMedikationRezept): Element hl7:templateId[@root='1.2.40.0.34.11.2.0.3'] ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.html"
              test="count(hl7:templateId[@root='1.2.40.0.34.11.2.0.3'])&lt;=1">(eMedikationRezept): Element hl7:templateId[@root='1.2.40.0.34.11.2.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.8.1-2014-01-31T000000.html"
              test="count(hl7:id[@root='1.2.40.0.10.1.4.3.4.2.1'])&gt;=1 and not(hl7:id[@root='1.2.40.0.10.1.4.3.4.2.1']/@nullFlavor)">(eMedikationRezept): Element hl7:id[@root='1.2.40.0.10.1.4.3.4.2.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.8.1-2014-01-31T000000.html"
              test="count(hl7:id[@root='1.2.40.0.10.1.4.3.4.2.1'])&lt;=1">(eMedikationRezept): Element hl7:id[@root='1.2.40.0.10.1.4.3.4.2.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.8.1-2014-01-31T000000.html"
              test="count(hl7:code[(@code='57833-6' and @codeSystem='2.16.840.1.113883.6.1')])&gt;=1 and not(hl7:code[(@code='57833-6' and @codeSystem='2.16.840.1.113883.6.1')]/@nullFlavor)">(eMedikationRezept): Element hl7:code[(@code='57833-6' 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.8.1-2014-01-31T000000.html"
              test="count(hl7:code[(@code='57833-6' and @codeSystem='2.16.840.1.113883.6.1')])&lt;=1">(eMedikationRezept): Element hl7:code[(@code='57833-6' 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.8.1-2014-01-31T000000.html"
              test="count(hl7:title)&gt;=1 and not(hl7:title/@nullFlavor)">(eMedikationRezept): Element hl7:title ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.html"
              test="count(hl7:title)&lt;=1">(eMedikationRezept): Element hl7:title 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.8.1-2014-01-31T000000.html"
              test="count(hl7:effectiveTime)&gt;=1 and not(hl7:effectiveTime/@nullFlavor)">(eMedikationRezept): Element hl7:effectiveTime ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.html"
              test="count(hl7:effectiveTime)&lt;=1">(eMedikationRezept): Element hl7:effectiveTime 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.8.1-2014-01-31T000000.html"
              test="count(hl7:confidentialityCode[(@code='N' and @codeSystem='2.16.840.1.113883.5.25')])&gt;=1 and not(hl7:confidentialityCode[(@code='N' and @codeSystem='2.16.840.1.113883.5.25')]/@nullFlavor)">(eMedikationRezept): Element hl7:confidentialityCode[(@code='N' and @codeSystem='2.16.840.1.113883.5.25')] ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.html"
              test="count(hl7:confidentialityCode[(@code='N' and @codeSystem='2.16.840.1.113883.5.25')])&lt;=1">(eMedikationRezept): Element hl7:confidentialityCode[(@code='N' and @codeSystem='2.16.840.1.113883.5.25')] 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.8.1-2014-01-31T000000.html"
              test="count(hl7:languageCode[@code='de-AT'])&gt;=1 and not(hl7:languageCode[@code='de-AT']/@nullFlavor)">(eMedikationRezept): Element hl7:languageCode[@code='de-AT'] ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.html"
              test="count(hl7:languageCode[@code='de-AT'])&lt;=1">(eMedikationRezept): Element hl7:languageCode[@code='de-AT'] 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.8.1-2014-01-31T000000.html"
              test="count(hl7:setId)&gt;=1 and not(hl7:setId/@nullFlavor)">(eMedikationRezept): Element hl7:setId ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.html"
              test="count(hl7:setId)&lt;=1">(eMedikationRezept): Element hl7:setId 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.8.1-2014-01-31T000000.html"
              test="count(hl7:versionNumber)&gt;=1 and not(hl7:versionNumber/@nullFlavor)">(eMedikationRezept): Element hl7:versionNumber ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.html"
              test="count(hl7:versionNumber)&lt;=1">(eMedikationRezept): Element hl7:versionNumber 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.8.1-2014-01-31T000000.html"
              test="count(hl7:recordTarget)&gt;=1 and not(hl7:recordTarget/@nullFlavor)">(eMedikationRezept): Element hl7:recordTarget ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.html"
              test="count(hl7:recordTarget)&lt;=1">(eMedikationRezept): Element hl7:recordTarget 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.8.1-2014-01-31T000000.html"
              test="count(hl7:author)&gt;=1 and not(hl7:author/@nullFlavor)">(eMedikationRezept): Element hl7:author ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.html"
              test="count(hl7:custodian)&gt;=1 and not(hl7:custodian/@nullFlavor)">(eMedikationRezept): Element hl7:custodian ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.html"
              test="count(hl7:custodian)&lt;=1">(eMedikationRezept): Element hl7:custodian 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.8.1-2014-01-31T000000.html"
              test="count(hl7:dataEnterer)=0">(eMedikationRezept): Element hl7:dataEnterer DARF NICHT vorkommen.</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.html"
              test="count(hl7:informationRecipient)=0">(eMedikationRezept): Element hl7:informationRecipient DARF NICHT vorkommen.</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.html"
              test="count(hl7:authenticator)=0">(eMedikationRezept): Element hl7:authenticator DARF NICHT vorkommen.</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.html"
              test="count(hl7:legalAuthenticator)&gt;=1 and not(hl7:legalAuthenticator/@nullFlavor)">(eMedikationRezept): Element hl7:legalAuthenticator ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.html"
              test="count(hl7:legalAuthenticator)&lt;=1">(eMedikationRezept): Element hl7:legalAuthenticator 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.8.1-2014-01-31T000000.html"
              test="count(hl7:participants)=0">(eMedikationRezept): Element hl7:participants DARF NICHT vorkommen.</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.html"
              test="count(hl7:inFulfillmentOf)=0">(eMedikationRezept): Element hl7:inFulfillmentOf DARF NICHT vorkommen.</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.html"
              test="count(hl7:documentationOf[hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]]])&gt;=1 and not(hl7:documentationOf[hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]]]/@nullFlavor)">(eMedikationRezept): Element hl7:documentationOf[hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) 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.8.1-2014-01-31T000000.html"
              test="count(hl7:relatedDocument)&lt;=1">(eMedikationRezept): Element hl7:relatedDocument 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.8.1-2014-01-31T000000.html"
              test="count(hl7:authorization)=0">(eMedikationRezept): Element hl7:authorization DARF NICHT vorkommen.</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.html"
              test="count(hl7:componentOf)=0">(eMedikationRezept): Element hl7:componentOf DARF NICHT vorkommen.</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.8.1
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:templateId[@root='1.2.40.0.34.11.8.1']
Item: (eMedikationRezept)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:templateId[@root='1.2.40.0.34.11.8.1']"
         id="tmp-r-2f9903c9-babf-4e1d-adbd-c976fbdf932f">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.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)">(eMedikationRezept): 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.8.1-2014-01-31T000000.html"
              test="string(@root)=('1.2.40.0.34.11.8.1')">(eMedikationRezept): Der Wert von @root MUSS '1.2.40.0.34.11.8.1' sein.</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.8.1
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:templateId[@root='1.3.6.1.4.1.19376.1.9.1.1.1']
Item: (eMedikationRezept)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:templateId[@root='1.3.6.1.4.1.19376.1.9.1.1.1']"
         id="tmp-r-add7b41f-ce5a-4772-94b6-7050cb01203d">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.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)">(eMedikationRezept): 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.8.1-2014-01-31T000000.html"
              test="string(@root)=('1.3.6.1.4.1.19376.1.9.1.1.1')">(eMedikationRezept): Der Wert von @root MUSS '1.3.6.1.4.1.19376.1.9.1.1.1' sein.</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.8.1
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:templateId[@root='1.3.6.1.4.1.19376.1.5.3.1.1.1']
Item: (eMedikationRezept)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:templateId[@root='1.3.6.1.4.1.19376.1.5.3.1.1.1']"
         id="tmp-r-0f38f945-ac72-457d-8de6-8edc626f2252">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.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)">(eMedikationRezept): 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.8.1-2014-01-31T000000.html"
              test="string(@root)=('1.3.6.1.4.1.19376.1.5.3.1.1.1')">(eMedikationRezept): Der Wert von @root MUSS '1.3.6.1.4.1.19376.1.5.3.1.1.1' sein.</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.8.1
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:templateId[@root='1.2.40.0.34.11.2.0.3']
Item: (eMedikationRezept)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:templateId[@root='1.2.40.0.34.11.2.0.3']"
         id="tmp-r-f1b0684d-abe7-4639-8180-0908af2a2046">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.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)">(eMedikationRezept): 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.8.1-2014-01-31T000000.html"
              test="string(@root)=('1.2.40.0.34.11.2.0.3')">(eMedikationRezept): Der Wert von @root MUSS '1.2.40.0.34.11.2.0.3' sein.</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.8.1
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:id[@root='1.2.40.0.10.1.4.3.4.2.1']
Item: (eMedikationRezept)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:id[@root='1.2.40.0.10.1.4.3.4.2.1']"
         id="tmp-r-0dd39471-972a-471b-97aa-8e84abe72104">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.html"
              test="string(@root)=('1.2.40.0.10.1.4.3.4.2.1')">(eMedikationRezept): Der Wert von @root MUSS '1.2.40.0.10.1.4.3.4.2.1' sein.</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.html"
              test="@extension">(eMedikationRezept): Attribut @extension MUSS vorkommen.</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.html"
              test="string(@assigningAuthorityName)=('e-MedAT') or not(@assigningAuthorityName)">(eMedikationRezept): Der Wert von @assigningAuthorityName MUSS 'e-MedAT' sein.</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.8.1
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:code[(@code='57833-6' and @codeSystem='2.16.840.1.113883.6.1')]
Item: (eMedikationRezept)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:code[(@code='57833-6' and @codeSystem='2.16.840.1.113883.6.1')]"
         id="tmp-r-578578e5-5da5-42ca-8cb6-89d1c006daba">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.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)">(eMedikationRezept): 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.8.1-2014-01-31T000000.html"
              test="@nullFlavor or (@code='57833-6' and @codeSystem='2.16.840.1.113883.6.1' and @displayName='Prescription for medication')">(eMedikationRezept): Der Elementinhalt MUSS einer von 'code '57833-6' codeSystem '2.16.840.1.113883.6.1' displayName='Prescription for medication'' sein.</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.8.1
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:title
Item: (eMedikationRezept)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:title"
         id="tmp-r-814cd298-2e20-46e1-adca-3ab8cf4f6fac">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='ST' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(eMedikationRezept): Wenn eine @xsi:type Instruktion anwesend ist MUSS diese den Wert "{urn:hl7-org:v3}:ST" 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="ST"/>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.html"
              test="text()='Rezept'">(eMedikationRezept): Der Elementinhalt von 'hl7:title' MUSS ''Rezept'' sein.</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.90008
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:effectiveTime
Item: (CDeffectiveTime)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:effectiveTime"
         id="tmp-r-bea04a8d-92bb-4d00-8ff1-59a4c5028761">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.90008-2013-11-07T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='TS' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(CDeffectiveTime): Wenn eine @xsi:type Instruktion anwesend ist MUSS diese den Wert "{urn:hl7-org:v3}:TS" 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="TS.DATE.MIN"/>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.90009
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:confidentialityCode[(@code='N' and @codeSystem='2.16.840.1.113883.5.25')]
Item: (CDconfidentialityCode)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:confidentialityCode[(@code='N' and @codeSystem='2.16.840.1.113883.5.25')]"
         id="tmp-r-fbbd5949-3d7c-4ea8-a488-f8502f0052bf">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.90009-2013-11-07T000000.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)">(CDconfidentialityCode): 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.90009-2013-11-07T000000.html"
              test="@nullFlavor or (@code='N' and @codeSystem='2.16.840.1.113883.5.25' and @displayName='normal')">(CDconfidentialityCode): Der Elementinhalt MUSS einer von 'code 'N' codeSystem '2.16.840.1.113883.5.25' displayName='normal'' sein.</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.90010
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:languageCode[@code='de-AT']
Item: (CDlanguageCode)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:languageCode[@code='de-AT']"
         id="tmp-r-2719427e-3833-4cc0-b94a-756d67f6f6fb">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.90010-2013-11-07T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='CS' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(CDlanguageCode): Wenn eine @xsi:type Instruktion anwesend ist MUSS diese den Wert "{urn:hl7-org:v3}:CS" 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="CS.LANG"/>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.90010-2013-11-07T000000.html"
              test="@nullFlavor or (@code='de-AT')">(CDlanguageCode): Der Elementinhalt MUSS einer von 'code 'de-AT'' sein.</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.90007
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:setId
Item: (CDsetIdversionNumber)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:setId"
         id="tmp-r-22631365-11e8-4111-811d-91e79028ecb0">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.90007-2015-05-29T000000.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)">(CDsetIdversionNumber): 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"/>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.90007
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:versionNumber
Item: (CDsetIdversionNumber)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:versionNumber"
         id="tmp-r-c98eee69-70f2-4d95-8890-417cca918518">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.90007-2015-05-29T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='INT' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(CDsetIdversionNumber): Wenn eine @xsi:type Instruktion anwesend ist MUSS diese den Wert "{urn:hl7-org:v3}:INT" 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="INT.POS"/>
      <let name="digitok" value="matches(string(@value), '^-?[1-9]\d*$|^+?\d*$')"/>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.90007-2015-05-29T000000.html"
              test="$digitok or @nullFlavor">(CDsetIdversionNumber): @value ist keine gültige INT Zahl <value-of select="@value"/>
      </assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.20001
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget
Item: (HeaderRecordTarget)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget"
         id="tmp-r-e668240e-d7c5-42b0-ac6e-00625393ac7d">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="string(@typeCode)=('RCT') or not(@typeCode)">(HeaderRecordTarget): Der Wert von @typeCode MUSS 'RCT' sein.</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="string(@contextControlCode)=('OP') or not(@contextControlCode)">(HeaderRecordTarget): Der Wert von @contextControlCode MUSS 'OP' sein.</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="count(hl7:patientRole)&gt;=1 ">(HeaderRecordTarget): Element hl7:patientRole ist required [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="count(hl7:patientRole)&lt;=1">(HeaderRecordTarget): Element hl7:patientRole kommt zu häufig vor [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.20001
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole
Item: (HeaderRecordTarget)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole"
         id="tmp-r-01d58372-17bb-470a-aef5-7a730fc844ba">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="string(@classCode)=('PAT') or not(@classCode)">(HeaderRecordTarget): Der Wert von @classCode MUSS 'PAT' sein.</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="string-length(hl7:id[1]/@root)&gt;0">(HeaderRecordTarget):  patientRole id[1] MUSS als lokale Patienten ID vom System vorhanden sein</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="hl7:id[2]/@root = '1.2.40.0.10.1.4.3.1' or hl7:id[2]/@nullFlavor='NI' or hl7:id[2]/@nullFlavor='UNK'">(HeaderRecordTarget):  patientRole id[2] MUSS Sozialversicherungsnummer des Patienten sein (1.2.40.0.10.1.4.3.1) oder @nullFlavor 'NI' oder 'UNK' ist angegeben</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="count(hl7:id)&gt;=2 ">(HeaderRecordTarget): Element hl7:id ist required [min 2x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="count(hl7:addr)&lt;=1">(HeaderRecordTarget): Element hl7:addr 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.20001-2013-10-08T000000.html"
              test="count(hl7:patient)&lt;=1">(HeaderRecordTarget): Element hl7:patient kommt zu häufig vor [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.20001
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:id
Item: (HeaderRecordTarget)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:id"
         id="tmp-r-0b2fe7f1-9936-4bbc-ba69-451605d2403a">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.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)">(HeaderRecordTarget): 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"/>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.20001
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:addr
Item: (HeaderRecordTarget)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:addr"
         id="tmp-r-3e9068d8-bc94-4cd9-9980-0d56212c1648">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='AD' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(HeaderRecordTarget): Wenn eine @xsi:type Instruktion anwesend ist MUSS diese den Wert "{urn:hl7-org:v3}:AD" 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="AD"/>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="hl7:streetAddressLine or (hl7:streetName and hl7:houseNumber)">(HeaderRecordTarget): Granularitätsstufen Adresse beachten: streetAddressLine oder streetName+houseNumber</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="count(hl7:streetAddressLine)&lt;=1">(HeaderRecordTarget): Element hl7:streetAddressLine 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.20001-2013-10-08T000000.html"
              test="count(hl7:streetName)&lt;=1">(HeaderRecordTarget): Element hl7:streetName 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.20001-2013-10-08T000000.html"
              test="count(hl7:houseNumber)&lt;=1">(HeaderRecordTarget): Element hl7:houseNumber 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.20001-2013-10-08T000000.html"
              test="count(hl7:postalCode)&gt;=1 and not(hl7:postalCode/@nullFlavor)">(HeaderRecordTarget): Element hl7:postalCode ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="count(hl7:postalCode)&lt;=1">(HeaderRecordTarget): Element hl7:postalCode 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.20001-2013-10-08T000000.html"
              test="count(hl7:city)&gt;=1 and not(hl7:city/@nullFlavor)">(HeaderRecordTarget): Element hl7:city ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="count(hl7:city)&lt;=1">(HeaderRecordTarget): Element hl7:city 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.20001-2013-10-08T000000.html"
              test="count(hl7:state)&gt;=1 ">(HeaderRecordTarget): Element hl7:state ist required [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="count(hl7:state)&lt;=1">(HeaderRecordTarget): Element hl7:state 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.20001-2013-10-08T000000.html"
              test="count(hl7:country)&gt;=1 and not(hl7:country/@nullFlavor)">(HeaderRecordTarget): Element hl7:country ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="count(hl7:country)&lt;=1">(HeaderRecordTarget): Element hl7:country 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.20001-2013-10-08T000000.html"
              test="count(hl7:additionalLocator)&lt;=1">(HeaderRecordTarget): Element hl7:additionalLocator kommt zu häufig vor [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.20001
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:addr/hl7:streetAddressLine
Item: (HeaderRecordTarget)
-->

   <!--
Template derived rules for ID: 1.2.40.0.34.11.20001
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:addr/hl7:streetName
Item: (HeaderRecordTarget)
-->

   <!--
Template derived rules for ID: 1.2.40.0.34.11.20001
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:addr/hl7:houseNumber
Item: (HeaderRecordTarget)
-->

   <!--
Template derived rules for ID: 1.2.40.0.34.11.20001
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:addr/hl7:postalCode
Item: (HeaderRecordTarget)
-->

   <!--
Template derived rules for ID: 1.2.40.0.34.11.20001
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:addr/hl7:city
Item: (HeaderRecordTarget)
-->

   <!--
Template derived rules for ID: 1.2.40.0.34.11.20001
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:addr/hl7:state
Item: (HeaderRecordTarget)
-->

   <!--
Template derived rules for ID: 1.2.40.0.34.11.20001
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:addr/hl7:country
Item: (HeaderRecordTarget)
-->

   <!--
Template derived rules for ID: 1.2.40.0.34.11.20001
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:addr/hl7:additionalLocator
Item: (HeaderRecordTarget)
-->

   <!--
Template derived rules for ID: 1.2.40.0.34.11.20001
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:telecom
Item: (HeaderRecordTarget)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:telecom"
         id="tmp-r-40fb5b9a-0541-438a-a88f-b2b3b88e9c1d">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='TEL' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(HeaderRecordTarget): Wenn eine @xsi:type Instruktion anwesend ist MUSS diese den Wert "{urn:hl7-org:v3}:TEL" 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="TEL.AT"/>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.20001
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:patient
Item: (HeaderRecordTarget)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:patient"
         id="tmp-r-686f8370-cb12-4bd4-9ff7-ee9ba7e24c59">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="string(@classCode)=('PSN') or not(@classCode)">(HeaderRecordTarget): Der Wert von @classCode MUSS 'PSN' sein.</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="string(@determinerCode)=('INSTANCE') or not(@determinerCode)">(HeaderRecordTarget): Der Wert von @determinerCode MUSS 'INSTANCE' sein.</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="count(hl7:name)&gt;=1 and not(hl7:name/@nullFlavor)">(HeaderRecordTarget): Element hl7:name ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="count(hl7:name)&lt;=1">(HeaderRecordTarget): Element hl7:name 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.20001-2013-10-08T000000.html"
              test="count(hl7:administrativeGenderCode[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.4-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.4-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor])&gt;=1 ">(HeaderRecordTarget): Element hl7:administrativeGenderCode[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.4-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.4-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) 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.20001-2013-10-08T000000.html"
              test="count(hl7:administrativeGenderCode[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.4-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.4-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor])&lt;=1">(HeaderRecordTarget): Element hl7:administrativeGenderCode[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.4-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.4-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) 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.20001-2013-10-08T000000.html"
              test="count(hl7:birthTime)&gt;=1 ">(HeaderRecordTarget): Element hl7:birthTime ist required [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="count(hl7:birthTime)&lt;=1">(HeaderRecordTarget): Element hl7:birthTime 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.20001-2013-10-08T000000.html"
              test="count(hl7:maritalStatusCode)&lt;=1">(HeaderRecordTarget): Element hl7:maritalStatusCode 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.20001-2013-10-08T000000.html"
              test="count(hl7:religiousAffiliationCode)&lt;=1">(HeaderRecordTarget): Element hl7:religiousAffiliationCode 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.20001-2013-10-08T000000.html"
              test="count(hl7:raceCode)=0">(HeaderRecordTarget): Element hl7:raceCode DARF NICHT vorkommen.</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="count(hl7:ethnicGroupCode)=0">(HeaderRecordTarget): Element hl7:ethnicGroupCode DARF NICHT vorkommen.</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="count(hl7:birthplace)&lt;=1">(HeaderRecordTarget): Element hl7:birthplace kommt zu häufig vor [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.20001
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:patient/hl7:name
Item: (HeaderRecordTarget)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:patient/hl7:name"
         id="tmp-r-2022c05b-69a2-496f-9e86-a78548f05871">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='PN' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(HeaderRecordTarget): Wenn eine @xsi:type Instruktion anwesend ist MUSS diese den Wert "{urn:hl7-org:v3}:PN" 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="PN"/>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="count(hl7:given)&gt;=1 and not(hl7:given/@nullFlavor)">(HeaderRecordTarget): Element hl7:given ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="count(hl7:family)&gt;=1 and not(hl7:family/@nullFlavor)">(HeaderRecordTarget): Element hl7:family ist mandatory [min 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.20001
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:patient/hl7:name/hl7:prefix
Item: (HeaderRecordTarget)
-->

   <!--
Template derived rules for ID: 1.2.40.0.34.11.20001
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:patient/hl7:name/hl7:given
Item: (HeaderRecordTarget)
-->

   <!--
Template derived rules for ID: 1.2.40.0.34.11.20001
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:patient/hl7:name/hl7:family
Item: (HeaderRecordTarget)
-->

   <!--
Template derived rules for ID: 1.2.40.0.34.11.20001
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:patient/hl7:name/hl7:suffix
Item: (HeaderRecordTarget)
-->

   <!--
Template derived rules for ID: 1.2.40.0.34.11.20001
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:patient/hl7:administrativeGenderCode[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.4-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.4-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]
Item: (HeaderRecordTarget)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:patient/hl7:administrativeGenderCode[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.4-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.4-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]"
         id="tmp-r-9a620192-27da-4e7c-983a-57a6cb4fec66">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.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)">(HeaderRecordTarget): 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"/>
      <let name="theCode" value="@code"/>
      <let name="theCodeSystem" value="@codeSystem"/>
      <let name="theCodeSystemVersion" value="@codeSystemVersion"/>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="@nullFlavor or exists(doc('include/voc-1.2.40.0.34.10.4-DYNAMIC.xml')/*/valueSet[conceptList/concept[@code = $theCode][@codeSystem = $theCodeSystem][not(@codeSystemVersion) or @codeSystemVersion=$theCodeSystemVersion] or completeCodeSystem[@codeSystem=$theCodeSystem][not(@codeSystemVersion) or @codeSystemVersion=$theCodeSystemVersion]])">(HeaderRecordTarget): Der Elementinhalt MUSS einer von 'ELGA_AdministrativeGender (DYNAMIC)' sein.</assert>
      <let name="theNullFlavor" value="@nullFlavor"/>
      <let name="validNullFlavorsFound"
           value="exists(doc('include/voc-1.2.40.0.34.10.4-DYNAMIC.xml')/*/valueSet/conceptList/exception[@code = $theNullFlavor][@codeSystem = '2.16.840.1.113883.5.1008'])"/>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="not(@nullFlavor) or $validNullFlavorsFound">(HeaderRecordTarget): Der fehlende Wert '<value-of select="@nullFlavor"/>' für @code MUSS gewählt werden aus dem Set gültiger null flavors für dieses Attribut oder denen assoziiert mit Value Set ELGA_AdministrativeGender (DYNAMIC).</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.20001
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:patient/hl7:birthTime
Item: (HeaderRecordTarget)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:patient/hl7:birthTime"
         id="tmp-r-326bac1f-35c3-467f-910f-6cf722e178ac">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='TS' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(HeaderRecordTarget): Wenn eine @xsi:type Instruktion anwesend ist MUSS diese den Wert "{urn:hl7-org:v3}:TS" 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="TS.DATE.MIN"/>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.20001
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:patient/hl7:maritalStatusCode
Item: (HeaderRecordTarget)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:patient/hl7:maritalStatusCode"
         id="tmp-r-02128482-b91b-459c-b9bd-b1b761e1db0d">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.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)">(HeaderRecordTarget): 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"/>
      <let name="theCode" value="@code"/>
      <let name="theCodeSystem" value="@codeSystem"/>
      <let name="theCodeSystemVersion" value="@codeSystemVersion"/>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="@nullFlavor or exists(doc('include/voc-1.2.40.0.34.10.11-DYNAMIC.xml')/*/valueSet[conceptList/concept[@code = $theCode][@codeSystem = $theCodeSystem][not(@codeSystemVersion) or @codeSystemVersion=$theCodeSystemVersion] or completeCodeSystem[@codeSystem=$theCodeSystem][not(@codeSystemVersion) or @codeSystemVersion=$theCodeSystemVersion]])">(HeaderRecordTarget): Der Elementinhalt MUSS einer von 'ELGA_MaritalStatus (DYNAMIC)' sein.</assert>
      <let name="theNullFlavor" value="@nullFlavor"/>
      <let name="validNullFlavorsFound"
           value="exists(doc('include/voc-1.2.40.0.34.10.11-DYNAMIC.xml')/*/valueSet/conceptList/exception[@code = $theNullFlavor][@codeSystem = '2.16.840.1.113883.5.1008'])"/>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="not(@nullFlavor) or $validNullFlavorsFound">(HeaderRecordTarget): Der fehlende Wert '<value-of select="@nullFlavor"/>' für @code MUSS gewählt werden aus dem Set gültiger null flavors für dieses Attribut oder denen assoziiert mit Value Set ELGA_MaritalStatus (DYNAMIC).</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.20001
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:patient/hl7:religiousAffiliationCode
Item: (HeaderRecordTarget)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:patient/hl7:religiousAffiliationCode"
         id="tmp-r-fa576d07-76bf-4ab8-b525-50ac1ff11252">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.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)">(HeaderRecordTarget): 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"/>
      <let name="theCode" value="@code"/>
      <let name="theCodeSystem" value="@codeSystem"/>
      <let name="theCodeSystemVersion" value="@codeSystemVersion"/>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="@nullFlavor or exists(doc('include/voc-1.2.40.0.34.10.18-DYNAMIC.xml')/*/valueSet[conceptList/concept[@code = $theCode][@codeSystem = $theCodeSystem][not(@codeSystemVersion) or @codeSystemVersion=$theCodeSystemVersion] or completeCodeSystem[@codeSystem=$theCodeSystem][not(@codeSystemVersion) or @codeSystemVersion=$theCodeSystemVersion]])">(HeaderRecordTarget): Der Elementinhalt MUSS einer von 'ELGA_ReligiousAffiliation (DYNAMIC)' sein.</assert>
      <let name="theNullFlavor" value="@nullFlavor"/>
      <let name="validNullFlavorsFound"
           value="exists(doc('include/voc-1.2.40.0.34.10.18-DYNAMIC.xml')/*/valueSet/conceptList/exception[@code = $theNullFlavor][@codeSystem = '2.16.840.1.113883.5.1008'])"/>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="not(@nullFlavor) or $validNullFlavorsFound">(HeaderRecordTarget): Der fehlende Wert '<value-of select="@nullFlavor"/>' für @code MUSS gewählt werden aus dem Set gültiger null flavors für dieses Attribut oder denen assoziiert mit Value Set ELGA_ReligiousAffiliation (DYNAMIC).</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.20001
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:patient/hl7:raceCode
Item: (HeaderRecordTarget)
-->

   <!--
Template derived rules for ID: 1.2.40.0.34.11.20001
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:patient/hl7:ethnicGroupCode
Item: (HeaderRecordTarget)
-->

   <!--
Template derived rules for ID: 1.2.40.0.34.11.20001
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:patient/hl7:guardian
Item: (HeaderRecordTarget)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:patient/hl7:guardian"
         id="tmp-r-4ad948af-66d8-4c68-8d44-c3b4254a3db8">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="count(hl7:addr)&lt;=1">(HeaderRecordTarget): Element hl7:addr kommt zu häufig vor [max 1x].</assert>
      <let name="elmcount"
           value="count(hl7:guardianPerson|hl7:guardianOrganization)"/>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="$elmcount&gt;=1">(HeaderRecordTarget): Auswahl (hl7:guardianPerson oder hl7:guardianOrganization) enthält nicht genügend Elemente [min 1x]</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="$elmcount&lt;=1">(HeaderRecordTarget): Auswahl (hl7:guardianPerson oder hl7:guardianOrganization) enthält zu viele Elemente [max 1x]</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="count(hl7:guardianPerson)&lt;=1">(HeaderRecordTarget): Element hl7:guardianPerson 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.20001-2013-10-08T000000.html"
              test="count(hl7:guardianOrganization)&lt;=1">(HeaderRecordTarget): Element hl7:guardianOrganization kommt zu häufig vor [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.20001
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:patient/hl7:guardian/hl7:addr
Item: (HeaderRecordTarget)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:patient/hl7:guardian/hl7:addr"
         id="tmp-r-651a3987-74a0-46b6-8fef-66563577ee89">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='AD' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(HeaderRecordTarget): Wenn eine @xsi:type Instruktion anwesend ist MUSS diese den Wert "{urn:hl7-org:v3}:AD" 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="AD"/>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.20001
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:patient/hl7:guardian/hl7:telecom
Item: (HeaderRecordTarget)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:patient/hl7:guardian/hl7:telecom"
         id="tmp-r-f5318562-570e-4594-b803-da939fb5e3a2">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='TEL' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(HeaderRecordTarget): Wenn eine @xsi:type Instruktion anwesend ist MUSS diese den Wert "{urn:hl7-org:v3}:TEL" 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="TEL.AT"/>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.20001
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:patient/hl7:guardian/hl7:guardianPerson
Item: (HeaderRecordTarget)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:patient/hl7:guardian/hl7:guardianPerson"
         id="tmp-r-2541f85a-20bf-47b4-acde-5a4989579b27">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="count(hl7:name)&gt;=1 and not(hl7:name/@nullFlavor)">(HeaderRecordTarget): Element hl7:name ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="count(hl7:name)&lt;=1">(HeaderRecordTarget): Element hl7:name kommt zu häufig vor [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.20001
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:patient/hl7:guardian/hl7:guardianPerson/hl7:name
Item: (HeaderRecordTarget)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:patient/hl7:guardian/hl7:guardianPerson/hl7:name"
         id="tmp-r-5b8a078f-16be-4e4b-8e55-e5bc5b96e09c">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='PN' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(HeaderRecordTarget): Wenn eine @xsi:type Instruktion anwesend ist MUSS diese den Wert "{urn:hl7-org:v3}:PN" 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="PN"/>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.20001
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:patient/hl7:guardian/hl7:guardianOrganization
Item: (HeaderRecordTarget)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:patient/hl7:guardian/hl7:guardianOrganization"
         id="tmp-r-12b24f91-bfa2-44f9-854c-5652a6bb96e9">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="count(hl7:name)&gt;=1 and not(hl7:name/@nullFlavor)">(HeaderRecordTarget): Element hl7:name ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="count(hl7:name)&lt;=1">(HeaderRecordTarget): Element hl7:name kommt zu häufig vor [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.20001
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:patient/hl7:guardian/hl7:guardianOrganization/hl7:name
Item: (HeaderRecordTarget)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:patient/hl7:guardian/hl7:guardianOrganization/hl7:name"
         id="tmp-r-3208dd60-36cd-46de-a465-65013043ac6e">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='ON' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(HeaderRecordTarget): Wenn eine @xsi:type Instruktion anwesend ist MUSS diese den Wert "{urn:hl7-org:v3}:ON" 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="ON"/>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.20001
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:patient/hl7:birthplace
Item: (HeaderRecordTarget)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:patient/hl7:birthplace"
         id="tmp-r-0b7cd3e2-b104-45a6-bc77-39d0f90a5dfb">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="count(hl7:place)&gt;=1 and not(hl7:place/@nullFlavor)">(HeaderRecordTarget): Element hl7:place ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="count(hl7:place)&lt;=1">(HeaderRecordTarget): Element hl7:place kommt zu häufig vor [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.20001
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:patient/hl7:birthplace/hl7:place
Item: (HeaderRecordTarget)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:patient/hl7:birthplace/hl7:place"
         id="tmp-r-474131ad-ae66-4232-8942-c33303305a16">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="count(hl7:addr)&gt;=1 and not(hl7:addr/@nullFlavor)">(HeaderRecordTarget): Element hl7:addr ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="count(hl7:addr)&lt;=1">(HeaderRecordTarget): Element hl7:addr kommt zu häufig vor [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.20001
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:patient/hl7:birthplace/hl7:place/hl7:addr
Item: (HeaderRecordTarget)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:recordTarget/hl7:patientRole/hl7:patient/hl7:birthplace/hl7:place/hl7:addr"
         id="tmp-r-be8e397a-179f-4e9a-b1bd-1686296b651a">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20001-2013-10-08T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='AD' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(HeaderRecordTarget): Wenn eine @xsi:type Instruktion anwesend ist MUSS diese den Wert "{urn:hl7-org:v3}:AD" 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="AD"/>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.20002
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:author
Item: (HeaderAuthor)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:author"
         id="tmp-r-4d52f9cb-0c29-4e91-978a-a14877cf7cd6">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20002-2015-05-09T000000.html"
              test="string(@typeCode)=('AUT') or not(@typeCode)">(HeaderAuthor): Der Wert von @typeCode MUSS 'AUT' sein.</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20002-2015-05-09T000000.html"
              test="string(@contextControlCode)=('OP') or not(@contextControlCode)">(HeaderAuthor): Der Wert von @contextControlCode MUSS 'OP' sein.</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20002-2015-05-09T000000.html"
              test="count(hl7:functionCode)&lt;=1">(HeaderAuthor): Element hl7:functionCode 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.20002-2015-05-09T000000.html"
              test="count(hl7:time)&gt;=1 ">(HeaderAuthor): Element hl7:time ist required [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20002-2015-05-09T000000.html"
              test="count(hl7:time)&lt;=1">(HeaderAuthor): Element hl7:time 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.20002-2015-05-09T000000.html"
              test="count(hl7:assignedAuthor)&gt;=1 ">(HeaderAuthor): Element hl7:assignedAuthor ist required [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20002-2015-05-09T000000.html"
              test="count(hl7:assignedAuthor)&lt;=1">(HeaderAuthor): Element hl7:assignedAuthor kommt zu häufig vor [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.20002
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:author/hl7:functionCode
Item: (HeaderAuthor)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:author/hl7:functionCode"
         id="tmp-r-30233fdd-60f9-45a6-98df-628148627371">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20002-2015-05-09T000000.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)">(HeaderAuthor): 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"/>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.20002
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:author/hl7:time
Item: (HeaderAuthor)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:author/hl7:time"
         id="tmp-r-c7d84e18-4dd3-41bd-ba4c-9028d110b617">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20002-2015-05-09T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='TS' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(HeaderAuthor): Wenn eine @xsi:type Instruktion anwesend ist MUSS diese den Wert "{urn:hl7-org:v3}:TS" 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="TS.DATE.MIN"/>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.20002
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:author/hl7:assignedAuthor
Item: (HeaderAuthor)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:author/hl7:assignedAuthor"
         id="tmp-r-67824052-cfe0-4ae5-8307-801a0f229f59">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20002-2015-05-09T000000.html"
              test="string(@classCode)=('ASSIGNED') or not(@classCode)">(HeaderAuthor): Der Wert von @classCode MUSS 'ASSIGNED' sein.</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20002-2015-05-09T000000.html"
              test="count(hl7:id)&gt;=1 ">(HeaderAuthor): 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.20002-2015-05-09T000000.html"
              test="count(hl7:code)&lt;=1">(HeaderAuthor): Element hl7:code kommt zu häufig vor [max 1x].</assert>
      <let name="elmcount"
           value="count(hl7:assignedPerson|hl7:assignedAuthoringDevice)"/>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20002-2015-05-09T000000.html"
              test="$elmcount&gt;=1">(HeaderAuthor): Auswahl (hl7:assignedPerson oder hl7:assignedAuthoringDevice) enthält nicht genügend Elemente [min 1x]</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20002-2015-05-09T000000.html"
              test="$elmcount&lt;=1">(HeaderAuthor): Auswahl (hl7:assignedPerson oder hl7:assignedAuthoringDevice) enthält zu viele Elemente [max 1x]</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20002-2015-05-09T000000.html"
              test="count(hl7:assignedPerson)&lt;=1">(HeaderAuthor): Element hl7:assignedPerson 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.20002-2015-05-09T000000.html"
              test="count(hl7:assignedAuthoringDevice)&lt;=1">(HeaderAuthor): Element hl7:assignedAuthoringDevice 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.20002-2015-05-09T000000.html"
              test="count(hl7:representedOrganization)&gt;=1 and not(hl7:representedOrganization/@nullFlavor)">(HeaderAuthor): Element hl7:representedOrganization ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20002-2015-05-09T000000.html"
              test="count(hl7:representedOrganization)&lt;=1">(HeaderAuthor): Element hl7:representedOrganization kommt zu häufig vor [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.20002
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:author/hl7:assignedAuthor/hl7:id
Item: (HeaderAuthor)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:author/hl7:assignedAuthor/hl7:id"
         id="tmp-r-faac297e-3f67-4dda-a2a5-1ec96f77ab07">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20002-2015-05-09T000000.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)">(HeaderAuthor): 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"/>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.20002
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:author/hl7:assignedAuthor/hl7:code
Item: (HeaderAuthor)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:author/hl7:assignedAuthor/hl7:code"
         id="tmp-r-a560bd5c-d31f-4007-a344-08f69e9b1da1">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20002-2015-05-09T000000.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)">(HeaderAuthor): 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"/>
      <let name="theCode" value="@code"/>
      <let name="theCodeSystem" value="@codeSystem"/>
      <let name="theCodeSystemVersion" value="@codeSystemVersion"/>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20002-2015-05-09T000000.html"
              test="@nullFlavor or exists(doc('include/voc-1.2.40.0.34.10.6-DYNAMIC.xml')/*/valueSet[conceptList/concept[@code = $theCode][@codeSystem = $theCodeSystem][not(@codeSystemVersion) or @codeSystemVersion=$theCodeSystemVersion] or completeCodeSystem[@codeSystem=$theCodeSystem][not(@codeSystemVersion) or @codeSystemVersion=$theCodeSystemVersion]])">(HeaderAuthor): Der Elementinhalt MUSS einer von 'ELGA_AuthorSpeciality (DYNAMIC)' sein.</assert>
      <let name="theNullFlavor" value="@nullFlavor"/>
      <let name="validNullFlavorsFound"
           value="exists(doc('include/voc-1.2.40.0.34.10.6-DYNAMIC.xml')/*/valueSet/conceptList/exception[@code = $theNullFlavor][@codeSystem = '2.16.840.1.113883.5.1008'])"/>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20002-2015-05-09T000000.html"
              test="not(@nullFlavor) or $validNullFlavorsFound">(HeaderAuthor): Der fehlende Wert '<value-of select="@nullFlavor"/>' für @code MUSS gewählt werden aus dem Set gültiger null flavors für dieses Attribut oder denen assoziiert mit Value Set ELGA_AuthorSpeciality (DYNAMIC).</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.20002
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:author/hl7:assignedAuthor/hl7:telecom
Item: (HeaderAuthor)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:author/hl7:assignedAuthor/hl7:telecom"
         id="tmp-r-367a8c2f-a287-4ec2-a056-22d88701efaf">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20002-2015-05-09T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='TEL' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(HeaderAuthor): Wenn eine @xsi:type Instruktion anwesend ist MUSS diese den Wert "{urn:hl7-org:v3}:TEL" 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="TEL.AT"/>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.20002
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:author/hl7:assignedAuthor/hl7:assignedPerson
Item: (HeaderAuthor)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:author/hl7:assignedAuthor/hl7:assignedPerson"
         id="tmp-r-46472faf-c21f-462b-a084-088dfd672ac3">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20002-2015-05-09T000000.html"
              test="string(@classCode)=('PSN') or not(@classCode)">(HeaderAuthor): Der Wert von @classCode MUSS 'PSN' sein.</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20002-2015-05-09T000000.html"
              test="string(@determinerCode)=('INSTANCE') or not(@determinerCode)">(HeaderAuthor): Der Wert von @determinerCode MUSS 'INSTANCE' sein.</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20002-2015-05-09T000000.html"
              test="count(hl7:name)&gt;=1 and not(hl7:name/@nullFlavor)">(HeaderAuthor): Element hl7:name ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20002-2015-05-09T000000.html"
              test="count(hl7:name)&lt;=1">(HeaderAuthor): Element hl7:name kommt zu häufig vor [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.90001
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:author/hl7:assignedAuthor/hl7:assignedPerson/hl7:name
Item: (PersonElements)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:author/hl7:assignedAuthor/hl7:assignedPerson/hl7:name"
         id="tmp-r-7a53cb43-26b2-4ec3-aaaa-24881ad586bb">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.90001-2011-12-19T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='PN' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(PersonElements): Wenn eine @xsi:type Instruktion anwesend ist MUSS diese den Wert "{urn:hl7-org:v3}:PN" 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="PN"/>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.20002
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:author/hl7:assignedAuthor/hl7:assignedAuthoringDevice
Item: (HeaderAuthor)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:author/hl7:assignedAuthor/hl7:assignedAuthoringDevice"
         id="tmp-r-1cc4ec08-693b-492d-814f-c1858d4c6089">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20002-2015-05-09T000000.html"
              test="string(@classCode)=('DEV') or not(@classCode)">(HeaderAuthor): Der Wert von @classCode MUSS 'DEV' sein.</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20002-2015-05-09T000000.html"
              test="string(@determinerCode)=('INSTANCE') or not(@determinerCode)">(HeaderAuthor): Der Wert von @determinerCode MUSS 'INSTANCE' sein.</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20002-2015-05-09T000000.html"
              test="count(hl7:manufacturerModelName)&gt;=1 ">(HeaderAuthor): Element hl7:manufacturerModelName ist required [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20002-2015-05-09T000000.html"
              test="count(hl7:manufacturerModelName)&lt;=1">(HeaderAuthor): Element hl7:manufacturerModelName 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.20002-2015-05-09T000000.html"
              test="count(hl7:softwareName)&gt;=1 ">(HeaderAuthor): Element hl7:softwareName ist required [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20002-2015-05-09T000000.html"
              test="count(hl7:softwareName)&lt;=1">(HeaderAuthor): Element hl7:softwareName kommt zu häufig vor [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.20002
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:author/hl7:assignedAuthor/hl7:assignedAuthoringDevice/hl7:manufacturerModelName
Item: (HeaderAuthor)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:author/hl7:assignedAuthor/hl7:assignedAuthoringDevice/hl7:manufacturerModelName"
         id="tmp-r-f6905eae-65f1-4d7f-9897-f41e630ef32d">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20002-2015-05-09T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='SC' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(HeaderAuthor): Wenn eine @xsi:type Instruktion anwesend ist MUSS diese den Wert "{urn:hl7-org:v3}:SC" 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="SC"/>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.20002
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:author/hl7:assignedAuthor/hl7:assignedAuthoringDevice/hl7:softwareName
Item: (HeaderAuthor)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:author/hl7:assignedAuthor/hl7:assignedAuthoringDevice/hl7:softwareName"
         id="tmp-r-5408552e-5fe1-4aa8-ba30-9610ecb9912e">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20002-2015-05-09T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='SC' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(HeaderAuthor): Wenn eine @xsi:type Instruktion anwesend ist MUSS diese den Wert "{urn:hl7-org:v3}:SC" 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="SC"/>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.20002
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:author/hl7:assignedAuthor/hl7:representedOrganization
Item: (HeaderAuthor)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:author/hl7:assignedAuthor/hl7:representedOrganization"
         id="tmp-r-e8801e2e-e69f-4195-9145-6c497a0ea379">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20002-2015-05-09T000000.html"
              test="count(hl7:id)&gt;=1 and not(hl7:id/@nullFlavor)">(HeaderAuthor): Element hl7:id ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20002-2015-05-09T000000.html"
              test="count(hl7:name)&gt;=1 and not(hl7:name/@nullFlavor)">(HeaderAuthor): Element hl7:name ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20002-2015-05-09T000000.html"
              test="count(hl7:name)&lt;=1">(HeaderAuthor): Element hl7:name 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.20002-2015-05-09T000000.html"
              test="count(hl7:addr)&lt;=1">(HeaderAuthor): Element hl7:addr kommt zu häufig vor [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.20002
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:author/hl7:assignedAuthor/hl7:representedOrganization/hl7:id
Item: (HeaderAuthor)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:author/hl7:assignedAuthor/hl7:representedOrganization/hl7:id"
         id="tmp-r-45b70407-0a19-4c59-b535-dcfafca1a3b0">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20002-2015-05-09T000000.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)">(HeaderAuthor): 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"/>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.20002
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:author/hl7:assignedAuthor/hl7:representedOrganization/hl7:name
Item: (HeaderAuthor)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:author/hl7:assignedAuthor/hl7:representedOrganization/hl7:name"
         id="tmp-r-a12fe993-83f3-406f-97e3-751a2835b83f">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20002-2015-05-09T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='ON' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(HeaderAuthor): Wenn eine @xsi:type Instruktion anwesend ist MUSS diese den Wert "{urn:hl7-org:v3}:ON" 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="ON"/>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.20002
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:author/hl7:assignedAuthor/hl7:representedOrganization/hl7:telecom
Item: (HeaderAuthor)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:author/hl7:assignedAuthor/hl7:representedOrganization/hl7:telecom"
         id="tmp-r-12464a46-9efc-4218-989b-c2fc7113e090">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20002-2015-05-09T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='TEL' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(HeaderAuthor): Wenn eine @xsi:type Instruktion anwesend ist MUSS diese den Wert "{urn:hl7-org:v3}:TEL" 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="TEL.AT"/>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.20002
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:author/hl7:assignedAuthor/hl7:representedOrganization/hl7:addr
Item: (HeaderAuthor)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:author/hl7:assignedAuthor/hl7:representedOrganization/hl7:addr"
         id="tmp-r-b264715f-9267-4152-a1e4-4e3c1b7974e4">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20002-2015-05-09T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='AD' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(HeaderAuthor): Wenn eine @xsi:type Instruktion anwesend ist MUSS diese den Wert "{urn:hl7-org:v3}:AD" 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="AD"/>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.20004
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:custodian
Item: (HeaderCustodian)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:custodian"
         id="tmp-r-2322a4fa-ebda-4927-8d3a-5082218f1d77">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20004-2015-05-28T000000.html"
              test="string(@typeCode)=('CST') or not(@typeCode)">(HeaderCustodian): Der Wert von @typeCode MUSS 'CST' sein.</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20004-2015-05-28T000000.html"
              test="count(hl7:assignedCustodian)&gt;=1 and not(hl7:assignedCustodian/@nullFlavor)">(HeaderCustodian): Element hl7:assignedCustodian ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20004-2015-05-28T000000.html"
              test="count(hl7:assignedCustodian)&lt;=1">(HeaderCustodian): Element hl7:assignedCustodian kommt zu häufig vor [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.20004
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:custodian/hl7:assignedCustodian
Item: (HeaderCustodian)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:custodian/hl7:assignedCustodian"
         id="tmp-r-c393cc25-4284-4cef-a6fc-964dcd9dd4c4">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20004-2015-05-28T000000.html"
              test="string(@classCode)=('ASSIGNED') or not(@classCode)">(HeaderCustodian): Der Wert von @classCode MUSS 'ASSIGNED' sein.</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20004-2015-05-28T000000.html"
              test="count(hl7:representedCustodianOrganization)&gt;=1 and not(hl7:representedCustodianOrganization/@nullFlavor)">(HeaderCustodian): Element hl7:representedCustodianOrganization ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20004-2015-05-28T000000.html"
              test="count(hl7:representedCustodianOrganization)&lt;=1">(HeaderCustodian): Element hl7:representedCustodianOrganization kommt zu häufig vor [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.20004
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:custodian/hl7:assignedCustodian/hl7:representedCustodianOrganization
Item: (HeaderCustodian)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:custodian/hl7:assignedCustodian/hl7:representedCustodianOrganization"
         id="tmp-r-3fde6e32-df3c-4ac4-8562-68d5b7f64814">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20004-2015-05-28T000000.html"
              test="string(@classCode)=('ORG') or not(@classCode)">(HeaderCustodian): Der Wert von @classCode MUSS 'ORG' sein.</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20004-2015-05-28T000000.html"
              test="string(@determinerCode)=('INSTANCE') or not(@determinerCode)">(HeaderCustodian): Der Wert von @determinerCode MUSS 'INSTANCE' sein.</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20004-2015-05-28T000000.html"
              test="count(hl7:id)&gt;=1 ">(HeaderCustodian): 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.20004-2015-05-28T000000.html"
              test="count(hl7:id)&lt;=1">(HeaderCustodian): 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.20004-2015-05-28T000000.html"
              test="count(hl7:name)&gt;=1 and not(hl7:name/@nullFlavor)">(HeaderCustodian): Element hl7:name ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20004-2015-05-28T000000.html"
              test="count(hl7:name)&lt;=1">(HeaderCustodian): Element hl7:name 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.20004-2015-05-28T000000.html"
              test="count(hl7:telecom)&lt;=1">(HeaderCustodian): Element hl7:telecom 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.20004-2015-05-28T000000.html"
              test="count(hl7:addr)&gt;=1 and not(hl7:addr/@nullFlavor)">(HeaderCustodian): Element hl7:addr ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20004-2015-05-28T000000.html"
              test="count(hl7:addr)&lt;=1">(HeaderCustodian): Element hl7:addr kommt zu häufig vor [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.20004
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:custodian/hl7:assignedCustodian/hl7:representedCustodianOrganization/hl7:id
Item: (HeaderCustodian)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:custodian/hl7:assignedCustodian/hl7:representedCustodianOrganization/hl7:id"
         id="tmp-r-15f38e22-dd04-4e52-8306-7e44dfb4b2e8">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20004-2015-05-28T000000.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)">(HeaderCustodian): 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"/>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.20004
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:custodian/hl7:assignedCustodian/hl7:representedCustodianOrganization/hl7:name
Item: (HeaderCustodian)
-->

   <!--
Template derived rules for ID: 1.2.40.0.34.11.20004
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:custodian/hl7:assignedCustodian/hl7:representedCustodianOrganization/hl7:telecom
Item: (HeaderCustodian)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:custodian/hl7:assignedCustodian/hl7:representedCustodianOrganization/hl7:telecom"
         id="tmp-r-340cd9b1-9a2e-4cb2-96be-a15a64ec6d2f">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20004-2015-05-28T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='TEL' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(HeaderCustodian): Wenn eine @xsi:type Instruktion anwesend ist MUSS diese den Wert "{urn:hl7-org:v3}:TEL" 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="TEL.AT"/>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.20004
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:custodian/hl7:assignedCustodian/hl7:representedCustodianOrganization/hl7:addr
Item: (HeaderCustodian)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:custodian/hl7:assignedCustodian/hl7:representedCustodianOrganization/hl7:addr"
         id="tmp-r-0310151a-0885-46e8-a192-57bbe67ef306">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20004-2015-05-28T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='AD' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(HeaderCustodian): Wenn eine @xsi:type Instruktion anwesend ist MUSS diese den Wert "{urn:hl7-org:v3}:AD" 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="AD"/>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.8.1
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:dataEnterer
Item: (eMedikationRezept)
-->

   <!--
Template derived rules for ID: 1.2.40.0.34.11.8.1
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:informationRecipient
Item: (eMedikationRezept)
-->

   <!--
Template derived rules for ID: 1.2.40.0.34.11.8.1
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:authenticator
Item: (eMedikationRezept)
-->

   <!--
Template derived rules for ID: 1.2.40.0.34.11.20006
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:legalAuthenticator
Item: (HeaderLegalAuthenticator)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:legalAuthenticator"
         id="tmp-r-16dd80d0-29c9-432c-b524-8bf7f8a8ad4d">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20006-2011-12-19T000000.html"
              test="string(@typeCode)=('LA') or not(@typeCode)">(HeaderLegalAuthenticator): Der Wert von @typeCode MUSS 'LA' sein.</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20006-2011-12-19T000000.html"
              test="count(hl7:time)&gt;=1 ">(HeaderLegalAuthenticator): Element hl7:time ist required [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20006-2011-12-19T000000.html"
              test="count(hl7:time)&lt;=1">(HeaderLegalAuthenticator): Element hl7:time 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.20006-2011-12-19T000000.html"
              test="count(hl7:signatureCode[@code='S'])&gt;=1 and not(hl7:signatureCode[@code='S']/@nullFlavor)">(HeaderLegalAuthenticator): Element hl7:signatureCode[@code='S'] ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20006-2011-12-19T000000.html"
              test="count(hl7:signatureCode[@code='S'])&lt;=1">(HeaderLegalAuthenticator): Element hl7:signatureCode[@code='S'] 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.20006-2011-12-19T000000.html"
              test="count(hl7:assignedEntity)&gt;=1 and not(hl7:assignedEntity/@nullFlavor)">(HeaderLegalAuthenticator): Element hl7:assignedEntity ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20006-2011-12-19T000000.html"
              test="count(hl7:assignedEntity)&lt;=1">(HeaderLegalAuthenticator): Element hl7:assignedEntity kommt zu häufig vor [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.20006
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:legalAuthenticator/hl7:time
Item: (HeaderLegalAuthenticator)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:legalAuthenticator/hl7:time"
         id="tmp-r-faaef8d4-4b22-443f-8401-09f29546eca2">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20006-2011-12-19T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='TS' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(HeaderLegalAuthenticator): Wenn eine @xsi:type Instruktion anwesend ist MUSS diese den Wert "{urn:hl7-org:v3}:TS" 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="TS.DATE.MIN"/>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.20006
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:legalAuthenticator/hl7:signatureCode[@code='S']
Item: (HeaderLegalAuthenticator)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:legalAuthenticator/hl7:signatureCode[@code='S']"
         id="tmp-r-5e77f693-fe14-4bf1-b277-0d84f36c452d">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20006-2011-12-19T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='CS' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(HeaderLegalAuthenticator): Wenn eine @xsi:type Instruktion anwesend ist MUSS diese den Wert "{urn:hl7-org:v3}:CS" 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="CS"/>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20006-2011-12-19T000000.html"
              test="@nullFlavor or (@code='S')">(HeaderLegalAuthenticator): Der Elementinhalt MUSS einer von 'code 'S'' sein.</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.20006
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:legalAuthenticator/hl7:assignedEntity
Item: (HeaderLegalAuthenticator)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:legalAuthenticator/hl7:assignedEntity"
         id="tmp-r-d969998b-0b4b-4b55-b438-58dc97de9760">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20006-2011-12-19T000000.html"
              test="count(hl7:id)&gt;=1 ">(HeaderLegalAuthenticator): 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.20006-2011-12-19T000000.html"
              test="count(hl7:addr)&lt;=1">(HeaderLegalAuthenticator): Element hl7:addr 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.20006-2011-12-19T000000.html"
              test="count(hl7:assignedPerson)&gt;=1 and not(hl7:assignedPerson/@nullFlavor)">(HeaderLegalAuthenticator): Element hl7:assignedPerson ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20006-2011-12-19T000000.html"
              test="count(hl7:assignedPerson)&lt;=1">(HeaderLegalAuthenticator): Element hl7:assignedPerson 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.20006-2011-12-19T000000.html"
              test="count(hl7:representedOrganization)&lt;=1">(HeaderLegalAuthenticator): Element hl7:representedOrganization kommt zu häufig vor [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.90003
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:legalAuthenticator/hl7:assignedEntity/hl7:id
Item: (AssignedEntityElements)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:legalAuthenticator/hl7:assignedEntity/hl7:id"
         id="tmp-r-cf9f2e22-1428-4de3-85ea-4fe9e40f2d8c">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.90003-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)">(AssignedEntityElements): 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"/>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.90003
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:legalAuthenticator/hl7:assignedEntity/hl7:addr
Item: (AssignedEntityElements)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:legalAuthenticator/hl7:assignedEntity/hl7:addr"
         id="tmp-r-427f3987-c465-4321-aa3e-e245502e281f">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.90003-2011-12-19T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='AD' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(AssignedEntityElements): Wenn eine @xsi:type Instruktion anwesend ist MUSS diese den Wert "{urn:hl7-org:v3}:AD" 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="AD"/>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.90003
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:legalAuthenticator/hl7:assignedEntity/hl7:telecom
Item: (AssignedEntityElements)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:legalAuthenticator/hl7:assignedEntity/hl7:telecom"
         id="tmp-r-259cc0f7-c9e0-482f-aa08-be7ccf4ca219">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.90003-2011-12-19T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='TEL' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(AssignedEntityElements): Wenn eine @xsi:type Instruktion anwesend ist MUSS diese den Wert "{urn:hl7-org:v3}:TEL" 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="TEL.AT"/>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.90003
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:legalAuthenticator/hl7:assignedEntity/hl7:assignedPerson
Item: (AssignedEntityElements)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:legalAuthenticator/hl7:assignedEntity/hl7:assignedPerson"
         id="tmp-r-aa58e333-9287-47fd-8647-599f4b49656a">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.90003-2011-12-19T000000.html"
              test="string(@classCode)=('PSN') or not(@classCode)">(AssignedEntityElements): Der Wert von @classCode MUSS 'PSN' sein.</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.90003-2011-12-19T000000.html"
              test="string(@determinerCode)=('INSTANCE') or not(@determinerCode)">(AssignedEntityElements): Der Wert von @determinerCode MUSS 'INSTANCE' sein.</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.90003-2011-12-19T000000.html"
              test="count(hl7:name)&gt;=1 and not(hl7:name/@nullFlavor)">(AssignedEntityElements): Element hl7:name ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.90003-2011-12-19T000000.html"
              test="count(hl7:name)&lt;=1">(AssignedEntityElements): Element hl7:name kommt zu häufig vor [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.90001
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:legalAuthenticator/hl7:assignedEntity/hl7:assignedPerson/hl7:name
Item: (PersonElements)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:legalAuthenticator/hl7:assignedEntity/hl7:assignedPerson/hl7:name"
         id="tmp-r-1e73da4f-15bd-406c-858b-b2e8c2e59ece">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.90001-2011-12-19T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='PN' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(PersonElements): Wenn eine @xsi:type Instruktion anwesend ist MUSS diese den Wert "{urn:hl7-org:v3}:PN" 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="PN"/>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.90003
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:legalAuthenticator/hl7:assignedEntity/hl7:representedOrganization
Item: (AssignedEntityElements)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:legalAuthenticator/hl7:assignedEntity/hl7:representedOrganization"
         id="tmp-r-783325c8-fe25-4dc1-aec8-c8b1cfa3a953">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.90003-2011-12-19T000000.html"
              test="string(@classCode)=('ORG') or not(@classCode)">(AssignedEntityElements): Der Wert von @classCode MUSS 'ORG' sein.</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.90003-2011-12-19T000000.html"
              test="string(@determinerCode)=('INSTANCE') or not(@determinerCode)">(AssignedEntityElements): Der Wert von @determinerCode MUSS 'INSTANCE' sein.</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.90003-2011-12-19T000000.html"
              test="count(hl7:name)&gt;=1 and not(hl7:name/@nullFlavor)">(AssignedEntityElements): Element hl7:name ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.90003-2011-12-19T000000.html"
              test="count(hl7:name)&lt;=1">(AssignedEntityElements): Element hl7:name 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.90003-2011-12-19T000000.html"
              test="count(hl7:addr)&lt;=1">(AssignedEntityElements): Element hl7:addr kommt zu häufig vor [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.90002
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:legalAuthenticator/hl7:assignedEntity/hl7:representedOrganization/hl7:id
Item: (OrganizationElements)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:legalAuthenticator/hl7:assignedEntity/hl7:representedOrganization/hl7:id"
         id="tmp-r-07a7b5f0-5555-4fa9-976e-4d4578f387c4">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.90002-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)">(OrganizationElements): 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"/>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.90002
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:legalAuthenticator/hl7:assignedEntity/hl7:representedOrganization/hl7:name
Item: (OrganizationElements)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:legalAuthenticator/hl7:assignedEntity/hl7:representedOrganization/hl7:name"
         id="tmp-r-01fc752d-d359-4d9d-9953-3d93a8f00e45">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.90002-2011-12-19T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='ON' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(OrganizationElements): Wenn eine @xsi:type Instruktion anwesend ist MUSS diese den Wert "{urn:hl7-org:v3}:ON" 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="ON"/>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.90002
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:legalAuthenticator/hl7:assignedEntity/hl7:representedOrganization/hl7:telecom
Item: (OrganizationElements)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:legalAuthenticator/hl7:assignedEntity/hl7:representedOrganization/hl7:telecom"
         id="tmp-r-4a1ed03c-cf81-4571-b4f9-6df0eb764a64">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.90002-2011-12-19T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='TEL' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(OrganizationElements): Wenn eine @xsi:type Instruktion anwesend ist MUSS diese den Wert "{urn:hl7-org:v3}:TEL" 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="TEL.AT"/>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.90002
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:legalAuthenticator/hl7:assignedEntity/hl7:representedOrganization/hl7:addr
Item: (OrganizationElements)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:legalAuthenticator/hl7:assignedEntity/hl7:representedOrganization/hl7:addr"
         id="tmp-r-12f1d9f4-4364-4267-a476-0efd675f86e9">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.90002-2011-12-19T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='AD' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(OrganizationElements): Wenn eine @xsi:type Instruktion anwesend ist MUSS diese den Wert "{urn:hl7-org:v3}:AD" 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="AD"/>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.8.1
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:participants
Item: (eMedikationRezept)
-->

   <!--
Template derived rules for ID: 1.2.40.0.34.11.8.1
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:inFulfillmentOf
Item: (eMedikationRezept)
-->

   <!--
Template derived rules for ID: 1.2.40.0.34.11.8.1
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:documentationOf[hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]]]
Item: (eMedikationRezept)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:documentationOf[hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]]]"
         id="tmp-r-11ed4147-43e9-45f9-a674-dfb8b2db2ffb">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.html"
              test="count(hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]])&gt;=1 and not(hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]]/@nullFlavor)">(eMedikationRezept): Element hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) 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.8.1-2014-01-31T000000.html"
              test="count(hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]])&lt;=1">(eMedikationRezept): Element hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]] kommt zu häufig vor [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.8.1
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:documentationOf[hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]]]/hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]]
Item: (eMedikationRezept)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:documentationOf[hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]]]/hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]]"
         id="tmp-r-0e4f4f16-6c0c-4528-8f9b-add7a0fbff5e">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.html"
              test="count(hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor])&gt;=1 ">(eMedikationRezept): Element hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) 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.8.1-2014-01-31T000000.html"
              test="count(hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor])&lt;=1">(eMedikationRezept): Element hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor] kommt zu häufig vor [max 1x].</assert>
      <let name="elmcount"
           value="count(hl7:effectiveTime[not(@nullFlavor)]|hl7:effectiveTime[@nullFlavor])"/>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.html"
              test="$elmcount&gt;=1">(eMedikationRezept): Auswahl (hl7:effectiveTime[not(@nullFlavor)] oder hl7:effectiveTime[@nullFlavor]) enthält nicht genügend Elemente [min 1x]</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.html"
              test="$elmcount&lt;=1">(eMedikationRezept): Auswahl (hl7:effectiveTime[not(@nullFlavor)] oder hl7:effectiveTime[@nullFlavor]) enthält zu viele Elemente [max 1x]</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.html"
              test="count(hl7:performer)=0">(eMedikationRezept): Element hl7:performer DARF NICHT vorkommen.</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.8.1
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:documentationOf[hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]]]/hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]]/hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]
Item: (eMedikationRezept)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:documentationOf[hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]]]/hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]]/hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]"
         id="tmp-r-21a77e6e-30e5-4dcc-b7a4-bab40d935232">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.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)">(eMedikationRezept): 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"/>
      <let name="theCode" value="@code"/>
      <let name="theCodeSystem" value="@codeSystem"/>
      <let name="theCodeSystemVersion" value="@codeSystemVersion"/>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.html"
              test="@nullFlavor or exists(doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet[conceptList/concept[@code = $theCode][@codeSystem = $theCodeSystem][not(@codeSystemVersion) or @codeSystemVersion=$theCodeSystemVersion] or completeCodeSystem[@codeSystem=$theCodeSystem][not(@codeSystemVersion) or @codeSystemVersion=$theCodeSystemVersion]])">(eMedikationRezept): Der Elementinhalt MUSS einer von 'ELGA_MedikationRezeptart (DYNAMIC)' sein.</assert>
      <let name="theNullFlavor" value="@nullFlavor"/>
      <let name="validNullFlavorsFound"
           value="exists(doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/exception[@code = $theNullFlavor][@codeSystem = '2.16.840.1.113883.5.1008'])"/>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.html"
              test="not(@nullFlavor) or $validNullFlavorsFound">(eMedikationRezept): Der fehlende Wert '<value-of select="@nullFlavor"/>' für @code MUSS gewählt werden aus dem Set gültiger null flavors für dieses Attribut oder denen assoziiert mit Value Set ELGA_MedikationRezeptart (DYNAMIC).</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.8.1
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:documentationOf[hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]]]/hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]]/hl7:effectiveTime[not(@nullFlavor)]
Item: (eMedikationRezept)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:documentationOf[hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]]]/hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]]/hl7:effectiveTime[not(@nullFlavor)]"
         id="tmp-r-9992b35e-29e3-4dd2-8966-dadece42321f">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='IVL_TS' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(eMedikationRezept): Wenn eine @xsi:type Instruktion anwesend ist MUSS diese den Wert "{urn:hl7-org:v3}:IVL_TS" 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="IVL_TS"/>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.html"
              test="string-length(hl7:low/@value)&lt;=8 and string-length(hl7:high/@value)&lt;=8">(eMedikationRezept): Datumsangaben für Beginn- und Ende des Gültigkeitszeitraums sind immer ohne Zeitangabe vorzunehmen (z.B. „20141224“ für den 24.12.2014).</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.html"
              test="count(hl7:low)&gt;=1 and not(hl7:low/@nullFlavor)">(eMedikationRezept): Element hl7:low ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.html"
              test="count(hl7:low)&lt;=1">(eMedikationRezept): Element hl7:low 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.8.1-2014-01-31T000000.html"
              test="count(hl7:high)&gt;=1 and not(hl7:high/@nullFlavor)">(eMedikationRezept): Element hl7:high ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.html"
              test="count(hl7:high)&lt;=1">(eMedikationRezept): Element hl7:high kommt zu häufig vor [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.8.1
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:documentationOf[hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]]]/hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]]/hl7:effectiveTime[not(@nullFlavor)]/hl7:low
Item: (eMedikationRezept)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:documentationOf[hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]]]/hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]]/hl7:effectiveTime[not(@nullFlavor)]/hl7:low"
         id="tmp-r-d0419810-32db-4dc5-86c9-1a260bcc632c">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='TS' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(eMedikationRezept): Wenn eine @xsi:type Instruktion anwesend ist MUSS diese den Wert "{urn:hl7-org:v3}:TS" 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="TS"/>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.8.1
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:documentationOf[hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]]]/hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]]/hl7:effectiveTime[not(@nullFlavor)]/hl7:high
Item: (eMedikationRezept)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:documentationOf[hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]]]/hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]]/hl7:effectiveTime[not(@nullFlavor)]/hl7:high"
         id="tmp-r-fd383e52-b179-4862-8e20-4c70643f4e65">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='TS' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(eMedikationRezept): Wenn eine @xsi:type Instruktion anwesend ist MUSS diese den Wert "{urn:hl7-org:v3}:TS" 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="TS"/>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.8.1
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:documentationOf[hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]]]/hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]]/hl7:effectiveTime[@nullFlavor]
Item: (eMedikationRezept)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:documentationOf[hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]]]/hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]]/hl7:effectiveTime[@nullFlavor]"
         id="tmp-r-ac2f41ea-332b-425c-a0eb-501b4f6c9bef">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='IVL_TS' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(eMedikationRezept): Wenn eine @xsi:type Instruktion anwesend ist MUSS diese den Wert "{urn:hl7-org:v3}:IVL_TS" 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="IVL_TS"/>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.html"
              test="string(@nullFlavor)=('MSK')">(eMedikationRezept): Der Wert von @nullFlavor MUSS 'MSK' sein.</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.8.1
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:documentationOf[hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]]]/hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.68-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]]/hl7:performer
Item: (eMedikationRezept)
-->

   <!--
Template derived rules for ID: 1.2.40.0.34.11.20011
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:relatedDocument
Item: (HeaderRelatedDocument)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:relatedDocument"
         id="tmp-r-9ec01304-d273-4b3d-850c-5e5274f7e1c7">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20011-2014-12-06T000000.html"
              test="string(@typeCode)=('RPLC')">(HeaderRelatedDocument): Der Wert von @typeCode MUSS 'RPLC' sein.</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20011-2014-12-06T000000.html"
              test="count(hl7:parentDocument)&gt;=1 and not(hl7:parentDocument/@nullFlavor)">(HeaderRelatedDocument): Element hl7:parentDocument ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20011-2014-12-06T000000.html"
              test="count(hl7:parentDocument)&lt;=1">(HeaderRelatedDocument): Element hl7:parentDocument kommt zu häufig vor [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.20011
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:relatedDocument/hl7:parentDocument
Item: (HeaderRelatedDocument)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:relatedDocument/hl7:parentDocument"
         id="tmp-r-9325dea7-4ec1-478a-be23-ccdd24bb4e5f">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20011-2014-12-06T000000.html"
              test="string(@classCode)=('DOCCLIN') or not(@classCode)">(HeaderRelatedDocument): Der Wert von @classCode MUSS 'DOCCLIN' sein.</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20011-2014-12-06T000000.html"
              test="string(@moodCode)=('EVN') or not(@moodCode)">(HeaderRelatedDocument): Der Wert von @moodCode MUSS 'EVN' sein.</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20011-2014-12-06T000000.html"
              test="count(hl7:id)&gt;=1 and not(hl7:id/@nullFlavor)">(HeaderRelatedDocument): Element hl7:id ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20011-2014-12-06T000000.html"
              test="count(hl7:id)&lt;=1">(HeaderRelatedDocument): Element hl7:id kommt zu häufig vor [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.20011
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:relatedDocument/hl7:parentDocument/hl7:id
Item: (HeaderRelatedDocument)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:relatedDocument/hl7:parentDocument/hl7:id"
         id="tmp-r-071e0146-9487-4e43-b7ec-5518ec181298">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.20011-2014-12-06T000000.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)">(HeaderRelatedDocument): 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"/>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.8.1
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:authorization
Item: (eMedikationRezept)
-->

   <!--
Template derived rules for ID: 1.2.40.0.34.11.8.1
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:componentOf
Item: (eMedikationRezept)
-->

   <!--
Template derived rules for ID: 1.2.40.0.34.11.8.1
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:component
Item: (eMedikationRezept)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:component"
         id="tmp-r-e2d7309f-e24c-48cb-9a6d-3ea97979d144">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.html"
              test="string(@typeCode)=('COMP') or not(@typeCode)">(eMedikationRezept): Der Wert von @typeCode MUSS 'COMP' sein.</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.html"
              test="string(@contextConductionInd)=('true') or not(@contextConductionInd)">(eMedikationRezept): Der Wert von @contextConductionInd MUSS 'true' sein.</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.8.1
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:component/hl7:structuredBody
Item: (eMedikationRezept)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:component/hl7:structuredBody"
         id="tmp-r-ea5c4c95-8e69-4c76-bf0c-da9e11e61327">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.html"
              test="string(@classCode)=('DOCBODY') or not(@classCode)">(eMedikationRezept): Der Wert von @classCode MUSS 'DOCBODY' sein.</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.html"
              test="string(@moodCode)=('EVN') or not(@moodCode)">(eMedikationRezept): Der Wert von @moodCode MUSS 'EVN' sein.</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.html"
              test="count(hl7:component[hl7:section[hl7:templateId/@root='1.2.40.0.34.11.8.1.2.1' and hl7:templateId/@root='1.3.6.1.4.1.19376.1.9.1.2.1' and hl7:templateId/@root='1.3.6.1.4.1.19376.1.5.3.1.3.19' and hl7:templateId/@root='2.16.840.1.113883.10.20.1.8']])&gt;=1 ">(eMedikationRezept): Element hl7:component[hl7:section[hl7:templateId/@root='1.2.40.0.34.11.8.1.2.1' and hl7:templateId/@root='1.3.6.1.4.1.19376.1.9.1.2.1' and hl7:templateId/@root='1.3.6.1.4.1.19376.1.5.3.1.3.19' and hl7:templateId/@root='2.16.840.1.113883.10.20.1.8']] ist required [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.html"
              test="count(hl7:component[hl7:section[hl7:templateId/@root='1.2.40.0.34.11.8.1.2.1' and hl7:templateId/@root='1.3.6.1.4.1.19376.1.9.1.2.1' and hl7:templateId/@root='1.3.6.1.4.1.19376.1.5.3.1.3.19' and hl7:templateId/@root='2.16.840.1.113883.10.20.1.8']])&lt;=1">(eMedikationRezept): Element hl7:component[hl7:section[hl7:templateId/@root='1.2.40.0.34.11.8.1.2.1' and hl7:templateId/@root='1.3.6.1.4.1.19376.1.9.1.2.1' and hl7:templateId/@root='1.3.6.1.4.1.19376.1.5.3.1.3.19' and hl7:templateId/@root='2.16.840.1.113883.10.20.1.8']] kommt zu häufig vor [max 1x].</assert>
   </rule>

   <!--
Template derived rules for ID: 1.2.40.0.34.11.8.1
Context: *[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:component/hl7:structuredBody/hl7:component[hl7:section[hl7:templateId/@root='1.2.40.0.34.11.8.1.2.1' and hl7:templateId/@root='1.3.6.1.4.1.19376.1.9.1.2.1' and hl7:templateId/@root='1.3.6.1.4.1.19376.1.5.3.1.3.19' and hl7:templateId/@root='2.16.840.1.113883.10.20.1.8']]
Item: (eMedikationRezept)
-->
   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.8.1']/hl7:component/hl7:structuredBody/hl7:component[hl7:section[hl7:templateId/@root='1.2.40.0.34.11.8.1.2.1' and hl7:templateId/@root='1.3.6.1.4.1.19376.1.9.1.2.1' and hl7:templateId/@root='1.3.6.1.4.1.19376.1.5.3.1.3.19' and hl7:templateId/@root='2.16.840.1.113883.10.20.1.8']]">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.html"
              test="string(@typeCode)=('COMP') or not(@typeCode)">(eMedikationRezept): Der Wert von @typeCode MUSS 'COMP' sein.</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.8.1-2014-01-31T000000.html"
              test="string(@contextConductionInd)=('true') or not(@contextConductionInd)">(eMedikationRezept): Der Wert von @contextConductionInd MUSS 'true' sein.</assert>
   </rule>
</pattern>
