<?xml version="1.0" encoding="UTF-8"?>
<!--
Template derived pattern
===========================================
ID: 2.16.840.1.113883.3.4424.13.10.2.110
Name: [2] Treść wyniku badania cytologicznego
Description: Szablon struktury CDA dla treści wyniku badania cytologicznego.
-->
<pattern xmlns="http://purl.oclc.org/dsdl/schematron"
         id="template-2.16.840.1.113883.3.4424.13.10.2.110-2024-08-04T000000">
   <title>[2] Treść wyniku badania cytologicznego</title>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.2.110
Context: *[hl7:component[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.110']]
Item: (plCdaCytologyResultComponent)
-->

   <rule context="*[hl7:component[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.110']]"
         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.2.110-2024-08-04T000000.html"
              test="count(hl7:component[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.110'])&gt;=1 and not(hl7:component[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.110']/@nullFlavor)">(plCdaCytologyResultComponent): element hl7:component[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.110'] jest mandatory [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.2.110-2024-08-04T000000.html"
              test="count(hl7:component[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.110'])&lt;=1">(plCdaCytologyResultComponent): element hl7:component[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.110'] występuje zbyt często [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.2.110
Context: *[hl7:component[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.110']]/hl7:component[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.110']
Item: (plCdaCytologyResultComponent)
-->

   <rule context="*[hl7:component[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.110']]/hl7:component[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.110']"
         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.2.110-2024-08-04T000000.html"
              test="string(@typeCode)='COMP' or not(@typeCode)">(plCdaCytologyResultComponent): 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.2.110-2024-08-04T000000.html"
              test="not(@contextConductionInd) or string(@contextConductionInd)=('true','false')">(plCdaCytologyResultComponent): Atrybut @contextConductionInd MUSI być typu 'bl'</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.2.110-2024-08-04T000000.html"
              test="count(hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.2.110'])&gt;=1 and not(hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.2.110']/@nullFlavor)">(plCdaCytologyResultComponent): element hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.2.110'] jest mandatory [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.2.110-2024-08-04T000000.html"
              test="count(hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.2.110'])&lt;=1">(plCdaCytologyResultComponent): element hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.2.110'] 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.2.110-2024-08-04T000000.html"
              test="count(hl7:structuredBody[not(hl7:component/hl7:section/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.55')])&gt;=1 and not(hl7:structuredBody[not(hl7:component/hl7:section/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.55')]/@nullFlavor)">(plCdaCytologyResultComponent): element hl7:structuredBody[not(hl7:component/hl7:section/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.55')] 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.2.110-2024-08-04T000000.html"
              test="count(hl7:structuredBody[not(hl7:component/hl7:section/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.55')])&lt;=1">(plCdaCytologyResultComponent): element hl7:structuredBody[not(hl7:component/hl7:section/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.55')] występuje zbyt często [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.2.110
Context: *[hl7:component[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.110']]/hl7:component[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.110']/hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.2.110']
Item: (plCdaCytologyResultComponent)
-->

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

   <rule context="*[hl7:component[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.110']]/hl7:component[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.110']/hl7:structuredBody[not(hl7:component/hl7:section/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.55')]"
         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.2.110-2024-08-04T000000.html"
              test="string(@classCode)='DOCBODY' or not(@classCode)">(plCdaCytologyResultComponent): Wartość dla @classCode MUSI wynosić 'DOCBODY'.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.2.110-2024-08-04T000000.html"
              test="string(@moodCode)='EVN' or not(@moodCode)">(plCdaCytologyResultComponent): 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.2.110-2024-08-04T000000.html"
              test="count(hl7:component[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']])&gt;=1 and not(hl7:component[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']]/@nullFlavor)">(plCdaCytologyResultComponent): element hl7:component[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']] jest mandatory [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.2.110-2024-08-04T000000.html"
              test="count(hl7:component[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']])&lt;=1">(plCdaCytologyResultComponent): element hl7:component[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.196']] występuje zbyt często [max 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.2.110-2024-08-04T000000.html"
              test="count(hl7:component[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.200']])&gt;=1 and not(hl7:component[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.200']]/@nullFlavor)">(plCdaCytologyResultComponent): element hl7:component[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.200']] 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.2.110-2024-08-04T000000.html"
              test="count(hl7:component[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.200']])&lt;=1">(plCdaCytologyResultComponent): element hl7:component[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.200']] 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.2.110-2024-08-04T000000.html"
              test="count(hl7:component[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.201']])&gt;=1 and not(hl7:component[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.201']]/@nullFlavor)">(plCdaCytologyResultComponent): element hl7:component[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.201']] 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.2.110-2024-08-04T000000.html"
              test="count(hl7:component[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.201']])&lt;=1">(plCdaCytologyResultComponent): element hl7:component[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.201']] 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.2.110-2024-08-04T000000.html"
              test="count(hl7:component[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.202']])&gt;=1 and not(hl7:component[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.202']]/@nullFlavor)">(plCdaCytologyResultComponent): element hl7:component[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.202']] 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.2.110-2024-08-04T000000.html"
              test="count(hl7:component[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.202']])&lt;=1">(plCdaCytologyResultComponent): element hl7:component[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.202']] 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.2.110-2024-08-04T000000.html"
              test="count(hl7:component[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.195']])&lt;=1">(plCdaCytologyResultComponent): element hl7:component[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.195']] występuje zbyt często [max 1x].</assert>
   </rule>

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

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.2.110
Context: *[hl7:component[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.110']]/hl7:component[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.110']/hl7:structuredBody[not(hl7:component/hl7:section/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.55')]/hl7:component[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.200']]
Item: (plCdaCytologyResultComponent)
-->
   <rule context="*[hl7:component[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.110']]/hl7:component[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.110']/hl7:structuredBody[not(hl7:component/hl7:section/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.55')]/hl7:component[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.200']]">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.2.110-2024-08-04T000000.html"
              test="string(@typeCode)='COMP' or not(@typeCode)">(plCdaCytologyResultComponent): Wartość dla @typeCode MUSI wynosić 'COMP'.</assert>
   </rule>

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.2.110
Context: *[hl7:component[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.110']]/hl7:component[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.110']/hl7:structuredBody[not(hl7:component/hl7:section/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.55')]/hl7:component[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.201']]
Item: (plCdaCytologyResultComponent)
-->
   <rule context="*[hl7:component[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.110']]/hl7:component[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.110']/hl7:structuredBody[not(hl7:component/hl7:section/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.55')]/hl7:component[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.201']]">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.2.110-2024-08-04T000000.html"
              test="string(@typeCode)='COMP' or not(@typeCode)">(plCdaCytologyResultComponent): Wartość dla @typeCode MUSI wynosić 'COMP'.</assert>
   </rule>

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.2.110
Context: *[hl7:component[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.110']]/hl7:component[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.110']/hl7:structuredBody[not(hl7:component/hl7:section/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.55')]/hl7:component[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.202']]
Item: (plCdaCytologyResultComponent)
-->
   <rule context="*[hl7:component[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.110']]/hl7:component[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.110']/hl7:structuredBody[not(hl7:component/hl7:section/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.55')]/hl7:component[hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.202']]">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.2.110-2024-08-04T000000.html"
              test="string(@typeCode)='COMP' or not(@typeCode)">(plCdaCytologyResultComponent): Wartość dla @typeCode MUSI wynosić 'COMP'.</assert>
   </rule>

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