<?xml version="1.0" encoding="UTF-8"?>
<!--
Template derived pattern
===========================================
ID: 2.16.840.1.113883.3.4424.13.10.3.196
Name: [3] Sekcja informacji o skierowaniu do przeprowadzenia badania cytologicznego
Description: Szablon CDA dla sekcji informacji o skierowaniu do przeprowadzenia badania cytologicznego
-->
<pattern xmlns="http://purl.oclc.org/dsdl/schematron"
         id="template-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000">
   <title>[3] Sekcja informacji o skierowaniu do przeprowadzenia badania cytologicznego</title>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.3.196
Context: *[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]
Item: (plCdaInformationAboutReferralForCytologicalDiagnosisSection)
-->

   <rule context="*[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196'])&gt;=1 and not(hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/@nullFlavor)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196'] jest mandatory [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196'])&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196'] występuje zbyt często [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.3.196
Context: *[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']
Item: (plCdaInformationAboutReferralForCytologicalDiagnosisSection)
-->

   <rule context="*[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="string(@classCode)='DOCSECT' or not(@classCode)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Wartość dla @classCode MUSI wynosić 'DOCSECT'.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="string(@moodCode)='EVN' or not(@moodCode)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Wartość dla @moodCode MUSI wynosić 'EVN'.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.3.196'])&gt;=1 and not(hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.3.196']/@nullFlavor)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.3.196'] jest mandatory [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.3.196'])&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.3.196'] występuje zbyt często [max 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:code[(@code='57832-8' and @codeSystem='2.16.840.1.113883.6.1')])&gt;=1 and not(hl7:code[(@code='57832-8' and @codeSystem='2.16.840.1.113883.6.1')]/@nullFlavor)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:code[(@code='57832-8' and @codeSystem='2.16.840.1.113883.6.1')] jest mandatory [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:code[(@code='57832-8' and @codeSystem='2.16.840.1.113883.6.1')])&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:code[(@code='57832-8' and @codeSystem='2.16.840.1.113883.6.1')] występuje zbyt często [max 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:title)&gt;=1 and not(hl7:title/@nullFlavor)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:title jest mandatory [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:title)&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:title występuje zbyt często [max 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:text)&gt;=1 and not(hl7:text/@nullFlavor)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:text jest mandatory [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:text)&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:text występuje zbyt często [max 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:entry)&gt;=1 and not(hl7:entry/@nullFlavor)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:entry jest mandatory [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:entry)&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:entry występuje zbyt często [max 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:component[hl7:section/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.197'])&gt;=1 and not(hl7:component[hl7:section/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.197']/@nullFlavor)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:component[hl7:section/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.197'] jest mandatory [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:component[hl7:section/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.197'])&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:component[hl7:section/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.197'] występuje zbyt często [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.3.196
Context: *[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.3.196']
Item: (plCdaInformationAboutReferralForCytologicalDiagnosisSection)
-->

   <rule context="*[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.3.196']"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='II' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Jeśli występuje instrukcja @xsi:type, to MUSI mieć wartość "{urn:hl7-org:v3}:II", znaleziono "{<value-of select="namespace-uri-from-QName(resolve-QName(@xsi:type,.))"/>}:<value-of select="local-name-from-QName(resolve-QName(@xsi:type,.))"/>"</assert>
      <extends rule="II"/>
      <let name="theValue" value="@value"/>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="string(@root)='2.16.840.1.113883.3.4424.13.10.3.196'">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Wartość dla @root MUSI wynosić '2.16.840.1.113883.3.4424.13.10.3.196'.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="not(@root) or matches(@root,'^[0-2](\.(0|[1-9][0-9]*))*$')">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Atrybut @root MUSI być typu 'oid'</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.3.196
Context: *[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:code[(@code='57832-8' and @codeSystem='2.16.840.1.113883.6.1')]
Item: (plCdaInformationAboutReferralForCytologicalDiagnosisSection)
-->

   <rule context="*[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:code[(@code='57832-8' and @codeSystem='2.16.840.1.113883.6.1')]"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='CE' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Jeśli występuje instrukcja @xsi:type, to MUSI mieć wartość "{urn:hl7-org:v3}:CE", znaleziono "{<value-of select="namespace-uri-from-QName(resolve-QName(@xsi:type,.))"/>}:<value-of select="local-name-from-QName(resolve-QName(@xsi:type,.))"/>"</assert>
      <extends rule="CE"/>
      <let name="theValue" value="@value"/>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="@nullFlavor or (@code='57832-8' and @codeSystem='2.16.840.1.113883.6.1' and @displayName='Prescription for diagnostic or specialist care Document' and @codeSystemName='LOINC')">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Wartość elementu MUSI wynosić code '57832-8' codeSystem '2.16.840.1.113883.6.1' displayName='Prescription for diagnostic or specialist care Document' codeSystemName='LOINC'.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:translation[(@code='DSDPBC' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')])&gt;=1 and not(hl7:translation[(@code='DSDPBC' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]/@nullFlavor)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:translation[(@code='DSDPBC' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')] jest mandatory [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:translation[(@code='DSDPBC' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')])&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:translation[(@code='DSDPBC' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')] występuje zbyt często [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.3.196
Context: *[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:code[(@code='57832-8' and @codeSystem='2.16.840.1.113883.6.1')]/hl7:translation[(@code='DSDPBC' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]
Item: (plCdaInformationAboutReferralForCytologicalDiagnosisSection)
-->

   <rule context="*[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:code[(@code='57832-8' and @codeSystem='2.16.840.1.113883.6.1')]/hl7:translation[(@code='DSDPBC' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="@nullFlavor or (@code='DSDPBC' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18' and @displayName='Dane skierowania do przeprowadzenia badania cytologicznego' and @codeSystemName='AtrybutyWBCYT')">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Wartość elementu MUSI wynosić code 'DSDPBC' codeSystem '2.16.840.1.113883.3.4424.13.5.18' displayName='Dane skierowania do przeprowadzenia badania cytologicznego' codeSystemName='AtrybutyWBCYT'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.3.196
Context: *[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:title
Item: (plCdaInformationAboutReferralForCytologicalDiagnosisSection)
-->

   <rule context="*[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:title"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='ST' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Jeśli występuje instrukcja @xsi:type, to MUSI mieć wartość "{urn:hl7-org:v3}:ST", znaleziono "{<value-of select="namespace-uri-from-QName(resolve-QName(@xsi:type,.))"/>}:<value-of select="local-name-from-QName(resolve-QName(@xsi:type,.))"/>"</assert>
      <extends rule="ST"/>
      <let name="theValue" value="text()"/>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="text()='Informacja o skierowaniu'">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): zawartość elementu hl7:title MUSI wynosić ''Informacja o skierowaniu''.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.3.196
Context: *[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:text
Item: (plCdaInformationAboutReferralForCytologicalDiagnosisSection)
-->

   <rule context="*[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:text"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='SD.TEXT' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Jeśli występuje instrukcja @xsi:type, to MUSI mieć wartość "{urn:hl7-org:v3}:SD.TEXT", znaleziono "{<value-of select="namespace-uri-from-QName(resolve-QName(@xsi:type,.))"/>}:<value-of select="local-name-from-QName(resolve-QName(@xsi:type,.))"/>"</assert>
      <extends rule="SD.TEXT"/>
      <let name="theValue" value="@value"/>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.3.196
Context: *[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry
Item: (plCdaInformationAboutReferralForCytologicalDiagnosisSection)
-->

   <rule context="*[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="not(@typeCode) or (string-length(@typeCode)&gt;0 and not(matches(@typeCode,'\s')))">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Atrybut @typeCode MUSI być typu 'cs'</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:encounter)&gt;=1 and not(hl7:encounter/@nullFlavor)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:encounter jest mandatory [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:encounter)&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:encounter występuje zbyt często [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.3.196
Context: *[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter
Item: (plCdaInformationAboutReferralForCytologicalDiagnosisSection)
-->

   <rule context="*[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="string(@classCode)='ENC'">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Wartość dla @classCode MUSI wynosić 'ENC'.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="not(@classCode) or (string-length(@classCode)&gt;0 and not(matches(@classCode,'\s')))">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Atrybut @classCode MUSI być typu 'cs'</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="string(@moodCode)='RQO'">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Wartość dla @moodCode MUSI wynosić 'RQO'.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="not(@moodCode) or (string-length(@moodCode)&gt;0 and not(matches(@moodCode,'\s')))">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Atrybut @moodCode MUSI być typu 'cs'</assert>
      <let name="elmcount"
           value="count(hl7:id[starts-with(@root,'2.16.840.1.113883.3.4424.2.7.') and ends-with(@root,'.4.1')]|hl7:id[starts-with(@root,'2.16.840.1.113883.3.4424.2.7.') and ends-with(@root,'.12.1')])"/>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="$elmcount&gt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): wybór (hl7:id[starts-with(@root,'2.16.840.1.113883.3.4424.2.7.') and ends-with(@root,'.4.1')] lub hl7:id[starts-with(@root,'2.16.840.1.113883.3.4424.2.7.') and ends-with(@root,'.12.1')]) zawiera zbyt mało elementów [min 1x]</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="$elmcount&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): wybór (hl7:id[starts-with(@root,'2.16.840.1.113883.3.4424.2.7.') and ends-with(@root,'.4.1')] lub hl7:id[starts-with(@root,'2.16.840.1.113883.3.4424.2.7.') and ends-with(@root,'.12.1')]) zawiera zbyt dużo elementów [min 1x]</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:id[starts-with(@root,'2.16.840.1.113883.3.4424.2.7.') and ends-with(@root,'.4.1')])&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:id[starts-with(@root,'2.16.840.1.113883.3.4424.2.7.') and ends-with(@root,'.4.1')] występuje zbyt często [max 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:id[starts-with(@root,'2.16.840.1.113883.3.4424.2.7.') and ends-with(@root,'.12.1')])&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:id[starts-with(@root,'2.16.840.1.113883.3.4424.2.7.') and ends-with(@root,'.12.1')] występuje zbyt często [max 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:text)&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:text występuje zbyt często [max 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:author)&gt;=1 and not(hl7:author/@nullFlavor)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:author jest mandatory [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:author)&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:author występuje zbyt często [max 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:entryRelationship[hl7:observation[hl7:code[(@code='KRK' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]])&gt;=1 and not(hl7:entryRelationship[hl7:observation[hl7:code[(@code='KRK' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/@nullFlavor)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:entryRelationship[hl7:observation[hl7:code[(@code='KRK' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]] jest mandatory [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:entryRelationship[hl7:observation[hl7:code[(@code='KRK' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]])&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:entryRelationship[hl7:observation[hl7:code[(@code='KRK' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]] występuje zbyt często [max 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:entryRelationship[hl7:observation[hl7:code[(@code='DODOPISSKIER' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]])&gt;=1 and not(hl7:entryRelationship[hl7:observation[hl7:code[(@code='DODOPISSKIER' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/@nullFlavor)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:entryRelationship[hl7:observation[hl7:code[(@code='DODOPISSKIER' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]] jest mandatory [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:entryRelationship[hl7:observation[hl7:code[(@code='DODOPISSKIER' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]])&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:entryRelationship[hl7:observation[hl7:code[(@code='DODOPISSKIER' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]] występuje zbyt często [max 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:entryRelationship[hl7:observation[hl7:code[(@code='OSTP' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]])&gt;=1 and not(hl7:entryRelationship[hl7:observation[hl7:code[(@code='OSTP' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/@nullFlavor)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:entryRelationship[hl7:observation[hl7:code[(@code='OSTP' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]] jest mandatory [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:entryRelationship[hl7:observation[hl7:code[(@code='OSTP' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]])&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:entryRelationship[hl7:observation[hl7:code[(@code='OSTP' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]] występuje zbyt często [max 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:entryRelationship[hl7:observation[hl7:code[(@code='DILONUM' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]])&gt;=1 and not(hl7:entryRelationship[hl7:observation[hl7:code[(@code='DILONUM' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/@nullFlavor)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:entryRelationship[hl7:observation[hl7:code[(@code='DILONUM' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]] jest mandatory [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:entryRelationship[hl7:observation[hl7:code[(@code='DILONUM' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]])&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:entryRelationship[hl7:observation[hl7:code[(@code='DILONUM' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]] występuje zbyt często [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.3.196
Context: *[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:id[starts-with(@root,'2.16.840.1.113883.3.4424.2.7.') and ends-with(@root,'.4.1')]
Item: (plCdaInformationAboutReferralForCytologicalDiagnosisSection)
-->

   <rule context="*[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:id[starts-with(@root,'2.16.840.1.113883.3.4424.2.7.') and ends-with(@root,'.4.1')]"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='II' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Jeśli występuje instrukcja @xsi:type, to MUSI mieć wartość "{urn:hl7-org:v3}:II", znaleziono "{<value-of select="namespace-uri-from-QName(resolve-QName(@xsi:type,.))"/>}:<value-of select="local-name-from-QName(resolve-QName(@xsi:type,.))"/>"</assert>
      <extends rule="II"/>
      <let name="theValue" value="@value"/>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="@extension">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): atrybut @extension MUSI wystąpić.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="not(@extension) or string-length(@extension)&gt;0">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Atrybut @extension MUSI być typu 'st'</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.3.196
Context: *[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:id[starts-with(@root,'2.16.840.1.113883.3.4424.2.7.') and ends-with(@root,'.12.1')]
Item: (plCdaInformationAboutReferralForCytologicalDiagnosisSection)
-->

   <rule context="*[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:id[starts-with(@root,'2.16.840.1.113883.3.4424.2.7.') and ends-with(@root,'.12.1')]"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='II' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Jeśli występuje instrukcja @xsi:type, to MUSI mieć wartość "{urn:hl7-org:v3}:II", znaleziono "{<value-of select="namespace-uri-from-QName(resolve-QName(@xsi:type,.))"/>}:<value-of select="local-name-from-QName(resolve-QName(@xsi:type,.))"/>"</assert>
      <extends rule="II"/>
      <let name="theValue" value="@value"/>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="@extension">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): atrybut @extension MUSI wystąpić.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="not(@extension) or string-length(@extension)&gt;0">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Atrybut @extension MUSI być typu 'st'</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.3.196
Context: *[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:author
Item: (plCdaInformationAboutReferralForCytologicalDiagnosisSection)
-->

   <rule context="*[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:author"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="string(@typeCode)='AUT' or not(@typeCode)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Wartość dla @typeCode MUSI wynosić 'AUT'.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="string(@contextControlCode)='OP' or not(@contextControlCode)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Wartość dla @contextControlCode MUSI wynosić 'OP'.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:functionCode[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.3.4424.13.11.37-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.37-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor])&gt;=1 ">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:functionCode[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.3.4424.13.11.37-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.37-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor] jest required [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:functionCode[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.3.4424.13.11.37-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.37-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor])&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:functionCode[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.3.4424.13.11.37-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.37-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor] występuje zbyt często [max 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:time)&gt;=1 and not(hl7:time/@nullFlavor)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:time jest mandatory [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:time)&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:time występuje zbyt często [max 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:assignedAuthor)&gt;=1 ">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:assignedAuthor jest required [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:assignedAuthor)&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:assignedAuthor występuje zbyt często [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.3.196
Context: *[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:author/hl7:functionCode[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.3.4424.13.11.37-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.37-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]
Item: (plCdaInformationAboutReferralForCytologicalDiagnosisSection)
-->

   <rule context="*[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:author/hl7:functionCode[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.3.4424.13.11.37-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.37-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='CE' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Jeśli występuje instrukcja @xsi:type, to MUSI mieć wartość "{urn:hl7-org:v3}:CE", znaleziono "{<value-of select="namespace-uri-from-QName(resolve-QName(@xsi:type,.))"/>}:<value-of select="local-name-from-QName(resolve-QName(@xsi:type,.))"/>"</assert>
      <extends rule="CE"/>
      <let name="theValue" value="@value"/>
      <let name="theCode" value="@code"/>
      <let name="theCodeSystem" value="@codeSystem"/>
      <let name="theCodeSystemVersion" value="@codeSystemVersion"/>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="@nullFlavor or exists(doc('include/voc-2.16.840.1.113883.3.4424.13.11.37-DYNAMIC.xml')/*/valueSet[conceptList/concept[@code = $theCode][@codeSystem = $theCodeSystem][not(@codeSystemVersion) or @codeSystemVersion=$theCodeSystemVersion] or completeCodeSystem[@codeSystem=$theCodeSystem][not(@codeSystemVersion) or @codeSystemVersion=$theCodeSystemVersion]])">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Wartość elementu MUSI wynosić ZawodMedyczny Zawód medyczny (DYNAMICZNE).</assert>
      <let name="theNullFlavor" value="@nullFlavor"/>
      <let name="validNullFlavorsFound"
           value="exists(doc('include/voc-2.16.840.1.113883.3.4424.13.11.37-DYNAMIC.xml')/*/valueSet/conceptList/exception[@code = $theNullFlavor][@codeSystem = '2.16.840.1.113883.5.1008'])"/>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="not(@nullFlavor) or not(empty(($validNullFlavorsFound))) ">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Kod braku danych dla @code MUSI pochodzić ze zbioru dopuszczalnych kodów braku danych zdefiniowanych dla tego atrybutu lub powiązanych ze zbiorem wartości ZawodMedyczny Zawód medyczny (DYNAMICZNE)</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.3.196
Context: *[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:author/hl7:time
Item: (plCdaInformationAboutReferralForCytologicalDiagnosisSection)
-->

   <rule context="*[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:author/hl7:time"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='TS' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Jeśli występuje instrukcja @xsi:type, to MUSI mieć wartość "{urn:hl7-org:v3}:TS", znaleziono "{<value-of select="namespace-uri-from-QName(resolve-QName(@xsi:type,.))"/>}:<value-of select="local-name-from-QName(resolve-QName(@xsi:type,.))"/>"</assert>
      <extends rule="TS"/>
      <let name="theValue" value="@value"/>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.3.196
Context: *[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:author/hl7:assignedAuthor
Item: (plCdaInformationAboutReferralForCytologicalDiagnosisSection)
-->

   <rule context="*[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:author/hl7:assignedAuthor"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="string(@classCode)='ASSIGNED' or not(@classCode)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Wartość dla @classCode MUSI wynosić 'ASSIGNED'.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:id)&gt;=1 ">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:id jest required [min 1x].</assert>
      <let name="elmcount"
           value="count(hl7:code[@codeSystem='2.16.840.1.113883.3.4424.11.3.3']|hl7:code[@codeSystem='2.16.840.1.113883.3.4424.11.3.3.1']|hl7:code[@nullFlavor='NI'])"/>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="$elmcount&gt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): wybór (hl7:code[@codeSystem='2.16.840.1.113883.3.4424.11.3.3'] lub hl7:code[@codeSystem='2.16.840.1.113883.3.4424.11.3.3.1'] lub hl7:code[@nullFlavor='NI']) zawiera zbyt mało elementów [min 1x]</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="$elmcount&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): wybór (hl7:code[@codeSystem='2.16.840.1.113883.3.4424.11.3.3'] lub hl7:code[@codeSystem='2.16.840.1.113883.3.4424.11.3.3.1'] lub hl7:code[@nullFlavor='NI']) zawiera zbyt dużo elementów [min 1x]</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:code[@codeSystem='2.16.840.1.113883.3.4424.11.3.3'])&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:code[@codeSystem='2.16.840.1.113883.3.4424.11.3.3'] występuje zbyt często [max 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:code[@codeSystem='2.16.840.1.113883.3.4424.11.3.3.1'])&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:code[@codeSystem='2.16.840.1.113883.3.4424.11.3.3.1'] występuje zbyt często [max 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:code[@nullFlavor='NI'])&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:code[@nullFlavor='NI'] występuje zbyt często [max 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:assignedPerson[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.1'])&gt;=1 ">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:assignedPerson[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.1'] jest required [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:assignedPerson[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.1'])&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:assignedPerson[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.1'] występuje zbyt często [max 1x].</assert>
      <let name="elmcount"
           value="count(hl7:representedOrganization[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.15']|hl7:representedOrganization[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.17']|hl7:representedOrganization[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.18'])"/>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="$elmcount&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): wybór (hl7:representedOrganization[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.15'] lub hl7:representedOrganization[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.17'] lub hl7:representedOrganization[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.18']) zawiera zbyt dużo elementów [min 1x]</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:representedOrganization[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.15'])&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:representedOrganization[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.15'] występuje zbyt często [max 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:representedOrganization[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.17'])&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:representedOrganization[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.17'] występuje zbyt często [max 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:representedOrganization[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.18'])&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:representedOrganization[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.18'] występuje zbyt często [max 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(extPL:boundedBy)&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element extPL:boundedBy występuje zbyt często [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.3.196
Context: *[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:author/hl7:assignedAuthor/hl7:id
Item: (plCdaInformationAboutReferralForCytologicalDiagnosisSection)
-->

   <rule context="*[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:author/hl7:assignedAuthor/hl7:id"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='II' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Jeśli występuje instrukcja @xsi:type, to MUSI mieć wartość "{urn:hl7-org:v3}:II", znaleziono "{<value-of select="namespace-uri-from-QName(resolve-QName(@xsi:type,.))"/>}:<value-of select="local-name-from-QName(resolve-QName(@xsi:type,.))"/>"</assert>
      <extends rule="II"/>
      <let name="theValue" value="@value"/>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="string(@nullFlavor)='NI' or not(@nullFlavor)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Wartość dla @nullFlavor MUSI wynosić 'NI'.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="not(@nullFlavor) or (string-length(@nullFlavor)&gt;0 and not(matches(@nullFlavor,'\s')))">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Atrybut @nullFlavor MUSI być typu 'cs'</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.3.196
Context: *[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:author/hl7:assignedAuthor/hl7:code[@codeSystem='2.16.840.1.113883.3.4424.11.3.3']
Item: (plCdaInformationAboutReferralForCytologicalDiagnosisSection)
-->

   <rule context="*[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:author/hl7:assignedAuthor/hl7:code[@codeSystem='2.16.840.1.113883.3.4424.11.3.3']"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='CE' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Jeśli występuje instrukcja @xsi:type, to MUSI mieć wartość "{urn:hl7-org:v3}:CE", znaleziono "{<value-of select="namespace-uri-from-QName(resolve-QName(@xsi:type,.))"/>}:<value-of select="local-name-from-QName(resolve-QName(@xsi:type,.))"/>"</assert>
      <extends rule="CE"/>
      <let name="theValue" value="@value"/>
      <let name="theCode" value="@code"/>
      <let name="theCodeSystem" value="@codeSystem"/>
      <let name="theCodeSystemVersion" value="@codeSystemVersion"/>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="@nullFlavor or exists(doc('include/voc-2.16.840.1.113883.3.4424.13.11.21-DYNAMIC.xml')/*/valueSet[conceptList/concept[@code = $theCode][@codeSystem = $theCodeSystem][not(@codeSystemVersion) or @codeSystemVersion=$theCodeSystemVersion] or completeCodeSystem[@codeSystem=$theCodeSystem][not(@codeSystemVersion) or @codeSystemVersion=$theCodeSystemVersion]])">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Wartość elementu MUSI wynosić SpecjalnoscLekarza Specjalizacja lekarza (DYNAMICZNE).</assert>
      <let name="theNullFlavor" value="@nullFlavor"/>
      <let name="validNullFlavorsFound"
           value="exists(doc('include/voc-2.16.840.1.113883.3.4424.13.11.21-DYNAMIC.xml')/*/valueSet/conceptList/exception[@code = $theNullFlavor][@codeSystem = '2.16.840.1.113883.5.1008'])"/>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="not(@nullFlavor) or not(empty(($validNullFlavorsFound))) ">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Kod braku danych dla @code MUSI pochodzić ze zbioru dopuszczalnych kodów braku danych zdefiniowanych dla tego atrybutu lub powiązanych ze zbiorem wartości SpecjalnoscLekarza Specjalizacja lekarza (DYNAMICZNE)</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.3.196
Context: *[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:author/hl7:assignedAuthor/hl7:code[@codeSystem='2.16.840.1.113883.3.4424.11.3.3.1']
Item: (plCdaInformationAboutReferralForCytologicalDiagnosisSection)
-->

   <rule context="*[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:author/hl7:assignedAuthor/hl7:code[@codeSystem='2.16.840.1.113883.3.4424.11.3.3.1']"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='CE' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Jeśli występuje instrukcja @xsi:type, to MUSI mieć wartość "{urn:hl7-org:v3}:CE", znaleziono "{<value-of select="namespace-uri-from-QName(resolve-QName(@xsi:type,.))"/>}:<value-of select="local-name-from-QName(resolve-QName(@xsi:type,.))"/>"</assert>
      <extends rule="CE"/>
      <let name="theValue" value="@value"/>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="@nullFlavor or (@codeSystem='2.16.840.1.113883.3.4424.11.3.3.1')">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Wartość elementu MUSI wynosić codeSystem '2.16.840.1.113883.3.4424.11.3.3.1'.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="@code">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): atrybut @code MUSI wystąpić.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="not(@code) or (string-length(@code)&gt;0 and not(matches(@code,'\s')))">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Atrybut @code MUSI być typu 'cs'</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="@displayName">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): atrybut @displayName MUSI wystąpić.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="not(@displayName) or string-length(@displayName)&gt;0">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Atrybut @displayName MUSI być typu 'st'</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.3.196
Context: *[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:author/hl7:assignedAuthor/hl7:code[@nullFlavor='NI']
Item: (plCdaInformationAboutReferralForCytologicalDiagnosisSection)
-->

   <rule context="*[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:author/hl7:assignedAuthor/hl7:code[@nullFlavor='NI']"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='CD' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Jeśli występuje instrukcja @xsi:type, to MUSI mieć wartość "{urn:hl7-org:v3}:CD", znaleziono "{<value-of select="namespace-uri-from-QName(resolve-QName(@xsi:type,.))"/>}:<value-of select="local-name-from-QName(resolve-QName(@xsi:type,.))"/>"</assert>
      <extends rule="CD"/>
      <let name="theValue" value="@value"/>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="string(@nullFlavor)='NI'">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Wartość dla @nullFlavor MUSI wynosić 'NI'.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="not(@nullFlavor) or (string-length(@nullFlavor)&gt;0 and not(matches(@nullFlavor,'\s')))">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Atrybut @nullFlavor MUSI być typu 'cs'</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.3.196
Context: *[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:author/hl7:assignedAuthor/hl7:addr
Item: (plCdaInformationAboutReferralForCytologicalDiagnosisSection)
-->

   <rule context="*[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:author/hl7:assignedAuthor/hl7:addr"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='AD' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Jeśli występuje instrukcja @xsi:type, to MUSI mieć wartość "{urn:hl7-org:v3}:AD", znaleziono "{<value-of select="namespace-uri-from-QName(resolve-QName(@xsi:type,.))"/>}:<value-of select="local-name-from-QName(resolve-QName(@xsi:type,.))"/>"</assert>
      <extends rule="AD"/>
      <let name="theValue" value="@value"/>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.3.196
Context: *[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:author/hl7:assignedAuthor/hl7:telecom
Item: (plCdaInformationAboutReferralForCytologicalDiagnosisSection)
-->

   <rule context="*[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:author/hl7:assignedAuthor/hl7:telecom"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='TEL' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Jeśli występuje instrukcja @xsi:type, to MUSI mieć wartość "{urn:hl7-org:v3}:TEL", znaleziono "{<value-of select="namespace-uri-from-QName(resolve-QName(@xsi:type,.))"/>}:<value-of select="local-name-from-QName(resolve-QName(@xsi:type,.))"/>"</assert>
      <extends rule="TEL"/>
      <let name="theValue" value="@value"/>
   </rule>

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.3.196
Context: *[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:author/hl7:assignedAuthor/hl7:assignedPerson[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.1']
Item: (plCdaInformationAboutReferralForCytologicalDiagnosisSection)
-->

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.3.196
Context: *[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:author/hl7:assignedAuthor/hl7:representedOrganization[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.15']
Item: (plCdaInformationAboutReferralForCytologicalDiagnosisSection)
-->

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.3.196
Context: *[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:author/hl7:assignedAuthor/hl7:representedOrganization[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.17']
Item: (plCdaInformationAboutReferralForCytologicalDiagnosisSection)
-->

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.3.196
Context: *[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:author/hl7:assignedAuthor/hl7:representedOrganization[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.18']
Item: (plCdaInformationAboutReferralForCytologicalDiagnosisSection)
-->
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.3.196
Context: *[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:entryRelationship[hl7:observation[hl7:code[(@code='KRK' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]
Item: (plCdaInformationAboutReferralForCytologicalDiagnosisSection)
-->

   <rule context="*[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:entryRelationship[hl7:observation[hl7:code[(@code='KRK' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="string(@typeCode)='COMP'">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Wartość dla @typeCode MUSI wynosić 'COMP'.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:observation[hl7:code[(@code='KRK' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]])&gt;=1 and not(hl7:observation[hl7:code[(@code='KRK' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]/@nullFlavor)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:observation[hl7:code[(@code='KRK' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]] jest mandatory [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:observation[hl7:code[(@code='KRK' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]])&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:observation[hl7:code[(@code='KRK' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]] występuje zbyt często [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.3.196
Context: *[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:entryRelationship[hl7:observation[hl7:code[(@code='KRK' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/hl7:observation[hl7:code[(@code='KRK' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]
Item: (plCdaInformationAboutReferralForCytologicalDiagnosisSection)
-->

   <rule context="*[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:entryRelationship[hl7:observation[hl7:code[(@code='KRK' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/hl7:observation[hl7:code[(@code='KRK' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="string(@classCode)='OBS'">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Wartość dla @classCode MUSI wynosić 'OBS'.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="not(@classCode) or (string-length(@classCode)&gt;0 and not(matches(@classCode,'\s')))">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Atrybut @classCode MUSI być typu 'cs'</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="string(@moodCode)='EVN'">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Wartość dla @moodCode MUSI wynosić 'EVN'.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="not(@moodCode) or (string-length(@moodCode)&gt;0 and not(matches(@moodCode,'\s')))">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Atrybut @moodCode MUSI być typu 'cs'</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:code[(@code='KRK' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')])&gt;=1 and not(hl7:code[(@code='KRK' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]/@nullFlavor)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:code[(@code='KRK' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')] jest mandatory [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:code[(@code='KRK' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')])&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:code[(@code='KRK' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')] występuje zbyt często [max 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:text)&gt;=1 ">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:text jest required [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:text)&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:text występuje zbyt często [max 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:statusCode[@code='completed'])&gt;=1 and not(hl7:statusCode[@code='completed']/@nullFlavor)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:statusCode[@code='completed'] jest mandatory [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:statusCode[@code='completed'])&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:statusCode[@code='completed'] występuje zbyt często [max 1x].</assert>
      <let name="elmcount"
           value="count(hl7:value[@code]|hl7:value[@nullFlavor='NI'])"/>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="$elmcount&gt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): wybór (hl7:value[@code] lub hl7:value[@nullFlavor='NI']) zawiera zbyt mało elementów [min 1x]</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="$elmcount&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): wybór (hl7:value[@code] lub hl7:value[@nullFlavor='NI']) zawiera zbyt dużo elementów [min 1x]</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:value[@code])&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:value[@code] występuje zbyt często [max 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:value[@nullFlavor='NI'])&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:value[@nullFlavor='NI'] występuje zbyt często [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.3.196
Context: *[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:entryRelationship[hl7:observation[hl7:code[(@code='KRK' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/hl7:observation[hl7:code[(@code='KRK' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]/hl7:code[(@code='KRK' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]
Item: (plCdaInformationAboutReferralForCytologicalDiagnosisSection)
-->

   <rule context="*[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:entryRelationship[hl7:observation[hl7:code[(@code='KRK' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/hl7:observation[hl7:code[(@code='KRK' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]/hl7:code[(@code='KRK' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='CD' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Jeśli występuje instrukcja @xsi:type, to MUSI mieć wartość "{urn:hl7-org:v3}:CD", znaleziono "{<value-of select="namespace-uri-from-QName(resolve-QName(@xsi:type,.))"/>}:<value-of select="local-name-from-QName(resolve-QName(@xsi:type,.))"/>"</assert>
      <extends rule="CD"/>
      <let name="theValue" value="@value"/>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="@nullFlavor or (@code='KRK' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18' and @displayName='Kod rozpoznania klinicznego' and @codeSystemName='AtrybutyWBCYT')">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Wartość elementu MUSI wynosić code 'KRK' codeSystem '2.16.840.1.113883.3.4424.13.5.18' displayName='Kod rozpoznania klinicznego' codeSystemName='AtrybutyWBCYT'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.3.196
Context: *[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:entryRelationship[hl7:observation[hl7:code[(@code='KRK' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/hl7:observation[hl7:code[(@code='KRK' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]/hl7:statusCode[@code='completed']
Item: (plCdaInformationAboutReferralForCytologicalDiagnosisSection)
-->

   <rule context="*[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:entryRelationship[hl7:observation[hl7:code[(@code='KRK' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/hl7:observation[hl7:code[(@code='KRK' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]/hl7:statusCode[@code='completed']"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='CS' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Jeśli występuje instrukcja @xsi:type, to MUSI mieć wartość "{urn:hl7-org:v3}:CS", znaleziono "{<value-of select="namespace-uri-from-QName(resolve-QName(@xsi:type,.))"/>}:<value-of select="local-name-from-QName(resolve-QName(@xsi:type,.))"/>"</assert>
      <extends rule="CS"/>
      <let name="theValue" value="@value"/>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="@nullFlavor or (@code='completed')">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Wartość elementu MUSI wynosić code 'completed'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.3.196
Context: *[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:entryRelationship[hl7:observation[hl7:code[(@code='KRK' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/hl7:observation[hl7:code[(@code='KRK' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]/hl7:value[@code]
Item: (plCdaInformationAboutReferralForCytologicalDiagnosisSection)
-->

   <rule context="*[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:entryRelationship[hl7:observation[hl7:code[(@code='KRK' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/hl7:observation[hl7:code[(@code='KRK' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]/hl7:value[@code]"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='CD' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Jeśli występuje instrukcja @xsi:type, to MUSI mieć wartość "{urn:hl7-org:v3}:CD", znaleziono "{<value-of select="namespace-uri-from-QName(resolve-QName(@xsi:type,.))"/>}:<value-of select="local-name-from-QName(resolve-QName(@xsi:type,.))"/>"</assert>
      <extends rule="CD"/>
      <let name="theValue" value="@value"/>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="@nullFlavor or (@codeSystem='2.16.840.1.113883.6.3' and @codeSystemName='icd10')">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Wartość elementu MUSI wynosić codeSystem '2.16.840.1.113883.6.3' codeSystemName='icd10'.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="@code">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): atrybut @code MUSI wystąpić.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="not(@code) or (string-length(@code)&gt;0 and not(matches(@code,'\s')))">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Atrybut @code MUSI być typu 'cs'</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="@displayName">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): atrybut @displayName MUSI wystąpić.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="not(@displayName) or string-length(@displayName)&gt;0">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Atrybut @displayName MUSI być typu 'st'</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.3.196
Context: *[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:entryRelationship[hl7:observation[hl7:code[(@code='KRK' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/hl7:observation[hl7:code[(@code='KRK' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]/hl7:value[@nullFlavor='NI']
Item: (plCdaInformationAboutReferralForCytologicalDiagnosisSection)
-->

   <rule context="*[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:entryRelationship[hl7:observation[hl7:code[(@code='KRK' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/hl7:observation[hl7:code[(@code='KRK' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]/hl7:value[@nullFlavor='NI']"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='CD' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Jeśli występuje instrukcja @xsi:type, to MUSI mieć wartość "{urn:hl7-org:v3}:CD", znaleziono "{<value-of select="namespace-uri-from-QName(resolve-QName(@xsi:type,.))"/>}:<value-of select="local-name-from-QName(resolve-QName(@xsi:type,.))"/>"</assert>
      <extends rule="CD"/>
      <let name="theValue" value="@value"/>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="string(@nullFlavor)='NI'">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Wartość dla @nullFlavor MUSI wynosić 'NI'.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="not(@nullFlavor) or (string-length(@nullFlavor)&gt;0 and not(matches(@nullFlavor,'\s')))">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Atrybut @nullFlavor MUSI być typu 'cs'</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.3.196
Context: *[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:entryRelationship[hl7:observation[hl7:code[(@code='DODOPISSKIER' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]
Item: (plCdaInformationAboutReferralForCytologicalDiagnosisSection)
-->

   <rule context="*[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:entryRelationship[hl7:observation[hl7:code[(@code='DODOPISSKIER' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="string(@typeCode)='COMP'">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Wartość dla @typeCode MUSI wynosić 'COMP'.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:observation[hl7:code[(@code='DODOPISSKIER' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]])&gt;=1 and not(hl7:observation[hl7:code[(@code='DODOPISSKIER' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]/@nullFlavor)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:observation[hl7:code[(@code='DODOPISSKIER' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]] jest mandatory [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:observation[hl7:code[(@code='DODOPISSKIER' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]])&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:observation[hl7:code[(@code='DODOPISSKIER' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]] występuje zbyt często [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.3.196
Context: *[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:entryRelationship[hl7:observation[hl7:code[(@code='DODOPISSKIER' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/hl7:observation[hl7:code[(@code='DODOPISSKIER' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]
Item: (plCdaInformationAboutReferralForCytologicalDiagnosisSection)
-->

   <rule context="*[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:entryRelationship[hl7:observation[hl7:code[(@code='DODOPISSKIER' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/hl7:observation[hl7:code[(@code='DODOPISSKIER' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="string(@classCode)='OBS'">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Wartość dla @classCode MUSI wynosić 'OBS'.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="not(@classCode) or (string-length(@classCode)&gt;0 and not(matches(@classCode,'\s')))">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Atrybut @classCode MUSI być typu 'cs'</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="string(@moodCode)='EVN'">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Wartość dla @moodCode MUSI wynosić 'EVN'.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="not(@moodCode) or (string-length(@moodCode)&gt;0 and not(matches(@moodCode,'\s')))">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Atrybut @moodCode MUSI być typu 'cs'</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:code[(@code='DODOPISSKIER' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')])&gt;=1 and not(hl7:code[(@code='DODOPISSKIER' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]/@nullFlavor)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:code[(@code='DODOPISSKIER' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')] jest mandatory [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:code[(@code='DODOPISSKIER' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')])&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:code[(@code='DODOPISSKIER' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')] występuje zbyt często [max 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:text)&gt;=1 ">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:text jest required [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:text)&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:text występuje zbyt często [max 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:statusCode[@code='completed'])&gt;=1 and not(hl7:statusCode[@code='completed']/@nullFlavor)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:statusCode[@code='completed'] jest mandatory [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:statusCode[@code='completed'])&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:statusCode[@code='completed'] występuje zbyt często [max 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:value)&gt;=1 ">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:value jest required [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:value)&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:value występuje zbyt często [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.3.196
Context: *[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:entryRelationship[hl7:observation[hl7:code[(@code='DODOPISSKIER' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/hl7:observation[hl7:code[(@code='DODOPISSKIER' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]/hl7:code[(@code='DODOPISSKIER' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]
Item: (plCdaInformationAboutReferralForCytologicalDiagnosisSection)
-->

   <rule context="*[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:entryRelationship[hl7:observation[hl7:code[(@code='DODOPISSKIER' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/hl7:observation[hl7:code[(@code='DODOPISSKIER' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]/hl7:code[(@code='DODOPISSKIER' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='CD' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Jeśli występuje instrukcja @xsi:type, to MUSI mieć wartość "{urn:hl7-org:v3}:CD", znaleziono "{<value-of select="namespace-uri-from-QName(resolve-QName(@xsi:type,.))"/>}:<value-of select="local-name-from-QName(resolve-QName(@xsi:type,.))"/>"</assert>
      <extends rule="CD"/>
      <let name="theValue" value="@value"/>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="@nullFlavor or (@code='DODOPISSKIER' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18' and @displayName='Dodatkowy opis w informacji o skierowaniu' and @codeSystemName='AtrybutyWBCYT')">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Wartość elementu MUSI wynosić code 'DODOPISSKIER' codeSystem '2.16.840.1.113883.3.4424.13.5.18' displayName='Dodatkowy opis w informacji o skierowaniu' codeSystemName='AtrybutyWBCYT'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.3.196
Context: *[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:entryRelationship[hl7:observation[hl7:code[(@code='DODOPISSKIER' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/hl7:observation[hl7:code[(@code='DODOPISSKIER' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]/hl7:statusCode[@code='completed']
Item: (plCdaInformationAboutReferralForCytologicalDiagnosisSection)
-->

   <rule context="*[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:entryRelationship[hl7:observation[hl7:code[(@code='DODOPISSKIER' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/hl7:observation[hl7:code[(@code='DODOPISSKIER' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]/hl7:statusCode[@code='completed']"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='CS' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Jeśli występuje instrukcja @xsi:type, to MUSI mieć wartość "{urn:hl7-org:v3}:CS", znaleziono "{<value-of select="namespace-uri-from-QName(resolve-QName(@xsi:type,.))"/>}:<value-of select="local-name-from-QName(resolve-QName(@xsi:type,.))"/>"</assert>
      <extends rule="CS"/>
      <let name="theValue" value="@value"/>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="@nullFlavor or (@code='completed')">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Wartość elementu MUSI wynosić code 'completed'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.3.196
Context: *[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:entryRelationship[hl7:observation[hl7:code[(@code='DODOPISSKIER' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/hl7:observation[hl7:code[(@code='DODOPISSKIER' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]/hl7:value
Item: (plCdaInformationAboutReferralForCytologicalDiagnosisSection)
-->

   <rule context="*[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:entryRelationship[hl7:observation[hl7:code[(@code='DODOPISSKIER' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/hl7:observation[hl7:code[(@code='DODOPISSKIER' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]/hl7:value"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='ST' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Jeśli występuje instrukcja @xsi:type, to MUSI mieć wartość "{urn:hl7-org:v3}:ST", znaleziono "{<value-of select="namespace-uri-from-QName(resolve-QName(@xsi:type,.))"/>}:<value-of select="local-name-from-QName(resolve-QName(@xsi:type,.))"/>"</assert>
      <extends rule="ST"/>
      <let name="theValue" value="text()"/>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="not(@nullFlavor) or (string-length(@nullFlavor)&gt;0 and not(matches(@nullFlavor,'\s')))">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Atrybut @nullFlavor MUSI być typu 'cs'</assert>
      <let name="theAttValue"
           value="distinct-values(tokenize(normalize-space(@nullFlavor),' '))"/>
      <let name="theAttCheck"
           value="distinct-values(for $code in tokenize(@nullFlavor,' ') return if ($code=('NI')) then ($code) else ())"/>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="not(@nullFlavor) or count($theAttValue) = count($theAttCheck)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Wartość dla nullFlavor MUSI wynosić 'kod NI'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.3.196
Context: *[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:entryRelationship[hl7:observation[hl7:code[(@code='OSTP' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]
Item: (plCdaInformationAboutReferralForCytologicalDiagnosisSection)
-->

   <rule context="*[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:entryRelationship[hl7:observation[hl7:code[(@code='OSTP' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="string(@typeCode)='COMP'">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Wartość dla @typeCode MUSI wynosić 'COMP'.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:observation[hl7:code[(@code='OSTP' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]])&gt;=1 and not(hl7:observation[hl7:code[(@code='OSTP' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]/@nullFlavor)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:observation[hl7:code[(@code='OSTP' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]] jest mandatory [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:observation[hl7:code[(@code='OSTP' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]])&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:observation[hl7:code[(@code='OSTP' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]] występuje zbyt często [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.3.196
Context: *[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:entryRelationship[hl7:observation[hl7:code[(@code='OSTP' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/hl7:observation[hl7:code[(@code='OSTP' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]
Item: (plCdaInformationAboutReferralForCytologicalDiagnosisSection)
-->

   <rule context="*[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:entryRelationship[hl7:observation[hl7:code[(@code='OSTP' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/hl7:observation[hl7:code[(@code='OSTP' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="string(@classCode)='OBS'">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Wartość dla @classCode MUSI wynosić 'OBS'.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="not(@classCode) or (string-length(@classCode)&gt;0 and not(matches(@classCode,'\s')))">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Atrybut @classCode MUSI być typu 'cs'</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="string(@moodCode)='EVN'">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Wartość dla @moodCode MUSI wynosić 'EVN'.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="not(@moodCode) or (string-length(@moodCode)&gt;0 and not(matches(@moodCode,'\s')))">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Atrybut @moodCode MUSI być typu 'cs'</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:code[(@code='OSTP' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')])&gt;=1 and not(hl7:code[(@code='OSTP' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]/@nullFlavor)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:code[(@code='OSTP' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')] jest mandatory [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:code[(@code='OSTP' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')])&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:code[(@code='OSTP' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')] występuje zbyt często [max 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:text)&gt;=1 ">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:text jest required [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:text)&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:text występuje zbyt często [max 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:statusCode[@code='completed'])&gt;=1 and not(hl7:statusCode[@code='completed']/@nullFlavor)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:statusCode[@code='completed'] jest mandatory [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:statusCode[@code='completed'])&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:statusCode[@code='completed'] występuje zbyt często [max 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:value[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.3.4424.13.11.166-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.166-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor])&gt;=1 ">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:value[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.3.4424.13.11.166-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.166-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor] jest required [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:value[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.3.4424.13.11.166-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.166-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor])&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:value[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.3.4424.13.11.166-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.166-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor] występuje zbyt często [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.3.196
Context: *[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:entryRelationship[hl7:observation[hl7:code[(@code='OSTP' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/hl7:observation[hl7:code[(@code='OSTP' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]/hl7:code[(@code='OSTP' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]
Item: (plCdaInformationAboutReferralForCytologicalDiagnosisSection)
-->

   <rule context="*[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:entryRelationship[hl7:observation[hl7:code[(@code='OSTP' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/hl7:observation[hl7:code[(@code='OSTP' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]/hl7:code[(@code='OSTP' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='CD' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Jeśli występuje instrukcja @xsi:type, to MUSI mieć wartość "{urn:hl7-org:v3}:CD", znaleziono "{<value-of select="namespace-uri-from-QName(resolve-QName(@xsi:type,.))"/>}:<value-of select="local-name-from-QName(resolve-QName(@xsi:type,.))"/>"</assert>
      <extends rule="CD"/>
      <let name="theValue" value="@value"/>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="@nullFlavor or (@code='OSTP' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18' and @displayName='Określenie stanu terapii pacjenta' and @codeSystemName='AtrybutyWBCYT')">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Wartość elementu MUSI wynosić code 'OSTP' codeSystem '2.16.840.1.113883.3.4424.13.5.18' displayName='Określenie stanu terapii pacjenta' codeSystemName='AtrybutyWBCYT'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.3.196
Context: *[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:entryRelationship[hl7:observation[hl7:code[(@code='OSTP' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/hl7:observation[hl7:code[(@code='OSTP' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]/hl7:statusCode[@code='completed']
Item: (plCdaInformationAboutReferralForCytologicalDiagnosisSection)
-->

   <rule context="*[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:entryRelationship[hl7:observation[hl7:code[(@code='OSTP' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/hl7:observation[hl7:code[(@code='OSTP' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]/hl7:statusCode[@code='completed']"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='CS' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Jeśli występuje instrukcja @xsi:type, to MUSI mieć wartość "{urn:hl7-org:v3}:CS", znaleziono "{<value-of select="namespace-uri-from-QName(resolve-QName(@xsi:type,.))"/>}:<value-of select="local-name-from-QName(resolve-QName(@xsi:type,.))"/>"</assert>
      <extends rule="CS"/>
      <let name="theValue" value="@value"/>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="@nullFlavor or (@code='completed')">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Wartość elementu MUSI wynosić code 'completed'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.3.196
Context: *[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:entryRelationship[hl7:observation[hl7:code[(@code='OSTP' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/hl7:observation[hl7:code[(@code='OSTP' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]/hl7:value[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.3.4424.13.11.166-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.166-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]
Item: (plCdaInformationAboutReferralForCytologicalDiagnosisSection)
-->

   <rule context="*[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:entryRelationship[hl7:observation[hl7:code[(@code='OSTP' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/hl7:observation[hl7:code[(@code='OSTP' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]/hl7:value[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.3.4424.13.11.166-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.166-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code) or @nullFlavor]"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='CD' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Jeśli występuje instrukcja @xsi:type, to MUSI mieć wartość "{urn:hl7-org:v3}:CD", znaleziono "{<value-of select="namespace-uri-from-QName(resolve-QName(@xsi:type,.))"/>}:<value-of select="local-name-from-QName(resolve-QName(@xsi:type,.))"/>"</assert>
      <extends rule="CD"/>
      <let name="theValue" value="@value"/>
      <let name="theCode" value="@code"/>
      <let name="theCodeSystem" value="@codeSystem"/>
      <let name="theCodeSystemVersion" value="@codeSystemVersion"/>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="@nullFlavor or exists(doc('include/voc-2.16.840.1.113883.3.4424.13.11.166-DYNAMIC.xml')/*/valueSet[conceptList/concept[@code = $theCode][@codeSystem = $theCodeSystem][not(@codeSystemVersion) or @codeSystemVersion=$theCodeSystemVersion] or completeCodeSystem[@codeSystem=$theCodeSystem][not(@codeSystemVersion) or @codeSystemVersion=$theCodeSystemVersion]])">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Wartość elementu MUSI wynosić PacjentWTrakcieTerapii Pacjent w trakcie terapii (DYNAMICZNE).</assert>
      <let name="theNullFlavor" value="@nullFlavor"/>
      <let name="validNullFlavorsFound"
           value="exists(doc('include/voc-2.16.840.1.113883.3.4424.13.11.166-DYNAMIC.xml')/*/valueSet/conceptList/exception[@code = $theNullFlavor][@codeSystem = '2.16.840.1.113883.5.1008'])"/>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="not(@nullFlavor) or not(empty(($validNullFlavorsFound))) or @nullFlavor=('NI')">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Kod braku danych dla @code MUSI pochodzić ze zbioru dopuszczalnych kodów braku danych zdefiniowanych dla tego atrybutu lub powiązanych ze zbiorem wartości PacjentWTrakcieTerapii Pacjent w trakcie terapii (DYNAMICZNE)</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="not(@nullFlavor) or (string-length(@nullFlavor)&gt;0 and not(matches(@nullFlavor,'\s')))">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Atrybut @nullFlavor MUSI być typu 'cs'</assert>
      <let name="theAttValue"
           value="distinct-values(tokenize(normalize-space(@nullFlavor),' '))"/>
      <let name="theAttCheck"
           value="distinct-values(for $code in tokenize(@nullFlavor,' ') return if ($code=('NI')) then ($code) else ())"/>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="not(@nullFlavor) or count($theAttValue) = count($theAttCheck)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Wartość dla nullFlavor MUSI wynosić 'kod NI'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.3.196
Context: *[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:entryRelationship[hl7:observation[hl7:code[(@code='DILONUM' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]
Item: (plCdaInformationAboutReferralForCytologicalDiagnosisSection)
-->

   <rule context="*[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:entryRelationship[hl7:observation[hl7:code[(@code='DILONUM' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="string(@typeCode)='COMP'">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Wartość dla @typeCode MUSI wynosić 'COMP'.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:observation[hl7:code[(@code='DILONUM' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]])&gt;=1 and not(hl7:observation[hl7:code[(@code='DILONUM' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]/@nullFlavor)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:observation[hl7:code[(@code='DILONUM' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]] jest mandatory [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:observation[hl7:code[(@code='DILONUM' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]])&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:observation[hl7:code[(@code='DILONUM' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]] występuje zbyt często [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.3.196
Context: *[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:entryRelationship[hl7:observation[hl7:code[(@code='DILONUM' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/hl7:observation[hl7:code[(@code='DILONUM' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]
Item: (plCdaInformationAboutReferralForCytologicalDiagnosisSection)
-->

   <rule context="*[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:entryRelationship[hl7:observation[hl7:code[(@code='DILONUM' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/hl7:observation[hl7:code[(@code='DILONUM' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="string(@classCode)='OBS'">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Wartość dla @classCode MUSI wynosić 'OBS'.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="not(@classCode) or (string-length(@classCode)&gt;0 and not(matches(@classCode,'\s')))">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Atrybut @classCode MUSI być typu 'cs'</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="string(@moodCode)='EVN'">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Wartość dla @moodCode MUSI wynosić 'EVN'.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="not(@moodCode) or (string-length(@moodCode)&gt;0 and not(matches(@moodCode,'\s')))">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Atrybut @moodCode MUSI być typu 'cs'</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:code[(@code='DILONUM' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')])&gt;=1 and not(hl7:code[(@code='DILONUM' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]/@nullFlavor)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:code[(@code='DILONUM' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')] jest mandatory [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:code[(@code='DILONUM' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')])&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:code[(@code='DILONUM' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')] występuje zbyt często [max 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:text)&gt;=1 ">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:text jest required [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:text)&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:text występuje zbyt często [max 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:statusCode[@code='completed'])&gt;=1 and not(hl7:statusCode[@code='completed']/@nullFlavor)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:statusCode[@code='completed'] jest mandatory [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:statusCode[@code='completed'])&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:statusCode[@code='completed'] występuje zbyt często [max 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:value)&gt;=1 ">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:value jest required [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="count(hl7:value)&lt;=1">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): element hl7:value występuje zbyt często [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.3.196
Context: *[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:entryRelationship[hl7:observation[hl7:code[(@code='DILONUM' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/hl7:observation[hl7:code[(@code='DILONUM' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]/hl7:code[(@code='DILONUM' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]
Item: (plCdaInformationAboutReferralForCytologicalDiagnosisSection)
-->

   <rule context="*[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:entryRelationship[hl7:observation[hl7:code[(@code='DILONUM' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/hl7:observation[hl7:code[(@code='DILONUM' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]/hl7:code[(@code='DILONUM' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='CD' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Jeśli występuje instrukcja @xsi:type, to MUSI mieć wartość "{urn:hl7-org:v3}:CD", znaleziono "{<value-of select="namespace-uri-from-QName(resolve-QName(@xsi:type,.))"/>}:<value-of select="local-name-from-QName(resolve-QName(@xsi:type,.))"/>"</assert>
      <extends rule="CD"/>
      <let name="theValue" value="@value"/>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="@nullFlavor or (@code='DILONUM' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18' and @displayName='Numer karty DILO' and @codeSystemName='AtrybutyWBCYT')">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Wartość elementu MUSI wynosić code 'DILONUM' codeSystem '2.16.840.1.113883.3.4424.13.5.18' displayName='Numer karty DILO' codeSystemName='AtrybutyWBCYT'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.3.196
Context: *[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:entryRelationship[hl7:observation[hl7:code[(@code='DILONUM' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/hl7:observation[hl7:code[(@code='DILONUM' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]/hl7:statusCode[@code='completed']
Item: (plCdaInformationAboutReferralForCytologicalDiagnosisSection)
-->

   <rule context="*[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:entryRelationship[hl7:observation[hl7:code[(@code='DILONUM' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/hl7:observation[hl7:code[(@code='DILONUM' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]/hl7:statusCode[@code='completed']"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='CS' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Jeśli występuje instrukcja @xsi:type, to MUSI mieć wartość "{urn:hl7-org:v3}:CS", znaleziono "{<value-of select="namespace-uri-from-QName(resolve-QName(@xsi:type,.))"/>}:<value-of select="local-name-from-QName(resolve-QName(@xsi:type,.))"/>"</assert>
      <extends rule="CS"/>
      <let name="theValue" value="@value"/>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="@nullFlavor or (@code='completed')">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Wartość elementu MUSI wynosić code 'completed'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.3.196
Context: *[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:entryRelationship[hl7:observation[hl7:code[(@code='DILONUM' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/hl7:observation[hl7:code[(@code='DILONUM' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]/hl7:value
Item: (plCdaInformationAboutReferralForCytologicalDiagnosisSection)
-->

   <rule context="*[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:entry/hl7:encounter/hl7:entryRelationship[hl7:observation[hl7:code[(@code='DILONUM' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/hl7:observation[hl7:code[(@code='DILONUM' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]/hl7:value"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='ST' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Jeśli występuje instrukcja @xsi:type, to MUSI mieć wartość "{urn:hl7-org:v3}:ST", znaleziono "{<value-of select="namespace-uri-from-QName(resolve-QName(@xsi:type,.))"/>}:<value-of select="local-name-from-QName(resolve-QName(@xsi:type,.))"/>"</assert>
      <extends rule="ST"/>
      <let name="theValue" value="text()"/>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="not(@nullFlavor) or (string-length(@nullFlavor)&gt;0 and not(matches(@nullFlavor,'\s')))">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Atrybut @nullFlavor MUSI być typu 'cs'</assert>
      <let name="theAttValue"
           value="distinct-values(tokenize(normalize-space(@nullFlavor),' '))"/>
      <let name="theAttCheck"
           value="distinct-values(for $code in tokenize(@nullFlavor,' ') return if ($code=('NI')) then ($code) else ())"/>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="not(@nullFlavor) or count($theAttValue) = count($theAttCheck)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Wartość dla nullFlavor MUSI wynosić 'kod NI'.</assert>
   </rule>

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.3.196
Context: *[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:component[hl7:section/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.197']
Item: (plCdaInformationAboutReferralForCytologicalDiagnosisSection)
-->
   <rule context="*[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']/hl7:component[hl7:section/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.197']">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.3.196-2023-10-12T000000.html"
              test="string(@typeCode)='COMP' or not(@typeCode)">(plCdaInformationAboutReferralForCytologicalDiagnosisSection): Wartość dla @typeCode MUSI wynosić 'COMP'.</assert>
   </rule>
</pattern>
