<?xml version="1.0" encoding="UTF-8"?>
<!--
Template derived pattern
===========================================
ID: 2.16.840.1.113883.3.1937.777.63.10.716
Name: Allergie - act (Tele)
Description: Template CDA Act (prototype, directly derived from POCD_RM000040 MIF)
-->
<pattern xmlns="http://purl.oclc.org/dsdl/schematron"
         id="template-2.16.840.1.113883.3.1937.777.63.10.716-2025-07-11T103950">
   <title>Allergie - act (Tele)</title>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.716
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]
Item: (Allergie - act (Tele))
-->

   <rule fpi="RULC-1"
         context="*[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]"
         id="d44e7533-false-d937834e0">
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.716-2025-07-11T103950.html"
              test="count(hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]) &gt;= 1">(Allergie - act (Tele)): element hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]] is required [min 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.716-2025-07-11T103950.html"
              test="count(hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]) &lt;= 1">(Allergie - act (Tele)): element hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]] appears too often [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.716
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]
Item: (Allergie - act (Tele))
-->

   <rule fpi="RULC-1"
         context="*[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]"
         id="d44e7546-false-d937899e0">
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.716-2025-07-11T103950.html"
              test="string(@classCode) = ('ACT')">(Allergie - act (Tele)): The value for classCode SHALL be 'ACT'. Found: "<value-of select="@classCode"/>"</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.716-2025-07-11T103950.html"
              test="string(@moodCode) = ('EVN')">(Allergie - act (Tele)): The value for moodCode SHALL be 'EVN'. Found: "<value-of select="@moodCode"/>"</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.716-2025-07-11T103950.html"
              test="count(hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.716']) &lt;= 1">(Allergie - act (Tele)): element hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.716'] appears too often [max 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.716-2025-07-11T103950.html"
              test="count(hl7:code) &gt;= 1">(Allergie - act (Tele)): element hl7:code is required [min 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.716-2025-07-11T103950.html"
              test="count(hl7:code) &lt;= 1">(Allergie - act (Tele)): element hl7:code appears too often [max 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.716-2025-07-11T103950.html"
              test="count(hl7:text) &lt;= 1">(Allergie - act (Tele)): element hl7:text appears too often [max 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.716-2025-07-11T103950.html"
              test="count(hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]) &gt;= 1">(Allergie - act (Tele)): element hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor] is required [min 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.716-2025-07-11T103950.html"
              test="count(hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]) &lt;= 1">(Allergie - act (Tele)): element hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor] appears too often [max 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.716-2025-07-11T103950.html"
              test="count(hl7:effectiveTime) &gt;= 1">(Allergie - act (Tele)): element hl7:effectiveTime is required [min 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.716-2025-07-11T103950.html"
              test="count(hl7:effectiveTime) &lt;= 1">(Allergie - act (Tele)): element hl7:effectiveTime appears too often [max 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.716-2025-07-11T103950.html"
              test="count(hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]) &gt;= 1">(Allergie - act (Tele)): element hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]] is required [min 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.716-2025-07-11T103950.html"
              test="count(hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]) &lt;= 1">(Allergie - act (Tele)): element hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]] appears too often [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.716
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.716']
Item: (Allergie - act (Tele))
-->

   <rule fpi="RULC-1"
         context="*[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.716']"
         id="d44e7563-false-d937987e0">
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.716-2025-07-11T103950.html"
              test="string(@root) = ('2.16.840.1.113883.3.1937.777.63.10.716')">(Allergie - act (Tele)): The value for root SHALL be '2.16.840.1.113883.3.1937.777.63.10.716'. Found: "<value-of select="@root"/>"</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.716
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:code
Item: (Allergie - act (Tele))
-->

   <rule fpi="RULC-1"
         context="*[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:code"
         id="d44e7568-false-d937998e0">
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.716-2025-07-11T103950.html"
              test="string(@nullFlavor) = ('NA') or not(@nullFlavor)">(Allergie - act (Tele)): The value for nullFlavor SHALL be 'NA'. Found: "<value-of select="@nullFlavor"/>"</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.716
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:text
Item: (Allergie - act (Tele))
-->

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.716
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]
Item: (Allergie - act (Tele))
-->

   <rule fpi="RULC-1"
         context="*[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]"
         id="d44e7576-false-d938020e0">
      <let name="theCode" value="@code"/>
      <let name="theCodeSystem" value="@codeSystem"/>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.716-2025-07-11T103950.html"
              test="@nullFlavor or exists(doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/concept[@code = $theCode] or completeCodeSystem)">(Allergie - act (Tele)): The element value SHALL be one of '2.16.840.1.113883.3.1937.777.63.11.10 X_ActStatusActiveSuspendedAbortedCompleted (DYNAMIC)'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.716
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:effectiveTime
Item: (Allergie - act (Tele))
-->


   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.716
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]
Item: (Allergie - act (Tele))
-->
   <rule fpi="RULC-1"
         context="*[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]">
      <extends rule="d938080e0-false-d938084e0"/>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.716-2025-07-11T103950.html"
              test="@typeCode">(Allergie - act (Tele)): attribute @typeCode SHALL be present.</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.716-2025-07-11T103950.html"
              test="not(@typeCode) or (string-length(@typeCode) &gt; 0 and not(matches(@typeCode,'\s')))">(Allergie - act (Tele)): Attribute @typeCode SHALL be of data type 'cs'  - '<value-of select="@typeCode"/>'</assert>
   </rule>

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.717
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]
Item: (Allergie - observation (Tele))
-->
   <rule fpi="RULC-1" id="d938080e0-false-d938084e0" abstract="true">
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.717-2025-07-11T105611.html"
              test="count(hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]) &gt;= 1">(Allergie - observation (Tele)): element hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]] is required [min 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.717-2025-07-11T105611.html"
              test="count(hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]) &lt;= 1">(Allergie - observation (Tele)): element hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]] appears too often [max 1x].</assert>
   </rule>

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.717
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]
Item: (Allergie - observation (Tele))
-->
   <rule fpi="RULC-1"
         context="*[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]">
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.717-2025-07-11T105611.html"
              test="string(@classCode) = ('OBS') or not(@classCode)">(Allergie - observation (Tele)): The value for classCode SHALL be 'OBS'. Found: "<value-of select="@classCode"/>"</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.717-2025-07-11T105611.html"
              test="string(@moodCode) = ('EVN')">(Allergie - observation (Tele)): The value for moodCode SHALL be 'EVN'. Found: "<value-of select="@moodCode"/>"</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.717-2025-07-11T105611.html"
              test="count(hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.717']) &lt;= 1">(Allergie - observation (Tele)): element hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.717'] appears too often [max 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.717-2025-07-11T105611.html"
              test="count(hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]) &gt;= 1">(Allergie - observation (Tele)): element hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor] is required [min 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.717-2025-07-11T105611.html"
              test="count(hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]) &lt;= 1">(Allergie - observation (Tele)): element hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor] appears too often [max 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.717-2025-07-11T105611.html"
              test="count(hl7:text) &lt;= 1">(Allergie - observation (Tele)): element hl7:text appears too often [max 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.717-2025-07-11T105611.html"
              test="count(hl7:statusCode[@code = 'completed' or @nullFlavor]) &gt;= 1">(Allergie - observation (Tele)): element hl7:statusCode[@code = 'completed' or @nullFlavor] is required [min 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.717-2025-07-11T105611.html"
              test="count(hl7:statusCode[@code = 'completed' or @nullFlavor]) &lt;= 1">(Allergie - observation (Tele)): element hl7:statusCode[@code = 'completed' or @nullFlavor] appears too often [max 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.717-2025-07-11T105611.html"
              test="count(hl7:effectiveTime) &gt;= 1">(Allergie - observation (Tele)): element hl7:effectiveTime is required [min 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.717-2025-07-11T105611.html"
              test="count(hl7:effectiveTime) &lt;= 1">(Allergie - observation (Tele)): element hl7:effectiveTime appears too often [max 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.717-2025-07-11T105611.html"
              test="count(hl7:value) &gt;= 1">(Allergie - observation (Tele)): element hl7:value is required [min 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.717-2025-07-11T105611.html"
              test="count(hl7:value) &lt;= 1">(Allergie - observation (Tele)): element hl7:value appears too often [max 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.717-2025-07-11T105611.html"
              test="count(hl7:participant[@typeCode = 'CSM'][@typeCode][@typeCode = 'CSM'][hl7:participantRole]) &gt;= 1">(Allergie - observation (Tele)): element hl7:participant[@typeCode = 'CSM'][@typeCode][@typeCode = 'CSM'][hl7:participantRole] is required [min 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.717-2025-07-11T105611.html"
              test="count(hl7:entryRelationship[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.164']]]) &lt;= 1">(Allergie - observation (Tele)): element hl7:entryRelationship[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.164']]] appears too often [max 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.717-2025-07-11T105611.html"
              test="count(hl7:entryRelationship[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.165']]]) &lt;= 1">(Allergie - observation (Tele)): element hl7:entryRelationship[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.165']]] appears too often [max 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.717-2025-07-11T105611.html"
              test="count(hl7:entryRelationship[hl7:act[hl7:code[(@code = '48767-8' and @codeSystem = '2.16.840.1.113883.6.1')]]]) &lt;= 1">(Allergie - observation (Tele)): element hl7:entryRelationship[hl7:act[hl7:code[(@code = '48767-8' and @codeSystem = '2.16.840.1.113883.6.1')]]] appears too often [max 1x].</assert>
   </rule>

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.717
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.717']
Item: (Allergie - observation (Tele))
-->
   <rule fpi="RULC-1"
         context="*[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.717']">
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.717-2025-07-11T105611.html"
              test="string(@root) = ('2.16.840.1.113883.3.1937.777.63.10.717')">(Allergie - observation (Tele)): The value for root SHALL be '2.16.840.1.113883.3.1937.777.63.10.717'. Found: "<value-of select="@root"/>"</assert>
   </rule>

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.717
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]
Item: (Allergie - observation (Tele))
-->
   <rule fpi="RULC-1"
         context="*[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]">
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.717-2025-07-11T105611.html"
              test="@nullFlavor or (@code='52473-6' and @codeSystem='2.16.840.1.113883.6.1')">(Allergie - observation (Tele)): The element value SHALL be one of 'code '52473-6' codeSystem '2.16.840.1.113883.6.1''.</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.717-2025-07-11T105611.html"
              test="not(@codeSystemName) or string-length(@codeSystemName)&gt;0">(Allergie - observation (Tele)): Attribute @codeSystemName SHALL be of data type 'st'  - '<value-of select="@codeSystemName"/>'</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.717-2025-07-11T105611.html"
              test="not(@displayName) or string-length(@displayName)&gt;0">(Allergie - observation (Tele)): Attribute @displayName SHALL be of data type 'st'  - '<value-of select="@displayName"/>'</assert>
   </rule>

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.717
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:text
Item: (Allergie - observation (Tele))
-->

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.717
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:statusCode[@code = 'completed' or @nullFlavor]
Item: (Allergie - observation (Tele))
-->
   <rule fpi="RULC-1"
         context="*[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:statusCode[@code = 'completed' or @nullFlavor]">
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.717-2025-07-11T105611.html"
              test="@nullFlavor or (@code='completed')">(Allergie - observation (Tele)): The element value SHALL be one of 'code 'completed''.</assert>
   </rule>

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.717
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:effectiveTime
Item: (Allergie - observation (Tele))
-->

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.717
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:value
Item: (Allergie - observation (Tele))
-->
   <rule fpi="RULC-1"
         context="*[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:value">
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.717-2025-07-11T105611.html"
              test="count(hl7:originalText) &lt;= 1">(Allergie - observation (Tele)): element hl7:originalText appears too often [max 1x].</assert>
   </rule>

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.717
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:value/hl7:originalText
Item: (Allergie - observation (Tele))
-->

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.717
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:value/hl7:originalText/hl7:text
Item: (Allergie - observation (Tele))
-->

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.717
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:participant[@typeCode = 'CSM'][@typeCode][@typeCode = 'CSM'][hl7:participantRole]
Item: (Allergie - observation (Tele))
-->
   <rule fpi="RULC-1"
         context="*[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:participant[@typeCode = 'CSM'][@typeCode][@typeCode = 'CSM'][hl7:participantRole]">
      <extends rule="d938366e0-false-d938370e0"/>
   </rule>

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.161
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:participant[@typeCode = 'CSM'][@typeCode][@typeCode = 'CSM'][hl7:participantRole]
Item: (Descrizione Agente)
-->
   <rule fpi="RULC-1" id="d938366e0-false-d938370e0" abstract="true">
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.161-2022-09-25T151100.html"
              test="@typeCode">(Descrizione Agente): attribute @typeCode SHALL be present.</assert>
      <let name="theAttValue"
           value="distinct-values(tokenize(normalize-space(@typeCode),'\s'))"/>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.161-2022-09-25T151100.html"
              test="not(@typeCode) or empty($theAttValue[not(. = (doc('include/voc-2.16.840.1.113883.1.11.10901-DYNAMIC.xml')/*/valueSet/conceptList/concept/@code))])">(Descrizione Agente): The value for typeCode SHALL be selected from value set '2.16.840.1.113883.1.11.10901' ParticipationType (DYNAMIC).</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.161-2022-09-25T151100.html"
              test="string(@contextControlCode) = ('OP') or not(@contextControlCode)">(Descrizione Agente): The value for contextControlCode SHALL be 'OP'. Found: "<value-of select="@contextControlCode"/>"</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.161-2022-09-25T151100.html"
              test="string(@typeCode) = ('CSM')">(Descrizione Agente): The value for typeCode SHALL be 'CSM'. Found: "<value-of select="@typeCode"/>"</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.161-2022-09-25T151100.html"
              test="count(hl7:time) &lt;= 1">(Descrizione Agente): element hl7:time appears too often [max 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.161-2022-09-25T151100.html"
              test="count(hl7:participantRole[hl7:playingEntity[hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.15-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]]]) &gt;= 1">(Descrizione Agente): element hl7:participantRole[hl7:playingEntity[hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.15-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]]] is required [min 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.161-2022-09-25T151100.html"
              test="count(hl7:participantRole[hl7:playingEntity[hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.15-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]]]) &lt;= 1">(Descrizione Agente): element hl7:participantRole[hl7:playingEntity[hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.15-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]]] appears too often [max 1x].</assert>
   </rule>

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.161
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:participant[@typeCode = 'CSM'][@typeCode][@typeCode = 'CSM'][hl7:participantRole]/hl7:time
Item: (Descrizione Agente)
-->

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.161
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:participant[@typeCode = 'CSM'][@typeCode][@typeCode = 'CSM'][hl7:participantRole]/hl7:participantRole[hl7:playingEntity[hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.15-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]]]
Item: (Descrizione Agente)
-->
   <rule fpi="RULC-1"
         context="*[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:participant[@typeCode = 'CSM'][@typeCode][@typeCode = 'CSM'][hl7:participantRole]/hl7:participantRole[hl7:playingEntity[hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.15-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]]]">
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.161-2022-09-25T151100.html"
              test="not(@classCode) or (string-length(@classCode) &gt; 0 and not(matches(@classCode,'\s')))">(Descrizione Agente): Attribute @classCode SHALL be of data type 'cs'  - '<value-of select="@classCode"/>'</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.161-2022-09-25T151100.html"
              test="count(hl7:playingEntity[hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.15-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]]) &gt;= 1">(Descrizione Agente): element hl7:playingEntity[hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.15-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]] is required [min 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.161-2022-09-25T151100.html"
              test="count(hl7:playingEntity[hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.15-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]]) &lt;= 1">(Descrizione Agente): element hl7:playingEntity[hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.15-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]] appears too often [max 1x].</assert>
   </rule>

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.161
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:participant[@typeCode = 'CSM'][@typeCode][@typeCode = 'CSM'][hl7:participantRole]/hl7:participantRole[hl7:playingEntity[hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.15-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]]]/hl7:playingEntity[hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.15-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]]
Item: (Descrizione Agente)
-->

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.162
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:participant[@typeCode = 'CSM'][@typeCode][@typeCode = 'CSM'][hl7:participantRole]/hl7:participantRole[hl7:playingEntity[hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.15-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]]]/hl7:playingEntity[hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.15-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]]
Item: (playingEntity - Agente)
-->
   <rule fpi="RULC-1"
         context="*[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:participant[@typeCode = 'CSM'][@typeCode][@typeCode = 'CSM'][hl7:participantRole]/hl7:participantRole[hl7:playingEntity[hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.15-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]]]/hl7:playingEntity[hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.15-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]]">
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.162-2022-09-25T151441.html"
              test="not(@classCode) or (string-length(@classCode) &gt; 0 and not(matches(@classCode,'\s')))">(playingEntity - Agente): Attribute @classCode SHALL be of data type 'cs'  - '<value-of select="@classCode"/>'</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.162-2022-09-25T151441.html"
              test="string(@determinerCode) = ('INSTANCE') or not(@determinerCode)">(playingEntity - Agente): The value for determinerCode SHALL be 'INSTANCE'. Found: "<value-of select="@determinerCode"/>"</assert>
      <report fpi="CD-UNKN-BSP"
              role="warning"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.162-2022-09-25T151441.html"
              test="count(hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.15-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]) &lt; 1">(playingEntity - Agente): element hl7:code is coded with binding strength 'extensible' and contains a code other than the specified set.</report>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.162-2022-09-25T151441.html"
              test="count(hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.15-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]) &lt;= 1">(playingEntity - Agente): element hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.15-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)] appears too often [max 1x].</assert>
   </rule>

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.162
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:participant[@typeCode = 'CSM'][@typeCode][@typeCode = 'CSM'][hl7:participantRole]/hl7:participantRole[hl7:playingEntity[hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.15-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]]]/hl7:playingEntity[hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.15-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]]/hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.15-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]
Item: (playingEntity - Agente)
-->
   <rule fpi="RULC-1"
         context="*[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:participant[@typeCode = 'CSM'][@typeCode][@typeCode = 'CSM'][hl7:participantRole]/hl7:participantRole[hl7:playingEntity[hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.15-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]]]/hl7:playingEntity[hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.15-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]]/hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.15-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]">
      <let name="theCode" value="@code"/>
      <let name="theCodeSystem" value="@codeSystem"/>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.162-2022-09-25T151441.html"
              test="@nullFlavor or exists(doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.15-DYNAMIC.xml')//valueSet[1][conceptList/concept[@code = $theCode][@codeSystem = $theCodeSystem]])">(playingEntity - Agente): The element value SHALL be one of '2.16.840.1.113883.3.1937.777.63.11.15 ObservationIntoleranceType (DYNAMIC)'.</assert>
   </rule>

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.717
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.163']]]
Item: (Allergie - observation (Tele))
-->
   <rule fpi="RULC-1"
         context="*[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.163']]]">
      <extends rule="d938537e0-false-d938541e0"/>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.717-2025-07-11T105611.html"
              test="string(@typeCode) = ('MFST')">(Allergie - observation (Tele)): The value for typeCode SHALL be 'MFST'. Found: "<value-of select="@typeCode"/>"</assert>
   </rule>

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.163
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.163']]]
Item: (Descrizione Reazione)
-->
   <rule fpi="RULC-1" id="d938537e0-false-d938541e0" abstract="true">
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.163-2022-09-25T153114.html"
              test="count(hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.163']]) &gt;= 1">(Descrizione Reazione): element hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.163']] is required [min 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.163-2022-09-25T153114.html"
              test="count(hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.163']]) &lt;= 1">(Descrizione Reazione): element hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.163']] appears too often [max 1x].</assert>
   </rule>

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.163
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.163']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.163']]
Item: (Descrizione Reazione)
-->
   <rule fpi="RULC-1"
         context="*[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.163']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.163']]">
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.163-2022-09-25T153114.html"
              test="string(@classCode) = ('OBS') or not(@classCode)">(Descrizione Reazione): The value for classCode SHALL be 'OBS'. Found: "<value-of select="@classCode"/>"</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.163-2022-09-25T153114.html"
              test="string(@moodCode) = ('EVN')">(Descrizione Reazione): The value for moodCode SHALL be 'EVN'. Found: "<value-of select="@moodCode"/>"</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.163-2022-09-25T153114.html"
              test="count(hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.163']) &gt;= 1">(Descrizione Reazione): element hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.163'] is mandatory [min 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.163-2022-09-25T153114.html"
              test="count(hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.163']) &lt;= 1">(Descrizione Reazione): element hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.163'] appears too often [max 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.163-2022-09-25T153114.html"
              test="count(hl7:code[(@code = '75321-0' and @codeSystem = '2.16.840.1.113883.6.1')]) &gt;= 1">(Descrizione Reazione): element hl7:code[(@code = '75321-0' and @codeSystem = '2.16.840.1.113883.6.1')] is required [min 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.163-2022-09-25T153114.html"
              test="count(hl7:code[(@code = '75321-0' and @codeSystem = '2.16.840.1.113883.6.1')]) &lt;= 1">(Descrizione Reazione): element hl7:code[(@code = '75321-0' and @codeSystem = '2.16.840.1.113883.6.1')] appears too often [max 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.163-2022-09-25T153114.html"
              test="count(hl7:text) &lt;= 1">(Descrizione Reazione): element hl7:text appears too often [max 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.163-2022-09-25T153114.html"
              test="count(hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]) &lt;= 1">(Descrizione Reazione): element hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor] appears too often [max 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.163-2022-09-25T153114.html"
              test="count(hl7:effectiveTime) &gt;= 1">(Descrizione Reazione): element hl7:effectiveTime is required [min 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.163-2022-09-25T153114.html"
              test="count(hl7:effectiveTime) &lt;= 1">(Descrizione Reazione): element hl7:effectiveTime appears too often [max 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.163-2022-09-25T153114.html"
              test="count(hl7:value) &gt;= 1">(Descrizione Reazione): element hl7:value is required [min 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.163-2022-09-25T153114.html"
              test="count(hl7:value) &lt;= 1">(Descrizione Reazione): element hl7:value appears too often [max 1x].</assert>
   </rule>

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.163
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.163']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.163']]/hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.163']
Item: (Descrizione Reazione)
-->
   <rule fpi="RULC-1"
         context="*[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.163']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.163']]/hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.163']">
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.163-2022-09-25T153114.html"
              test="string(@root) = ('2.16.840.1.113883.3.1937.777.63.10.163')">(Descrizione Reazione): The value for root SHALL be '2.16.840.1.113883.3.1937.777.63.10.163'. Found: "<value-of select="@root"/>"</assert>
   </rule>

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.163
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.163']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.163']]/hl7:code[(@code = '75321-0' and @codeSystem = '2.16.840.1.113883.6.1')]
Item: (Descrizione Reazione)
-->
   <rule fpi="RULC-1"
         context="*[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.163']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.163']]/hl7:code[(@code = '75321-0' and @codeSystem = '2.16.840.1.113883.6.1')]">
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.163-2022-09-25T153114.html"
              test="string(@code) = ('75321-0')">(Descrizione Reazione): The value for code SHALL be '75321-0'. Found: "<value-of select="@code"/>"</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.163-2022-09-25T153114.html"
              test="string(@codeSystem) = ('2.16.840.1.113883.6.1')">(Descrizione Reazione): The value for codeSystem SHALL be '2.16.840.1.113883.6.1'. Found: "<value-of select="@codeSystem"/>"</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.163-2022-09-25T153114.html"
              test="not(@codeSystemName) or string-length(@codeSystemName)&gt;0">(Descrizione Reazione): Attribute @codeSystemName SHALL be of data type 'st'  - '<value-of select="@codeSystemName"/>'</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.163-2022-09-25T153114.html"
              test="not(@displayName) or string-length(@displayName)&gt;0">(Descrizione Reazione): Attribute @displayName SHALL be of data type 'st'  - '<value-of select="@displayName"/>'</assert>
   </rule>

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.163
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.163']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.163']]/hl7:text
Item: (Descrizione Reazione)
-->

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.163
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.163']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.163']]/hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]
Item: (Descrizione Reazione)
-->
   <rule fpi="RULC-1"
         context="*[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.163']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.163']]/hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]">
      <let name="theCode" value="@code"/>
      <let name="theCodeSystem" value="@codeSystem"/>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.163-2022-09-25T153114.html"
              test="@nullFlavor or exists(doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/concept[@code = $theCode] or completeCodeSystem)">(Descrizione Reazione): The element value SHALL be one of '2.16.840.1.113883.3.1937.777.63.11.10 X_ActStatusActiveSuspendedAbortedCompleted (DYNAMIC)'.</assert>
   </rule>

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.163
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.163']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.163']]/hl7:effectiveTime
Item: (Descrizione Reazione)
-->

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.163
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.163']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.163']]/hl7:value
Item: (Descrizione Reazione)
-->

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.717
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.164']]]
Item: (Allergie - observation (Tele))
-->
   <rule fpi="RULC-1"
         context="*[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.164']]]">
      <extends rule="d938717e0-false-d938721e0"/>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.717-2025-07-11T105611.html"
              test="string(@typeCode) = ('SUBJ')">(Allergie - observation (Tele)): The value for typeCode SHALL be 'SUBJ'. Found: "<value-of select="@typeCode"/>"</assert>
   </rule>

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.164
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.164']]]
Item: (Descrizione Criticità)
-->
   <rule fpi="RULC-1" id="d938717e0-false-d938721e0" abstract="true">
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.164-2022-09-25T154929.html"
              test="count(hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.164']]) &gt;= 1">(Descrizione Criticità): element hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.164']] is required [min 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.164-2022-09-25T154929.html"
              test="count(hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.164']]) &lt;= 1">(Descrizione Criticità): element hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.164']] appears too often [max 1x].</assert>
   </rule>

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.164
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.164']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.164']]
Item: (Descrizione Criticità)
-->
   <rule fpi="RULC-1"
         context="*[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.164']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.164']]">
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.164-2022-09-25T154929.html"
              test="string(@classCode) = ('OBS') or not(@classCode)">(Descrizione Criticità): The value for classCode SHALL be 'OBS'. Found: "<value-of select="@classCode"/>"</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.164-2022-09-25T154929.html"
              test="string(@moodCode) = ('EVN')">(Descrizione Criticità): The value for moodCode SHALL be 'EVN'. Found: "<value-of select="@moodCode"/>"</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.164-2022-09-25T154929.html"
              test="count(hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.164']) &gt;= 1">(Descrizione Criticità): element hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.164'] is mandatory [min 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.164-2022-09-25T154929.html"
              test="count(hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.164']) &lt;= 1">(Descrizione Criticità): element hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.164'] appears too often [max 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.164-2022-09-25T154929.html"
              test="count(hl7:code[(@code = '82606-5' and @codeSystem = '2.16.840.1.113883.6.1')]) &gt;= 1">(Descrizione Criticità): element hl7:code[(@code = '82606-5' and @codeSystem = '2.16.840.1.113883.6.1')] is required [min 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.164-2022-09-25T154929.html"
              test="count(hl7:code[(@code = '82606-5' and @codeSystem = '2.16.840.1.113883.6.1')]) &lt;= 1">(Descrizione Criticità): element hl7:code[(@code = '82606-5' and @codeSystem = '2.16.840.1.113883.6.1')] appears too often [max 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.164-2022-09-25T154929.html"
              test="count(hl7:text) &lt;= 1">(Descrizione Criticità): element hl7:text appears too often [max 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.164-2022-09-25T154929.html"
              test="count(hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]) &lt;= 1">(Descrizione Criticità): element hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor] appears too often [max 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.164-2022-09-25T154929.html"
              test="count(hl7:effectiveTime) &lt;= 1">(Descrizione Criticità): element hl7:effectiveTime appears too often [max 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.164-2022-09-25T154929.html"
              test="count(hl7:value) &gt;= 1">(Descrizione Criticità): element hl7:value is required [min 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.164-2022-09-25T154929.html"
              test="count(hl7:value) &lt;= 1">(Descrizione Criticità): element hl7:value appears too often [max 1x].</assert>
   </rule>

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.164
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.164']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.164']]/hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.164']
Item: (Descrizione Criticità)
-->
   <rule fpi="RULC-1"
         context="*[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.164']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.164']]/hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.164']">
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.164-2022-09-25T154929.html"
              test="string(@root) = ('2.16.840.1.113883.3.1937.777.63.10.164')">(Descrizione Criticità): The value for root SHALL be '2.16.840.1.113883.3.1937.777.63.10.164'. Found: "<value-of select="@root"/>"</assert>
   </rule>

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.164
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.164']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.164']]/hl7:code[(@code = '82606-5' and @codeSystem = '2.16.840.1.113883.6.1')]
Item: (Descrizione Criticità)
-->
   <rule fpi="RULC-1"
         context="*[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.164']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.164']]/hl7:code[(@code = '82606-5' and @codeSystem = '2.16.840.1.113883.6.1')]">
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.164-2022-09-25T154929.html"
              test="string(@code) = ('82606-5')">(Descrizione Criticità): The value for code SHALL be '82606-5'. Found: "<value-of select="@code"/>"</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.164-2022-09-25T154929.html"
              test="string(@codeSystem) = ('2.16.840.1.113883.6.1')">(Descrizione Criticità): The value for codeSystem SHALL be '2.16.840.1.113883.6.1'. Found: "<value-of select="@codeSystem"/>"</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.164-2022-09-25T154929.html"
              test="string(@codeSystemName) = ('LOINC') or not(@codeSystemName)">(Descrizione Criticità): The value for codeSystemName SHALL be 'LOINC'. Found: "<value-of select="@codeSystemName"/>"</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.164-2022-09-25T154929.html"
              test="not(@codeSystemName) or string-length(@codeSystemName)&gt;0">(Descrizione Criticità): Attribute @codeSystemName SHALL be of data type 'st'  - '<value-of select="@codeSystemName"/>'</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.164-2022-09-25T154929.html"
              test="not(@displayName) or string-length(@displayName)&gt;0">(Descrizione Criticità): Attribute @displayName SHALL be of data type 'st'  - '<value-of select="@displayName"/>'</assert>
   </rule>

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.164
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.164']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.164']]/hl7:text
Item: (Descrizione Criticità)
-->

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.164
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.164']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.164']]/hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]
Item: (Descrizione Criticità)
-->
   <rule fpi="RULC-1"
         context="*[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.164']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.164']]/hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]">
      <let name="theCode" value="@code"/>
      <let name="theCodeSystem" value="@codeSystem"/>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.164-2022-09-25T154929.html"
              test="@nullFlavor or exists(doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/concept[@code = $theCode] or completeCodeSystem)">(Descrizione Criticità): The element value SHALL be one of '2.16.840.1.113883.3.1937.777.63.11.10 X_ActStatusActiveSuspendedAbortedCompleted (DYNAMIC)'.</assert>
   </rule>

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.164
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.164']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.164']]/hl7:effectiveTime
Item: (Descrizione Criticità)
-->

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.164
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.164']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.164']]/hl7:value
Item: (Descrizione Criticità)
-->

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.717
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.165']]]
Item: (Allergie - observation (Tele))
-->
   <rule fpi="RULC-1"
         context="*[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.165']]]">
      <extends rule="d938898e0-false-d938902e0"/>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.717-2025-07-11T105611.html"
              test="string(@typeCode) = ('REFR')">(Allergie - observation (Tele)): The value for typeCode SHALL be 'REFR'. Found: "<value-of select="@typeCode"/>"</assert>
   </rule>

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.165
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.165']]]
Item: (Stato dell'Allergia/Intolleranza )
-->
   <rule fpi="RULC-1" id="d938898e0-false-d938902e0" abstract="true">
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.165-2022-09-25T155950.html"
              test="count(hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.165']]) &gt;= 1">(Stato dell'Allergia/Intolleranza ): element hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.165']] is required [min 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.165-2022-09-25T155950.html"
              test="count(hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.165']]) &lt;= 1">(Stato dell'Allergia/Intolleranza ): element hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.165']] appears too often [max 1x].</assert>
   </rule>

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.165
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.165']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.165']]
Item: (Stato dell'Allergia/Intolleranza )
-->
   <rule fpi="RULC-1"
         context="*[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.165']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.165']]">
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.165-2022-09-25T155950.html"
              test="string(@classCode) = ('OBS') or not(@classCode)">(Stato dell'Allergia/Intolleranza ): The value for classCode SHALL be 'OBS'. Found: "<value-of select="@classCode"/>"</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.165-2022-09-25T155950.html"
              test="string(@moodCode) = ('EVN')">(Stato dell'Allergia/Intolleranza ): The value for moodCode SHALL be 'EVN'. Found: "<value-of select="@moodCode"/>"</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.165-2022-09-25T155950.html"
              test="count(hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.165']) &gt;= 1">(Stato dell'Allergia/Intolleranza ): element hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.165'] is mandatory [min 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.165-2022-09-25T155950.html"
              test="count(hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.165']) &lt;= 1">(Stato dell'Allergia/Intolleranza ): element hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.165'] appears too often [max 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.165-2022-09-25T155950.html"
              test="count(hl7:code[(@code = '33999-4' and @codeSystem = '2.16.840.1.113883.6.1')]) &gt;= 1">(Stato dell'Allergia/Intolleranza ): element hl7:code[(@code = '33999-4' and @codeSystem = '2.16.840.1.113883.6.1')] is required [min 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.165-2022-09-25T155950.html"
              test="count(hl7:code[(@code = '33999-4' and @codeSystem = '2.16.840.1.113883.6.1')]) &lt;= 1">(Stato dell'Allergia/Intolleranza ): element hl7:code[(@code = '33999-4' and @codeSystem = '2.16.840.1.113883.6.1')] appears too often [max 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.165-2022-09-25T155950.html"
              test="count(hl7:text) &lt;= 1">(Stato dell'Allergia/Intolleranza ): element hl7:text appears too often [max 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.165-2022-09-25T155950.html"
              test="count(hl7:statusCode) &lt;= 1">(Stato dell'Allergia/Intolleranza ): element hl7:statusCode appears too often [max 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.165-2022-09-25T155950.html"
              test="count(hl7:effectiveTime) &lt;= 1">(Stato dell'Allergia/Intolleranza ): element hl7:effectiveTime appears too often [max 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.165-2022-09-25T155950.html"
              test="count(hl7:value) &gt;= 1">(Stato dell'Allergia/Intolleranza ): element hl7:value is required [min 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.165-2022-09-25T155950.html"
              test="count(hl7:value) &lt;= 1">(Stato dell'Allergia/Intolleranza ): element hl7:value appears too often [max 1x].</assert>
   </rule>

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.165
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.165']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.165']]/hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.165']
Item: (Stato dell'Allergia/Intolleranza )
-->
   <rule fpi="RULC-1"
         context="*[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.165']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.165']]/hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.165']">
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.165-2022-09-25T155950.html"
              test="string(@root) = ('2.16.840.1.113883.3.1937.777.63.10.165')">(Stato dell'Allergia/Intolleranza ): The value for root SHALL be '2.16.840.1.113883.3.1937.777.63.10.165'. Found: "<value-of select="@root"/>"</assert>
   </rule>

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.165
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.165']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.165']]/hl7:code[(@code = '33999-4' and @codeSystem = '2.16.840.1.113883.6.1')]
Item: (Stato dell'Allergia/Intolleranza )
-->
   <rule fpi="RULC-1"
         context="*[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.165']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.165']]/hl7:code[(@code = '33999-4' and @codeSystem = '2.16.840.1.113883.6.1')]">
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.165-2022-09-25T155950.html"
              test="string(@code) = ('33999-4')">(Stato dell'Allergia/Intolleranza ): The value for code SHALL be '33999-4'. Found: "<value-of select="@code"/>"</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.165-2022-09-25T155950.html"
              test="string(@codeSystem) = ('2.16.840.1.113883.6.1')">(Stato dell'Allergia/Intolleranza ): The value for codeSystem SHALL be '2.16.840.1.113883.6.1'. Found: "<value-of select="@codeSystem"/>"</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.165-2022-09-25T155950.html"
              test="not(@codeSystemName) or string-length(@codeSystemName)&gt;0">(Stato dell'Allergia/Intolleranza ): Attribute @codeSystemName SHALL be of data type 'st'  - '<value-of select="@codeSystemName"/>'</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.165-2022-09-25T155950.html"
              test="not(@displayName) or string-length(@displayName)&gt;0">(Stato dell'Allergia/Intolleranza ): Attribute @displayName SHALL be of data type 'st'  - '<value-of select="@displayName"/>'</assert>
   </rule>

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.165
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.165']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.165']]/hl7:text
Item: (Stato dell'Allergia/Intolleranza )
-->

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.165
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.165']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.165']]/hl7:statusCode
Item: (Stato dell'Allergia/Intolleranza )
-->
   <rule fpi="RULC-1"
         context="*[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.165']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.165']]/hl7:statusCode">
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.165-2022-09-25T155950.html"
              test="@code">(Stato dell'Allergia/Intolleranza ): attribute @code SHALL be present.</assert>
      <let name="theAttValue"
           value="distinct-values(tokenize(normalize-space(@code),'\s'))"/>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.165-2022-09-25T155950.html"
              test="not(@code) or empty($theAttValue[not(. = (doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')/*/valueSet/conceptList/concept/@code))])">(Stato dell'Allergia/Intolleranza ): The value for code SHALL be selected from value set '2.16.840.1.113883.3.1937.777.63.11.10' X_ActStatusActiveSuspendedAbortedCompleted (DYNAMIC).</assert>
   </rule>

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.165
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.165']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.165']]/hl7:effectiveTime
Item: (Stato dell'Allergia/Intolleranza )
-->

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.165
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.165']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.165']]/hl7:value
Item: (Stato dell'Allergia/Intolleranza )
-->

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.717
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:act[hl7:code[(@code = '48767-8' and @codeSystem = '2.16.840.1.113883.6.1')]]]
Item: (Allergie - observation (Tele))
-->
   <rule fpi="RULC-1"
         context="*[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:act[hl7:code[(@code = '48767-8' and @codeSystem = '2.16.840.1.113883.6.1')]]]">
      <extends rule="d939076e0-false-d939080e0"/>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.717-2025-07-11T105611.html"
              test="string(@typeCode) = ('SUBJ')">(Allergie - observation (Tele)): The value for typeCode SHALL be 'SUBJ'. Found: "<value-of select="@typeCode"/>"</assert>
   </rule>

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.166
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:act[hl7:code[(@code = '48767-8' and @codeSystem = '2.16.840.1.113883.6.1')]]]
Item: (Commenti)
-->
   <rule fpi="RULC-1" id="d939076e0-false-d939080e0" abstract="true">
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.166-2022-09-25T200132.html"
              test="count(hl7:act[hl7:code[(@code = '48767-8' and @codeSystem = '2.16.840.1.113883.6.1')]]) &gt;= 1">(Commenti): element hl7:act[hl7:code[(@code = '48767-8' and @codeSystem = '2.16.840.1.113883.6.1')]] is required [min 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.166-2022-09-25T200132.html"
              test="count(hl7:act[hl7:code[(@code = '48767-8' and @codeSystem = '2.16.840.1.113883.6.1')]]) &lt;= 1">(Commenti): element hl7:act[hl7:code[(@code = '48767-8' and @codeSystem = '2.16.840.1.113883.6.1')]] appears too often [max 1x].</assert>
   </rule>

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.166
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:act[hl7:code[(@code = '48767-8' and @codeSystem = '2.16.840.1.113883.6.1')]]]/hl7:act[hl7:code[(@code = '48767-8' and @codeSystem = '2.16.840.1.113883.6.1')]]
Item: (Commenti)
-->
   <rule fpi="RULC-1"
         context="*[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:act[hl7:code[(@code = '48767-8' and @codeSystem = '2.16.840.1.113883.6.1')]]]/hl7:act[hl7:code[(@code = '48767-8' and @codeSystem = '2.16.840.1.113883.6.1')]]">
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.166-2022-09-25T200132.html"
              test="string(@classCode) = ('ACT')">(Commenti): The value for classCode SHALL be 'ACT'. Found: "<value-of select="@classCode"/>"</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.166-2022-09-25T200132.html"
              test="string(@moodCode) = ('EVN')">(Commenti): The value for moodCode SHALL be 'EVN'. Found: "<value-of select="@moodCode"/>"</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.166-2022-09-25T200132.html"
              test="count(hl7:templateId[not(@nullFlavor)]) &gt;= 1">(Commenti): element hl7:templateId[not(@nullFlavor)] is mandatory [min 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.166-2022-09-25T200132.html"
              test="count(hl7:templateId[not(@nullFlavor)]) &lt;= 1">(Commenti): element hl7:templateId[not(@nullFlavor)] appears too often [max 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.166-2022-09-25T200132.html"
              test="count(hl7:code[(@code = '48767-8' and @codeSystem = '2.16.840.1.113883.6.1')]) &gt;= 1">(Commenti): element hl7:code[(@code = '48767-8' and @codeSystem = '2.16.840.1.113883.6.1')] is required [min 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.166-2022-09-25T200132.html"
              test="count(hl7:code[(@code = '48767-8' and @codeSystem = '2.16.840.1.113883.6.1')]) &lt;= 1">(Commenti): element hl7:code[(@code = '48767-8' and @codeSystem = '2.16.840.1.113883.6.1')] appears too often [max 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.166-2022-09-25T200132.html"
              test="count(hl7:text) &gt;= 1">(Commenti): element hl7:text is required [min 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.166-2022-09-25T200132.html"
              test="count(hl7:text) &lt;= 1">(Commenti): element hl7:text appears too often [max 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.166-2022-09-25T200132.html"
              test="count(hl7:statusCode[@code = 'completed' or @nullFlavor]) &lt;= 1">(Commenti): element hl7:statusCode[@code = 'completed' or @nullFlavor] appears too often [max 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.166-2022-09-25T200132.html"
              test="count(hl7:effectiveTime) &lt;= 1">(Commenti): element hl7:effectiveTime appears too often [max 1x].</assert>
   </rule>

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.166
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:act[hl7:code[(@code = '48767-8' and @codeSystem = '2.16.840.1.113883.6.1')]]]/hl7:act[hl7:code[(@code = '48767-8' and @codeSystem = '2.16.840.1.113883.6.1')]]/hl7:templateId[not(@nullFlavor)]
Item: (Commenti)
-->
   <rule fpi="RULC-1"
         context="*[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:act[hl7:code[(@code = '48767-8' and @codeSystem = '2.16.840.1.113883.6.1')]]]/hl7:act[hl7:code[(@code = '48767-8' and @codeSystem = '2.16.840.1.113883.6.1')]]/hl7:templateId[not(@nullFlavor)]">
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.166-2022-09-25T200132.html"
              test="string(@root) = ('2.16.840.1.113883.3.1937.777.63.10.166') or not(@root)">(Commenti): The value for root SHALL be '2.16.840.1.113883.3.1937.777.63.10.166'. Found: "<value-of select="@root"/>"</assert>
   </rule>

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.166
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:act[hl7:code[(@code = '48767-8' and @codeSystem = '2.16.840.1.113883.6.1')]]]/hl7:act[hl7:code[(@code = '48767-8' and @codeSystem = '2.16.840.1.113883.6.1')]]/hl7:code[(@code = '48767-8' and @codeSystem = '2.16.840.1.113883.6.1')]
Item: (Commenti)
-->
   <rule fpi="RULC-1"
         context="*[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:act[hl7:code[(@code = '48767-8' and @codeSystem = '2.16.840.1.113883.6.1')]]]/hl7:act[hl7:code[(@code = '48767-8' and @codeSystem = '2.16.840.1.113883.6.1')]]/hl7:code[(@code = '48767-8' and @codeSystem = '2.16.840.1.113883.6.1')]">
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.166-2022-09-25T200132.html"
              test="string(@code) = ('48767-8')">(Commenti): The value for code SHALL be '48767-8'. Found: "<value-of select="@code"/>"</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.166-2022-09-25T200132.html"
              test="string(@codeSystem) = ('2.16.840.1.113883.6.1')">(Commenti): The value for codeSystem SHALL be '2.16.840.1.113883.6.1'. Found: "<value-of select="@codeSystem"/>"</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.166-2022-09-25T200132.html"
              test="not(@codeSystemName) or string-length(@codeSystemName)&gt;0">(Commenti): Attribute @codeSystemName SHALL be of data type 'st'  - '<value-of select="@codeSystemName"/>'</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.166-2022-09-25T200132.html"
              test="not(@displayName) or string-length(@displayName)&gt;0">(Commenti): Attribute @displayName SHALL be of data type 'st'  - '<value-of select="@displayName"/>'</assert>
   </rule>

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.166
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:act[hl7:code[(@code = '48767-8' and @codeSystem = '2.16.840.1.113883.6.1')]]]/hl7:act[hl7:code[(@code = '48767-8' and @codeSystem = '2.16.840.1.113883.6.1')]]/hl7:text
Item: (Commenti)
-->
   <rule fpi="RULC-1"
         context="*[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:act[hl7:code[(@code = '48767-8' and @codeSystem = '2.16.840.1.113883.6.1')]]]/hl7:act[hl7:code[(@code = '48767-8' and @codeSystem = '2.16.840.1.113883.6.1')]]/hl7:text">
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.166-2022-09-25T200132.html"
              test="count(hl7:reference) &lt;= 1">(Commenti): element hl7:reference appears too often [max 1x].</assert>
   </rule>

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.166
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:act[hl7:code[(@code = '48767-8' and @codeSystem = '2.16.840.1.113883.6.1')]]]/hl7:act[hl7:code[(@code = '48767-8' and @codeSystem = '2.16.840.1.113883.6.1')]]/hl7:text/hl7:reference
Item: (Commenti)
-->

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.166
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:act[hl7:code[(@code = '48767-8' and @codeSystem = '2.16.840.1.113883.6.1')]]]/hl7:act[hl7:code[(@code = '48767-8' and @codeSystem = '2.16.840.1.113883.6.1')]]/hl7:statusCode[@code = 'completed' or @nullFlavor]
Item: (Commenti)
-->
   <rule fpi="RULC-1"
         context="*[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:act[hl7:code[(@code = '48767-8' and @codeSystem = '2.16.840.1.113883.6.1')]]]/hl7:act[hl7:code[(@code = '48767-8' and @codeSystem = '2.16.840.1.113883.6.1')]]/hl7:statusCode[@code = 'completed' or @nullFlavor]">
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251023T111406/tmp-2.16.840.1.113883.3.1937.777.63.10.166-2022-09-25T200132.html"
              test="@nullFlavor or (@code='completed')">(Commenti): The element value SHALL be one of 'code 'completed''.</assert>
   </rule>

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.166
Context: *[hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]]/hl7:act[hl7:statusCode[@code = doc('include/voc-2.16.840.1.113883.3.1937.777.63.11.10-DYNAMIC.xml')//valueSet[1]/conceptList/*/@code or @nullFlavor]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]]/hl7:observation[hl7:code[(@code = '52473-6' and @codeSystem = '2.16.840.1.113883.6.1') or @nullFlavor]]/hl7:entryRelationship[hl7:act[hl7:code[(@code = '48767-8' and @codeSystem = '2.16.840.1.113883.6.1')]]]/hl7:act[hl7:code[(@code = '48767-8' and @codeSystem = '2.16.840.1.113883.6.1')]]/hl7:effectiveTime
Item: (Commenti)
--></pattern>
