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

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.4']"
         id="tmp-r-01726e7c-921d-4021-82a5-02b0696096ed">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.4-2013-07-19T000000.html"
              test="count(hl7:templateId[@root='1.2.40.0.34.11.4'])&gt;=1 ">(Laborbefund): Element hl7:templateId[@root='1.2.40.0.34.11.4'] ist required [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.4-2013-07-19T000000.html"
              test="count(hl7:templateId[@root='1.2.40.0.34.11.4'])&lt;=1">(Laborbefund): Element hl7:templateId[@root='1.2.40.0.34.11.4'] 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.4-2013-07-19T000000.html"
              test="count(hl7:code[(@code='11502-2' and @codeSystem='2.16.840.1.113883.6.1')])&gt;=1 and not(hl7:code[(@code='11502-2' and @codeSystem='2.16.840.1.113883.6.1')]/@nullFlavor)">(Laborbefund): Element hl7:code[(@code='11502-2' 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.4-2013-07-19T000000.html"
              test="count(hl7:code[(@code='11502-2' and @codeSystem='2.16.840.1.113883.6.1')])&lt;=1">(Laborbefund): Element hl7:code[(@code='11502-2' 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.4-2013-07-19T000000.html"
              test="count(hl7:title)&gt;=1 and not(hl7:title/@nullFlavor)">(Laborbefund): 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.4-2013-07-19T000000.html"
              test="count(hl7:title)&lt;=1">(Laborbefund): 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.4-2013-07-19T000000.html"
              test="count(hl7:legalAuthenticator)&gt;=1 ">(Laborbefund): Element hl7:legalAuthenticator ist required [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.4-2013-07-19T000000.html"
              test="count(hl7:legalAuthenticator)&lt;=1">(Laborbefund): 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.4-2013-07-19T000000.html"
              test="count(hl7:participant[@typeCode='REF'])&gt;=1 and not(hl7:participant[@typeCode='REF']/@nullFlavor)">(Laborbefund): Element hl7:participant[@typeCode='REF'] ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.4-2013-07-19T000000.html"
              test="count(hl7:participant[@typeCode='REF'])&lt;=1">(Laborbefund): Element hl7:participant[@typeCode='REF'] kommt zu häufig vor [max 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.4-2013-07-19T000000.html"
              test="count(hl7:documentationOf[hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.22-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.22-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.22-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.22-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]]]/@nullFlavor)">(Laborbefund): Element hl7:documentationOf[hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.22-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.22-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.4-2013-07-19T000000.html"
              test="count(hl7:componentOf)=0">(Laborbefund): Element hl7:componentOf DARF NICHT vorkommen.</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.4
Context: *[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:templateId[@root='1.2.40.0.34.11.4']
Item: (Laborbefund)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:templateId[@root='1.2.40.0.34.11.4']"
         id="tmp-r-4eb1af97-5119-4656-a928-177536996d46">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.4-2013-07-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)">(Laborbefund): 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.4-2013-07-19T000000.html"
              test="string(@root)=('1.2.40.0.34.11.4')">(Laborbefund): Der Wert von @root MUSS '1.2.40.0.34.11.4' sein.</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.4
Context: *[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:code[(@code='11502-2' and @codeSystem='2.16.840.1.113883.6.1')]
Item: (Laborbefund)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:code[(@code='11502-2' and @codeSystem='2.16.840.1.113883.6.1')]"
         id="tmp-r-06012e5c-92a2-4aca-8f07-a8bf9822c730">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.4-2013-07-19T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='CE' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(Laborbefund): 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.4-2013-07-19T000000.html"
              test="@nullFlavor or (@code='11502-2' and @codeSystem='2.16.840.1.113883.6.1' and @displayName='LABORATORY REPORT.TOTAL')">(Laborbefund): Der Elementinhalt MUSS einer von 'code '11502-2' codeSystem '2.16.840.1.113883.6.1' displayName='LABORATORY REPORT.TOTAL'' sein.</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.4
Context: *[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:title
Item: (Laborbefund)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:title"
         id="tmp-r-2bda70bb-f4f7-4977-8adc-2da9a3e9d444">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.4-2013-07-19T000000.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)">(Laborbefund): 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"/>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.4
Context: *[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:informationRecipient[hl7:templateId/@root='1.3.6.1.4.1.19376.1.3.3.1.4']
Item: (Laborbefund)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:informationRecipient[hl7:templateId/@root='1.3.6.1.4.1.19376.1.3.3.1.4']"
         id="tmp-r-3e277f9a-d16b-4da2-95be-5d0b149f5bc6">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.4-2013-07-19T000000.html"
              test="count(hl7:templateId[@root='1.3.6.1.4.1.19376.1.3.3.1.4'])&gt;=1 ">(Laborbefund): Element hl7:templateId[@root='1.3.6.1.4.1.19376.1.3.3.1.4'] ist required [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.4-2013-07-19T000000.html"
              test="count(hl7:templateId[@root='1.3.6.1.4.1.19376.1.3.3.1.4'])&lt;=1">(Laborbefund): Element hl7:templateId[@root='1.3.6.1.4.1.19376.1.3.3.1.4'] kommt zu häufig vor [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.4
Context: *[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:informationRecipient[hl7:templateId/@root='1.3.6.1.4.1.19376.1.3.3.1.4']/hl7:templateId[@root='1.3.6.1.4.1.19376.1.3.3.1.4']
Item: (Laborbefund)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:informationRecipient[hl7:templateId/@root='1.3.6.1.4.1.19376.1.3.3.1.4']/hl7:templateId[@root='1.3.6.1.4.1.19376.1.3.3.1.4']"
         id="tmp-r-96bd1487-d45e-4894-8a27-73645c07b374">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.4-2013-07-19T000000.html"
              test="string(@root)=('1.3.6.1.4.1.19376.1.3.3.1.4')">(Laborbefund): Der Wert von @root MUSS '1.3.6.1.4.1.19376.1.3.3.1.4' sein.</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.4
Context: *[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:authenticator[hl7:templateId/@root='1.3.6.1.4.1.19376.1.3.3.1.5']
Item: (Laborbefund)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:authenticator[hl7:templateId/@root='1.3.6.1.4.1.19376.1.3.3.1.5']"
         id="tmp-r-3f67a381-dfbb-425d-8e05-935172788454">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.4-2013-07-19T000000.html"
              test="count(hl7:templateId[@root='1.3.6.1.4.1.19376.1.3.3.1.5'])&gt;=1 ">(Laborbefund): Element hl7:templateId[@root='1.3.6.1.4.1.19376.1.3.3.1.5'] ist required [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.4-2013-07-19T000000.html"
              test="count(hl7:templateId[@root='1.3.6.1.4.1.19376.1.3.3.1.5'])&lt;=1">(Laborbefund): Element hl7:templateId[@root='1.3.6.1.4.1.19376.1.3.3.1.5'] kommt zu häufig vor [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.4
Context: *[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:authenticator[hl7:templateId/@root='1.3.6.1.4.1.19376.1.3.3.1.5']/hl7:templateId[@root='1.3.6.1.4.1.19376.1.3.3.1.5']
Item: (Laborbefund)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:authenticator[hl7:templateId/@root='1.3.6.1.4.1.19376.1.3.3.1.5']/hl7:templateId[@root='1.3.6.1.4.1.19376.1.3.3.1.5']"
         id="tmp-r-fdbeaad7-4f9c-4141-aad4-b6fc88525b65">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.4-2013-07-19T000000.html"
              test="string(@root)=('1.3.6.1.4.1.19376.1.3.3.1.5')">(Laborbefund): Der Wert von @root MUSS '1.3.6.1.4.1.19376.1.3.3.1.5' sein.</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.4
Context: *[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:legalAuthenticator
Item: (Laborbefund)
-->

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

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:participant[@typeCode='REF']"
         id="tmp-r-309f26ba-670b-4ad4-8266-167d8f3d6cb8">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.4-2013-07-19T000000.html"
              test="string(@typeCode)=('REF')">(Laborbefund): Der Wert von @typeCode MUSS 'REF' sein.</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.4-2013-07-19T000000.html"
              test="count(hl7:time)&gt;=1 ">(Laborbefund): 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.4-2013-07-19T000000.html"
              test="count(hl7:time)&lt;=1">(Laborbefund): 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.4-2013-07-19T000000.html"
              test="count(hl7:associatedEntity)&gt;=1 and not(hl7:associatedEntity/@nullFlavor)">(Laborbefund): Element hl7:associatedEntity ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.4-2013-07-19T000000.html"
              test="count(hl7:associatedEntity)&lt;=1">(Laborbefund): Element hl7:associatedEntity kommt zu häufig vor [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.4
Context: *[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:participant[@typeCode='REF']/hl7:time
Item: (Laborbefund)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:participant[@typeCode='REF']/hl7:time"
         id="tmp-r-7bd155df-dc71-4b19-863e-19138126bbb5">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.4-2013-07-19T000000.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)">(Laborbefund): 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"/>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.4
Context: *[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:participant[@typeCode='REF']/hl7:associatedEntity
Item: (Laborbefund)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:participant[@typeCode='REF']/hl7:associatedEntity"
         id="tmp-r-e4d2ffd0-6a1d-466e-b5b9-840770d39f47">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.4-2013-07-19T000000.html"
              test="string(@classCode)=('PROV')">(Laborbefund): Der Wert von @classCode MUSS 'PROV' sein.</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.4-2013-07-19T000000.html"
              test="count(hl7:templateId[@root='1.3.6.1.4.1.19376.1.3.3.1.6'])&lt;=1">(Laborbefund): Element hl7:templateId[@root='1.3.6.1.4.1.19376.1.3.3.1.6'] 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.4-2013-07-19T000000.html"
              test="count(hl7:id)&gt;=1 and not(hl7:id/@nullFlavor)">(Laborbefund): 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.4-2013-07-19T000000.html"
              test="count(hl7:id)&lt;=1">(Laborbefund): 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.4-2013-07-19T000000.html"
              test="count(hl7:addr)&gt;=1 ">(Laborbefund): Element hl7:addr ist required [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.4-2013-07-19T000000.html"
              test="count(hl7:addr)&lt;=1">(Laborbefund): 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.4-2013-07-19T000000.html"
              test="count(hl7:telecom)&gt;=1 and not(hl7:telecom/@nullFlavor)">(Laborbefund): Element hl7:telecom ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.4-2013-07-19T000000.html"
              test="count(hl7:associatedPerson)&gt;=1 and not(hl7:associatedPerson/@nullFlavor)">(Laborbefund): Element hl7:associatedPerson ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.4-2013-07-19T000000.html"
              test="count(hl7:associatedPerson)&lt;=1">(Laborbefund): Element hl7:associatedPerson 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.4-2013-07-19T000000.html"
              test="count(hl7:scopingOrganization)&lt;=1">(Laborbefund): Element hl7:scopingOrganization kommt zu häufig vor [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.4
Context: *[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:participant[@typeCode='REF']/hl7:associatedEntity/hl7:templateId[@root='1.3.6.1.4.1.19376.1.3.3.1.6']
Item: (Laborbefund)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:participant[@typeCode='REF']/hl7:associatedEntity/hl7:templateId[@root='1.3.6.1.4.1.19376.1.3.3.1.6']"
         id="tmp-r-394f13c2-30e8-43a0-9cfa-5deb681f0e9e">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.4-2013-07-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)">(Laborbefund): 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.4-2013-07-19T000000.html"
              test="string(@root)=('1.3.6.1.4.1.19376.1.3.3.1.6')">(Laborbefund): Der Wert von @root MUSS '1.3.6.1.4.1.19376.1.3.3.1.6' sein.</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.4
Context: *[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:participant[@typeCode='REF']/hl7:associatedEntity/hl7:id
Item: (Laborbefund)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:participant[@typeCode='REF']/hl7:associatedEntity/hl7:id"
         id="tmp-r-c8c71d2b-54e4-4b83-872e-ef76e6dde87d">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.4-2013-07-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)">(Laborbefund): 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.4
Context: *[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:participant[@typeCode='REF']/hl7:associatedEntity/hl7:addr
Item: (Laborbefund)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:participant[@typeCode='REF']/hl7:associatedEntity/hl7:addr"
         id="tmp-r-a800e5be-119f-4ba9-a4b8-8b01270d7dd5">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.4-2013-07-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)">(Laborbefund): 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.4
Context: *[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:participant[@typeCode='REF']/hl7:associatedEntity/hl7:telecom
Item: (Laborbefund)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:participant[@typeCode='REF']/hl7:associatedEntity/hl7:telecom"
         id="tmp-r-729dc4ed-164d-448d-a64e-b04fac04bc98">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.4-2013-07-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)">(Laborbefund): 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.4
Context: *[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:participant[@typeCode='REF']/hl7:associatedEntity/hl7:associatedPerson
Item: (Laborbefund)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:participant[@typeCode='REF']/hl7:associatedEntity/hl7:associatedPerson"
         id="tmp-r-032a7d8d-f208-42c7-bfc5-42d77e412701">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.4-2013-07-19T000000.html"
              test="string(@classCode)=('PSN') or not(@classCode)">(Laborbefund): 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.4-2013-07-19T000000.html"
              test="string(@determinerCode)=('INSTANCE') or not(@determinerCode)">(Laborbefund): 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.4-2013-07-19T000000.html"
              test="count(hl7:name)&gt;=1 and not(hl7:name/@nullFlavor)">(Laborbefund): 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.4-2013-07-19T000000.html"
              test="count(hl7:name)&lt;=1">(Laborbefund): 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.4']/hl7:participant[@typeCode='REF']/hl7:associatedEntity/hl7:associatedPerson/hl7:name
Item: (PersonElements)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:participant[@typeCode='REF']/hl7:associatedEntity/hl7:associatedPerson/hl7:name"
         id="tmp-r-18587f9e-80c3-4d31-bf77-c49b81a6b673">
      <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.4
Context: *[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:participant[@typeCode='REF']/hl7:associatedEntity/hl7:scopingOrganization
Item: (Laborbefund)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:participant[@typeCode='REF']/hl7:associatedEntity/hl7:scopingOrganization"
         id="tmp-r-c24f4f4b-5fcc-4398-a179-c7b359cfa8a6">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.4-2013-07-19T000000.html"
              test="string(@classCode)=('ORG') or not(@classCode)">(Laborbefund): 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.4-2013-07-19T000000.html"
              test="string(@determinerCode)=('INSTANCE') or not(@determinerCode)">(Laborbefund): 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.4-2013-07-19T000000.html"
              test="count(hl7:name)&gt;=1 and not(hl7:name/@nullFlavor)">(Laborbefund): 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.4-2013-07-19T000000.html"
              test="count(hl7:name)&lt;=1">(Laborbefund): 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.4-2013-07-19T000000.html"
              test="count(hl7:addr)&lt;=1">(Laborbefund): 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.4']/hl7:participant[@typeCode='REF']/hl7:associatedEntity/hl7:scopingOrganization/hl7:id
Item: (OrganizationElements)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:participant[@typeCode='REF']/hl7:associatedEntity/hl7:scopingOrganization/hl7:id"
         id="tmp-r-314cba63-c932-4edb-aaaf-7b888e60b155">
      <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.4']/hl7:participant[@typeCode='REF']/hl7:associatedEntity/hl7:scopingOrganization/hl7:name
Item: (OrganizationElements)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:participant[@typeCode='REF']/hl7:associatedEntity/hl7:scopingOrganization/hl7:name"
         id="tmp-r-3f06e524-2cc7-4992-8f20-b8a0b6ac2c3b">
      <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.4']/hl7:participant[@typeCode='REF']/hl7:associatedEntity/hl7:scopingOrganization/hl7:telecom
Item: (OrganizationElements)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:participant[@typeCode='REF']/hl7:associatedEntity/hl7:scopingOrganization/hl7:telecom"
         id="tmp-r-ed867894-f794-4c5a-8c6f-04298cbbc186">
      <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.4']/hl7:participant[@typeCode='REF']/hl7:associatedEntity/hl7:scopingOrganization/hl7:addr
Item: (OrganizationElements)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:participant[@typeCode='REF']/hl7:associatedEntity/hl7:scopingOrganization/hl7:addr"
         id="tmp-r-1928b5eb-e01f-4d29-88ed-bf7d32991c2c">
      <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.4
Context: *[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:documentationOf[hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.22-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.22-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]]]
Item: (Laborbefund)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:documentationOf[hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.22-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.22-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]]]"
         id="tmp-r-ed75f970-084b-4056-96ea-a86e19536702">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.4-2013-07-19T000000.html"
              test="count(hl7:serviceEvent[hl7:performer[hl7:templateId/@root='1.3.6.1.4.1.19376.1.3.3.1.7']])&gt;=1 and not(hl7:serviceEvent[hl7:performer[hl7:templateId/@root='1.3.6.1.4.1.19376.1.3.3.1.7']]/@nullFlavor)">(Laborbefund): Element hl7:serviceEvent[hl7:performer[hl7:templateId/@root='1.3.6.1.4.1.19376.1.3.3.1.7']] ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.4-2013-07-19T000000.html"
              test="count(hl7:serviceEvent[hl7:performer[hl7:templateId/@root='1.3.6.1.4.1.19376.1.3.3.1.7']])&lt;=1">(Laborbefund): Element hl7:serviceEvent[hl7:performer[hl7:templateId/@root='1.3.6.1.4.1.19376.1.3.3.1.7']] kommt zu häufig vor [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.4
Context: *[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:documentationOf[hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.22-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.22-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]]]/hl7:serviceEvent[hl7:performer[hl7:templateId/@root='1.3.6.1.4.1.19376.1.3.3.1.7']]
Item: (Laborbefund)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:documentationOf[hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.22-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.22-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]]]/hl7:serviceEvent[hl7:performer[hl7:templateId/@root='1.3.6.1.4.1.19376.1.3.3.1.7']]"
         id="tmp-r-a2b7e1dc-ae9c-46aa-a43c-44df4ff14379">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.4-2013-07-19T000000.html"
              test="count(hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.22-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.22-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor])&gt;=1 ">(Laborbefund): Element hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.22-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.22-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.4-2013-07-19T000000.html"
              test="count(hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.22-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.22-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor])&lt;=1">(Laborbefund): Element hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.22-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.22-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.4-2013-07-19T000000.html"
              test="count(hl7:effectiveTime)&gt;=1 and not(hl7:effectiveTime/@nullFlavor)">(Laborbefund): 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.4-2013-07-19T000000.html"
              test="count(hl7:effectiveTime)&lt;=1">(Laborbefund): Element hl7:effectiveTime kommt zu häufig vor [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.4
Context: *[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:documentationOf[hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.22-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.22-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]]]/hl7:serviceEvent[hl7:performer[hl7:templateId/@root='1.3.6.1.4.1.19376.1.3.3.1.7']]/hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.22-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.22-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]
Item: (Laborbefund)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:documentationOf[hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.22-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.22-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]]]/hl7:serviceEvent[hl7:performer[hl7:templateId/@root='1.3.6.1.4.1.19376.1.3.3.1.7']]/hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.22-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.22-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]"
         id="tmp-r-12602547-9c2f-4d21-a4a5-e81bca6fedce">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.4-2013-07-19T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='CE' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(Laborbefund): 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.4-2013-07-19T000000.html"
              test="@nullFlavor or exists(doc('include/voc-1.2.40.0.34.10.22-DYNAMIC.xml')/*/valueSet[conceptList/concept[@code = $theCode][@codeSystem = $theCodeSystem][not(@codeSystemVersion) or @codeSystemVersion=$theCodeSystemVersion] or completeCodeSystem[@codeSystem=$theCodeSystem][not(@codeSystemVersion) or @codeSystemVersion=$theCodeSystemVersion]])">(Laborbefund): Der Elementinhalt MUSS einer von '1.2.40.0.34.10.22 ELGA_ServiceEventsLabor (DYNAMIC)' sein.</assert>
      <let name="theNullFlavor" value="@nullFlavor"/>
      <let name="validNullFlavorsFound"
           value="exists(doc('include/voc-1.2.40.0.34.10.22-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.4-2013-07-19T000000.html"
              test="not(@nullFlavor) or $validNullFlavorsFound">(Laborbefund): 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 1.2.40.0.34.10.22 ELGA_ServiceEventsLabor (DYNAMIC).</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.4
Context: *[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:documentationOf[hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.22-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.22-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]]]/hl7:serviceEvent[hl7:performer[hl7:templateId/@root='1.3.6.1.4.1.19376.1.3.3.1.7']]/hl7:effectiveTime
Item: (Laborbefund)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:documentationOf[hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.22-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.22-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]]]/hl7:serviceEvent[hl7:performer[hl7:templateId/@root='1.3.6.1.4.1.19376.1.3.3.1.7']]/hl7:effectiveTime"
         id="tmp-r-6d9b336e-2718-4be3-b9b1-e0e025407298">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.4-2013-07-19T000000.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)">(Laborbefund): 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.4-2013-07-19T000000.html"
              test="count(hl7:low)&gt;=1 and not(hl7:low/@nullFlavor)">(Laborbefund): 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.4-2013-07-19T000000.html"
              test="count(hl7:low)&lt;=1">(Laborbefund): 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.4-2013-07-19T000000.html"
              test="count(hl7:high)&gt;=1 and not(hl7:high/@nullFlavor)">(Laborbefund): 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.4-2013-07-19T000000.html"
              test="count(hl7:high)&lt;=1">(Laborbefund): Element hl7:high kommt zu häufig vor [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.4
Context: *[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:documentationOf[hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.22-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.22-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]]]/hl7:serviceEvent[hl7:performer[hl7:templateId/@root='1.3.6.1.4.1.19376.1.3.3.1.7']]/hl7:effectiveTime/hl7:low
Item: (Laborbefund)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:documentationOf[hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.22-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.22-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]]]/hl7:serviceEvent[hl7:performer[hl7:templateId/@root='1.3.6.1.4.1.19376.1.3.3.1.7']]/hl7:effectiveTime/hl7:low"
         id="tmp-r-efa09ad1-e4c3-4bd8-91fb-848a3724a6c9">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.4-2013-07-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)">(Laborbefund): 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.4
Context: *[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:documentationOf[hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.22-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.22-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]]]/hl7:serviceEvent[hl7:performer[hl7:templateId/@root='1.3.6.1.4.1.19376.1.3.3.1.7']]/hl7:effectiveTime/hl7:high
Item: (Laborbefund)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:documentationOf[hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.22-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.22-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]]]/hl7:serviceEvent[hl7:performer[hl7:templateId/@root='1.3.6.1.4.1.19376.1.3.3.1.7']]/hl7:effectiveTime/hl7:high"
         id="tmp-r-2da86729-f382-474f-8f15-cde3ca8327c0">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.4-2013-07-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)">(Laborbefund): 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.4
Context: *[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:documentationOf[hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.22-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.22-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]]]/hl7:serviceEvent[hl7:performer[hl7:templateId/@root='1.3.6.1.4.1.19376.1.3.3.1.7']]/hl7:performer[hl7:templateId/@root='1.3.6.1.4.1.19376.1.3.3.1.7']
Item: (Laborbefund)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:documentationOf[hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.22-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.22-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]]]/hl7:serviceEvent[hl7:performer[hl7:templateId/@root='1.3.6.1.4.1.19376.1.3.3.1.7']]/hl7:performer[hl7:templateId/@root='1.3.6.1.4.1.19376.1.3.3.1.7']"
         id="tmp-r-bee3331f-ccbe-4682-bd26-88e4e9f0a9ae">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.4-2013-07-19T000000.html"
              test="count(hl7:templateId[@root='1.3.6.1.4.1.19376.1.3.3.1.7'])&gt;=1 and not(hl7:templateId[@root='1.3.6.1.4.1.19376.1.3.3.1.7']/@nullFlavor)">(Laborbefund): Element hl7:templateId[@root='1.3.6.1.4.1.19376.1.3.3.1.7'] ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.4-2013-07-19T000000.html"
              test="count(hl7:templateId[@root='1.3.6.1.4.1.19376.1.3.3.1.7'])&lt;=1">(Laborbefund): Element hl7:templateId[@root='1.3.6.1.4.1.19376.1.3.3.1.7'] kommt zu häufig vor [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.4
Context: *[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:documentationOf[hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.22-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.22-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]]]/hl7:serviceEvent[hl7:performer[hl7:templateId/@root='1.3.6.1.4.1.19376.1.3.3.1.7']]/hl7:performer[hl7:templateId/@root='1.3.6.1.4.1.19376.1.3.3.1.7']/hl7:templateId[@root='1.3.6.1.4.1.19376.1.3.3.1.7']
Item: (Laborbefund)
-->

   <rule context="*[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:documentationOf[hl7:serviceEvent[hl7:code[concat(@code,@codeSystem)=doc('include/voc-1.2.40.0.34.10.22-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-1.2.40.0.34.10.22-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]]]/hl7:serviceEvent[hl7:performer[hl7:templateId/@root='1.3.6.1.4.1.19376.1.3.3.1.7']]/hl7:performer[hl7:templateId/@root='1.3.6.1.4.1.19376.1.3.3.1.7']/hl7:templateId[@root='1.3.6.1.4.1.19376.1.3.3.1.7']"
         id="tmp-r-2d9fcd35-9a22-463e-89ad-b020ed1dc0a6">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.4-2013-07-19T000000.html"
              test="string(@root)=('1.3.6.1.4.1.19376.1.3.3.1.7')">(Laborbefund): Der Wert von @root MUSS '1.3.6.1.4.1.19376.1.3.3.1.7' sein.</assert>
   </rule>
   <!--
Template derived rules for ID: 1.2.40.0.34.11.4
Context: *[hl7:templateId/@root='1.2.40.0.34.11.4']/hl7:componentOf
Item: (Laborbefund)
-->
</pattern>
