<?xml version="1.0" encoding="UTF-8"?>
<!--
Template derived pattern
===========================================
ID: 2.16.840.1.113883.10.20.6.2.6
Name: Study Act
Description: 
-->
<pattern xmlns="http://purl.oclc.org/dsdl/schematron"
         id="template-2.16.840.1.113883.10.20.6.2.6-2013-10-03T000000">
   <title>Study Act</title>
   <!--
Template derived rules for ID: 2.16.840.1.113883.10.20.6.2.6
Context: *[hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']]
Item: (StudyAct)
-->

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

   <rule context="*[hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']]/hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']"
         id="tmp-r-09986b47-f0f0-4ea3-8731-75fc9a39df60">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-2.16.840.1.113883.10.20.6.2.6-2013-10-03T000000.html"
              test="string(@classCode)=('ACT')">(StudyAct): Der Wert von @classCode MUSS 'ACT' sein.</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-2.16.840.1.113883.10.20.6.2.6-2013-10-03T000000.html"
              test="string(@moodCode)=('EVN')">(StudyAct): Der Wert von @moodCode MUSS 'EVN' sein.</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-2.16.840.1.113883.10.20.6.2.6-2013-10-03T000000.html"
              test="count(hl7:templateId[@root='2.16.840.1.113883.10.20.6.2.6'])&gt;=1 ">(StudyAct): Element hl7:templateId[@root='2.16.840.1.113883.10.20.6.2.6'] ist required [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-2.16.840.1.113883.10.20.6.2.6-2013-10-03T000000.html"
              test="count(hl7:templateId[@root='2.16.840.1.113883.10.20.6.2.6'])&lt;=1">(StudyAct): Element hl7:templateId[@root='2.16.840.1.113883.10.20.6.2.6'] kommt zu häufig vor [max 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-2.16.840.1.113883.10.20.6.2.6-2013-10-03T000000.html"
              test="count(hl7:id)&gt;=1 ">(StudyAct): Element hl7:id ist required [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-2.16.840.1.113883.10.20.6.2.6-2013-10-03T000000.html"
              test="count(hl7:id)&lt;=1">(StudyAct): Element hl7:id kommt zu häufig vor [max 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-2.16.840.1.113883.10.20.6.2.6-2013-10-03T000000.html"
              test="count(hl7:code[(@code='113014' and @codeSystem='1.2.840.10008.2.16.4')])&gt;=1 and not(hl7:code[(@code='113014' and @codeSystem='1.2.840.10008.2.16.4')]/@nullFlavor)">(StudyAct): Element hl7:code[(@code='113014' and @codeSystem='1.2.840.10008.2.16.4')] ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-2.16.840.1.113883.10.20.6.2.6-2013-10-03T000000.html"
              test="count(hl7:code[(@code='113014' and @codeSystem='1.2.840.10008.2.16.4')])&lt;=1">(StudyAct): Element hl7:code[(@code='113014' and @codeSystem='1.2.840.10008.2.16.4')] kommt zu häufig vor [max 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-2.16.840.1.113883.10.20.6.2.6-2013-10-03T000000.html"
              test="count(hl7:text)&lt;=1">(StudyAct): Element hl7:text kommt zu häufig vor [max 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-2.16.840.1.113883.10.20.6.2.6-2013-10-03T000000.html"
              test="count(hl7:effectiveTime)&lt;=1">(StudyAct): Element hl7:effectiveTime kommt zu häufig vor [max 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-2.16.840.1.113883.10.20.6.2.6-2013-10-03T000000.html"
              test="count(hl7:entryRelationship[hl7:act[hl7:code[@code='113015']]])&gt;=1 and not(hl7:entryRelationship[hl7:act[hl7:code[@code='113015']]]/@nullFlavor)">(StudyAct): Element hl7:entryRelationship[hl7:act[hl7:code[@code='113015']]] ist mandatory [min 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.10.20.6.2.6
Context: *[hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']]/hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']/hl7:templateId[@root='2.16.840.1.113883.10.20.6.2.6']
Item: (StudyAct)
-->

   <rule context="*[hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']]/hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']/hl7:templateId[@root='2.16.840.1.113883.10.20.6.2.6']"
         id="tmp-r-ed196743-2a78-4e1e-b347-d3748c54eec5">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-2.16.840.1.113883.10.20.6.2.6-2013-10-03T000000.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)">(StudyAct): 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-2.16.840.1.113883.10.20.6.2.6-2013-10-03T000000.html"
              test="string(@root)=('2.16.840.1.113883.10.20.6.2.6')">(StudyAct): Der Wert von @root MUSS '2.16.840.1.113883.10.20.6.2.6' sein.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.10.20.6.2.6
Context: *[hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']]/hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']/hl7:id
Item: (StudyAct)
-->

   <rule context="*[hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']]/hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']/hl7:id"
         id="tmp-r-62738527-1072-46b8-aa2b-87207743a7a3">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-2.16.840.1.113883.10.20.6.2.6-2013-10-03T000000.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)">(StudyAct): 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-2.16.840.1.113883.10.20.6.2.6-2013-10-03T000000.html"
              test="@root">(StudyAct): Attribut @root MUSS vorkommen.</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-2.16.840.1.113883.10.20.6.2.6-2013-10-03T000000.html"
              test="not(@extension)">(StudyAct): Attribut @extension DARF NICHT vorkommen.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.10.20.6.2.6
Context: *[hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']]/hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']/hl7:code[(@code='113014' and @codeSystem='1.2.840.10008.2.16.4')]
Item: (StudyAct)
-->

   <rule context="*[hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']]/hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']/hl7:code[(@code='113014' and @codeSystem='1.2.840.10008.2.16.4')]"
         id="tmp-r-ecc80388-52f2-4ad7-aa29-5edf7d6c5338">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-2.16.840.1.113883.10.20.6.2.6-2013-10-03T000000.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)">(StudyAct): 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-2.16.840.1.113883.10.20.6.2.6-2013-10-03T000000.html"
              test="@nullFlavor or (@code='113014' and @codeSystem='1.2.840.10008.2.16.4' and @displayName='DICOM Study' and @codeSystemName='DCM')">(StudyAct): Der Elementinhalt MUSS einer von 'code '113014' codeSystem '1.2.840.10008.2.16.4' displayName='DICOM Study' codeSystemName='DCM'' sein.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.10.20.6.2.6
Context: *[hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']]/hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']/hl7:text
Item: (StudyAct)
-->

   <rule context="*[hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']]/hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']/hl7:text"
         id="tmp-r-13fd3f18-9e8f-4448-badd-65906c839637">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-2.16.840.1.113883.10.20.6.2.6-2013-10-03T000000.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)">(StudyAct): 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: 2.16.840.1.113883.10.20.6.2.6
Context: *[hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']]/hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']/hl7:effectiveTime
Item: (StudyAct)
-->

   <rule context="*[hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']]/hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']/hl7:effectiveTime"
         id="tmp-r-bb2c715a-2d37-45eb-9f5f-349b22b9fd10">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-2.16.840.1.113883.10.20.6.2.6-2013-10-03T000000.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)">(StudyAct): 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: 2.16.840.1.113883.10.20.6.2.6
Context: *[hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']]/hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']/hl7:entryRelationship[hl7:act[hl7:code[@code='113015']]]
Item: (StudyAct)
-->

   <!--
Template derived rules for ID: 1.2.40.0.34.11.30031
Context: *[hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']]/hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']/hl7:entryRelationship[hl7:act[hl7:code[@code='113015']]]
Item: (SeriesAct)
-->

   <!--
Template derived rules for ID: 1.2.40.0.34.11.30031
Context: *[hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']]/hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']/hl7:entryRelationship[hl7:act[hl7:code[@code='113015']]]/hl7:act[hl7:code[(@code='113015' and @codeSystem='1.2.840.10008.2.16.4')]]
Item: (SeriesAct)
-->
   <rule context="*[hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']]/hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']/hl7:entryRelationship[hl7:act[hl7:code[@code='113015']]]/hl7:act[hl7:code[(@code='113015' and @codeSystem='1.2.840.10008.2.16.4')]]">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.30031-2012-01-12T000000.html"
              test="string(@classCode)=('ACT')">(SeriesAct): Der Wert von @classCode MUSS 'ACT' sein.</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.30031-2012-01-12T000000.html"
              test="string(@moodCode)=('EVN')">(SeriesAct): 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.30031-2012-01-12T000000.html"
              test="count(hl7:id)&gt;=1 ">(SeriesAct): 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.30031-2012-01-12T000000.html"
              test="count(hl7:id)&lt;=1">(SeriesAct): 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.30031-2012-01-12T000000.html"
              test="count(hl7:code[(@code='113015' and @codeSystem='1.2.840.10008.2.16.4')])&gt;=1 and not(hl7:code[(@code='113015' and @codeSystem='1.2.840.10008.2.16.4')]/@nullFlavor)">(SeriesAct): Element hl7:code[(@code='113015' and @codeSystem='1.2.840.10008.2.16.4')] ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.30031-2012-01-12T000000.html"
              test="count(hl7:code[(@code='113015' and @codeSystem='1.2.840.10008.2.16.4')])&lt;=1">(SeriesAct): Element hl7:code[(@code='113015' and @codeSystem='1.2.840.10008.2.16.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.30031-2012-01-12T000000.html"
              test="count(hl7:text)&lt;=1">(SeriesAct): Element hl7:text 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.30031-2012-01-12T000000.html"
              test="count(hl7:effectiveTime)&lt;=1">(SeriesAct): 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.30031-2012-01-12T000000.html"
              test="count(hl7:entryRelationship[hl7:observation[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.8']])&gt;=1 and not(hl7:entryRelationship[hl7:observation[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.8']]/@nullFlavor)">(SeriesAct): Element hl7:entryRelationship[hl7:observation[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.8']] ist mandatory [min 1x].</assert>
   </rule>

   <!--
Template derived rules for ID: 1.2.40.0.34.11.30031
Context: *[hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']]/hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']/hl7:entryRelationship[hl7:act[hl7:code[@code='113015']]]/hl7:act[hl7:code[(@code='113015' and @codeSystem='1.2.840.10008.2.16.4')]]/hl7:id
Item: (SeriesAct)
-->
   <rule context="*[hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']]/hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']/hl7:entryRelationship[hl7:act[hl7:code[@code='113015']]]/hl7:act[hl7:code[(@code='113015' and @codeSystem='1.2.840.10008.2.16.4')]]/hl7:id">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.30031-2012-01-12T000000.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)">(SeriesAct): 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.30031-2012-01-12T000000.html"
              test="@root">(SeriesAct): Attribut @root MUSS vorkommen.</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.30031-2012-01-12T000000.html"
              test="not(@extension)">(SeriesAct): Attribut @extension DARF NICHT vorkommen.</assert>
   </rule>

   <!--
Template derived rules for ID: 1.2.40.0.34.11.30031
Context: *[hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']]/hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']/hl7:entryRelationship[hl7:act[hl7:code[@code='113015']]]/hl7:act[hl7:code[(@code='113015' and @codeSystem='1.2.840.10008.2.16.4')]]/hl7:code[(@code='113015' and @codeSystem='1.2.840.10008.2.16.4')]
Item: (SeriesAct)
-->
   <rule context="*[hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']]/hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']/hl7:entryRelationship[hl7:act[hl7:code[@code='113015']]]/hl7:act[hl7:code[(@code='113015' and @codeSystem='1.2.840.10008.2.16.4')]]/hl7:code[(@code='113015' and @codeSystem='1.2.840.10008.2.16.4')]">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.30031-2012-01-12T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='CD' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(SeriesAct): Wenn eine @xsi:type Instruktion anwesend ist MUSS diese den Wert "{urn:hl7-org:v3}:CD" 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="CD"/>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.30031-2012-01-12T000000.html"
              test="@nullFlavor or (@code='113015' and @codeSystem='1.2.840.10008.2.16.4' and @displayName='DICOM Series' and @codeSystemName='DCM')">(SeriesAct): Der Elementinhalt MUSS einer von 'code '113015' codeSystem '1.2.840.10008.2.16.4' displayName='DICOM Series' codeSystemName='DCM'' sein.</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.30031-2012-01-12T000000.html"
              test="count(hl7:qualifier)&gt;=1 and not(hl7:qualifier/@nullFlavor)">(SeriesAct): Element hl7:qualifier ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.30031-2012-01-12T000000.html"
              test="count(hl7:qualifier)&lt;=1">(SeriesAct): Element hl7:qualifier kommt zu häufig vor [max 1x].</assert>
   </rule>

   <!--
Template derived rules for ID: 1.2.40.0.34.11.30031
Context: *[hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']]/hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']/hl7:entryRelationship[hl7:act[hl7:code[@code='113015']]]/hl7:act[hl7:code[(@code='113015' and @codeSystem='1.2.840.10008.2.16.4')]]/hl7:code[(@code='113015' and @codeSystem='1.2.840.10008.2.16.4')]/hl7:qualifier
Item: (SeriesAct)
-->
   <rule context="*[hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']]/hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']/hl7:entryRelationship[hl7:act[hl7:code[@code='113015']]]/hl7:act[hl7:code[(@code='113015' and @codeSystem='1.2.840.10008.2.16.4')]]/hl7:code[(@code='113015' and @codeSystem='1.2.840.10008.2.16.4')]/hl7:qualifier">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.30031-2012-01-12T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='CR' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(SeriesAct): Wenn eine @xsi:type Instruktion anwesend ist MUSS diese den Wert "{urn:hl7-org:v3}:CR" 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="CR"/>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.30031-2012-01-12T000000.html"
              test="count(hl7:name[(@code='121139' and @codeSystem='1.2.840.10008.2.16.4')])&gt;=1 and not(hl7:name[(@code='121139' and @codeSystem='1.2.840.10008.2.16.4')]/@nullFlavor)">(SeriesAct): Element hl7:name[(@code='121139' and @codeSystem='1.2.840.10008.2.16.4')] ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.30031-2012-01-12T000000.html"
              test="count(hl7:name[(@code='121139' and @codeSystem='1.2.840.10008.2.16.4')])&lt;=1">(SeriesAct): Element hl7:name[(@code='121139' and @codeSystem='1.2.840.10008.2.16.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.30031-2012-01-12T000000.html"
              test="count(hl7:value[@codeSystem='1.2.840.10008.2.16.4'])&gt;=1 and not(hl7:value[@codeSystem='1.2.840.10008.2.16.4']/@nullFlavor)">(SeriesAct): Element hl7:value[@codeSystem='1.2.840.10008.2.16.4'] ist mandatory [min 1x].</assert>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.30031-2012-01-12T000000.html"
              test="count(hl7:value[@codeSystem='1.2.840.10008.2.16.4'])&lt;=1">(SeriesAct): Element hl7:value[@codeSystem='1.2.840.10008.2.16.4'] kommt zu häufig vor [max 1x].</assert>
   </rule>

   <!--
Template derived rules for ID: 1.2.40.0.34.11.30031
Context: *[hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']]/hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']/hl7:entryRelationship[hl7:act[hl7:code[@code='113015']]]/hl7:act[hl7:code[(@code='113015' and @codeSystem='1.2.840.10008.2.16.4')]]/hl7:code[(@code='113015' and @codeSystem='1.2.840.10008.2.16.4')]/hl7:qualifier/hl7:name[(@code='121139' and @codeSystem='1.2.840.10008.2.16.4')]
Item: (SeriesAct)
-->
   <rule context="*[hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']]/hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']/hl7:entryRelationship[hl7:act[hl7:code[@code='113015']]]/hl7:act[hl7:code[(@code='113015' and @codeSystem='1.2.840.10008.2.16.4')]]/hl7:code[(@code='113015' and @codeSystem='1.2.840.10008.2.16.4')]/hl7:qualifier/hl7:name[(@code='121139' and @codeSystem='1.2.840.10008.2.16.4')]">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.30031-2012-01-12T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='CD' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(SeriesAct): Wenn eine @xsi:type Instruktion anwesend ist MUSS diese den Wert "{urn:hl7-org:v3}:CD" 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="CD"/>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.30031-2012-01-12T000000.html"
              test="@nullFlavor or (@code='121139' and @codeSystem='1.2.840.10008.2.16.4' and @displayName='Modality' and @codeSystemName='DCM')">(SeriesAct): Der Elementinhalt MUSS einer von 'code '121139' codeSystem '1.2.840.10008.2.16.4' displayName='Modality' codeSystemName='DCM'' sein.</assert>
   </rule>

   <!--
Template derived rules for ID: 1.2.40.0.34.11.30031
Context: *[hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']]/hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']/hl7:entryRelationship[hl7:act[hl7:code[@code='113015']]]/hl7:act[hl7:code[(@code='113015' and @codeSystem='1.2.840.10008.2.16.4')]]/hl7:code[(@code='113015' and @codeSystem='1.2.840.10008.2.16.4')]/hl7:qualifier/hl7:value[@codeSystem='1.2.840.10008.2.16.4']
Item: (SeriesAct)
-->
   <rule context="*[hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']]/hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']/hl7:entryRelationship[hl7:act[hl7:code[@code='113015']]]/hl7:act[hl7:code[(@code='113015' and @codeSystem='1.2.840.10008.2.16.4')]]/hl7:code[(@code='113015' and @codeSystem='1.2.840.10008.2.16.4')]/hl7:qualifier/hl7:value[@codeSystem='1.2.840.10008.2.16.4']">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.30031-2012-01-12T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='CD' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(SeriesAct): Wenn eine @xsi:type Instruktion anwesend ist MUSS diese den Wert "{urn:hl7-org:v3}:CD" 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="CD"/>
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.30031-2012-01-12T000000.html"
              test="@nullFlavor or (@codeSystem='1.2.840.10008.2.16.4')">(SeriesAct): Der Elementinhalt MUSS einer von 'codeSystem '1.2.840.10008.2.16.4'' sein.</assert>
   </rule>

   <!--
Template derived rules for ID: 1.2.40.0.34.11.30031
Context: *[hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']]/hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']/hl7:entryRelationship[hl7:act[hl7:code[@code='113015']]]/hl7:act[hl7:code[(@code='113015' and @codeSystem='1.2.840.10008.2.16.4')]]/hl7:text
Item: (SeriesAct)
-->
   <rule context="*[hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']]/hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']/hl7:entryRelationship[hl7:act[hl7:code[@code='113015']]]/hl7:act[hl7:code[(@code='113015' and @codeSystem='1.2.840.10008.2.16.4')]]/hl7:text">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.30031-2012-01-12T000000.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)">(SeriesAct): 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.30031
Context: *[hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']]/hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']/hl7:entryRelationship[hl7:act[hl7:code[@code='113015']]]/hl7:act[hl7:code[(@code='113015' and @codeSystem='1.2.840.10008.2.16.4')]]/hl7:effectiveTime
Item: (SeriesAct)
-->
   <rule context="*[hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']]/hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']/hl7:entryRelationship[hl7:act[hl7:code[@code='113015']]]/hl7:act[hl7:code[(@code='113015' and @codeSystem='1.2.840.10008.2.16.4')]]/hl7:effectiveTime">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.30031-2012-01-12T000000.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)">(SeriesAct): 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.30031
Context: *[hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']]/hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']/hl7:entryRelationship[hl7:act[hl7:code[@code='113015']]]/hl7:act[hl7:code[(@code='113015' and @codeSystem='1.2.840.10008.2.16.4')]]/hl7:entryRelationship[hl7:observation[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.8']]
Item: (SeriesAct)
-->
   <rule context="*[hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']]/hl7:act[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.6']/hl7:entryRelationship[hl7:act[hl7:code[@code='113015']]]/hl7:act[hl7:code[(@code='113015' and @codeSystem='1.2.840.10008.2.16.4')]]/hl7:entryRelationship[hl7:observation[hl7:templateId/@root='2.16.840.1.113883.10.20.6.2.8']]">
      <assert role="error"
              see="http://elga.art-decor.org/elga-html-20150713T115013/tmp-1.2.40.0.34.11.30031-2012-01-12T000000.html"
              test="string(@typeCode)=('COMP')">(SeriesAct): Der Wert von @typeCode MUSS 'COMP' sein.</assert>
   </rule>
</pattern>
