<?xml version="1.0" encoding="UTF-8"?>
<!--
Template derived pattern
===========================================
ID: 2.16.840.1.113883.3.4424.13.10.4.179
Name: [4] Opis makroskopowy w cytologii dla pojedynczego badanego materiału
Description: Szablon CDA dla opisu makroskopowego w cytologii dla pojedynczego badanego materiału
-->
<pattern xmlns="http://purl.oclc.org/dsdl/schematron"
         id="template-2.16.840.1.113883.3.4424.13.10.4.179-2023-04-27T000000">
   <title>[4] Opis makroskopowy w cytologii dla pojedynczego badanego materiału</title>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

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

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']"
         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.4.179-2023-04-27T000000.html"
              test="string(@classCode)='BATTERY'">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): Wartość dla @classCode MUSI wynosić 'BATTERY'.</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.4.179-2023-04-27T000000.html"
              test="not(@classCode) or (string-length(@classCode)&gt;0 and not(matches(@classCode,'\s')))">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="string(@moodCode)='EVN'">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.4.179'])&gt;=1 and not(hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.4.179']/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.4.179'] 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.4.179-2023-04-27T000000.html"
              test="count(hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.4.179'])&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.4.179'] 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.4.179-2023-04-27T000000.html"
              test="count(hl7:code)&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7: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.4.179-2023-04-27T000000.html"
              test="count(hl7:statusCode[@code='completed'])&gt;=1 and not(hl7:statusCode[@code='completed']/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:statusCode[@code='completed'])&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:statusCode[@code='completed'] występuje zbyt często [max 1x].</assert>
      <let name="elmcount"
           value="count(hl7:component[hl7:observation/hl7:code/@code='50595-8']|hl7:component[hl7:observation/hl7:code/@code='21025-2']|hl7:component[hl7:observation/hl7:code/@nullFlavor='NA'])"/>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.179-2023-04-27T000000.html"
              test="$elmcount&gt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): wybór (hl7:component[hl7:observation/hl7:code/@code='50595-8'] lub hl7:component[hl7:observation/hl7:code/@code='21025-2'] lub hl7:component[hl7:observation/hl7:code/@nullFlavor='NA']) 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.4.179-2023-04-27T000000.html"
              test="$elmcount&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): wybór (hl7:component[hl7:observation/hl7:code/@code='50595-8'] lub hl7:component[hl7:observation/hl7:code/@code='21025-2'] lub hl7:component[hl7:observation/hl7:code/@nullFlavor='NA']) 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.4.179-2023-04-27T000000.html"
              test="count(hl7:component[hl7:observation/hl7:code/@code='50595-8'])&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:component[hl7:observation/hl7:code/@code='50595-8'] 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.4.179-2023-04-27T000000.html"
              test="count(hl7:component[hl7:observation/hl7:code/@code='21025-2'])&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:component[hl7:observation/hl7:code/@code='21025-2'] 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.4.179-2023-04-27T000000.html"
              test="count(hl7:component[hl7:observation/hl7:code/@nullFlavor='NA'])&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:component[hl7:observation/hl7:code/@nullFlavor='NA'] występuje zbyt często [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.4.179']
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.4.179']"
         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.4.179-2023-04-27T000000.html"
              test="string(@root)='2.16.840.1.113883.3.4424.13.10.4.179'">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): Wartość dla @root MUSI wynosić '2.16.840.1.113883.3.4424.13.10.4.179'.</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.4.179-2023-04-27T000000.html"
              test="not(@root) or matches(@root,'^[0-2](\.(0|[1-9][0-9]*))*$')">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): Atrybut @root MUSI być typu 'oid'</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:code
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7: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.4.179-2023-04-27T000000.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)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="not(@nullFlavor) or (string-length(@nullFlavor)&gt;0 and not(matches(@nullFlavor,'\s')))">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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=('NA')) 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.4.179-2023-04-27T000000.html"
              test="not(@nullFlavor) or count($theAttValue) = count($theAttCheck)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): Wartość dla nullFlavor MUSI wynosić 'kod NA'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:statusCode[@code='completed']
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/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.4.179-2023-04-27T000000.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)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="@nullFlavor or (@code='completed')">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): Wartość elementu MUSI wynosić code 'completed'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='50595-8']
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='50595-8']"
         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.4.179-2023-04-27T000000.html"
              test="string(@typeCode)='COMP' or not(@typeCode)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:observation[hl7:code[(@code='50595-8' and @codeSystem='2.16.840.1.113883.6.1')]])&gt;=1 and not(hl7:observation[hl7:code[(@code='50595-8' and @codeSystem='2.16.840.1.113883.6.1')]]/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:observation[hl7:code[(@code='50595-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.4.179-2023-04-27T000000.html"
              test="count(hl7:observation[hl7:code[(@code='50595-8' and @codeSystem='2.16.840.1.113883.6.1')]])&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:observation[hl7:code[(@code='50595-8' and @codeSystem='2.16.840.1.113883.6.1')]] występuje zbyt często [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='50595-8']/hl7:observation[hl7:code[(@code='50595-8' and @codeSystem='2.16.840.1.113883.6.1')]]
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='50595-8']/hl7:observation[hl7:code[(@code='50595-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.4.179-2023-04-27T000000.html"
              test="string(@classCode)='OBS' or not(@classCode)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="not(@classCode) or (string-length(@classCode)&gt;0 and not(matches(@classCode,'\s')))">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="string(@moodCode)='EVN' or not(@moodCode)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="not(@moodCode) or (string-length(@moodCode)&gt;0 and not(matches(@moodCode,'\s')))">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:code[(@code='50595-8' and @codeSystem='2.16.840.1.113883.6.1')])&gt;=1 and not(hl7:code[(@code='50595-8' and @codeSystem='2.16.840.1.113883.6.1')]/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:code[(@code='50595-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.4.179-2023-04-27T000000.html"
              test="count(hl7:code[(@code='50595-8' and @codeSystem='2.16.840.1.113883.6.1')])&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:code[(@code='50595-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.4.179-2023-04-27T000000.html"
              test="count(hl7:text)&gt;=1 and not(hl7:text/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:text)&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:statusCode[@code='completed'])&gt;=1 and not(hl7:statusCode[@code='completed']/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:statusCode[@code='completed'])&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]])&gt;=1 and not(hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' 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.4.179-2023-04-27T000000.html"
              test="count(hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]])&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' 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.4.179-2023-04-27T000000.html"
              test="count(hl7:entryRelationship[hl7:observation/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.186'])&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:entryRelationship[hl7:observation/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.186'] występuje zbyt często [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='50595-8']/hl7:observation[hl7:code[(@code='50595-8' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='50595-8' and @codeSystem='2.16.840.1.113883.6.1')]
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='50595-8']/hl7:observation[hl7:code[(@code='50595-8' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='50595-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.4.179-2023-04-27T000000.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)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="@nullFlavor or (@code='50595-8' and @codeSystem='2.16.840.1.113883.6.1' and @displayName='Pathologist interpretation of Specimen tests' and @codeSystemName='LOINC')">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): Wartość elementu MUSI wynosić code '50595-8' codeSystem '2.16.840.1.113883.6.1' displayName='Pathologist interpretation of Specimen tests' 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.4.179-2023-04-27T000000.html"
              test="count(hl7:translation[(@code='ParamMatMakro' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')])&gt;=1 and not(hl7:translation[(@code='ParamMatMakro' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:translation[(@code='ParamMatMakro' 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.4.179-2023-04-27T000000.html"
              test="count(hl7:translation[(@code='ParamMatMakro' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')])&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:translation[(@code='ParamMatMakro' 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.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='50595-8']/hl7:observation[hl7:code[(@code='50595-8' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='50595-8' and @codeSystem='2.16.840.1.113883.6.1')]/hl7:translation[(@code='ParamMatMakro' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='50595-8']/hl7:observation[hl7:code[(@code='50595-8' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='50595-8' and @codeSystem='2.16.840.1.113883.6.1')]/hl7:translation[(@code='ParamMatMakro' 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.4.179-2023-04-27T000000.html"
              test="@nullFlavor or (@code='ParamMatMakro' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18' and @displayName='Parametry materiału w opisie makroskopowym' and @codeSystemName='AtrybutyWBCYT')">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): Wartość elementu MUSI wynosić code 'ParamMatMakro' codeSystem '2.16.840.1.113883.3.4424.13.5.18' displayName='Parametry materiału w opisie makroskopowym' codeSystemName='AtrybutyWBCYT'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='50595-8']/hl7:observation[hl7:code[(@code='50595-8' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:statusCode[@code='completed']
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='50595-8']/hl7:observation[hl7:code[(@code='50595-8' and @codeSystem='2.16.840.1.113883.6.1')]]/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.4.179-2023-04-27T000000.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)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="@nullFlavor or (@code='completed')">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): Wartość elementu MUSI wynosić code 'completed'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='50595-8']/hl7:observation[hl7:code[(@code='50595-8' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='50595-8']/hl7:observation[hl7:code[(@code='50595-8' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' 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.4.179-2023-04-27T000000.html"
              test="string(@typeCode)='COMP'">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]])&gt;=1 and not(hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:observation[hl7:code[(@code='66746-9' 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.4.179-2023-04-27T000000.html"
              test="count(hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]])&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]] występuje zbyt często [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='50595-8']/hl7:observation[hl7:code[(@code='50595-8' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='50595-8']/hl7:observation[hl7:code[(@code='50595-8' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' 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.4.179-2023-04-27T000000.html"
              test="string(@classCode)='OBS' or not(@classCode)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="not(@classCode) or (string-length(@classCode)&gt;0 and not(matches(@classCode,'\s')))">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="string(@moodCode)='EVN' or not(@moodCode)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="not(@moodCode) or (string-length(@moodCode)&gt;0 and not(matches(@moodCode,'\s')))">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')])&gt;=1 and not(hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:code[(@code='66746-9' 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.4.179-2023-04-27T000000.html"
              test="count(hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')])&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:code[(@code='66746-9' 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.4.179-2023-04-27T000000.html"
              test="count(hl7:text)&gt;=1 and not(hl7:text/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:text)&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:statusCode[@code='completed'])&gt;=1 and not(hl7:statusCode[@code='completed']/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:statusCode[@code='completed'])&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:value[(@code='CYTZLASP' and @codeSystem='2.16.840.1.113883.3.4424.13.5.19.4')])&gt;=1 and not(hl7:value[(@code='CYTZLASP' and @codeSystem='2.16.840.1.113883.3.4424.13.5.19.4')]/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:value[(@code='CYTZLASP' and @codeSystem='2.16.840.1.113883.3.4424.13.5.19.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.4.179-2023-04-27T000000.html"
              test="count(hl7:value[(@code='CYTZLASP' and @codeSystem='2.16.840.1.113883.3.4424.13.5.19.4')])&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:value[(@code='CYTZLASP' and @codeSystem='2.16.840.1.113883.3.4424.13.5.19.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.4.179-2023-04-27T000000.html"
              test="count(hl7:entryRelationship[hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]]])&gt;=1 and not(hl7:entryRelationship[hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:entryRelationship[hl7:observation[hl7:code[(@code='93047-9' 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.4.179-2023-04-27T000000.html"
              test="count(hl7:entryRelationship[hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]]])&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:entryRelationship[hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]]] występuje zbyt często [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='50595-8']/hl7:observation[hl7:code[(@code='50595-8' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='50595-8']/hl7:observation[hl7:code[(@code='50595-8' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='66746-9' 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.4.179-2023-04-27T000000.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)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="@nullFlavor or (@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1' and @displayName='Specimen type' and @codeSystemName='LOINC')">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): Wartość elementu MUSI wynosić code '66746-9' codeSystem '2.16.840.1.113883.6.1' displayName='Specimen type' 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.4.179-2023-04-27T000000.html"
              test="count(hl7:translation[(@code='TypNadMat' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')])&gt;=1 and not(hl7:translation[(@code='TypNadMat' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:translation[(@code='TypNadMat' 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.4.179-2023-04-27T000000.html"
              test="count(hl7:translation[(@code='TypNadMat' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')])&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:translation[(@code='TypNadMat' 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.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='50595-8']/hl7:observation[hl7:code[(@code='50595-8' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]/hl7:translation[(@code='TypNadMat' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='50595-8']/hl7:observation[hl7:code[(@code='50595-8' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]/hl7:translation[(@code='TypNadMat' 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.4.179-2023-04-27T000000.html"
              test="@nullFlavor or (@code='TypNadMat' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18' and @displayName='Typ nadesłanego materiału' and @codeSystemName='AtrybutyWBCYT')">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): Wartość elementu MUSI wynosić code 'TypNadMat' codeSystem '2.16.840.1.113883.3.4424.13.5.18' displayName='Typ nadesłanego materiału' codeSystemName='AtrybutyWBCYT'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='50595-8']/hl7:observation[hl7:code[(@code='50595-8' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:statusCode[@code='completed']
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='50595-8']/hl7:observation[hl7:code[(@code='50595-8' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/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.4.179-2023-04-27T000000.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)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="@nullFlavor or (@code='completed')">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): Wartość elementu MUSI wynosić code 'completed'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='50595-8']/hl7:observation[hl7:code[(@code='50595-8' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:value[(@code='CYTZLASP' and @codeSystem='2.16.840.1.113883.3.4424.13.5.19.4')]
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='50595-8']/hl7:observation[hl7:code[(@code='50595-8' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:value[(@code='CYTZLASP' and @codeSystem='2.16.840.1.113883.3.4424.13.5.19.4')]"
         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.4.179-2023-04-27T000000.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)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="@nullFlavor or (@code='CYTZLASP' and @codeSystem='2.16.840.1.113883.3.4424.13.5.19.4' and @displayName='Cytologia złuszczeniowa lub aspiracyjna (rozmaz)' and @codeSystemName='CytologiaTypNadeslanegoMaterialu')">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): Wartość elementu MUSI wynosić code 'CYTZLASP' codeSystem '2.16.840.1.113883.3.4424.13.5.19.4' displayName='Cytologia złuszczeniowa lub aspiracyjna (rozmaz)' codeSystemName='CytologiaTypNadeslanegoMaterialu'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='50595-8']/hl7:observation[hl7:code[(@code='50595-8' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]]]
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='50595-8']/hl7:observation[hl7:code[(@code='50595-8' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='93047-9' 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.4.179-2023-04-27T000000.html"
              test="string(@typeCode)='COMP'">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]])&gt;=1 and not(hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]]/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:observation[hl7:code[(@code='93047-9' 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.4.179-2023-04-27T000000.html"
              test="count(hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]])&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]] występuje zbyt często [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='50595-8']/hl7:observation[hl7:code[(@code='50595-8' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]]
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='50595-8']/hl7:observation[hl7:code[(@code='50595-8' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='93047-9' 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.4.179-2023-04-27T000000.html"
              test="string(@classCode)='OBS' or not(@classCode)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="not(@classCode) or (string-length(@classCode)&gt;0 and not(matches(@classCode,'\s')))">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="string(@moodCode)='EVN' or not(@moodCode)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="not(@moodCode) or (string-length(@moodCode)&gt;0 and not(matches(@moodCode,'\s')))">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')])&gt;=1 and not(hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:code[(@code='93047-9' 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.4.179-2023-04-27T000000.html"
              test="count(hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')])&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:code[(@code='93047-9' 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.4.179-2023-04-27T000000.html"
              test="count(hl7:text)&gt;=1 and not(hl7:text/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:text)&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:statusCode[@code='completed'])&gt;=1 and not(hl7:statusCode[@code='completed']/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:statusCode[@code='completed'])&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:value[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.3.4424.13.11.184-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.184-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code)])&gt;=1 and not(hl7:value[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.3.4424.13.11.184-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.184-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code)]/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:value[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.3.4424.13.11.184-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.184-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.4.179-2023-04-27T000000.html"
              test="count(hl7:value[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.3.4424.13.11.184-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.184-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code)])&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:value[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.3.4424.13.11.184-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.184-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code)] występuje zbyt często [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='50595-8']/hl7:observation[hl7:code[(@code='50595-8' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='50595-8']/hl7:observation[hl7:code[(@code='50595-8' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='93047-9' 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.4.179-2023-04-27T000000.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)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="@nullFlavor or (@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1' and @displayName='Specimen condition [Type]' and @codeSystemName='LOINC')">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): Wartość elementu MUSI wynosić code '93047-9' codeSystem '2.16.840.1.113883.6.1' displayName='Specimen condition [Type]' 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.4.179-2023-04-27T000000.html"
              test="count(hl7:translation[(@code='KwalOtrzPrep' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')])&gt;=1 and not(hl7:translation[(@code='KwalOtrzPrep' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:translation[(@code='KwalOtrzPrep' 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.4.179-2023-04-27T000000.html"
              test="count(hl7:translation[(@code='KwalOtrzPrep' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')])&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:translation[(@code='KwalOtrzPrep' 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.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='50595-8']/hl7:observation[hl7:code[(@code='50595-8' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]/hl7:translation[(@code='KwalOtrzPrep' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='50595-8']/hl7:observation[hl7:code[(@code='50595-8' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]/hl7:translation[(@code='KwalOtrzPrep' 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.4.179-2023-04-27T000000.html"
              test="@nullFlavor or (@code='KwalOtrzPrep' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18' and @displayName='Kwalifikacja otrzymanych preparatów' and @codeSystemName='AtrybutyWBCYT')">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): Wartość elementu MUSI wynosić code 'KwalOtrzPrep' codeSystem '2.16.840.1.113883.3.4424.13.5.18' displayName='Kwalifikacja otrzymanych preparatów' codeSystemName='AtrybutyWBCYT'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='50595-8']/hl7:observation[hl7:code[(@code='50595-8' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:statusCode[@code='completed']
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='50595-8']/hl7:observation[hl7:code[(@code='50595-8' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]]/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.4.179-2023-04-27T000000.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)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="@nullFlavor or (@code='completed')">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): Wartość elementu MUSI wynosić code 'completed'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='50595-8']/hl7:observation[hl7:code[(@code='50595-8' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:value[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.3.4424.13.11.184-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.184-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code)]
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='50595-8']/hl7:observation[hl7:code[(@code='50595-8' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:value[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.3.4424.13.11.184-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.184-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.4.179-2023-04-27T000000.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)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="@nullFlavor or exists(doc('include/voc-2.16.840.1.113883.3.4424.13.11.184-DYNAMIC.xml')/*/valueSet[conceptList/concept[@code = $theCode][@codeSystem = $theCodeSystem][not(@codeSystemVersion) or @codeSystemVersion=$theCodeSystemVersion] or completeCodeSystem[@codeSystem=$theCodeSystem][not(@codeSystemVersion) or @codeSystemVersion=$theCodeSystemVersion]])">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): Wartość elementu MUSI wynosić CytologiaKwalifikacjaOtrzymanychPreparatow Kwalifikacja otrzymanych preparatów w cytologii (DYNAMICZNE).</assert>
      <let name="theNullFlavor" value="@nullFlavor"/>
      <let name="validNullFlavorsFound"
           value="exists(doc('include/voc-2.16.840.1.113883.3.4424.13.11.184-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.4.179-2023-04-27T000000.html"
              test="not(@nullFlavor) or not(empty(($validNullFlavorsFound))) ">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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 CytologiaKwalifikacjaOtrzymanychPreparatow Kwalifikacja otrzymanych preparatów w cytologii (DYNAMICZNE)</assert>
   </rule>

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='50595-8']/hl7:observation[hl7:code[(@code='50595-8' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.186']
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->
   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='50595-8']/hl7:observation[hl7:code[(@code='50595-8' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.186']">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.179-2023-04-27T000000.html"
              test="string(@typeCode)='COMP' or not(@typeCode)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="not(@typeCode) or (string-length(@typeCode)&gt;0 and not(matches(@typeCode,'\s')))">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): Atrybut @typeCode MUSI być typu 'cs'</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']"
         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.4.179-2023-04-27T000000.html"
              test="string(@typeCode)='COMP' or not(@typeCode)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]])&gt;=1 and not(hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:observation[hl7:code[(@code='21025-2' 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.4.179-2023-04-27T000000.html"
              test="count(hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]])&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]] występuje zbyt często [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' 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.4.179-2023-04-27T000000.html"
              test="string(@classCode)='OBS' or not(@classCode)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="not(@classCode) or (string-length(@classCode)&gt;0 and not(matches(@classCode,'\s')))">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="string(@moodCode)='EVN' or not(@moodCode)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="not(@moodCode) or (string-length(@moodCode)&gt;0 and not(matches(@moodCode,'\s')))">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')])&gt;=1 and not(hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:code[(@code='21025-2' 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.4.179-2023-04-27T000000.html"
              test="count(hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')])&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:code[(@code='21025-2' 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.4.179-2023-04-27T000000.html"
              test="count(hl7:text)&gt;=1 and not(hl7:text/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:text)&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:statusCode[@code='completed'])&gt;=1 and not(hl7:statusCode[@code='completed']/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:statusCode[@code='completed'])&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]])&gt;=1 and not(hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' 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.4.179-2023-04-27T000000.html"
              test="count(hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]])&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' 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.4.179-2023-04-27T000000.html"
              test="count(hl7:entryRelationship[hl7:observation/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.186'])&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:entryRelationship[hl7:observation/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.186'] występuje zbyt często [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='21025-2' 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.4.179-2023-04-27T000000.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)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="@nullFlavor or (@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1' and @displayName='Pathologist interpretation of Body fluid tests' and @codeSystemName='LOINC')">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): Wartość elementu MUSI wynosić code '21025-2' codeSystem '2.16.840.1.113883.6.1' displayName='Pathologist interpretation of Body fluid tests' 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.4.179-2023-04-27T000000.html"
              test="count(hl7:translation[(@code='ParamMatMakro' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')])&gt;=1 and not(hl7:translation[(@code='ParamMatMakro' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:translation[(@code='ParamMatMakro' 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.4.179-2023-04-27T000000.html"
              test="count(hl7:translation[(@code='ParamMatMakro' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')])&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:translation[(@code='ParamMatMakro' 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.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]/hl7:translation[(@code='ParamMatMakro' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]/hl7:translation[(@code='ParamMatMakro' 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.4.179-2023-04-27T000000.html"
              test="@nullFlavor or (@code='ParamMatMakro' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18' and @displayName='Parametry materiału w opisie makroskopowym' and @codeSystemName='AtrybutyWBCYT')">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): Wartość elementu MUSI wynosić code 'ParamMatMakro' codeSystem '2.16.840.1.113883.3.4424.13.5.18' displayName='Parametry materiału w opisie makroskopowym' codeSystemName='AtrybutyWBCYT'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:statusCode[@code='completed']
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/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.4.179-2023-04-27T000000.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)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="@nullFlavor or (@code='completed')">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): Wartość elementu MUSI wynosić code 'completed'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' 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.4.179-2023-04-27T000000.html"
              test="string(@typeCode)='COMP'">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]])&gt;=1 and not(hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:observation[hl7:code[(@code='66746-9' 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.4.179-2023-04-27T000000.html"
              test="count(hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]])&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]] występuje zbyt często [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' 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.4.179-2023-04-27T000000.html"
              test="string(@classCode)='OBS' or not(@classCode)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="not(@classCode) or (string-length(@classCode)&gt;0 and not(matches(@classCode,'\s')))">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="string(@moodCode)='EVN' or not(@moodCode)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="not(@moodCode) or (string-length(@moodCode)&gt;0 and not(matches(@moodCode,'\s')))">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')])&gt;=1 and not(hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:code[(@code='66746-9' 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.4.179-2023-04-27T000000.html"
              test="count(hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')])&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:code[(@code='66746-9' 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.4.179-2023-04-27T000000.html"
              test="count(hl7:text)&gt;=1 and not(hl7:text/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:text)&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:statusCode[@code='completed'])&gt;=1 and not(hl7:statusCode[@code='completed']/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:statusCode[@code='completed'])&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:value[(@code='PLZJACIA' and @codeSystem='2.16.840.1.113883.3.4424.13.5.19.4')])&gt;=1 and not(hl7:value[(@code='PLZJACIA' and @codeSystem='2.16.840.1.113883.3.4424.13.5.19.4')]/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:value[(@code='PLZJACIA' and @codeSystem='2.16.840.1.113883.3.4424.13.5.19.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.4.179-2023-04-27T000000.html"
              test="count(hl7:value[(@code='PLZJACIA' and @codeSystem='2.16.840.1.113883.3.4424.13.5.19.4')])&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:value[(@code='PLZJACIA' and @codeSystem='2.16.840.1.113883.3.4424.13.5.19.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.4.179-2023-04-27T000000.html"
              test="count(hl7:entryRelationship[hl7:observation[hl7:code[(@code='12254-9' and @codeSystem='2.16.840.1.113883.6.1')]]])&gt;=1 and not(hl7:entryRelationship[hl7:observation[hl7:code[(@code='12254-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:entryRelationship[hl7:observation[hl7:code[(@code='12254-9' 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.4.179-2023-04-27T000000.html"
              test="count(hl7:entryRelationship[hl7:observation[hl7:code[(@code='12254-9' and @codeSystem='2.16.840.1.113883.6.1')]]])&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:entryRelationship[hl7:observation[hl7:code[(@code='12254-9' 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.4.179-2023-04-27T000000.html"
              test="count(hl7:entryRelationship[hl7:observation[hl7:code[(@code='6824-7' and @codeSystem='2.16.840.1.113883.6.1')]]])&gt;=1 and not(hl7:entryRelationship[hl7:observation[hl7:code[(@code='6824-7' and @codeSystem='2.16.840.1.113883.6.1')]]]/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:entryRelationship[hl7:observation[hl7:code[(@code='6824-7' 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.4.179-2023-04-27T000000.html"
              test="count(hl7:entryRelationship[hl7:observation[hl7:code[(@code='6824-7' and @codeSystem='2.16.840.1.113883.6.1')]]])&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:entryRelationship[hl7:observation[hl7:code[(@code='6824-7' 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.4.179-2023-04-27T000000.html"
              test="count(hl7:entryRelationship[hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]]])&gt;=1 and not(hl7:entryRelationship[hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:entryRelationship[hl7:observation[hl7:code[(@code='93047-9' 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.4.179-2023-04-27T000000.html"
              test="count(hl7:entryRelationship[hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]]])&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:entryRelationship[hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]]] występuje zbyt często [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='66746-9' 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.4.179-2023-04-27T000000.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)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="@nullFlavor or (@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1' and @displayName='Specimen type' and @codeSystemName='LOINC')">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): Wartość elementu MUSI wynosić code '66746-9' codeSystem '2.16.840.1.113883.6.1' displayName='Specimen type' 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.4.179-2023-04-27T000000.html"
              test="count(hl7:translation[(@code='TypNadMat' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')])&gt;=1 and not(hl7:translation[(@code='TypNadMat' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:translation[(@code='TypNadMat' 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.4.179-2023-04-27T000000.html"
              test="count(hl7:translation[(@code='TypNadMat' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')])&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:translation[(@code='TypNadMat' 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.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]/hl7:translation[(@code='TypNadMat' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]/hl7:translation[(@code='TypNadMat' 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.4.179-2023-04-27T000000.html"
              test="@nullFlavor or (@code='TypNadMat' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18' and @displayName='Typ nadesłanego materiału' and @codeSystemName='AtrybutyWBCYT')">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): Wartość elementu MUSI wynosić code 'TypNadMat' codeSystem '2.16.840.1.113883.3.4424.13.5.18' displayName='Typ nadesłanego materiału' codeSystemName='AtrybutyWBCYT'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:statusCode[@code='completed']
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/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.4.179-2023-04-27T000000.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)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="@nullFlavor or (@code='completed')">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): Wartość elementu MUSI wynosić code 'completed'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:value[(@code='PLZJACIA' and @codeSystem='2.16.840.1.113883.3.4424.13.5.19.4')]
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:value[(@code='PLZJACIA' and @codeSystem='2.16.840.1.113883.3.4424.13.5.19.4')]"
         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.4.179-2023-04-27T000000.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)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="@nullFlavor or (@code='PLZJACIA' and @codeSystem='2.16.840.1.113883.3.4424.13.5.19.4' and @displayName='Płyn z jam ciała' and @codeSystemName='CytologiaTypNadeslanegoMaterialu')">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): Wartość elementu MUSI wynosić code 'PLZJACIA' codeSystem '2.16.840.1.113883.3.4424.13.5.19.4' displayName='Płyn z jam ciała' codeSystemName='CytologiaTypNadeslanegoMaterialu'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='12254-9' and @codeSystem='2.16.840.1.113883.6.1')]]]
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='12254-9' 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.4.179-2023-04-27T000000.html"
              test="string(@typeCode)='COMP'">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:observation[hl7:code[(@code='12254-9' and @codeSystem='2.16.840.1.113883.6.1')]])&gt;=1 and not(hl7:observation[hl7:code[(@code='12254-9' and @codeSystem='2.16.840.1.113883.6.1')]]/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:observation[hl7:code[(@code='12254-9' 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.4.179-2023-04-27T000000.html"
              test="count(hl7:observation[hl7:code[(@code='12254-9' and @codeSystem='2.16.840.1.113883.6.1')]])&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:observation[hl7:code[(@code='12254-9' and @codeSystem='2.16.840.1.113883.6.1')]] występuje zbyt często [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='12254-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='12254-9' and @codeSystem='2.16.840.1.113883.6.1')]]
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='12254-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='12254-9' 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.4.179-2023-04-27T000000.html"
              test="string(@classCode)='OBS' or not(@classCode)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="not(@classCode) or (string-length(@classCode)&gt;0 and not(matches(@classCode,'\s')))">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="string(@moodCode)='EVN' or not(@moodCode)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="not(@moodCode) or (string-length(@moodCode)&gt;0 and not(matches(@moodCode,'\s')))">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:code[(@code='12254-9' and @codeSystem='2.16.840.1.113883.6.1')])&gt;=1 and not(hl7:code[(@code='12254-9' and @codeSystem='2.16.840.1.113883.6.1')]/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:code[(@code='12254-9' 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.4.179-2023-04-27T000000.html"
              test="count(hl7:code[(@code='12254-9' and @codeSystem='2.16.840.1.113883.6.1')])&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:code[(@code='12254-9' 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.4.179-2023-04-27T000000.html"
              test="count(hl7:text)&gt;=1 and not(hl7:text/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:text)&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:statusCode[@code='completed'])&gt;=1 and not(hl7:statusCode[@code='completed']/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:statusCode[@code='completed'])&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:value)&gt;=1 and not(hl7:value/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:value 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.4.179-2023-04-27T000000.html"
              test="count(hl7:value)&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='12254-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='12254-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='12254-9' and @codeSystem='2.16.840.1.113883.6.1')]
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='12254-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='12254-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='12254-9' 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.4.179-2023-04-27T000000.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)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="@nullFlavor or (@code='12254-9' and @codeSystem='2.16.840.1.113883.6.1' and @displayName='Volume of Body fluid' and @codeSystemName='LOINC')">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): Wartość elementu MUSI wynosić code '12254-9' codeSystem '2.16.840.1.113883.6.1' displayName='Volume of Body fluid' 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.4.179-2023-04-27T000000.html"
              test="count(hl7:translation[(@code='ObjPlyn' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')])&gt;=1 and not(hl7:translation[(@code='ObjPlyn' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:translation[(@code='ObjPlyn' 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.4.179-2023-04-27T000000.html"
              test="count(hl7:translation[(@code='ObjPlyn' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')])&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:translation[(@code='ObjPlyn' 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.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='12254-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='12254-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='12254-9' and @codeSystem='2.16.840.1.113883.6.1')]/hl7:translation[(@code='ObjPlyn' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='12254-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='12254-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='12254-9' and @codeSystem='2.16.840.1.113883.6.1')]/hl7:translation[(@code='ObjPlyn' 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.4.179-2023-04-27T000000.html"
              test="@nullFlavor or (@code='ObjPlyn' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18' and @displayName='Objętość płynu' and @codeSystemName='AtrybutyWBCYT')">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): Wartość elementu MUSI wynosić code 'ObjPlyn' codeSystem '2.16.840.1.113883.3.4424.13.5.18' displayName='Objętość płynu' codeSystemName='AtrybutyWBCYT'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='12254-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='12254-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:statusCode[@code='completed']
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='12254-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='12254-9' and @codeSystem='2.16.840.1.113883.6.1')]]/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.4.179-2023-04-27T000000.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)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="@nullFlavor or (@code='completed')">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): Wartość elementu MUSI wynosić code 'completed'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='12254-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='12254-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:value
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='12254-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='12254-9' and @codeSystem='2.16.840.1.113883.6.1')]]/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.4.179-2023-04-27T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='PQ' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): Jeśli występuje instrukcja @xsi:type, to MUSI mieć wartość "{urn:hl7-org:v3}:PQ", 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="PQ"/>
      <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.4.179-2023-04-27T000000.html"
              test="(@nullFlavor or (@unit='ml'))">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): value MUSIużywać jednostki 'ml' </assert>
      <let name="digitok"
           value="matches(string($theValue), '^[-+]?[0-9]*\.?[0-9]+([eE][-+]?[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.4.179-2023-04-27T000000.html"
              test="$digitok or @nullFlavor">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): @value nie jest poprawną liczbą typu PQ <value-of select="$theValue"/>
      </assert>
      <let name="theUnit" value="@unit"/>
      <let name="UCUMtest"
           value="doc('include/voc-UCUM.xml')/*/ucum[@unit=$theUnit]/@message"/>
      <assert role="warning"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.179-2023-04-27T000000.html"
              test="$UCUMtest='OK' or string-length($UCUMtest)=0">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): value/@unit (PQ) MUSI mieć poprawną jednostkę UCUM (<value-of select="$UCUMtest"/>).</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.4.179-2023-04-27T000000.html"
              test="@value">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): atrybut @value 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.4.179-2023-04-27T000000.html"
              test="not(@value) or matches(string(@value), '^[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$')">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): Atrybut @value nie jest porawną liczbą typu real <value-of select="$theValue"/>
      </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.4.179-2023-04-27T000000.html"
              test="@unit">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): atrybut @unit MUSI wystąpić.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='6824-7' and @codeSystem='2.16.840.1.113883.6.1')]]]
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='6824-7' 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.4.179-2023-04-27T000000.html"
              test="string(@typeCode)='COMP'">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:observation[hl7:code[(@code='6824-7' and @codeSystem='2.16.840.1.113883.6.1')]])&gt;=1 and not(hl7:observation[hl7:code[(@code='6824-7' and @codeSystem='2.16.840.1.113883.6.1')]]/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:observation[hl7:code[(@code='6824-7' 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.4.179-2023-04-27T000000.html"
              test="count(hl7:observation[hl7:code[(@code='6824-7' and @codeSystem='2.16.840.1.113883.6.1')]])&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:observation[hl7:code[(@code='6824-7' and @codeSystem='2.16.840.1.113883.6.1')]] występuje zbyt często [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='6824-7' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='6824-7' and @codeSystem='2.16.840.1.113883.6.1')]]
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='6824-7' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='6824-7' 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.4.179-2023-04-27T000000.html"
              test="string(@classCode)='OBS' or not(@classCode)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="not(@classCode) or (string-length(@classCode)&gt;0 and not(matches(@classCode,'\s')))">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="string(@moodCode)='EVN' or not(@moodCode)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="not(@moodCode) or (string-length(@moodCode)&gt;0 and not(matches(@moodCode,'\s')))">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:code[(@code='6824-7' and @codeSystem='2.16.840.1.113883.6.1')])&gt;=1 and not(hl7:code[(@code='6824-7' and @codeSystem='2.16.840.1.113883.6.1')]/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:code[(@code='6824-7' 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.4.179-2023-04-27T000000.html"
              test="count(hl7:code[(@code='6824-7' and @codeSystem='2.16.840.1.113883.6.1')])&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:code[(@code='6824-7' 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.4.179-2023-04-27T000000.html"
              test="count(hl7:text)&gt;=1 and not(hl7:text/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:text)&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:statusCode[@code='completed'])&gt;=1 and not(hl7:statusCode[@code='completed']/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:statusCode[@code='completed'])&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:value)&gt;=1 ">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:value)&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='6824-7' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='6824-7' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='6824-7' and @codeSystem='2.16.840.1.113883.6.1')]
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='6824-7' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='6824-7' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='6824-7' 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.4.179-2023-04-27T000000.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)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="@nullFlavor or (@code='6824-7' and @codeSystem='2.16.840.1.113883.6.1' and @displayName='Color of Body fluid' and @codeSystemName='LOINC')">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): Wartość elementu MUSI wynosić code '6824-7' codeSystem '2.16.840.1.113883.6.1' displayName='Color of Body fluid' 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.4.179-2023-04-27T000000.html"
              test="count(hl7:translation[(@code='KolPlyn' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')])&gt;=1 and not(hl7:translation[(@code='KolPlyn' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:translation[(@code='KolPlyn' 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.4.179-2023-04-27T000000.html"
              test="count(hl7:translation[(@code='KolPlyn' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')])&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:translation[(@code='KolPlyn' 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.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='6824-7' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='6824-7' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='6824-7' and @codeSystem='2.16.840.1.113883.6.1')]/hl7:translation[(@code='KolPlyn' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='6824-7' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='6824-7' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='6824-7' and @codeSystem='2.16.840.1.113883.6.1')]/hl7:translation[(@code='KolPlyn' 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.4.179-2023-04-27T000000.html"
              test="@nullFlavor or (@code='KolPlyn' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18' and @displayName='Kolor płynu' and @codeSystemName='AtrybutyWBCYT')">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): Wartość elementu MUSI wynosić code 'KolPlyn' codeSystem '2.16.840.1.113883.3.4424.13.5.18' displayName='Kolor płynu' codeSystemName='AtrybutyWBCYT'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='6824-7' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='6824-7' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:statusCode[@code='completed']
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='6824-7' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='6824-7' and @codeSystem='2.16.840.1.113883.6.1')]]/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.4.179-2023-04-27T000000.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)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="@nullFlavor or (@code='completed')">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): Wartość elementu MUSI wynosić code 'completed'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='6824-7' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='6824-7' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:value
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='6824-7' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='6824-7' and @codeSystem='2.16.840.1.113883.6.1')]]/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.4.179-2023-04-27T000000.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)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="not(@nullFlavor) or (string-length(@nullFlavor)&gt;0 and not(matches(@nullFlavor,'\s')))">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="not(@nullFlavor) or count($theAttValue) = count($theAttCheck)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): Wartość dla nullFlavor MUSI wynosić 'kod NI'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]]]
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='93047-9' 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.4.179-2023-04-27T000000.html"
              test="string(@typeCode)='COMP'">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]])&gt;=1 and not(hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]]/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:observation[hl7:code[(@code='93047-9' 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.4.179-2023-04-27T000000.html"
              test="count(hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]])&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]] występuje zbyt często [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]]
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='93047-9' 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.4.179-2023-04-27T000000.html"
              test="string(@classCode)='OBS' or not(@classCode)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="not(@classCode) or (string-length(@classCode)&gt;0 and not(matches(@classCode,'\s')))">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="string(@moodCode)='EVN' or not(@moodCode)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="not(@moodCode) or (string-length(@moodCode)&gt;0 and not(matches(@moodCode,'\s')))">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')])&gt;=1 and not(hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:code[(@code='93047-9' 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.4.179-2023-04-27T000000.html"
              test="count(hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')])&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:code[(@code='93047-9' 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.4.179-2023-04-27T000000.html"
              test="count(hl7:text)&gt;=1 and not(hl7:text/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:text)&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:statusCode[@code='completed'])&gt;=1 and not(hl7:statusCode[@code='completed']/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:statusCode[@code='completed'])&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:value[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.3.4424.13.11.185-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.185-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code)])&gt;=1 and not(hl7:value[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.3.4424.13.11.185-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.185-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code)]/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:value[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.3.4424.13.11.185-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.185-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.4.179-2023-04-27T000000.html"
              test="count(hl7:value[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.3.4424.13.11.185-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.185-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code)])&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:value[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.3.4424.13.11.185-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.185-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code)] występuje zbyt często [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='93047-9' 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.4.179-2023-04-27T000000.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)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="@nullFlavor or (@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1' and @displayName='Specimen condition [Type]' and @codeSystemName='LOINC')">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): Wartość elementu MUSI wynosić code '93047-9' codeSystem '2.16.840.1.113883.6.1' displayName='Specimen condition [Type]' 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.4.179-2023-04-27T000000.html"
              test="count(hl7:translation[(@code='KwalUtrwPlyn' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')])&gt;=1 and not(hl7:translation[(@code='KwalUtrwPlyn' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:translation[(@code='KwalUtrwPlyn' 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.4.179-2023-04-27T000000.html"
              test="count(hl7:translation[(@code='KwalUtrwPlyn' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')])&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:translation[(@code='KwalUtrwPlyn' 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.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]/hl7:translation[(@code='KwalUtrwPlyn' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]/hl7:translation[(@code='KwalUtrwPlyn' 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.4.179-2023-04-27T000000.html"
              test="@nullFlavor or (@code='KwalUtrwPlyn' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18' and @displayName='Kwalifikacja utrwalenia płynu' and @codeSystemName='AtrybutyWBCYT')">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): Wartość elementu MUSI wynosić code 'KwalUtrwPlyn' codeSystem '2.16.840.1.113883.3.4424.13.5.18' displayName='Kwalifikacja utrwalenia płynu' codeSystemName='AtrybutyWBCYT'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:statusCode[@code='completed']
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]]/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.4.179-2023-04-27T000000.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)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="@nullFlavor or (@code='completed')">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): Wartość elementu MUSI wynosić code 'completed'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:value[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.3.4424.13.11.185-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.185-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code)]
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='66746-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]]]/hl7:observation[hl7:code[(@code='93047-9' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:value[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.3.4424.13.11.185-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.185-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.4.179-2023-04-27T000000.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)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="@nullFlavor or exists(doc('include/voc-2.16.840.1.113883.3.4424.13.11.185-DYNAMIC.xml')/*/valueSet[conceptList/concept[@code = $theCode][@codeSystem = $theCodeSystem][not(@codeSystemVersion) or @codeSystemVersion=$theCodeSystemVersion] or completeCodeSystem[@codeSystem=$theCodeSystem][not(@codeSystemVersion) or @codeSystemVersion=$theCodeSystemVersion]])">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): Wartość elementu MUSI wynosić CytologiaKwalifikacjaUtrwaleniaPlynu Kwalifikacja utrwalenia płynu w cytologii (DYNAMICZNE).</assert>
      <let name="theNullFlavor" value="@nullFlavor"/>
      <let name="validNullFlavorsFound"
           value="exists(doc('include/voc-2.16.840.1.113883.3.4424.13.11.185-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.4.179-2023-04-27T000000.html"
              test="not(@nullFlavor) or not(empty(($validNullFlavorsFound))) ">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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 CytologiaKwalifikacjaUtrwaleniaPlynu Kwalifikacja utrwalenia płynu w cytologii (DYNAMICZNE)</assert>
   </rule>

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.186']
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->
   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@code='21025-2']/hl7:observation[hl7:code[(@code='21025-2' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.186']">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.179-2023-04-27T000000.html"
              test="string(@typeCode)='COMP' or not(@typeCode)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="not(@typeCode) or (string-length(@typeCode)&gt;0 and not(matches(@typeCode,'\s')))">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): Atrybut @typeCode MUSI być typu 'cs'</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@nullFlavor='NA']
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@nullFlavor='NA']"
         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.4.179-2023-04-27T000000.html"
              test="string(@typeCode)='COMP' or not(@typeCode)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="not(@typeCode) or (string-length(@typeCode)&gt;0 and not(matches(@typeCode,'\s')))">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:observation)&gt;=1 and not(hl7:observation/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:observation 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.4.179-2023-04-27T000000.html"
              test="count(hl7:observation)&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:observation występuje zbyt często [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@nullFlavor='NA']/hl7:observation
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@nullFlavor='NA']/hl7:observation"
         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.4.179-2023-04-27T000000.html"
              test="string(@classCode)='OBS' or not(@classCode)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="not(@classCode) or (string-length(@classCode)&gt;0 and not(matches(@classCode,'\s')))">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="string(@moodCode)='EVN' or not(@moodCode)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="not(@moodCode) or (string-length(@moodCode)&gt;0 and not(matches(@moodCode,'\s')))">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:code)&gt;=1 ">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:code 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.4.179-2023-04-27T000000.html"
              test="count(hl7:code)&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7: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.4.179-2023-04-27T000000.html"
              test="count(hl7:text)&gt;=1 and not(hl7:text/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:text)&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:statusCode[@code='completed'])&gt;=1 and not(hl7:statusCode[@code='completed']/@nullFlavor)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="count(hl7:statusCode[@code='completed'])&lt;=1">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): element hl7:statusCode[@code='completed'] występuje zbyt często [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@nullFlavor='NA']/hl7:observation/hl7:code
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@nullFlavor='NA']/hl7:observation/hl7: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.4.179-2023-04-27T000000.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)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="@nullFlavor">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): atrybut @nullFlavor 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.4.179-2023-04-27T000000.html"
              test="not(@nullFlavor) or (string-length(@nullFlavor)&gt;0 and not(matches(@nullFlavor,'\s')))">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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=('NA')) 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.4.179-2023-04-27T000000.html"
              test="not(@nullFlavor) or count($theAttValue) = count($theAttCheck)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): Wartość dla nullFlavor MUSI wynosić 'kod NA'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.179
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@nullFlavor='NA']/hl7:observation/hl7:statusCode[@code='completed']
Item: (plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.179']/hl7:component[hl7:observation/hl7:code/@nullFlavor='NA']/hl7:observation/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.4.179-2023-04-27T000000.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)">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): 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.4.179-2023-04-27T000000.html"
              test="@nullFlavor or (@code='completed')">(plCdaMacroscopicDescriptionInCytologyPerExaminedMaterialEntry): Wartość elementu MUSI wynosić code 'completed'.</assert>
   </rule>
</pattern>
