<?xml version="1.0" encoding="UTF-8"?>
<!--
Template derived pattern
===========================================
ID: 2.16.840.1.113883.3.1937.777.63.10.648
Name: Quesito Diagnostico (Tele)
Description: Reason for visit Narrative (LOINC: 29299-5 )
-->
<pattern xmlns="http://purl.oclc.org/dsdl/schematron"
         id="template-2.16.840.1.113883.3.1937.777.63.10.648-2025-05-27T122852">
   <title>Quesito Diagnostico (Tele)</title>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.648
Context: *[hl7:section[hl7:code[(@code = '29299-5 ' and @codeSystem = '2.16.840.1.113883.6.1')]]]
Item: (Quesito Diagnostico (Tele))
-->

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.648
Context: *[hl7:section[hl7:code[(@code = '29299-5 ' and @codeSystem = '2.16.840.1.113883.6.1')]]]/hl7:section[hl7:code[(@code = '29299-5 ' and @codeSystem = '2.16.840.1.113883.6.1')]]
Item: (Quesito Diagnostico (Tele))
-->

   <rule fpi="RULC-1"
         context="*[hl7:section[hl7:code[(@code = '29299-5 ' and @codeSystem = '2.16.840.1.113883.6.1')]]]/hl7:section[hl7:code[(@code = '29299-5 ' and @codeSystem = '2.16.840.1.113883.6.1')]]"
         id="d44e4725-false-d912120e0">
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251030T104952/tmp-2.16.840.1.113883.3.1937.777.63.10.648-2025-05-27T122852.html"
              test="string(@classCode) = ('DOCSECT') or not(@classCode)">(Quesito Diagnostico (Tele)): The value for classCode SHALL be 'DOCSECT'. Found: "<value-of select="@classCode"/>"</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251030T104952/tmp-2.16.840.1.113883.3.1937.777.63.10.648-2025-05-27T122852.html"
              test="string(@moodCode) = ('EVN') or not(@moodCode)">(Quesito Diagnostico (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-20251030T104952/tmp-2.16.840.1.113883.3.1937.777.63.10.648-2025-05-27T122852.html"
              test="count(hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.648']) &lt;= 1">(Quesito Diagnostico (Tele)): element hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.648'] appears too often [max 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251030T104952/tmp-2.16.840.1.113883.3.1937.777.63.10.648-2025-05-27T122852.html"
              test="count(hl7:id) &lt;= 1">(Quesito Diagnostico (Tele)): element hl7:id appears too often [max 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251030T104952/tmp-2.16.840.1.113883.3.1937.777.63.10.648-2025-05-27T122852.html"
              test="count(hl7:code[(@code = '29299-5 ' and @codeSystem = '2.16.840.1.113883.6.1')]) &gt;= 1">(Quesito Diagnostico (Tele)): element hl7:code[(@code = '29299-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-20251030T104952/tmp-2.16.840.1.113883.3.1937.777.63.10.648-2025-05-27T122852.html"
              test="count(hl7:code[(@code = '29299-5 ' and @codeSystem = '2.16.840.1.113883.6.1')]) &lt;= 1">(Quesito Diagnostico (Tele)): element hl7:code[(@code = '29299-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-20251030T104952/tmp-2.16.840.1.113883.3.1937.777.63.10.648-2025-05-27T122852.html"
              test="count(hl7:title) &lt;= 1">(Quesito Diagnostico (Tele)): element hl7:title appears too often [max 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251030T104952/tmp-2.16.840.1.113883.3.1937.777.63.10.648-2025-05-27T122852.html"
              test="count(hl7:text) &gt;= 1">(Quesito Diagnostico (Tele)): element hl7:text is required [min 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251030T104952/tmp-2.16.840.1.113883.3.1937.777.63.10.648-2025-05-27T122852.html"
              test="count(hl7:text) &lt;= 1">(Quesito Diagnostico (Tele)): element hl7:text appears too often [max 1x].</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251030T104952/tmp-2.16.840.1.113883.3.1937.777.63.10.648-2025-05-27T122852.html"
              test="count(hl7:entry[hl7:observation[hl7:code[(@code = '29298-7' and @codeSystem = '2.16.840.1.113883.6.1')]]]) &lt;= 1">(Quesito Diagnostico (Tele)): element hl7:entry[hl7:observation[hl7:code[(@code = '29298-7' 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.648
Context: *[hl7:section[hl7:code[(@code = '29299-5 ' and @codeSystem = '2.16.840.1.113883.6.1')]]]/hl7:section[hl7:code[(@code = '29299-5 ' and @codeSystem = '2.16.840.1.113883.6.1')]]/hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.648']
Item: (Quesito Diagnostico (Tele))
-->

   <rule fpi="RULC-1"
         context="*[hl7:section[hl7:code[(@code = '29299-5 ' and @codeSystem = '2.16.840.1.113883.6.1')]]]/hl7:section[hl7:code[(@code = '29299-5 ' and @codeSystem = '2.16.840.1.113883.6.1')]]/hl7:templateId[@root = '2.16.840.1.113883.3.1937.777.63.10.648']"
         id="d44e4731-false-d912520e0">
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251030T104952/tmp-2.16.840.1.113883.3.1937.777.63.10.648-2025-05-27T122852.html"
              test="string(@root) = ('2.16.840.1.113883.3.1937.777.63.10.648')">(Quesito Diagnostico (Tele)): The value for root SHALL be '2.16.840.1.113883.3.1937.777.63.10.648'. Found: "<value-of select="@root"/>"</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.648
Context: *[hl7:section[hl7:code[(@code = '29299-5 ' and @codeSystem = '2.16.840.1.113883.6.1')]]]/hl7:section[hl7:code[(@code = '29299-5 ' and @codeSystem = '2.16.840.1.113883.6.1')]]/hl7:id
Item: (Quesito Diagnostico (Tele))
-->

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.648
Context: *[hl7:section[hl7:code[(@code = '29299-5 ' and @codeSystem = '2.16.840.1.113883.6.1')]]]/hl7:section[hl7:code[(@code = '29299-5 ' and @codeSystem = '2.16.840.1.113883.6.1')]]/hl7:code[(@code = '29299-5 ' and @codeSystem = '2.16.840.1.113883.6.1')]
Item: (Quesito Diagnostico (Tele))
-->

   <rule fpi="RULC-1"
         context="*[hl7:section[hl7:code[(@code = '29299-5 ' and @codeSystem = '2.16.840.1.113883.6.1')]]]/hl7:section[hl7:code[(@code = '29299-5 ' and @codeSystem = '2.16.840.1.113883.6.1')]]/hl7:code[(@code = '29299-5 ' and @codeSystem = '2.16.840.1.113883.6.1')]"
         id="d44e4738-false-d912540e0">
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251030T104952/tmp-2.16.840.1.113883.3.1937.777.63.10.648-2025-05-27T122852.html"
              test="@nullFlavor or (@code='29299-5 ' and @codeSystem='2.16.840.1.113883.6.1')">(Quesito Diagnostico (Tele)): The element value SHALL be one of 'code '29299-5 ' codeSystem '2.16.840.1.113883.6.1''.</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251030T104952/tmp-2.16.840.1.113883.3.1937.777.63.10.648-2025-05-27T122852.html"
              test="@code">(Quesito Diagnostico (Tele)): attribute @code SHALL be present.</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251030T104952/tmp-2.16.840.1.113883.3.1937.777.63.10.648-2025-05-27T122852.html"
              test="not(@code) or (string-length(@code) &gt; 0 and not(matches(@code,'\s')))">(Quesito Diagnostico (Tele)): Attribute @code SHALL be of data type 'cs'  - '<value-of select="@code"/>'</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251030T104952/tmp-2.16.840.1.113883.3.1937.777.63.10.648-2025-05-27T122852.html"
              test="@codeSystem">(Quesito Diagnostico (Tele)): attribute @codeSystem SHALL be present.</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251030T104952/tmp-2.16.840.1.113883.3.1937.777.63.10.648-2025-05-27T122852.html"
              test="not(@codeSystem) or matches(@codeSystem,'^[0-2](\.(0|[1-9]\d*))*$') or matches(@codeSystem,'^[A-Fa-f\d]{8}-[A-Fa-f\d]{4}-[A-Fa-f\d]{4}-[A-Fa-f\d]{4}-[A-Fa-f\d]{12}$') or matches(@codeSystem,'^[A-Za-z][A-Za-z\d\-]*$')">(Quesito Diagnostico (Tele)): Attribute @codeSystem SHALL be of data type 'uid'  - '<value-of select="@codeSystem"/>'</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251030T104952/tmp-2.16.840.1.113883.3.1937.777.63.10.648-2025-05-27T122852.html"
              test="not(@codeSystemName) or string-length(@codeSystemName)&gt;0">(Quesito Diagnostico (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-20251030T104952/tmp-2.16.840.1.113883.3.1937.777.63.10.648-2025-05-27T122852.html"
              test="not(@displayName) or string-length(@displayName)&gt;0">(Quesito Diagnostico (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.648
Context: *[hl7:section[hl7:code[(@code = '29299-5 ' and @codeSystem = '2.16.840.1.113883.6.1')]]]/hl7:section[hl7:code[(@code = '29299-5 ' and @codeSystem = '2.16.840.1.113883.6.1')]]/hl7:title
Item: (Quesito Diagnostico (Tele))
-->

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.648
Context: *[hl7:section[hl7:code[(@code = '29299-5 ' and @codeSystem = '2.16.840.1.113883.6.1')]]]/hl7:section[hl7:code[(@code = '29299-5 ' and @codeSystem = '2.16.840.1.113883.6.1')]]/hl7:text
Item: (Quesito Diagnostico (Tele))
-->


   <!--
Template derived rules for ID: 2.16.840.1.113883.3.1937.777.63.10.648
Context: *[hl7:section[hl7:code[(@code = '29299-5 ' and @codeSystem = '2.16.840.1.113883.6.1')]]]/hl7:section[hl7:code[(@code = '29299-5 ' and @codeSystem = '2.16.840.1.113883.6.1')]]/hl7:entry[hl7:observation[hl7:code[(@code = '29298-7' and @codeSystem = '2.16.840.1.113883.6.1')]]]
Item: (Quesito Diagnostico (Tele))
-->
   <rule fpi="RULC-1"
         context="*[hl7:section[hl7:code[(@code = '29299-5 ' and @codeSystem = '2.16.840.1.113883.6.1')]]]/hl7:section[hl7:code[(@code = '29299-5 ' and @codeSystem = '2.16.840.1.113883.6.1')]]/hl7:entry[hl7:observation[hl7:code[(@code = '29298-7' and @codeSystem = '2.16.840.1.113883.6.1')]]]">
      <extends rule="d913049e0-false-d913053e0"/>
      <let name="theAttValue"
           value="distinct-values(tokenize(normalize-space(@typeCode),'\s'))"/>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251030T104952/tmp-2.16.840.1.113883.3.1937.777.63.10.648-2025-05-27T122852.html"
              test="not(@typeCode) or empty($theAttValue[not(. = (doc('include/voc-2.16.840.1.113883.1.11.19446-DYNAMIC.xml')/*/valueSet/conceptList/concept/@code))])">(Quesito Diagnostico (Tele)): The value for typeCode SHALL be selected from value set '2.16.840.1.113883.1.11.19446' x_ActRelationshipEntry (DYNAMIC).</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251030T104952/tmp-2.16.840.1.113883.3.1937.777.63.10.648-2025-05-27T122852.html"
              test="string(@contextConductionInd) = ('true') or not(@contextConductionInd)">(Quesito Diagnostico (Tele)): The value for contextConductionInd SHALL be 'true'. Found: "<value-of select="@contextConductionInd"/>"</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251030T104952/tmp-2.16.840.1.113883.3.1937.777.63.10.648-2025-05-27T122852.html"
              test="count(hl7:observation[hl7:code[(@code = '29298-7' and @codeSystem = '2.16.840.1.113883.6.1')]]) &gt;= 1">(Quesito Diagnostico (Tele)): element hl7:observation[hl7:code[(@code = '29298-7' 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-20251030T104952/tmp-2.16.840.1.113883.3.1937.777.63.10.648-2025-05-27T122852.html"
              test="count(hl7:observation[hl7:code[(@code = '29298-7' and @codeSystem = '2.16.840.1.113883.6.1')]]) &lt;= 1">(Quesito Diagnostico (Tele)): element hl7:observation[hl7:code[(@code = '29298-7' 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.648
Context: *[hl7:section[hl7:code[(@code = '29299-5 ' and @codeSystem = '2.16.840.1.113883.6.1')]]]/hl7:section[hl7:code[(@code = '29299-5 ' and @codeSystem = '2.16.840.1.113883.6.1')]]/hl7:entry[hl7:observation[hl7:code[(@code = '29298-7' and @codeSystem = '2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code = '29298-7' and @codeSystem = '2.16.840.1.113883.6.1')]]
Item: (Quesito Diagnostico (Tele))
-->
   <rule fpi="RULC-1"
         context="*[hl7:section[hl7:code[(@code = '29299-5 ' and @codeSystem = '2.16.840.1.113883.6.1')]]]/hl7:section[hl7:code[(@code = '29299-5 ' and @codeSystem = '2.16.840.1.113883.6.1')]]/hl7:entry[hl7:observation[hl7:code[(@code = '29298-7' and @codeSystem = '2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code = '29298-7' and @codeSystem = '2.16.840.1.113883.6.1')]]">
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251030T104952/tmp-2.16.840.1.113883.3.1937.777.63.10.648-2025-05-27T122852.html"
              test="string(@moodCode) = ('EVN')">(Quesito Diagnostico (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-20251030T104952/tmp-2.16.840.1.113883.3.1937.777.63.10.648-2025-05-27T122852.html"
              test="string(@classCode) = ('OBS') or not(@classCode)">(Quesito Diagnostico (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-20251030T104952/tmp-2.16.840.1.113883.3.1937.777.63.10.648-2025-05-27T122852.html"
              test="count(hl7:code[(@code = '29298-7' and @codeSystem = '2.16.840.1.113883.6.1')]) &gt;= 1">(Quesito Diagnostico (Tele)): element hl7:code[(@code = '29298-7' 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-20251030T104952/tmp-2.16.840.1.113883.3.1937.777.63.10.648-2025-05-27T122852.html"
              test="count(hl7:code[(@code = '29298-7' and @codeSystem = '2.16.840.1.113883.6.1')]) &lt;= 1">(Quesito Diagnostico (Tele)): element hl7:code[(@code = '29298-7' 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.648
Context: *[hl7:section[hl7:code[(@code = '29299-5 ' and @codeSystem = '2.16.840.1.113883.6.1')]]]/hl7:section[hl7:code[(@code = '29299-5 ' and @codeSystem = '2.16.840.1.113883.6.1')]]/hl7:entry[hl7:observation[hl7:code[(@code = '29298-7' and @codeSystem = '2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code = '29298-7' and @codeSystem = '2.16.840.1.113883.6.1')]]/hl7:code[(@code = '29298-7' and @codeSystem = '2.16.840.1.113883.6.1')]
Item: (Quesito Diagnostico (Tele))
-->
   <rule fpi="RULC-1"
         context="*[hl7:section[hl7:code[(@code = '29299-5 ' and @codeSystem = '2.16.840.1.113883.6.1')]]]/hl7:section[hl7:code[(@code = '29299-5 ' and @codeSystem = '2.16.840.1.113883.6.1')]]/hl7:entry[hl7:observation[hl7:code[(@code = '29298-7' and @codeSystem = '2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code = '29298-7' and @codeSystem = '2.16.840.1.113883.6.1')]]/hl7:code[(@code = '29298-7' and @codeSystem = '2.16.840.1.113883.6.1')]">
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251030T104952/tmp-2.16.840.1.113883.3.1937.777.63.10.648-2025-05-27T122852.html"
              test="string(@code) = ('29298-7')">(Quesito Diagnostico (Tele)): The value for code SHALL be '29298-7'. Found: "<value-of select="@code"/>"</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251030T104952/tmp-2.16.840.1.113883.3.1937.777.63.10.648-2025-05-27T122852.html"
              test="string(@codeSystem) = ('2.16.840.1.113883.6.1')">(Quesito Diagnostico (Tele)): 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-20251030T104952/tmp-2.16.840.1.113883.3.1937.777.63.10.648-2025-05-27T122852.html"
              test="string(@codeSystemName) = ('LOINC') or not(@codeSystemName)">(Quesito Diagnostico (Tele)): The value for codeSystemName SHALL be 'LOINC'. Found: "<value-of select="@codeSystemName"/>"</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251030T104952/tmp-2.16.840.1.113883.3.1937.777.63.10.648-2025-05-27T122852.html"
              test="not(@codeSystemName) or string-length(@codeSystemName)&gt;0">(Quesito Diagnostico (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-20251030T104952/tmp-2.16.840.1.113883.3.1937.777.63.10.648-2025-05-27T122852.html"
              test="string(@displayName) = ('Motivo della visita') or not(@displayName)">(Quesito Diagnostico (Tele)): The value for displayName SHALL be 'Motivo della visita'. Found: "<value-of select="@displayName"/>"</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251030T104952/tmp-2.16.840.1.113883.3.1937.777.63.10.648-2025-05-27T122852.html"
              test="not(@displayName) or string-length(@displayName)&gt;0">(Quesito Diagnostico (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.648
Context: *[hl7:section[hl7:code[(@code = '29299-5 ' and @codeSystem = '2.16.840.1.113883.6.1')]]]/hl7:section[hl7:code[(@code = '29299-5 ' and @codeSystem = '2.16.840.1.113883.6.1')]]/hl7:entry[hl7:observation[hl7:code[(@code = '29298-7' and @codeSystem = '2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code = '29298-7' and @codeSystem = '2.16.840.1.113883.6.1')]]/hl7:value[@codeSystem = '2.16.840.1.113883.6.103']
Item: (Quesito Diagnostico (Tele))
-->
   <rule fpi="RULC-1"
         context="*[hl7:section[hl7:code[(@code = '29299-5 ' and @codeSystem = '2.16.840.1.113883.6.1')]]]/hl7:section[hl7:code[(@code = '29299-5 ' and @codeSystem = '2.16.840.1.113883.6.1')]]/hl7:entry[hl7:observation[hl7:code[(@code = '29298-7' and @codeSystem = '2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code = '29298-7' and @codeSystem = '2.16.840.1.113883.6.1')]]/hl7:value[@codeSystem = '2.16.840.1.113883.6.103']">
      <let name="xsiLocalName"
           value="if (contains(@xsi:type, ':')) then substring-after(@xsi:type,':') else @xsi:type"/>
      <let name="xsiLocalNS"
           value="if (contains(@xsi:type, ':')) then namespace-uri-for-prefix(substring-before(@xsi:type,':'),.) else namespace-uri-for-prefix('',.)"/>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251030T104952/tmp-2.16.840.1.113883.3.1937.777.63.10.648-2025-05-27T122852.html"
              test="@nullFlavor or ($xsiLocalName='CD' and $xsiLocalNS='urn:hl7-org:v3')">(Quesito Diagnostico (Tele)): If an @xsi:type instruction is present it SHALL be valued "{urn:hl7-org:v3}:CD". Found "{<value-of select="namespace-uri-from-QName(resolve-QName(@xsi:type,.))"/>}:<value-of select="local-name-from-QName(resolve-QName(@xsi:type,.))"/>"</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251030T104952/tmp-2.16.840.1.113883.3.1937.777.63.10.648-2025-05-27T122852.html"
              test="@code">(Quesito Diagnostico (Tele)): attribute @code SHALL be present.</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251030T104952/tmp-2.16.840.1.113883.3.1937.777.63.10.648-2025-05-27T122852.html"
              test="not(@code) or (string-length(@code) &gt; 0 and not(matches(@code,'\s')))">(Quesito Diagnostico (Tele)): Attribute @code SHALL be of data type 'cs'  - '<value-of select="@code"/>'</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251030T104952/tmp-2.16.840.1.113883.3.1937.777.63.10.648-2025-05-27T122852.html"
              test="string(@codeSystem) = ('2.16.840.1.113883.6.103')">(Quesito Diagnostico (Tele)): The value for codeSystem SHALL be '2.16.840.1.113883.6.103'. Found: "<value-of select="@codeSystem"/>"</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251030T104952/tmp-2.16.840.1.113883.3.1937.777.63.10.648-2025-05-27T122852.html"
              test="string(@codeSystemName) = ('ICD9CM') or not(@codeSystemName)">(Quesito Diagnostico (Tele)): The value for codeSystemName SHALL be 'ICD9CM'. Found: "<value-of select="@codeSystemName"/>"</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251030T104952/tmp-2.16.840.1.113883.3.1937.777.63.10.648-2025-05-27T122852.html"
              test="not(@codeSystemName) or string-length(@codeSystemName)&gt;0">(Quesito Diagnostico (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-20251030T104952/tmp-2.16.840.1.113883.3.1937.777.63.10.648-2025-05-27T122852.html"
              test="not(@displayName) or string-length(@displayName)&gt;0">(Quesito Diagnostico (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.10.12.300
Context: *[hl7:section[hl7:code[(@code = '29299-5 ' and @codeSystem = '2.16.840.1.113883.6.1')]]]/hl7:section[hl7:code[(@code = '29299-5 ' and @codeSystem = '2.16.840.1.113883.6.1')]]/hl7:entry[hl7:observation[hl7:code[(@code = '29298-7' and @codeSystem = '2.16.840.1.113883.6.1')]]]
Item: (CDA Clinical Statement)
-->
   <rule fpi="RULC-1" id="d913049e0-false-d913053e0" abstract="true">
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251030T104952/tmp-2.16.840.1.113883.10.12.300-2005-09-07T000000.html"
              test="count(hl7:act[hl7:templateId[@root = '2.16.840.1.113883.10.12.301']] | hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.10.12.302']] | hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.10.12.303']] | hl7:observationMedia[hl7:templateId[@root = '2.16.840.1.113883.10.12.304']] | hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.10.12.305']] | hl7:procedure[hl7:templateId[@root = '2.16.840.1.113883.10.12.306']] | hl7:regionOfInterest[hl7:templateId[@root = '2.16.840.1.113883.10.12.307']] | hl7:substanceAdministration[hl7:templateId[@root = '2.16.840.1.113883.10.12.308']] | hl7:supply[hl7:templateId[@root = '2.16.840.1.113883.10.12.309']]) &gt;= 1">(CDA Clinical Statement): choice (hl7:act[hl7:templateId[@root = '2.16.840.1.113883.10.12.301']]  or  hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.10.12.302']]  or  hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.10.12.303']]  or  hl7:observationMedia[hl7:templateId[@root = '2.16.840.1.113883.10.12.304']]  or  hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.10.12.305']]  or  hl7:procedure[hl7:templateId[@root = '2.16.840.1.113883.10.12.306']]  or  hl7:regionOfInterest[hl7:templateId[@root = '2.16.840.1.113883.10.12.307']]  or  hl7:substanceAdministration[hl7:templateId[@root = '2.16.840.1.113883.10.12.308']]  or  hl7:supply[hl7:templateId[@root = '2.16.840.1.113883.10.12.309']]) does not contain enough elements [min 1x]</assert>
      <assert role="error"
              see="https://hl7itig.art-decor.pub/hl7itig-html-20251030T104952/tmp-2.16.840.1.113883.10.12.300-2005-09-07T000000.html"
              test="count(hl7:act[hl7:templateId[@root = '2.16.840.1.113883.10.12.301']] | hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.10.12.302']] | hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.10.12.303']] | hl7:observationMedia[hl7:templateId[@root = '2.16.840.1.113883.10.12.304']] | hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.10.12.305']] | hl7:procedure[hl7:templateId[@root = '2.16.840.1.113883.10.12.306']] | hl7:regionOfInterest[hl7:templateId[@root = '2.16.840.1.113883.10.12.307']] | hl7:substanceAdministration[hl7:templateId[@root = '2.16.840.1.113883.10.12.308']] | hl7:supply[hl7:templateId[@root = '2.16.840.1.113883.10.12.309']]) &lt;= 1">(CDA Clinical Statement): choice (hl7:act[hl7:templateId[@root = '2.16.840.1.113883.10.12.301']]  or  hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.10.12.302']]  or  hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.10.12.303']]  or  hl7:observationMedia[hl7:templateId[@root = '2.16.840.1.113883.10.12.304']]  or  hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.10.12.305']]  or  hl7:procedure[hl7:templateId[@root = '2.16.840.1.113883.10.12.306']]  or  hl7:regionOfInterest[hl7:templateId[@root = '2.16.840.1.113883.10.12.307']]  or  hl7:substanceAdministration[hl7:templateId[@root = '2.16.840.1.113883.10.12.308']]  or  hl7:supply[hl7:templateId[@root = '2.16.840.1.113883.10.12.309']]) contains too many elements [max 1x]</assert>
   </rule>
</pattern>
