<?xml version="1.0" encoding="UTF-8"?>
<!--
Template derived pattern
===========================================
ID: 2.16.840.1.113883.3.4424.13.10.1.44
Name: [1] Rozpoznanie patomorfologiczne - cytologia
Description: Szablon CDA Rozpoznania patomorfologicznego - cytologia
-->
<pattern xmlns="http://purl.oclc.org/dsdl/schematron"
         id="template-2.16.840.1.113883.3.4424.13.10.1.44-2023-08-03T000000">
   <title>[1] Rozpoznanie patomorfologiczne - cytologia</title>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.1.44
Context: /
Item: (plCdaCytologyResult)
-->

   <rule context="/" 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.1.44-2023-08-03T000000.html"
              test="count(hl7:ClinicalDocument[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.1.44'])&gt;=1 and not(hl7:ClinicalDocument[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.1.44']/@nullFlavor)">(plCdaCytologyResult): element hl7:ClinicalDocument[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.1.44'] 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.1.44-2023-08-03T000000.html"
              test="count(hl7:ClinicalDocument[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.1.44'])&lt;=1">(plCdaCytologyResult): element hl7:ClinicalDocument[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.1.44'] występuje zbyt często [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.1.44
Context: /hl7:ClinicalDocument[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.1.44']
Item: (plCdaCytologyResult)
-->

   <rule context="/hl7:ClinicalDocument[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.1.44']"
         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.1.44-2023-08-03T000000.html"
              test="string(@classCode)='DOCCLIN' or not(@classCode)">(plCdaCytologyResult): Wartość dla @classCode MUSI wynosić 'DOCCLIN'.</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.1.44-2023-08-03T000000.html"
              test="string(@moodCode)='EVN' or not(@moodCode)">(plCdaCytologyResult): Wartość dla @moodCode MUSI wynosić 'EVN'.</assert>
      <let name="versionLabel" value="'1.3.2'"/>
      <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.1.44-2023-08-03T000000.html"
              test="count(hl7:templateId[@root and @extension=$versionLabel])=1">(plCdaCytologyResult): Nie występuje prawidłowe oznaczenie zgodności dokumentu z daną wersją wydania Polskiej Implementacji Krajowej HL7 CDA.</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.1.44-2023-08-03T000000.html"
              test="/processing-instruction('xml-stylesheet') = concat('href=&#34;CDA_PL_IG_',/hl7:ClinicalDocument/hl7:templateId[@extension]/@extension,'.xsl&#34; type=&#34;text/xsl&#34;')">(plCdaCytologyResult): Nieprawidłowe wskazanie transformaty generującej warstwę prezentacyjną dokumentu.</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.1.44-2023-08-03T000000.html"
              test="count(hl7:typeId[@root='2.16.840.1.113883.1.3'])&gt;=1 and not(hl7:typeId[@root='2.16.840.1.113883.1.3']/@nullFlavor)">(plCdaCytologyResult): element hl7:typeId[@root='2.16.840.1.113883.1.3'] 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.1.44-2023-08-03T000000.html"
              test="count(hl7:typeId[@root='2.16.840.1.113883.1.3'])&lt;=1">(plCdaCytologyResult): element hl7:typeId[@root='2.16.840.1.113883.1.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.1.44-2023-08-03T000000.html"
              test="count(hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.1.44'])&gt;=1 and not(hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.1.44']/@nullFlavor)">(plCdaCytologyResult): element hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.1.44'] 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.1.44-2023-08-03T000000.html"
              test="count(hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.1.44'])&lt;=1">(plCdaCytologyResult): element hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.1.44'] 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.1.44-2023-08-03T000000.html"
              test="count(hl7:id)&gt;=1 ">(plCdaCytologyResult): element hl7:id 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.1.44-2023-08-03T000000.html"
              test="count(hl7:id)&lt;=1">(plCdaCytologyResult): element hl7:id 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.1.44-2023-08-03T000000.html"
              test="count(hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')])&gt;=1 and not(hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]/@nullFlavor)">(plCdaCytologyResult): element hl7:code[(@code='34574-4' 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.1.44-2023-08-03T000000.html"
              test="count(hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')])&lt;=1">(plCdaCytologyResult): element hl7:code[(@code='34574-4' 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.1.44-2023-08-03T000000.html"
              test="count(hl7:title)&gt;=1 and not(hl7:title/@nullFlavor)">(plCdaCytologyResult): 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.1.44-2023-08-03T000000.html"
              test="count(hl7:title)&lt;=1">(plCdaCytologyResult): 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.1.44-2023-08-03T000000.html"
              test="count(hl7:effectiveTime)&gt;=1 and not(hl7:effectiveTime/@nullFlavor)">(plCdaCytologyResult): element hl7:effectiveTime 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.1.44-2023-08-03T000000.html"
              test="count(hl7:effectiveTime)&lt;=1">(plCdaCytologyResult): element hl7:effectiveTime 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.1.44-2023-08-03T000000.html"
              test="count(hl7:confidentialityCode[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.1.11.16926-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.1.11.16926-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code)])&gt;=1 and not(hl7:confidentialityCode[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.1.11.16926-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.1.11.16926-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code)]/@nullFlavor)">(plCdaCytologyResult): element hl7:confidentialityCode[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.1.11.16926-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.1.11.16926-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code)] 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.1.44-2023-08-03T000000.html"
              test="count(hl7:confidentialityCode[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.1.11.16926-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.1.11.16926-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code)])&lt;=1">(plCdaCytologyResult): element hl7:confidentialityCode[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.1.11.16926-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.1.11.16926-DYNAMIC.xml')/*/valueSet/conceptList/exception/@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.1.44-2023-08-03T000000.html"
              test="count(hl7:languageCode[@code='pl-PL'])&gt;=1 and not(hl7:languageCode[@code='pl-PL']/@nullFlavor)">(plCdaCytologyResult): element hl7:languageCode[@code='pl-PL'] 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.1.44-2023-08-03T000000.html"
              test="count(hl7:languageCode[@code='pl-PL'])&lt;=1">(plCdaCytologyResult): element hl7:languageCode[@code='pl-PL'] 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.1.44-2023-08-03T000000.html"
              test="count(hl7:setId)&gt;=1 and not(hl7:setId/@nullFlavor)">(plCdaCytologyResult): element hl7:setId 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.1.44-2023-08-03T000000.html"
              test="count(hl7:setId)&lt;=1">(plCdaCytologyResult): element hl7:setId 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.1.44-2023-08-03T000000.html"
              test="count(hl7:versionNumber)&gt;=1 and not(hl7:versionNumber/@nullFlavor)">(plCdaCytologyResult): element hl7:versionNumber 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.1.44-2023-08-03T000000.html"
              test="count(hl7:versionNumber)&lt;=1">(plCdaCytologyResult): element hl7:versionNumber 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.1.44-2023-08-03T000000.html"
              test="count(hl7:recordTarget[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.3'])&gt;=1 and not(hl7:recordTarget[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.3']/@nullFlavor)">(plCdaCytologyResult): element hl7:recordTarget[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.3'] 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.1.44-2023-08-03T000000.html"
              test="count(hl7:recordTarget[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.3'])&lt;=1">(plCdaCytologyResult): element hl7:recordTarget[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.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.1.44-2023-08-03T000000.html"
              test="count(hl7:author[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.4'])&gt;=1 and not(hl7:author[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.4']/@nullFlavor)">(plCdaCytologyResult): element hl7:author[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.4'] 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.1.44-2023-08-03T000000.html"
              test="count(hl7:author[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.4'])&lt;=1">(plCdaCytologyResult): element hl7:author[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.4'] 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.1.44-2023-08-03T000000.html"
              test="count(hl7:dataEnterer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.90'])&lt;=1">(plCdaCytologyResult): element hl7:dataEnterer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.90'] 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.1.44-2023-08-03T000000.html"
              test="count(hl7:informant)=0">(plCdaCytologyResult): element hl7:informant NIE MOŻE 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.1.44-2023-08-03T000000.html"
              test="count(hl7:custodian[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.20'])&gt;=1 and not(hl7:custodian[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.20']/@nullFlavor)">(plCdaCytologyResult): element hl7:custodian[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.20'] 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.1.44-2023-08-03T000000.html"
              test="count(hl7:custodian[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.20'])&lt;=1">(plCdaCytologyResult): element hl7:custodian[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.20'] 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.1.44-2023-08-03T000000.html"
              test="count(hl7:legalAuthenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.6'])&gt;=1 and not(hl7:legalAuthenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.6']/@nullFlavor)">(plCdaCytologyResult): element hl7:legalAuthenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.6'] 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.1.44-2023-08-03T000000.html"
              test="count(hl7:legalAuthenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.6'])&lt;=1">(plCdaCytologyResult): element hl7:legalAuthenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.6'] 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.1.44-2023-08-03T000000.html"
              test="count(hl7:authenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.85'])&lt;=1">(plCdaCytologyResult): element hl7:authenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.85'] 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.1.44-2023-08-03T000000.html"
              test="count(hl7:relatedDocument[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.21'])&lt;=1">(plCdaCytologyResult): element hl7:relatedDocument[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.21'] 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.1.44-2023-08-03T000000.html"
              test="count(hl7:documentationOf)=0">(plCdaCytologyResult): element hl7:documentationOf NIE MOŻE 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.1.44-2023-08-03T000000.html"
              test="count(hl7:authorization)=0">(plCdaCytologyResult): element hl7:authorization NIE MOŻE 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.1.44-2023-08-03T000000.html"
              test="count(hl7:componentOf)=0">(plCdaCytologyResult): element hl7:componentOf NIE MOŻE 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.1.44-2023-08-03T000000.html"
              test="count(hl7:component[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.110'])&gt;=1 and not(hl7:component[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.110']/@nullFlavor)">(plCdaCytologyResult): element hl7:component[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.110'] 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.1.44-2023-08-03T000000.html"
              test="count(hl7:component[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.110'])&lt;=1">(plCdaCytologyResult): element hl7:component[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.110'] występuje zbyt często [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.1.44
Context: /hl7:ClinicalDocument[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.1.44']/hl7:typeId[@root='2.16.840.1.113883.1.3']
Item: (plCdaCytologyResult)
-->

   <rule context="/hl7:ClinicalDocument[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.1.44']/hl7:typeId[@root='2.16.840.1.113883.1.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.1.44-2023-08-03T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='II' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(plCdaCytologyResult): 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.1.44-2023-08-03T000000.html"
              test="string(@extension)='POCD_HD000040'">(plCdaCytologyResult): Wartość dla @extension MUSI wynosić 'POCD_HD000040'.</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.1.44-2023-08-03T000000.html"
              test="string(@root)='2.16.840.1.113883.1.3'">(plCdaCytologyResult): Wartość dla @root MUSI wynosić '2.16.840.1.113883.1.3'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.1.44
Context: /hl7:ClinicalDocument[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.1.44']/hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.1.44']
Item: (plCdaCytologyResult)
-->

   <rule context="/hl7:ClinicalDocument[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.1.44']/hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.1.44']"
         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.1.44-2023-08-03T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='II' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(plCdaCytologyResult): 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.1.44-2023-08-03T000000.html"
              test="string(@root)='2.16.840.1.113883.3.4424.13.10.1.44'">(plCdaCytologyResult): Wartość dla @root MUSI wynosić '2.16.840.1.113883.3.4424.13.10.1.44'.</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.1.44-2023-08-03T000000.html"
              test="not(@root) or matches(@root,'^[0-2](\.(0|[1-9][0-9]*))*$')">(plCdaCytologyResult): Atrybut @root MUSI być typu 'oid'</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.1.44-2023-08-03T000000.html"
              test="not(@extension) or string-length(@extension)&gt;0">(plCdaCytologyResult): Atrybut @extension MUSI być typu 'st'</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.1.44
Context: /hl7:ClinicalDocument[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.1.44']/hl7:id
Item: (plCdaCytologyResult)
-->

   <rule context="/hl7:ClinicalDocument[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.1.44']/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.1.44-2023-08-03T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='II' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(plCdaCytologyResult): 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.1.44-2023-08-03T000000.html"
              test="@root">(plCdaCytologyResult): atrybut @root 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.1.44-2023-08-03T000000.html"
              test="not(@root) or matches(@root,'^[0-2](\.(0|[1-9][0-9]*))*$')">(plCdaCytologyResult): Atrybut @root MUSI być typu 'oid'</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.1.44-2023-08-03T000000.html"
              test="@extension">(plCdaCytologyResult): 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.1.44-2023-08-03T000000.html"
              test="not(@extension) or string-length(@extension)&gt;0">(plCdaCytologyResult): Atrybut @extension MUSI być typu 'st'</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.1.44-2023-08-03T000000.html"
              test="ends-with(@root,'29.1')">(plCdaCytologyResult): Atrybut @root elementu ClinicalDocument/id MUSI kończyć się na .29.1</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.1.44
Context: /hl7:ClinicalDocument[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.1.44']/hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]
Item: (plCdaCytologyResult)
-->

   <rule context="/hl7:ClinicalDocument[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.1.44']/hl7:code[(@code='34574-4' 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.1.44-2023-08-03T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='CE' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(plCdaCytologyResult): 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.1.44-2023-08-03T000000.html"
              test="@nullFlavor or (@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1' and @displayName='Pathology report final diagnosis' and @codeSystemName='LOINC')">(plCdaCytologyResult): Wartość elementu MUSI wynosić code '34574-4' codeSystem '2.16.840.1.113883.6.1' displayName='Pathology report final diagnosis' 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.1.44-2023-08-03T000000.html"
              test="count(hl7:translation[(@code='06.21' and @codeSystem='2.16.840.1.113883.3.4424.11.1.32')])&gt;=1 and not(hl7:translation[(@code='06.21' and @codeSystem='2.16.840.1.113883.3.4424.11.1.32')]/@nullFlavor)">(plCdaCytologyResult): element hl7:translation[(@code='06.21' and @codeSystem='2.16.840.1.113883.3.4424.11.1.32')] 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.1.44-2023-08-03T000000.html"
              test="count(hl7:translation[(@code='06.21' and @codeSystem='2.16.840.1.113883.3.4424.11.1.32')])&lt;=1">(plCdaCytologyResult): element hl7:translation[(@code='06.21' and @codeSystem='2.16.840.1.113883.3.4424.11.1.32')] występuje zbyt często [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.1.44
Context: /hl7:ClinicalDocument[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.1.44']/hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]/hl7:translation[(@code='06.21' and @codeSystem='2.16.840.1.113883.3.4424.11.1.32')]
Item: (plCdaCytologyResult)
-->

   <rule context="/hl7:ClinicalDocument[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.1.44']/hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]/hl7:translation[(@code='06.21' and @codeSystem='2.16.840.1.113883.3.4424.11.1.32')]"
         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.1.44-2023-08-03T000000.html"
              test="@nullFlavor or (@code='06.21' and @codeSystem='2.16.840.1.113883.3.4424.11.1.32' and @displayName='Wynik badania cytologicznego' and @codeSystemName='KLAS_DOK_P1')">(plCdaCytologyResult): Wartość elementu MUSI wynosić code '06.21' codeSystem '2.16.840.1.113883.3.4424.11.1.32' displayName='Wynik badania cytologicznego' codeSystemName='KLAS_DOK_P1'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.1.44
Context: /hl7:ClinicalDocument[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.1.44']/hl7:title
Item: (plCdaCytologyResult)
-->

   <rule context="/hl7:ClinicalDocument[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.1.44']/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.1.44-2023-08-03T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='ST' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(plCdaCytologyResult): 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.1.44-2023-08-03T000000.html"
              test="text()='Rozpoznanie patomorfologiczne - cytologia'">(plCdaCytologyResult): zawartość elementu hl7:title MUSI wynosić ''Rozpoznanie patomorfologiczne - cytologia''.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.1.44
Context: /hl7:ClinicalDocument[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.1.44']/hl7:effectiveTime
Item: (plCdaCytologyResult)
-->

   <rule context="/hl7:ClinicalDocument[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.1.44']/hl7:effectiveTime"
         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.1.44-2023-08-03T000000.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)">(plCdaCytologyResult): 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"/>
      <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.1.44-2023-08-03T000000.html"
              test="concat(substring(@value,1,4),'-',substring(@value,5,2),'-',substring(@value,7,2)) castable as xs:date">(plCdaCytologyResult): Pierwsze 8 cyfr daty powinno być w formacie YYYYMMDD.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.1.44
Context: /hl7:ClinicalDocument[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.1.44']/hl7:confidentialityCode[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.1.11.16926-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.1.11.16926-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code)]
Item: (plCdaCytologyResult)
-->

   <rule context="/hl7:ClinicalDocument[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.1.44']/hl7:confidentialityCode[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.1.11.16926-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.1.11.16926-DYNAMIC.xml')/*/valueSet/conceptList/exception/@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.1.44-2023-08-03T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='CE' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(plCdaCytologyResult): 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.1.44-2023-08-03T000000.html"
              test="@nullFlavor or exists(doc('include/voc-2.16.840.1.113883.1.11.16926-DYNAMIC.xml')/*/valueSet[conceptList/concept[@code = $theCode][@codeSystem = $theCodeSystem][not(@codeSystemVersion) or @codeSystemVersion=$theCodeSystemVersion] or completeCodeSystem[@codeSystem=$theCodeSystem][not(@codeSystemVersion) or @codeSystemVersion=$theCodeSystemVersion]])">(plCdaCytologyResult): Wartość elementu MUSI wynosić x_BasicConfidentialityKind (DYNAMICZNE).</assert>
      <let name="theNullFlavor" value="@nullFlavor"/>
      <let name="validNullFlavorsFound"
           value="exists(doc('include/voc-2.16.840.1.113883.1.11.16926-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.1.44-2023-08-03T000000.html"
              test="not(@nullFlavor) or not(empty(($validNullFlavorsFound))) ">(plCdaCytologyResult): 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 x_BasicConfidentialityKind (DYNAMICZNE)</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.1.44
Context: /hl7:ClinicalDocument[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.1.44']/hl7:languageCode[@code='pl-PL']
Item: (plCdaCytologyResult)
-->

   <rule context="/hl7:ClinicalDocument[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.1.44']/hl7:languageCode[@code='pl-PL']"
         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.1.44-2023-08-03T000000.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)">(plCdaCytologyResult): 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.1.44-2023-08-03T000000.html"
              test="@nullFlavor or (@code='pl-PL')">(plCdaCytologyResult): Wartość elementu MUSI wynosić code 'pl-PL'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.1.44
Context: /hl7:ClinicalDocument[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.1.44']/hl7:setId
Item: (plCdaCytologyResult)
-->

   <rule context="/hl7:ClinicalDocument[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.1.44']/hl7:setId"
         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.1.44-2023-08-03T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='II' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(plCdaCytologyResult): 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.1.44-2023-08-03T000000.html"
              test="@root">(plCdaCytologyResult): atrybut @root 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.1.44-2023-08-03T000000.html"
              test="not(@root) or matches(@root,'^[0-2](\.(0|[1-9][0-9]*))*$')">(plCdaCytologyResult): Atrybut @root MUSI być typu 'oid'</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.1.44-2023-08-03T000000.html"
              test="@extension">(plCdaCytologyResult): 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.1.44-2023-08-03T000000.html"
              test="not(@extension) or string-length(@extension)&gt;0">(plCdaCytologyResult): Atrybut @extension MUSI być typu 'st'</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.1.44-2023-08-03T000000.html"
              test="ends-with(@root,'29.2')">(plCdaCytologyResult): Atrybut @root elementu ClinicalDocument/setId MUSI kończyć się na .29.2</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.1.44
Context: /hl7:ClinicalDocument[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.1.44']/hl7:versionNumber
Item: (plCdaCytologyResult)
-->

   <rule context="/hl7:ClinicalDocument[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.1.44']/hl7:versionNumber"
         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.1.44-2023-08-03T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='INT' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(plCdaCytologyResult): Jeśli występuje instrukcja @xsi:type, to MUSI mieć wartość "{urn:hl7-org:v3}:INT", 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="INT"/>
      <let name="theValue" value="@value"/>
      <let name="digitok"
           value="matches(string($theValue), '^-?[1-9][0-9]*$|^+?[0-9]*$')"/>
      <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.1.44-2023-08-03T000000.html"
              test="$digitok or @nullFlavor">(plCdaCytologyResult): @value nie jest poprawną liczbą typu INT <value-of select="$theValue"/>
      </assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.1.44
Context: /hl7:ClinicalDocument[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.1.44']/hl7:informant
Item: (plCdaCytologyResult)
-->

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.1.44
Context: /hl7:ClinicalDocument[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.1.44']/hl7:documentationOf
Item: (plCdaCytologyResult)
-->

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.1.44
Context: /hl7:ClinicalDocument[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.1.44']/hl7:authorization
Item: (plCdaCytologyResult)
-->

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.1.44
Context: /hl7:ClinicalDocument[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.1.44']/hl7:componentOf
Item: (plCdaCytologyResult)
-->
</pattern>
