<?xml version="1.0" encoding="UTF-8"?>
<!--
Template derived pattern
===========================================
ID: 2.16.840.1.113883.3.4424.13.10.4.184
Name: [4] Określenie rozpoznania patomorfologicznego w cytologii
Description: Szablon CDA dla określenia rozpoznania patomorfologicznego w cytologii
-->
<pattern xmlns="http://purl.oclc.org/dsdl/schematron"
         id="template-2.16.840.1.113883.3.4424.13.10.4.184-2023-04-27T000000">
   <title>[4] Określenie rozpoznania patomorfologicznego w cytologii</title>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.184
Context: *[hl7:observation[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184']]
Item: (plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship)
-->

   <rule context="*[hl7:observation[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184']]"
         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.184-2023-04-27T000000.html"
              test="count(hl7:observation[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184'])&gt;=1 and not(hl7:observation[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184']/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship): element 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.184-2023-04-27T000000.html"
              test="count(hl7:observation[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184'])&lt;=1">(plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship): element 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.184
Context: *[hl7:observation[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184']]/hl7:observation[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184']
Item: (plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship)
-->

   <rule context="*[hl7:observation[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184']]/hl7:observation[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184']"
         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.184-2023-04-27T000000.html"
              test="string(@classCode)='OBS'">(plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship): 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.184-2023-04-27T000000.html"
              test="not(@classCode) or (string-length(@classCode)&gt;0 and not(matches(@classCode,'\s')))">(plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship): 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.184-2023-04-27T000000.html"
              test="string(@moodCode)='EVN'">(plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship): 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.184-2023-04-27T000000.html"
              test="not(@moodCode) or (string-length(@moodCode)&gt;0 and not(matches(@moodCode,'\s')))">(plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship): 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.184-2023-04-27T000000.html"
              test="count(hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.4.184'])&gt;=1 and not(hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.4.184']/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship): element 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.184-2023-04-27T000000.html"
              test="count(hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.4.184'])&lt;=1">(plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship): element hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.4.184'] 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.184-2023-04-27T000000.html"
              test="count(hl7:code[(@code='RozpPato' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')])&gt;=1 and not(hl7:code[(@code='RozpPato' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship): element hl7:code[(@code='RozpPato' 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.184-2023-04-27T000000.html"
              test="count(hl7:code[(@code='RozpPato' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')])&lt;=1">(plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship): element hl7:code[(@code='RozpPato' 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.184-2023-04-27T000000.html"
              test="count(hl7:text)&gt;=1 ">(plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship): element hl7:text jest required [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.184-2023-04-27T000000.html"
              test="count(hl7:text)&lt;=1">(plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship): 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.184-2023-04-27T000000.html"
              test="count(hl7:statusCode[@code='completed'])&gt;=1 and not(hl7:statusCode[@code='completed']/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship): 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.184-2023-04-27T000000.html"
              test="count(hl7:statusCode[@code='completed'])&lt;=1">(plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship): element hl7:statusCode[@code='completed'] występuje zbyt często [max 1x].</assert>
      <let name="elmcount"
           value="count(hl7:value[@codeSystem='2.16.840.1.113883.6.3']|hl7:value[@codeSystem='2.16.840.1.113883.6.347']|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.184-2023-04-27T000000.html"
              test="$elmcount&gt;=1">(plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship): wybór (hl7:value[@codeSystem='2.16.840.1.113883.6.3'] lub hl7:value[@codeSystem='2.16.840.1.113883.6.347'] lub 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.184-2023-04-27T000000.html"
              test="$elmcount&lt;=1">(plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship): wybór (hl7:value[@codeSystem='2.16.840.1.113883.6.3'] lub hl7:value[@codeSystem='2.16.840.1.113883.6.347'] lub 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.184-2023-04-27T000000.html"
              test="count(hl7:value[@codeSystem='2.16.840.1.113883.6.3'])&lt;=1">(plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship): element hl7:value[@codeSystem='2.16.840.1.113883.6.3'] występuje zbyt często [max 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.184-2023-04-27T000000.html"
              test="count(hl7:value[@codeSystem='2.16.840.1.113883.6.347'])&lt;=1">(plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship): element hl7:value[@codeSystem='2.16.840.1.113883.6.347'] 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.184-2023-04-27T000000.html"
              test="count(hl7:code[@nullFlavor='NA'])&lt;=1">(plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship): element hl7:code[@nullFlavor='NA'] 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.184-2023-04-27T000000.html"
              test="count(hl7:entryRelationship[hl7:observation[hl7:code[(@code='RozpPatoDoprec' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]])&lt;=1">(plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship): element hl7:entryRelationship[hl7:observation[hl7:code[(@code='RozpPatoDoprec' 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.184
Context: *[hl7:observation[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184']]/hl7:observation[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184']/hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.4.184']
Item: (plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship)
-->

   <rule context="*[hl7:observation[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184']]/hl7:observation[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184']/hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.4.184']"
         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.184-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)">(plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship): 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.4.184-2023-04-27T000000.html"
              test="string(@root)='2.16.840.1.113883.3.4424.13.10.4.184'">(plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship): Wartość dla @root MUSI wynosić '2.16.840.1.113883.3.4424.13.10.4.184'.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.184-2023-04-27T000000.html"
              test="not(@root) or matches(@root,'^[0-2](\.(0|[1-9][0-9]*))*$')">(plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship): Atrybut @root MUSI być typu 'oid'</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.184
Context: *[hl7:observation[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184']]/hl7:observation[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184']/hl7:code[(@code='RozpPato' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]
Item: (plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship)
-->

   <rule context="*[hl7:observation[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184']]/hl7:observation[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184']/hl7:code[(@code='RozpPato' 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.184-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)">(plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship): 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.184-2023-04-27T000000.html"
              test="@nullFlavor or (@code='RozpPato' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18' and @displayName='Określenie rozpoznania patomorfologicznego' and @codeSystemName='AtrybutyWBCYT')">(plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship): Wartość elementu MUSI wynosić code 'RozpPato' codeSystem '2.16.840.1.113883.3.4424.13.5.18' displayName='Określenie rozpoznania patomorfologicznego' codeSystemName='AtrybutyWBCYT'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.184
Context: *[hl7:observation[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184']]/hl7:observation[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184']/hl7:statusCode[@code='completed']
Item: (plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship)
-->

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

   <rule context="*[hl7:observation[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184']]/hl7:observation[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184']/hl7:value[@codeSystem='2.16.840.1.113883.6.3']"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.184-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)">(plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship): 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.184-2023-04-27T000000.html"
              test="@nullFlavor or (@codeSystem='2.16.840.1.113883.6.3' and @codeSystemName='ICD10')">(plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship): Wartość elementu MUSI wynosić codeSystem '2.16.840.1.113883.6.3' codeSystemName='ICD10'.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.184-2023-04-27T000000.html"
              test="@code">(plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship): atrybut @code MUSI wystąpić.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.184-2023-04-27T000000.html"
              test="not(@code) or string-length(@code)&gt;0">(plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship): Atrybut @code MUSI być typu 'st'</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.184-2023-04-27T000000.html"
              test="@displayName">(plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship): atrybut @displayName MUSI wystąpić.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.184-2023-04-27T000000.html"
              test="not(@displayName) or string-length(@displayName)&gt;0">(plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship): Atrybut @displayName MUSI być typu 'st'</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.184
Context: *[hl7:observation[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184']]/hl7:observation[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184']/hl7:value[@codeSystem='2.16.840.1.113883.6.347']
Item: (plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship)
-->

   <rule context="*[hl7:observation[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184']]/hl7:observation[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184']/hl7:value[@codeSystem='2.16.840.1.113883.6.347']"
         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.184-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)">(plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship): 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.184-2023-04-27T000000.html"
              test="@nullFlavor or (@codeSystem='2.16.840.1.113883.6.347' and @codeSystemName='ICD-11')">(plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship): Wartość elementu MUSI wynosić codeSystem '2.16.840.1.113883.6.347' codeSystemName='ICD-11'.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.184-2023-04-27T000000.html"
              test="@code">(plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship): atrybut @code MUSI wystąpić.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.184-2023-04-27T000000.html"
              test="not(@code) or string-length(@code)&gt;0">(plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship): Atrybut @code MUSI być typu 'st'</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.184-2023-04-27T000000.html"
              test="@displayName">(plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship): atrybut @displayName MUSI wystąpić.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.184-2023-04-27T000000.html"
              test="not(@displayName) or string-length(@displayName)&gt;0">(plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship): Atrybut @displayName MUSI być typu 'st'</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.184
Context: *[hl7:observation[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184']]/hl7:observation[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184']/hl7:code[@nullFlavor='NA']
Item: (plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship)
-->

   <rule context="*[hl7:observation[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184']]/hl7:observation[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184']/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.184-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)">(plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship): 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.184-2023-04-27T000000.html"
              test="string(@nullFlavor)='NA'">(plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship): Wartość dla @nullFlavor MUSI wynosić 'NA'.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.184-2023-04-27T000000.html"
              test="not(@nullFlavor) or (string-length(@nullFlavor)&gt;0 and not(matches(@nullFlavor,'\s')))">(plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship): Atrybut @nullFlavor MUSI być typu 'cs'</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.184
Context: *[hl7:observation[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184']]/hl7:observation[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184']/hl7:entryRelationship[hl7:observation[hl7:code[(@code='RozpPatoDoprec' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]
Item: (plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship)
-->

   <rule context="*[hl7:observation[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184']]/hl7:observation[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184']/hl7:entryRelationship[hl7:observation[hl7:code[(@code='RozpPatoDoprec' 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.184-2023-04-27T000000.html"
              test="string(@typeCode)='COMP' or not(@typeCode)">(plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship): 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.184-2023-04-27T000000.html"
              test="not(@typeCode) or (string-length(@typeCode)&gt;0 and not(matches(@typeCode,'\s')))">(plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship): 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.184-2023-04-27T000000.html"
              test="count(hl7:observation[hl7:code[(@code='RozpPatoDoprec' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]])&gt;=1 and not(hl7:observation[hl7:code[(@code='RozpPatoDoprec' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]/@nullFlavor)">(plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship): element hl7:observation[hl7:code[(@code='RozpPatoDoprec' 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.184-2023-04-27T000000.html"
              test="count(hl7:observation[hl7:code[(@code='RozpPatoDoprec' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]])&lt;=1">(plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship): element hl7:observation[hl7:code[(@code='RozpPatoDoprec' 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.184
Context: *[hl7:observation[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184']]/hl7:observation[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184']/hl7:entryRelationship[hl7:observation[hl7:code[(@code='RozpPatoDoprec' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/hl7:observation[hl7:code[(@code='RozpPatoDoprec' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]
Item: (plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship)
-->

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

   <rule context="*[hl7:observation[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184']]/hl7:observation[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184']/hl7:entryRelationship[hl7:observation[hl7:code[(@code='RozpPatoDoprec' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/hl7:observation[hl7:code[(@code='RozpPatoDoprec' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]/hl7:code[(@code='RozpPatoDoprec' 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.184-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)">(plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship): 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.184-2023-04-27T000000.html"
              test="@nullFlavor or (@code='RozpPatoDoprec' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18' and @displayName='Określenie rozpoznania patomorfologicznego - doprecyzowanie' and @codeSystemName='AtrybutyWBCYT')">(plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship): Wartość elementu MUSI wynosić code 'RozpPatoDoprec' codeSystem '2.16.840.1.113883.3.4424.13.5.18' displayName='Określenie rozpoznania patomorfologicznego - doprecyzowanie' codeSystemName='AtrybutyWBCYT'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.184
Context: *[hl7:observation[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184']]/hl7:observation[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184']/hl7:entryRelationship[hl7:observation[hl7:code[(@code='RozpPatoDoprec' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/hl7:observation[hl7:code[(@code='RozpPatoDoprec' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]/hl7:statusCode[@code='completed']
Item: (plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship)
-->

   <rule context="*[hl7:observation[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184']]/hl7:observation[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184']/hl7:entryRelationship[hl7:observation[hl7:code[(@code='RozpPatoDoprec' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/hl7:observation[hl7:code[(@code='RozpPatoDoprec' 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.184-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)">(plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship): 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.184-2023-04-27T000000.html"
              test="@nullFlavor or (@code='completed')">(plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship): Wartość elementu MUSI wynosić code 'completed'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.184
Context: *[hl7:observation[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184']]/hl7:observation[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.184']/hl7:entryRelationship[hl7:observation[hl7:code[(@code='RozpPatoDoprec' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]]/hl7:observation[hl7:code[(@code='RozpPatoDoprec' and @codeSystem='2.16.840.1.113883.3.4424.13.5.18')]]/hl7:value
Item: (plCdaPathomorphologicalDiagnosisResultInCytologyEntryRelationship)
-->

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