<?xml version="1.0" encoding="UTF-8"?>
<!--
Template derived pattern
===========================================
ID: 2.16.840.1.113883.3.4424.13.10.4.181
Name: [4] Podsumowanie wyniku rozpoznania patomorfologicznego w badaniu cytologicznym
Description: Szablon CDA dla podsumowania rozpoznania patomorfologicznego w cytologii
-->
<pattern xmlns="http://purl.oclc.org/dsdl/schematron"
         id="template-2.16.840.1.113883.3.4424.13.10.4.181-2023-04-27T000000">
   <title>[4] Podsumowanie wyniku rozpoznania patomorfologicznego w badaniu cytologicznym</title>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->

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

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']"
         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.181-2023-04-27T000000.html"
              test="string(@classCode)='BATTERY'">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="not(@classCode) or (string-length(@classCode)&gt;0 and not(matches(@classCode,'\s')))">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="string(@moodCode)='EVN'">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="count(hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.4.181'])&gt;=1 and not(hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.4.181']/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.4.181'] 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.181-2023-04-27T000000.html"
              test="count(hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.4.181'])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.4.181'] 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.181-2023-04-27T000000.html"
              test="count(hl7:code)&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="count(hl7:statusCode[@code='completed'])&gt;=1 and not(hl7:statusCode[@code='completed']/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="count(hl7:statusCode[@code='completed'])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="count(hl7:author)&gt;=1 and not(hl7:author/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:author jest mandatory [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.181-2023-04-27T000000.html"
              test="count(hl7:author)&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:author występuje zbyt często [max 1x].</assert>
      <let name="elmcount"
           value="count(hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']|hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoBezWykoMiedzKlas']|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.181-2023-04-27T000000.html"
              test="$elmcount&gt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): wybór (hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas'] lub hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoBezWykoMiedzKlas'] 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.181-2023-04-27T000000.html"
              test="$elmcount&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): wybór (hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas'] lub hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoBezWykoMiedzKlas'] 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.181-2023-04-27T000000.html"
              test="count(hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas'])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas'] 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.181-2023-04-27T000000.html"
              test="count(hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoBezWykoMiedzKlas'])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoBezWykoMiedzKlas'] 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.181-2023-04-27T000000.html"
              test="count(hl7:component[hl7:observation/hl7:code/@nullFlavor='NA'])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.4.181']
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->

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

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

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

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

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

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:author/hl7:assignedAuthor"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.181-2023-04-27T000000.html"
              test="string(@classCode)='ASSIGNED' or not(@classCode)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): Wartość dla @classCode MUSI wynosić 'ASSIGNED'.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.181-2023-04-27T000000.html"
              test="count(hl7:id)&gt;=1 and not(hl7:id/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:id 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.181-2023-04-27T000000.html"
              test="count(hl7:id)&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:id występuje zbyt często [max 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.181-2023-04-27T000000.html"
              test="count(hl7:assignedPerson[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.1'])&gt;=1 ">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:assignedPerson[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.1'] jest required [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.181-2023-04-27T000000.html"
              test="count(hl7:assignedPerson[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.1'])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:assignedPerson[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.1'] występuje zbyt często [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:author/hl7:assignedAuthor/hl7:id
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->

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

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:author/hl7:assignedAuthor/hl7:assignedPerson[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.1']
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']"
         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.181-2023-04-27T000000.html"
              test="string(@typeCode)='COMP' or not(@typeCode)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="not(@typeCode) or (string-length(@typeCode)&gt;0 and not(matches(@typeCode,'\s')))">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="count(hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]])&gt;=1 and not(hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]] jest mandatory [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.181-2023-04-27T000000.html"
              test="count(hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:observation[hl7:code[(@code='34574-4' 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.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.181-2023-04-27T000000.html"
              test="string(@classCode)='OBS' or not(@classCode)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="not(@classCode) or (string-length(@classCode)&gt;0 and not(matches(@classCode,'\s')))">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="string(@moodCode)='EVN' or not(@moodCode)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="not(@moodCode) or (string-length(@moodCode)&gt;0 and not(matches(@moodCode,'\s')))">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="count(hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')])&gt;=1 and not(hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')] jest mandatory [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.181-2023-04-27T000000.html"
              test="count(hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')] występuje zbyt często [max 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.181-2023-04-27T000000.html"
              test="count(hl7:text)&gt;=1 and not(hl7:text/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="count(hl7:text)&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="count(hl7:statusCode[@code='completed'])&gt;=1 and not(hl7:statusCode[@code='completed']/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="count(hl7:statusCode[@code='completed'])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="count(hl7:entryRelationship[hl7:observation/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.183'])&gt;=1 and not(hl7:entryRelationship[hl7:observation/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.183']/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:entryRelationship[hl7:observation/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.183'] 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.181-2023-04-27T000000.html"
              test="count(hl7:entryRelationship[hl7:observation/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.183'])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:entryRelationship[hl7:observation/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.183'] 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.181-2023-04-27T000000.html"
              test="count(hl7:entryRelationship[hl7:observation/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184'])&gt;=1 and not(hl7:entryRelationship[hl7:observation/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184']/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:entryRelationship[hl7:observation/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184'] 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.181-2023-04-27T000000.html"
              test="count(hl7:entryRelationship[hl7:observation/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184'])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:entryRelationship[hl7:observation/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184'] występuje zbyt często [max 1x].</assert>
      <let name="elmcount"
           value="count(hl7:entryRelationship[hl7:observation/hl7:code/@code='18497-8']|hl7:entryRelationship[hl7:observation/hl7:code/@code='11070-0']|hl7:entryRelationship[hl7:observation/hl7:code/@code='31198-5']|hl7:entryRelationship[hl7:observation/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.185'])"/>
      <assert role="error"
              see="https://www.cez.gov.pl/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.181-2023-04-27T000000.html"
              test="$elmcount&gt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): wybór (hl7:entryRelationship[hl7:observation/hl7:code/@code='18497-8'] lub hl7:entryRelationship[hl7:observation/hl7:code/@code='11070-0'] lub hl7:entryRelationship[hl7:observation/hl7:code/@code='31198-5'] lub hl7:entryRelationship[hl7:observation/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.185']) 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.181-2023-04-27T000000.html"
              test="$elmcount&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): wybór (hl7:entryRelationship[hl7:observation/hl7:code/@code='18497-8'] lub hl7:entryRelationship[hl7:observation/hl7:code/@code='11070-0'] lub hl7:entryRelationship[hl7:observation/hl7:code/@code='31198-5'] lub hl7:entryRelationship[hl7:observation/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.185']) 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.181-2023-04-27T000000.html"
              test="count(hl7:entryRelationship[hl7:observation/hl7:code/@code='18497-8'])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:entryRelationship[hl7:observation/hl7:code/@code='18497-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.181-2023-04-27T000000.html"
              test="count(hl7:entryRelationship[hl7:observation/hl7:code/@code='11070-0'])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:entryRelationship[hl7:observation/hl7:code/@code='11070-0'] 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.181-2023-04-27T000000.html"
              test="count(hl7:entryRelationship[hl7:observation/hl7:code/@code='31198-5'])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:entryRelationship[hl7:observation/hl7:code/@code='31198-5'] 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.181-2023-04-27T000000.html"
              test="count(hl7:entryRelationship[hl7:observation/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.185'])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:entryRelationship[hl7:observation/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.185'] występuje zbyt często [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.181-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)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="@nullFlavor or (@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1' and @displayName='Pathology report final diagnosis' and @codeSystemName='LOINC')">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): Wartość elementu MUSI wynosić code '34574-4' codeSystem '2.16.840.1.113883.6.1' displayName='Pathology report final diagnosis' codeSystemName='LOINC'.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.181-2023-04-27T000000.html"
              test="count(hl7:translation[(@code='ParamRozpPatoZWykoMiedzKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')])&gt;=1 and not(hl7:translation[(@code='ParamRozpPatoZWykoMiedzKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:translation[(@code='ParamRozpPatoZWykoMiedzKlas' 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.181-2023-04-27T000000.html"
              test="count(hl7:translation[(@code='ParamRozpPatoZWykoMiedzKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:translation[(@code='ParamRozpPatoZWykoMiedzKlas' 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.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]/hl7:translation[(@code='ParamRozpPatoZWykoMiedzKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]/hl7:translation[(@code='ParamRozpPatoZWykoMiedzKlas' 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.181-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)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="@nullFlavor or (@code='ParamRozpPatoZWykoMiedzKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18' and @displayName='Parametry rozpoznania patomorfologicznego z wykorzystaniem międzynarodowej klasyfikacji' and @codeSystemName='AtrybutyWBCYT')">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): Wartość elementu MUSI wynosić code 'ParamRozpPatoZWykoMiedzKlas' codeSystem '2.16.840.1.113883.3.4424.13.5.18' displayName='Parametry rozpoznania patomorfologicznego z wykorzystaniem międzynarodowej klasyfikacji' codeSystemName='AtrybutyWBCYT'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:statusCode[@code='completed']
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' 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.181-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)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="@nullFlavor or (@code='completed')">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): Wartość elementu MUSI wynosić code 'completed'.</assert>
   </rule>

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' 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.183']
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->
   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' 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.183']">
      <assert role="error"
              see="https://www.cez.gov.pl/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.181-2023-04-27T000000.html"
              test="string(@typeCode)='COMP' or not(@typeCode)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="not(@typeCode) or (string-length(@typeCode)&gt;0 and not(matches(@typeCode,'\s')))">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): Atrybut @typeCode MUSI być typu 'cs'</assert>
   </rule>

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' 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.184']
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->
   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' 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.184']">
      <assert role="error"
              see="https://www.cez.gov.pl/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.181-2023-04-27T000000.html"
              test="string(@typeCode)='COMP' or not(@typeCode)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="not(@typeCode) or (string-length(@typeCode)&gt;0 and not(matches(@typeCode,'\s')))">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): Atrybut @typeCode MUSI być typu 'cs'</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='18497-8']
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='18497-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.181-2023-04-27T000000.html"
              test="string(@typeCode)='COMP' or not(@typeCode)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="not(@typeCode) or (string-length(@typeCode)&gt;0 and not(matches(@typeCode,'\s')))">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="count(hl7:observation[hl7:code[(@code='18497-8' and @codeSystem='2.16.840.1.113883.6.1')]])&gt;=1 and not(hl7:observation[hl7:code[(@code='18497-8' and @codeSystem='2.16.840.1.113883.6.1')]]/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:observation[hl7:code[(@code='18497-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.181-2023-04-27T000000.html"
              test="count(hl7:observation[hl7:code[(@code='18497-8' and @codeSystem='2.16.840.1.113883.6.1')]])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:observation[hl7:code[(@code='18497-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.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='18497-8']/hl7:observation[hl7:code[(@code='18497-8' and @codeSystem='2.16.840.1.113883.6.1')]]
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='18497-8']/hl7:observation[hl7:code[(@code='18497-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.181-2023-04-27T000000.html"
              test="string(@classCode)='OBS' or not(@classCode)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="not(@classCode) or (string-length(@classCode)&gt;0 and not(matches(@classCode,'\s')))">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="string(@moodCode)='EVN' or not(@moodCode)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="not(@moodCode) or (string-length(@moodCode)&gt;0 and not(matches(@moodCode,'\s')))">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="count(hl7:code[(@code='18497-8' and @codeSystem='2.16.840.1.113883.6.1')])&gt;=1 and not(hl7:code[(@code='18497-8' and @codeSystem='2.16.840.1.113883.6.1')]/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:code[(@code='18497-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.181-2023-04-27T000000.html"
              test="count(hl7:code[(@code='18497-8' and @codeSystem='2.16.840.1.113883.6.1')])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:code[(@code='18497-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.181-2023-04-27T000000.html"
              test="count(hl7:text)&gt;=1 and not(hl7:text/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="count(hl7:text)&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="count(hl7:statusCode[@code='completed'])&gt;=1 and not(hl7:statusCode[@code='completed']/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="count(hl7:statusCode[@code='completed'])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="count(hl7:value[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.3.4424.13.11.189-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.189-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.189-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.189-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code)]/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:value[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.3.4424.13.11.189-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.189-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.181-2023-04-27T000000.html"
              test="count(hl7:value[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.3.4424.13.11.189-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.189-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code)])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:value[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.3.4424.13.11.189-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.189-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.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='18497-8']/hl7:observation[hl7:code[(@code='18497-8' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='18497-8' and @codeSystem='2.16.840.1.113883.6.1')]
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='18497-8']/hl7:observation[hl7:code[(@code='18497-8' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='18497-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.181-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)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="@nullFlavor or (@code='18497-8' and @codeSystem='2.16.840.1.113883.6.1' and @displayName='Microscopic observation [Identifier] in Thyroid fine needle aspirate by Cyto stain' and @codeSystemName='LOINC')">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): Wartość elementu MUSI wynosić code '18497-8' codeSystem '2.16.840.1.113883.6.1' displayName='Microscopic observation [Identifier] in Thyroid fine needle aspirate by Cyto stain' 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.181-2023-04-27T000000.html"
              test="count(hl7:translation[(@code='StosKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')])&gt;=1 and not(hl7:translation[(@code='StosKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:translation[(@code='StosKlas' 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.181-2023-04-27T000000.html"
              test="count(hl7:translation[(@code='StosKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:translation[(@code='StosKlas' 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.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='18497-8']/hl7:observation[hl7:code[(@code='18497-8' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='18497-8' and @codeSystem='2.16.840.1.113883.6.1')]/hl7:translation[(@code='StosKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='18497-8']/hl7:observation[hl7:code[(@code='18497-8' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='18497-8' and @codeSystem='2.16.840.1.113883.6.1')]/hl7:translation[(@code='StosKlas' 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.181-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)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="@nullFlavor or (@code='StosKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18' and @displayName='Stosowana klasyfikacja' and @codeSystemName='AtrybutyWBCYT')">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): Wartość elementu MUSI wynosić code 'StosKlas' codeSystem '2.16.840.1.113883.3.4424.13.5.18' displayName='Stosowana klasyfikacja' codeSystemName='AtrybutyWBCYT'.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/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.181-2023-04-27T000000.html"
              test="count(hl7:qualifier[hl7:name/@code='NazwaStosMiedzynKlas'])&gt;=1 and not(hl7:qualifier[hl7:name/@code='NazwaStosMiedzynKlas']/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:qualifier[hl7:name/@code='NazwaStosMiedzynKlas'] 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.181-2023-04-27T000000.html"
              test="count(hl7:qualifier[hl7:name/@code='NazwaStosMiedzynKlas'])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:qualifier[hl7:name/@code='NazwaStosMiedzynKlas'] występuje zbyt często [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='18497-8']/hl7:observation[hl7:code[(@code='18497-8' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='18497-8' and @codeSystem='2.16.840.1.113883.6.1')]/hl7:translation[(@code='StosKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]/hl7:qualifier[hl7:name/@code='NazwaStosMiedzynKlas']
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='18497-8']/hl7:observation[hl7:code[(@code='18497-8' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='18497-8' and @codeSystem='2.16.840.1.113883.6.1')]/hl7:translation[(@code='StosKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]/hl7:qualifier[hl7:name/@code='NazwaStosMiedzynKlas']"
         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.181-2023-04-27T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='CR' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): Jeśli występuje instrukcja @xsi:type, to MUSI mieć wartość "{urn:hl7-org:v3}:CR", 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="CR"/>
      <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.181-2023-04-27T000000.html"
              test="count(hl7:name[(@code='NazwaStosMiedzynKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')])&gt;=1 and not(hl7:name[(@code='NazwaStosMiedzynKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:name[(@code='NazwaStosMiedzynKlas' 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.181-2023-04-27T000000.html"
              test="count(hl7:name[(@code='NazwaStosMiedzynKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:name[(@code='NazwaStosMiedzynKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')] występuje zbyt często [max 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.181-2023-04-27T000000.html"
              test="count(hl7:value[(@code='SBDBACT' and @codeSystem='2.16.840.1.113883.3.4424.13.5.19.7')])&gt;=1 and not(hl7:value[(@code='SBDBACT' and @codeSystem='2.16.840.1.113883.3.4424.13.5.19.7')]/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:value[(@code='SBDBACT' and @codeSystem='2.16.840.1.113883.3.4424.13.5.19.7')] 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.181-2023-04-27T000000.html"
              test="count(hl7:value[(@code='SBDBACT' and @codeSystem='2.16.840.1.113883.3.4424.13.5.19.7')])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:value[(@code='SBDBACT' and @codeSystem='2.16.840.1.113883.3.4424.13.5.19.7')] występuje zbyt często [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='18497-8']/hl7:observation[hl7:code[(@code='18497-8' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='18497-8' and @codeSystem='2.16.840.1.113883.6.1')]/hl7:translation[(@code='StosKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]/hl7:qualifier[hl7:name/@code='NazwaStosMiedzynKlas']/hl7:name[(@code='NazwaStosMiedzynKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='18497-8']/hl7:observation[hl7:code[(@code='18497-8' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='18497-8' and @codeSystem='2.16.840.1.113883.6.1')]/hl7:translation[(@code='StosKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]/hl7:qualifier[hl7:name/@code='NazwaStosMiedzynKlas']/hl7:name[(@code='NazwaStosMiedzynKlas' 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.181-2023-04-27T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='CV' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): Jeśli występuje instrukcja @xsi:type, to MUSI mieć wartość "{urn:hl7-org:v3}:CV", 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="CV"/>
      <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.181-2023-04-27T000000.html"
              test="@nullFlavor or (@code='NazwaStosMiedzynKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18' and @displayName='Nazwa stosowanej międzynarodowej klasyfikacji' and @codeSystemName='AtrybutyWBCYT')">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): Wartość elementu MUSI wynosić code 'NazwaStosMiedzynKlas' codeSystem '2.16.840.1.113883.3.4424.13.5.18' displayName='Nazwa stosowanej międzynarodowej klasyfikacji' codeSystemName='AtrybutyWBCYT'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='18497-8']/hl7:observation[hl7:code[(@code='18497-8' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='18497-8' and @codeSystem='2.16.840.1.113883.6.1')]/hl7:translation[(@code='StosKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]/hl7:qualifier[hl7:name/@code='NazwaStosMiedzynKlas']/hl7:value[(@code='SBDBACT' and @codeSystem='2.16.840.1.113883.3.4424.13.5.19.7')]
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='18497-8']/hl7:observation[hl7:code[(@code='18497-8' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='18497-8' and @codeSystem='2.16.840.1.113883.6.1')]/hl7:translation[(@code='StosKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]/hl7:qualifier[hl7:name/@code='NazwaStosMiedzynKlas']/hl7:value[(@code='SBDBACT' and @codeSystem='2.16.840.1.113883.3.4424.13.5.19.7')]"
         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.181-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)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="@nullFlavor or (@code='SBDBACT' and @codeSystem='2.16.840.1.113883.3.4424.13.5.19.7' and @displayName='System Bethesda dla biopsji aspiracyjnej cienkoigłowej tarczycy' and @codeSystemName='CytologiaStosowaneMiedzynarodoweKlasyfikacje')">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): Wartość elementu MUSI wynosić code 'SBDBACT' codeSystem '2.16.840.1.113883.3.4424.13.5.19.7' displayName='System Bethesda dla biopsji aspiracyjnej cienkoigłowej tarczycy' codeSystemName='CytologiaStosowaneMiedzynarodoweKlasyfikacje'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='18497-8']/hl7:observation[hl7:code[(@code='18497-8' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:statusCode[@code='completed']
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='18497-8']/hl7:observation[hl7:code[(@code='18497-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.181-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)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="@nullFlavor or (@code='completed')">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): Wartość elementu MUSI wynosić code 'completed'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='18497-8']/hl7:observation[hl7:code[(@code='18497-8' 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.189-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.189-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code)]
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='18497-8']/hl7:observation[hl7:code[(@code='18497-8' 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.189-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.189-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.181-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)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="@nullFlavor or exists(doc('include/voc-2.16.840.1.113883.3.4424.13.11.189-DYNAMIC.xml')/*/valueSet[conceptList/concept[@code = $theCode][@codeSystem = $theCodeSystem][not(@codeSystemVersion) or @codeSystemVersion=$theCodeSystemVersion] or completeCodeSystem[@codeSystem=$theCodeSystem][not(@codeSystemVersion) or @codeSystemVersion=$theCodeSystemVersion]])">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): Wartość elementu MUSI wynosić CytologiaSystemBethesdaDlaBiopsjiAspiracyjnejCienkoigłowejTarczycy System Bethesda dla biopsji aspiracyjnej cienkoigłowej tarczycy (DYNAMICZNE).</assert>
      <let name="theNullFlavor" value="@nullFlavor"/>
      <let name="validNullFlavorsFound"
           value="exists(doc('include/voc-2.16.840.1.113883.3.4424.13.11.189-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.181-2023-04-27T000000.html"
              test="not(@nullFlavor) or not(empty(($validNullFlavorsFound))) ">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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 CytologiaSystemBethesdaDlaBiopsjiAspiracyjnejCienkoigłowejTarczycy System Bethesda dla biopsji aspiracyjnej cienkoigłowej tarczycy (DYNAMICZNE)</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='11070-0']
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='11070-0']"
         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.181-2023-04-27T000000.html"
              test="string(@typeCode)='COMP' or not(@typeCode)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="not(@typeCode) or (string-length(@typeCode)&gt;0 and not(matches(@typeCode,'\s')))">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="count(hl7:observation[hl7:code[(@code='11070-0' and @codeSystem='2.16.840.1.113883.6.1')]])&gt;=1 and not(hl7:observation[hl7:code[(@code='11070-0' and @codeSystem='2.16.840.1.113883.6.1')]]/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:observation[hl7:code[(@code='11070-0' 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.181-2023-04-27T000000.html"
              test="count(hl7:observation[hl7:code[(@code='11070-0' and @codeSystem='2.16.840.1.113883.6.1')]])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:observation[hl7:code[(@code='11070-0' 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.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='11070-0']/hl7:observation[hl7:code[(@code='11070-0' and @codeSystem='2.16.840.1.113883.6.1')]]
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='11070-0']/hl7:observation[hl7:code[(@code='11070-0' 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.181-2023-04-27T000000.html"
              test="string(@classCode)='OBS' or not(@classCode)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="not(@classCode) or (string-length(@classCode)&gt;0 and not(matches(@classCode,'\s')))">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="string(@moodCode)='EVN' or not(@moodCode)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="not(@moodCode) or (string-length(@moodCode)&gt;0 and not(matches(@moodCode,'\s')))">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="count(hl7:code[(@code='11070-0' and @codeSystem='2.16.840.1.113883.6.1')])&gt;=1 and not(hl7:code[(@code='11070-0' and @codeSystem='2.16.840.1.113883.6.1')]/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:code[(@code='11070-0' 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.181-2023-04-27T000000.html"
              test="count(hl7:code[(@code='11070-0' and @codeSystem='2.16.840.1.113883.6.1')])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:code[(@code='11070-0' 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.181-2023-04-27T000000.html"
              test="count(hl7:text)&gt;=1 and not(hl7:text/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="count(hl7:text)&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="count(hl7:statusCode[@code='completed'])&gt;=1 and not(hl7:statusCode[@code='completed']/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="count(hl7:statusCode[@code='completed'])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="count(hl7:value[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.3.4424.13.11.190-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.190-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.190-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.190-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code)]/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:value[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.3.4424.13.11.190-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.190-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.181-2023-04-27T000000.html"
              test="count(hl7:value[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.3.4424.13.11.190-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.190-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code)])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:value[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.3.4424.13.11.190-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.190-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.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='11070-0']/hl7:observation[hl7:code[(@code='11070-0' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='11070-0' and @codeSystem='2.16.840.1.113883.6.1')]
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='11070-0']/hl7:observation[hl7:code[(@code='11070-0' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='11070-0' 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.181-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)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="@nullFlavor or (@code='11070-0' and @codeSystem='2.16.840.1.113883.6.1' and @displayName='Microscopic observation [Identifier] in Urine by Cyto stain' and @codeSystemName='LOINC')">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): Wartość elementu MUSI wynosić code '11070-0' codeSystem '2.16.840.1.113883.6.1' displayName='Microscopic observation [Identifier] in Urine by Cyto stain' 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.181-2023-04-27T000000.html"
              test="count(hl7:translation[(@code='StosKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')])&gt;=1 and not(hl7:translation[(@code='StosKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:translation[(@code='StosKlas' 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.181-2023-04-27T000000.html"
              test="count(hl7:translation[(@code='StosKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:translation[(@code='StosKlas' 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.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='11070-0']/hl7:observation[hl7:code[(@code='11070-0' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='11070-0' and @codeSystem='2.16.840.1.113883.6.1')]/hl7:translation[(@code='StosKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='11070-0']/hl7:observation[hl7:code[(@code='11070-0' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='11070-0' and @codeSystem='2.16.840.1.113883.6.1')]/hl7:translation[(@code='StosKlas' 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.181-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)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="@nullFlavor or (@code='StosKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18' and @displayName='Stosowana klasyfikacja' and @codeSystemName='AtrybutyWBCYT')">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): Wartość elementu MUSI wynosić code 'StosKlas' codeSystem '2.16.840.1.113883.3.4424.13.5.18' displayName='Stosowana klasyfikacja' codeSystemName='AtrybutyWBCYT'.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/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.181-2023-04-27T000000.html"
              test="count(hl7:qualifier[hl7:name/@code='NazwaStosMiedzynKlas'])&gt;=1 and not(hl7:qualifier[hl7:name/@code='NazwaStosMiedzynKlas']/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:qualifier[hl7:name/@code='NazwaStosMiedzynKlas'] 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.181-2023-04-27T000000.html"
              test="count(hl7:qualifier[hl7:name/@code='NazwaStosMiedzynKlas'])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:qualifier[hl7:name/@code='NazwaStosMiedzynKlas'] występuje zbyt często [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='11070-0']/hl7:observation[hl7:code[(@code='11070-0' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='11070-0' and @codeSystem='2.16.840.1.113883.6.1')]/hl7:translation[(@code='StosKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]/hl7:qualifier[hl7:name/@code='NazwaStosMiedzynKlas']
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='11070-0']/hl7:observation[hl7:code[(@code='11070-0' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='11070-0' and @codeSystem='2.16.840.1.113883.6.1')]/hl7:translation[(@code='StosKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]/hl7:qualifier[hl7:name/@code='NazwaStosMiedzynKlas']"
         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.181-2023-04-27T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='CR' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): Jeśli występuje instrukcja @xsi:type, to MUSI mieć wartość "{urn:hl7-org:v3}:CR", 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="CR"/>
      <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.181-2023-04-27T000000.html"
              test="count(hl7:name[(@code='NazwaStosMiedzynKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')])&gt;=1 and not(hl7:name[(@code='NazwaStosMiedzynKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:name[(@code='NazwaStosMiedzynKlas' 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.181-2023-04-27T000000.html"
              test="count(hl7:name[(@code='NazwaStosMiedzynKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:name[(@code='NazwaStosMiedzynKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')] występuje zbyt często [max 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.181-2023-04-27T000000.html"
              test="count(hl7:value[(@code='KPDCMOC' and @codeSystem='2.16.840.1.113883.3.4424.13.5.19.7')])&gt;=1 and not(hl7:value[(@code='KPDCMOC' and @codeSystem='2.16.840.1.113883.3.4424.13.5.19.7')]/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:value[(@code='KPDCMOC' and @codeSystem='2.16.840.1.113883.3.4424.13.5.19.7')] 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.181-2023-04-27T000000.html"
              test="count(hl7:value[(@code='KPDCMOC' and @codeSystem='2.16.840.1.113883.3.4424.13.5.19.7')])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:value[(@code='KPDCMOC' and @codeSystem='2.16.840.1.113883.3.4424.13.5.19.7')] występuje zbyt często [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='11070-0']/hl7:observation[hl7:code[(@code='11070-0' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='11070-0' and @codeSystem='2.16.840.1.113883.6.1')]/hl7:translation[(@code='StosKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]/hl7:qualifier[hl7:name/@code='NazwaStosMiedzynKlas']/hl7:name[(@code='NazwaStosMiedzynKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='11070-0']/hl7:observation[hl7:code[(@code='11070-0' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='11070-0' and @codeSystem='2.16.840.1.113883.6.1')]/hl7:translation[(@code='StosKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]/hl7:qualifier[hl7:name/@code='NazwaStosMiedzynKlas']/hl7:name[(@code='NazwaStosMiedzynKlas' 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.181-2023-04-27T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='CV' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): Jeśli występuje instrukcja @xsi:type, to MUSI mieć wartość "{urn:hl7-org:v3}:CV", 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="CV"/>
      <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.181-2023-04-27T000000.html"
              test="@nullFlavor or (@code='NazwaStosMiedzynKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18' and @displayName='Nazwa stosowanej międzynarodowej klasyfikacji' and @codeSystemName='AtrybutyWBCYT')">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): Wartość elementu MUSI wynosić code 'NazwaStosMiedzynKlas' codeSystem '2.16.840.1.113883.3.4424.13.5.18' displayName='Nazwa stosowanej międzynarodowej klasyfikacji' codeSystemName='AtrybutyWBCYT'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='11070-0']/hl7:observation[hl7:code[(@code='11070-0' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='11070-0' and @codeSystem='2.16.840.1.113883.6.1')]/hl7:translation[(@code='StosKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]/hl7:qualifier[hl7:name/@code='NazwaStosMiedzynKlas']/hl7:value[(@code='KPDCMOC' and @codeSystem='2.16.840.1.113883.3.4424.13.5.19.7')]
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='11070-0']/hl7:observation[hl7:code[(@code='11070-0' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='11070-0' and @codeSystem='2.16.840.1.113883.6.1')]/hl7:translation[(@code='StosKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]/hl7:qualifier[hl7:name/@code='NazwaStosMiedzynKlas']/hl7:value[(@code='KPDCMOC' and @codeSystem='2.16.840.1.113883.3.4424.13.5.19.7')]"
         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.181-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)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="@nullFlavor or (@code='KPDCMOC' and @codeSystem='2.16.840.1.113883.3.4424.13.5.19.7' and @displayName='Klasyfikacja Paryska dla cytologii moczu' and @codeSystemName='CytologiaStosowaneMiedzynarodoweKlasyfikacje')">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): Wartość elementu MUSI wynosić code 'KPDCMOC' codeSystem '2.16.840.1.113883.3.4424.13.5.19.7' displayName='Klasyfikacja Paryska dla cytologii moczu' codeSystemName='CytologiaStosowaneMiedzynarodoweKlasyfikacje'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='11070-0']/hl7:observation[hl7:code[(@code='11070-0' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:statusCode[@code='completed']
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='11070-0']/hl7:observation[hl7:code[(@code='11070-0' 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.181-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)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="@nullFlavor or (@code='completed')">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): Wartość elementu MUSI wynosić code 'completed'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='11070-0']/hl7:observation[hl7:code[(@code='11070-0' 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.190-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.190-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code)]
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='11070-0']/hl7:observation[hl7:code[(@code='11070-0' 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.190-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.190-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.181-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)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="@nullFlavor or exists(doc('include/voc-2.16.840.1.113883.3.4424.13.11.190-DYNAMIC.xml')/*/valueSet[conceptList/concept[@code = $theCode][@codeSystem = $theCodeSystem][not(@codeSystemVersion) or @codeSystemVersion=$theCodeSystemVersion] or completeCodeSystem[@codeSystem=$theCodeSystem][not(@codeSystemVersion) or @codeSystemVersion=$theCodeSystemVersion]])">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): Wartość elementu MUSI wynosić CytologiaKlasyfikacjaParyskaDlaCytologiiMoczu Klasyfikacja Paryska dla cytologii moczu (DYNAMICZNE).</assert>
      <let name="theNullFlavor" value="@nullFlavor"/>
      <let name="validNullFlavorsFound"
           value="exists(doc('include/voc-2.16.840.1.113883.3.4424.13.11.190-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.181-2023-04-27T000000.html"
              test="not(@nullFlavor) or not(empty(($validNullFlavorsFound))) ">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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 CytologiaKlasyfikacjaParyskaDlaCytologiiMoczu Klasyfikacja Paryska dla cytologii moczu (DYNAMICZNE)</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='31198-5']
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='31198-5']"
         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.181-2023-04-27T000000.html"
              test="string(@typeCode)='COMP' or not(@typeCode)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="not(@typeCode) or (string-length(@typeCode)&gt;0 and not(matches(@typeCode,'\s')))">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="count(hl7:observation[hl7:code[(@code='31198-5' and @codeSystem='2.16.840.1.113883.6.1')]])&gt;=1 and not(hl7:observation[hl7:code[(@code='31198-5' and @codeSystem='2.16.840.1.113883.6.1')]]/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:observation[hl7:code[(@code='31198-5' 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.181-2023-04-27T000000.html"
              test="count(hl7:observation[hl7:code[(@code='31198-5' and @codeSystem='2.16.840.1.113883.6.1')]])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:observation[hl7:code[(@code='31198-5' 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.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='31198-5']/hl7:observation[hl7:code[(@code='31198-5' and @codeSystem='2.16.840.1.113883.6.1')]]
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='31198-5']/hl7:observation[hl7:code[(@code='31198-5' 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.181-2023-04-27T000000.html"
              test="string(@classCode)='OBS' or not(@classCode)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="not(@classCode) or (string-length(@classCode)&gt;0 and not(matches(@classCode,'\s')))">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="string(@moodCode)='EVN' or not(@moodCode)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="not(@moodCode) or (string-length(@moodCode)&gt;0 and not(matches(@moodCode,'\s')))">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="count(hl7:code[(@code='31198-5' and @codeSystem='2.16.840.1.113883.6.1')])&gt;=1 and not(hl7:code[(@code='31198-5' and @codeSystem='2.16.840.1.113883.6.1')]/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:code[(@code='31198-5' 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.181-2023-04-27T000000.html"
              test="count(hl7:code[(@code='31198-5' and @codeSystem='2.16.840.1.113883.6.1')])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:code[(@code='31198-5' 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.181-2023-04-27T000000.html"
              test="count(hl7:text)&gt;=1 and not(hl7:text/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="count(hl7:text)&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="count(hl7:statusCode[@code='completed'])&gt;=1 and not(hl7:statusCode[@code='completed']/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="count(hl7:statusCode[@code='completed'])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="count(hl7:value[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.3.4424.13.11.191-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.191-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.191-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.191-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code)]/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:value[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.3.4424.13.11.191-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.191-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.181-2023-04-27T000000.html"
              test="count(hl7:value[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.3.4424.13.11.191-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.191-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code)])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:value[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.3.4424.13.11.191-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.191-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.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='31198-5']/hl7:observation[hl7:code[(@code='31198-5' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='31198-5' and @codeSystem='2.16.840.1.113883.6.1')]
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='31198-5']/hl7:observation[hl7:code[(@code='31198-5' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='31198-5' 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.181-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)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="@nullFlavor or (@code='31198-5' and @codeSystem='2.16.840.1.113883.6.1' and @displayName='Microscopic observation [Identifier] in Parotid fine needle aspirate by Cyto stain' and @codeSystemName='LOINC')">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): Wartość elementu MUSI wynosić code '31198-5' codeSystem '2.16.840.1.113883.6.1' displayName='Microscopic observation [Identifier] in Parotid fine needle aspirate by Cyto stain' 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.181-2023-04-27T000000.html"
              test="count(hl7:translation[(@code='StosKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')])&gt;=1 and not(hl7:translation[(@code='StosKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:translation[(@code='StosKlas' 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.181-2023-04-27T000000.html"
              test="count(hl7:translation[(@code='StosKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:translation[(@code='StosKlas' 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.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='31198-5']/hl7:observation[hl7:code[(@code='31198-5' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='31198-5' and @codeSystem='2.16.840.1.113883.6.1')]/hl7:translation[(@code='StosKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='31198-5']/hl7:observation[hl7:code[(@code='31198-5' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='31198-5' and @codeSystem='2.16.840.1.113883.6.1')]/hl7:translation[(@code='StosKlas' 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.181-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)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="@nullFlavor or (@code='StosKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18' and @displayName='Stosowana klasyfikacja' and @codeSystemName='AtrybutyWBCYT')">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): Wartość elementu MUSI wynosić code 'StosKlas' codeSystem '2.16.840.1.113883.3.4424.13.5.18' displayName='Stosowana klasyfikacja' codeSystemName='AtrybutyWBCYT'.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/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.181-2023-04-27T000000.html"
              test="count(hl7:qualifier[hl7:name/@code='NazwaStosMiedzynKlas'])&gt;=1 and not(hl7:qualifier[hl7:name/@code='NazwaStosMiedzynKlas']/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:qualifier[hl7:name/@code='NazwaStosMiedzynKlas'] 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.181-2023-04-27T000000.html"
              test="count(hl7:qualifier[hl7:name/@code='NazwaStosMiedzynKlas'])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:qualifier[hl7:name/@code='NazwaStosMiedzynKlas'] występuje zbyt często [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='31198-5']/hl7:observation[hl7:code[(@code='31198-5' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='31198-5' and @codeSystem='2.16.840.1.113883.6.1')]/hl7:translation[(@code='StosKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]/hl7:qualifier[hl7:name/@code='NazwaStosMiedzynKlas']
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='31198-5']/hl7:observation[hl7:code[(@code='31198-5' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='31198-5' and @codeSystem='2.16.840.1.113883.6.1')]/hl7:translation[(@code='StosKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]/hl7:qualifier[hl7:name/@code='NazwaStosMiedzynKlas']"
         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.181-2023-04-27T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='CR' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): Jeśli występuje instrukcja @xsi:type, to MUSI mieć wartość "{urn:hl7-org:v3}:CR", 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="CR"/>
      <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.181-2023-04-27T000000.html"
              test="count(hl7:name[(@code='NazwaStosMiedzynKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')])&gt;=1 and not(hl7:name[(@code='NazwaStosMiedzynKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:name[(@code='NazwaStosMiedzynKlas' 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.181-2023-04-27T000000.html"
              test="count(hl7:name[(@code='NazwaStosMiedzynKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:name[(@code='NazwaStosMiedzynKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')] występuje zbyt często [max 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.181-2023-04-27T000000.html"
              test="count(hl7:value[(@code='SMDCACS' and @codeSystem='2.16.840.1.113883.3.4424.13.5.19.7')])&gt;=1 and not(hl7:value[(@code='SMDCACS' and @codeSystem='2.16.840.1.113883.3.4424.13.5.19.7')]/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:value[(@code='SMDCACS' and @codeSystem='2.16.840.1.113883.3.4424.13.5.19.7')] 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.181-2023-04-27T000000.html"
              test="count(hl7:value[(@code='SMDCACS' and @codeSystem='2.16.840.1.113883.3.4424.13.5.19.7')])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:value[(@code='SMDCACS' and @codeSystem='2.16.840.1.113883.3.4424.13.5.19.7')] występuje zbyt często [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='31198-5']/hl7:observation[hl7:code[(@code='31198-5' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='31198-5' and @codeSystem='2.16.840.1.113883.6.1')]/hl7:translation[(@code='StosKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]/hl7:qualifier[hl7:name/@code='NazwaStosMiedzynKlas']/hl7:name[(@code='NazwaStosMiedzynKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='31198-5']/hl7:observation[hl7:code[(@code='31198-5' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='31198-5' and @codeSystem='2.16.840.1.113883.6.1')]/hl7:translation[(@code='StosKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]/hl7:qualifier[hl7:name/@code='NazwaStosMiedzynKlas']/hl7:name[(@code='NazwaStosMiedzynKlas' 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.181-2023-04-27T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='CV' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): Jeśli występuje instrukcja @xsi:type, to MUSI mieć wartość "{urn:hl7-org:v3}:CV", 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="CV"/>
      <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.181-2023-04-27T000000.html"
              test="@nullFlavor or (@code='NazwaStosMiedzynKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18' and @displayName='Nazwa stosowanej międzynarodowej klasyfikacji' and @codeSystemName='AtrybutyWBCYT')">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): Wartość elementu MUSI wynosić code 'NazwaStosMiedzynKlas' codeSystem '2.16.840.1.113883.3.4424.13.5.18' displayName='Nazwa stosowanej międzynarodowej klasyfikacji' codeSystemName='AtrybutyWBCYT'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='31198-5']/hl7:observation[hl7:code[(@code='31198-5' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='31198-5' and @codeSystem='2.16.840.1.113883.6.1')]/hl7:translation[(@code='StosKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]/hl7:qualifier[hl7:name/@code='NazwaStosMiedzynKlas']/hl7:value[(@code='SMDCACS' and @codeSystem='2.16.840.1.113883.3.4424.13.5.19.7')]
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='31198-5']/hl7:observation[hl7:code[(@code='31198-5' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='31198-5' and @codeSystem='2.16.840.1.113883.6.1')]/hl7:translation[(@code='StosKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]/hl7:qualifier[hl7:name/@code='NazwaStosMiedzynKlas']/hl7:value[(@code='SMDCACS' and @codeSystem='2.16.840.1.113883.3.4424.13.5.19.7')]"
         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.181-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)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="@nullFlavor or (@code='SMDCACS' and @codeSystem='2.16.840.1.113883.3.4424.13.5.19.7' and @displayName='System Milano dla cytologii aspiracyjnej cienkoigłowej ślinianek' and @codeSystemName='CytologiaStosowaneMiedzynarodoweKlasyfikacje')">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): Wartość elementu MUSI wynosić code 'SMDCACS' codeSystem '2.16.840.1.113883.3.4424.13.5.19.7' displayName='System Milano dla cytologii aspiracyjnej cienkoigłowej ślinianek' codeSystemName='CytologiaStosowaneMiedzynarodoweKlasyfikacje'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='31198-5']/hl7:observation[hl7:code[(@code='31198-5' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:statusCode[@code='completed']
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='31198-5']/hl7:observation[hl7:code[(@code='31198-5' 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.181-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)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="@nullFlavor or (@code='completed')">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): Wartość elementu MUSI wynosić code 'completed'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='31198-5']/hl7:observation[hl7:code[(@code='31198-5' 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.191-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.191-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code)]
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation/hl7:code/@code='31198-5']/hl7:observation[hl7:code[(@code='31198-5' 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.191-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.191-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.181-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)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="@nullFlavor or exists(doc('include/voc-2.16.840.1.113883.3.4424.13.11.191-DYNAMIC.xml')/*/valueSet[conceptList/concept[@code = $theCode][@codeSystem = $theCodeSystem][not(@codeSystemVersion) or @codeSystemVersion=$theCodeSystemVersion] or completeCodeSystem[@codeSystem=$theCodeSystem][not(@codeSystemVersion) or @codeSystemVersion=$theCodeSystemVersion]])">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): Wartość elementu MUSI wynosić CytologiaSystemMilanoDlaCytologiiAspiracyjnejCienkoiglowejSlinianek System Milano dla cytologii aspiracyjnej cienkoigłowej ślinianek (DYNAMICZNE).</assert>
      <let name="theNullFlavor" value="@nullFlavor"/>
      <let name="validNullFlavorsFound"
           value="exists(doc('include/voc-2.16.840.1.113883.3.4424.13.11.191-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.181-2023-04-27T000000.html"
              test="not(@nullFlavor) or not(empty(($validNullFlavorsFound))) ">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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 CytologiaSystemMilanoDlaCytologiiAspiracyjnejCienkoiglowejSlinianek System Milano dla cytologii aspiracyjnej cienkoigłowej ślinianek (DYNAMICZNE)</assert>
   </rule>

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' 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.185']
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->
   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoZWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' 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.185']">
      <assert role="error"
              see="https://www.cez.gov.pl/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.181-2023-04-27T000000.html"
              test="string(@typeCode)='COMP' or not(@typeCode)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="not(@typeCode) or (string-length(@typeCode)&gt;0 and not(matches(@typeCode,'\s')))">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): Atrybut @typeCode MUSI być typu 'cs'</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoBezWykoMiedzKlas']
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoBezWykoMiedzKlas']"
         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.181-2023-04-27T000000.html"
              test="string(@typeCode)='COMP' or not(@typeCode)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="not(@typeCode) or (string-length(@typeCode)&gt;0 and not(matches(@typeCode,'\s')))">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="count(hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]])&gt;=1 and not(hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]] jest mandatory [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.181-2023-04-27T000000.html"
              test="count(hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:observation[hl7:code[(@code='34574-4' 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.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoBezWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoBezWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.181-2023-04-27T000000.html"
              test="string(@classCode)='OBS' or not(@classCode)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="not(@classCode) or (string-length(@classCode)&gt;0 and not(matches(@classCode,'\s')))">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="string(@moodCode)='EVN' or not(@moodCode)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="not(@moodCode) or (string-length(@moodCode)&gt;0 and not(matches(@moodCode,'\s')))">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="count(hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')])&gt;=1 and not(hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')] jest mandatory [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.181-2023-04-27T000000.html"
              test="count(hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')] występuje zbyt często [max 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.181-2023-04-27T000000.html"
              test="count(hl7:text)&gt;=1 and not(hl7:text/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="count(hl7:text)&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="count(hl7:statusCode[@code='completed'])&gt;=1 and not(hl7:statusCode[@code='completed']/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="count(hl7:statusCode[@code='completed'])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="count(hl7:entryRelationship[hl7:observation/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.183'])&gt;=1 and not(hl7:entryRelationship[hl7:observation/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.183']/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:entryRelationship[hl7:observation/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.183'] 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.181-2023-04-27T000000.html"
              test="count(hl7:entryRelationship[hl7:observation/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.183'])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:entryRelationship[hl7:observation/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.183'] 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.181-2023-04-27T000000.html"
              test="count(hl7:entryRelationship[hl7:observation[hl7:code[(@code='KwalRozpPato' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]])&gt;=1 and not(hl7:entryRelationship[hl7:observation[hl7:code[(@code='KwalRozpPato' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:entryRelationship[hl7:observation[hl7:code[(@code='KwalRozpPato' 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.181-2023-04-27T000000.html"
              test="count(hl7:entryRelationship[hl7:observation[hl7:code[(@code='KwalRozpPato' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:entryRelationship[hl7:observation[hl7:code[(@code='KwalRozpPato' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]] występuje zbyt często [max 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.181-2023-04-27T000000.html"
              test="count(hl7:entryRelationship[hl7:observation/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184'])&gt;=1 and not(hl7:entryRelationship[hl7:observation/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184']/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:entryRelationship[hl7:observation/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184'] 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.181-2023-04-27T000000.html"
              test="count(hl7:entryRelationship[hl7:observation/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184'])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:entryRelationship[hl7:observation/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184'] występuje zbyt często [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoBezWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoBezWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.181-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)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="@nullFlavor or (@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1' and @displayName='Pathology report final diagnosis' and @codeSystemName='LOINC')">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): Wartość elementu MUSI wynosić code '34574-4' codeSystem '2.16.840.1.113883.6.1' displayName='Pathology report final diagnosis' codeSystemName='LOINC'.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.181-2023-04-27T000000.html"
              test="count(hl7:translation[(@code='ParamRozpPatoBezWykoMiedzKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')])&gt;=1 and not(hl7:translation[(@code='ParamRozpPatoBezWykoMiedzKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:translation[(@code='ParamRozpPatoBezWykoMiedzKlas' 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.181-2023-04-27T000000.html"
              test="count(hl7:translation[(@code='ParamRozpPatoBezWykoMiedzKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:translation[(@code='ParamRozpPatoBezWykoMiedzKlas' 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.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoBezWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]/hl7:translation[(@code='ParamRozpPatoBezWykoMiedzKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoBezWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]/hl7:translation[(@code='ParamRozpPatoBezWykoMiedzKlas' 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.181-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)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="@nullFlavor or (@code='ParamRozpPatoBezWykoMiedzKlas' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18' and @displayName='Parametry rozpoznania patomorfologicznego bez wykorzystania międzynarodowej klasyfikacji' and @codeSystemName='AtrybutyWBCYT')">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): Wartość elementu MUSI wynosić code 'ParamRozpPatoBezWykoMiedzKlas' codeSystem '2.16.840.1.113883.3.4424.13.5.18' displayName='Parametry rozpoznania patomorfologicznego bez wykorzystania międzynarodowej klasyfikacji' codeSystemName='AtrybutyWBCYT'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoBezWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:statusCode[@code='completed']
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoBezWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' 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.181-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)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="@nullFlavor or (@code='completed')">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): Wartość elementu MUSI wynosić code 'completed'.</assert>
   </rule>

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoBezWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' 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.183']
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->
   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoBezWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' 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.183']">
      <assert role="error"
              see="https://www.cez.gov.pl/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.181-2023-04-27T000000.html"
              test="string(@typeCode)='COMP' or not(@typeCode)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="not(@typeCode) or (string-length(@typeCode)&gt;0 and not(matches(@typeCode,'\s')))">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): Atrybut @typeCode MUSI być typu 'cs'</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoBezWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='KwalRozpPato' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoBezWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='KwalRozpPato' 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.181-2023-04-27T000000.html"
              test="string(@typeCode)='COMP' or not(@typeCode)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="not(@typeCode) or (string-length(@typeCode)&gt;0 and not(matches(@typeCode,'\s')))">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="count(hl7:observation[hl7:code[(@code='KwalRozpPato' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]])&gt;=1 and not(hl7:observation[hl7:code[(@code='KwalRozpPato' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:observation[hl7:code[(@code='KwalRozpPato' 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.181-2023-04-27T000000.html"
              test="count(hl7:observation[hl7:code[(@code='KwalRozpPato' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:observation[hl7:code[(@code='KwalRozpPato' 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.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoBezWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='KwalRozpPato' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/hl7:observation[hl7:code[(@code='KwalRozpPato' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoBezWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='KwalRozpPato' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/hl7:observation[hl7:code[(@code='KwalRozpPato' 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.181-2023-04-27T000000.html"
              test="string(@classCode)='OBS' or not(@classCode)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="not(@classCode) or (string-length(@classCode)&gt;0 and not(matches(@classCode,'\s')))">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="string(@moodCode)='EVN' or not(@moodCode)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="not(@moodCode) or (string-length(@moodCode)&gt;0 and not(matches(@moodCode,'\s')))">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="count(hl7:code[(@code='KwalRozpPato' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')])&gt;=1 and not(hl7:code[(@code='KwalRozpPato' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:code[(@code='KwalRozpPato' 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.181-2023-04-27T000000.html"
              test="count(hl7:code[(@code='KwalRozpPato' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:code[(@code='KwalRozpPato' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')] występuje zbyt często [max 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.181-2023-04-27T000000.html"
              test="count(hl7:text)&gt;=1 and not(hl7:text/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="count(hl7:text)&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="count(hl7:statusCode[@code='completed'])&gt;=1 and not(hl7:statusCode[@code='completed']/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="count(hl7:statusCode[@code='completed'])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="count(hl7:value[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.3.4424.13.11.187-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.187-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.187-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.187-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code)]/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:value[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.3.4424.13.11.187-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.187-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.181-2023-04-27T000000.html"
              test="count(hl7:value[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.3.4424.13.11.187-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.187-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code)])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): element hl7:value[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.3.4424.13.11.187-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.187-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.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoBezWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='KwalRozpPato' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/hl7:observation[hl7:code[(@code='KwalRozpPato' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]/hl7:code[(@code='KwalRozpPato' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoBezWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='KwalRozpPato' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/hl7:observation[hl7:code[(@code='KwalRozpPato' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]/hl7:code[(@code='KwalRozpPato' 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.181-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)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="@nullFlavor or (@code='KwalRozpPato' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18' and @displayName='Kwalifikacja rozpoznania patomorfologicznego bez wykorzystania międzynarodowej klasyfikacji' and @codeSystemName='AtrybutyWBCYT')">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): Wartość elementu MUSI wynosić code 'KwalRozpPato' codeSystem '2.16.840.1.113883.3.4424.13.5.18' displayName='Kwalifikacja rozpoznania patomorfologicznego bez wykorzystania międzynarodowej klasyfikacji' codeSystemName='AtrybutyWBCYT'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoBezWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='KwalRozpPato' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/hl7:observation[hl7:code[(@code='KwalRozpPato' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]/hl7:statusCode[@code='completed']
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoBezWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='KwalRozpPato' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/hl7:observation[hl7:code[(@code='KwalRozpPato' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]/hl7:statusCode[@code='completed']"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.181-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)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="@nullFlavor or (@code='completed')">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): Wartość elementu MUSI wynosić code 'completed'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoBezWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='KwalRozpPato' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/hl7:observation[hl7:code[(@code='KwalRozpPato' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]/hl7:value[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.3.4424.13.11.187-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.187-DYNAMIC.xml')/*/valueSet/conceptList/exception/@code)]
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoBezWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' and @codeSystem='2.16.840.1.113883.6.1')]]/hl7:entryRelationship[hl7:observation[hl7:code[(@code='KwalRozpPato' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/hl7:observation[hl7:code[(@code='KwalRozpPato' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]/hl7:value[concat(@code,@codeSystem)=doc('include/voc-2.16.840.1.113883.3.4424.13.11.187-DYNAMIC.xml')/*/valueSet/conceptList/concept/concat(@code,@codeSystem) or (@nullFlavor=doc('include/voc-2.16.840.1.113883.3.4424.13.11.187-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.181-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)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="@nullFlavor or exists(doc('include/voc-2.16.840.1.113883.3.4424.13.11.187-DYNAMIC.xml')/*/valueSet[conceptList/concept[@code = $theCode][@codeSystem = $theCodeSystem][not(@codeSystemVersion) or @codeSystemVersion=$theCodeSystemVersion] or completeCodeSystem[@codeSystem=$theCodeSystem][not(@codeSystemVersion) or @codeSystemVersion=$theCodeSystemVersion]])">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): Wartość elementu MUSI wynosić CytologiaKwalifikacjaRozpoznaniaPatomorfologicznegoWPodsumowaniuBezWykorzystaniaMiędzynarodowejKlasyfikacji Kwalifikacja rozpoznania patomorfologicznego w podsumowaniu bez wykorzystania międzynarodowej klasyfikacji 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.187-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.181-2023-04-27T000000.html"
              test="not(@nullFlavor) or not(empty(($validNullFlavorsFound))) ">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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 CytologiaKwalifikacjaRozpoznaniaPatomorfologicznegoWPodsumowaniuBezWykorzystaniaMiędzynarodowejKlasyfikacji Kwalifikacja rozpoznania patomorfologicznego w podsumowaniu bez wykorzystania międzynarodowej klasyfikacji w cytologii (DYNAMICZNE)</assert>
   </rule>

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoBezWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' 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.184']
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->
   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/hl7:translation/@code='ParamRozpPatoBezWykoMiedzKlas']/hl7:observation[hl7:code[(@code='34574-4' 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.184']">
      <assert role="error"
              see="https://www.cez.gov.pl/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.181-2023-04-27T000000.html"
              test="string(@typeCode)='COMP' or not(@typeCode)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="not(@typeCode) or (string-length(@typeCode)&gt;0 and not(matches(@typeCode,'\s')))">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): Atrybut @typeCode MUSI być typu 'cs'</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/@nullFlavor='NA']
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/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.181-2023-04-27T000000.html"
              test="string(@typeCode)='COMP' or not(@typeCode)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="not(@typeCode) or (string-length(@typeCode)&gt;0 and not(matches(@typeCode,'\s')))">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="count(hl7:observation)&gt;=1 and not(hl7:observation/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="count(hl7:observation)&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/@nullFlavor='NA']/hl7:observation
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->

   <rule context="*[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/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.181-2023-04-27T000000.html"
              test="string(@classCode)='OBS' or not(@classCode)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="not(@classCode) or (string-length(@classCode)&gt;0 and not(matches(@classCode,'\s')))">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="string(@moodCode)='EVN' or not(@moodCode)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="not(@moodCode) or (string-length(@moodCode)&gt;0 and not(matches(@moodCode,'\s')))">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="count(hl7:code)&gt;=1 ">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="count(hl7:code)&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="count(hl7:text)&gt;=1 and not(hl7:text/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="count(hl7:text)&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="count(hl7:statusCode[@code='completed'])&gt;=1 and not(hl7:statusCode[@code='completed']/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181-2023-04-27T000000.html"
              test="count(hl7:statusCode[@code='completed'])&lt;=1">(plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry): 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.181
Context: *[hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']]/hl7:organizer[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.181']/hl7:component[hl7:observation/hl7:code/@nullFlavor='NA']/hl7:observation/hl7:code
Item: (plCdaPathomorphologicalDiagnosisResultSummaryInCytologyEntry)
-->

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

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