<?xml version="1.0" encoding="UTF-8"?>
<!--
Template derived pattern
===========================================
ID: 2.16.840.1.113883.3.4424.13.10.4.253
Name: [4] Nagłe zatrzymanie krążenia
Description: Nagłe zatrzymanie krążenia
-->
<pattern xmlns="http://purl.oclc.org/dsdl/schematron"
         id="template-2.16.840.1.113883.3.4424.13.10.4.253-2025-02-26T000000">
   <title>[4] Nagłe zatrzymanie krążenia</title>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.253
Context: *[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.253']]]
Item: (plCdaCardiacArrestDisorderEntry)
-->

   <rule fpi="RULC-1"
         context="*[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.253']]]"
         id="d16e9507-false-d37463e0">
      <assert role="error"
              see="https://www.csioz.gov.pl/HL7POL/pl-cda-html-pl-PL/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.253-2025-02-26T000000.html"
              test="count(hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.253']]) &gt;= 1">(plCdaCardiacArrestDisorderEntry): element hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.253']] is mandatory [min 1x].</assert>
      <assert role="error"
              see="https://www.csioz.gov.pl/HL7POL/pl-cda-html-pl-PL/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.253-2025-02-26T000000.html"
              test="count(hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.253']]) &lt;= 1">(plCdaCardiacArrestDisorderEntry): element hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.253']] appears too often [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.253
Context: *[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.253']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.253']]
Item: (plCdaCardiacArrestDisorderEntry)
-->

   <rule fpi="RULC-1"
         context="*[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.253']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.253']]"
         id="d16e9534-false-d37480e0">
      <assert role="error"
              see="https://www.csioz.gov.pl/HL7POL/pl-cda-html-pl-PL/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.253-2025-02-26T000000.html"
              test="string(@classCode) = ('OBS')">(plCdaCardiacArrestDisorderEntry): The value for classCode SHALL be 'OBS'. Found: "<value-of select="@classCode"/>"</assert>
      <assert role="error"
              see="https://www.csioz.gov.pl/HL7POL/pl-cda-html-pl-PL/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.253-2025-02-26T000000.html"
              test="string(@moodCode) = ('EVN')">(plCdaCardiacArrestDisorderEntry): The value for moodCode SHALL be 'EVN'. Found: "<value-of select="@moodCode"/>"</assert>
      <assert role="error"
              see="https://www.csioz.gov.pl/HL7POL/pl-cda-html-pl-PL/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.253-2025-02-26T000000.html"
              test="@negationInd">(plCdaCardiacArrestDisorderEntry): attribute @negationInd SHALL be present.</assert>
      <assert role="error"
              see="https://www.csioz.gov.pl/HL7POL/pl-cda-html-pl-PL/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.253-2025-02-26T000000.html"
              test="not(@negationInd) or string(@negationInd)=('true','false')">(plCdaCardiacArrestDisorderEntry): Attribute @negationInd SHALL be of data type 'bl'  - '<value-of select="@negationInd"/>'</assert>
      <assert role="error"
              see="https://www.csioz.gov.pl/HL7POL/pl-cda-html-pl-PL/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.253-2025-02-26T000000.html"
              test="count(hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.253']) &gt;= 1">(plCdaCardiacArrestDisorderEntry): element hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.253'] is mandatory [min 1x].</assert>
      <assert role="error"
              see="https://www.csioz.gov.pl/HL7POL/pl-cda-html-pl-PL/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.253-2025-02-26T000000.html"
              test="count(hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.253']) &lt;= 1">(plCdaCardiacArrestDisorderEntry): element hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.253'] appears too often [max 1x].</assert>
      <assert role="error"
              see="https://www.csioz.gov.pl/HL7POL/pl-cda-html-pl-PL/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.253-2025-02-26T000000.html"
              test="count(hl7:code[(@code = '410429000' and @codeSystem = '2.16.840.1.113883.6.96')]) &gt;= 1">(plCdaCardiacArrestDisorderEntry): element hl7:code[(@code = '410429000' and @codeSystem = '2.16.840.1.113883.6.96')] is mandatory [min 1x].</assert>
      <assert role="error"
              see="https://www.csioz.gov.pl/HL7POL/pl-cda-html-pl-PL/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.253-2025-02-26T000000.html"
              test="count(hl7:code[(@code = '410429000' and @codeSystem = '2.16.840.1.113883.6.96')]) &lt;= 1">(plCdaCardiacArrestDisorderEntry): element hl7:code[(@code = '410429000' and @codeSystem = '2.16.840.1.113883.6.96')] appears too often [max 1x].</assert>
      <assert role="error"
              see="https://www.csioz.gov.pl/HL7POL/pl-cda-html-pl-PL/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.253-2025-02-26T000000.html"
              test="count(hl7:statusCode[@code = 'completed']) &gt;= 1">(plCdaCardiacArrestDisorderEntry): element hl7:statusCode[@code = 'completed'] is mandatory [min 1x].</assert>
      <assert role="error"
              see="https://www.csioz.gov.pl/HL7POL/pl-cda-html-pl-PL/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.253-2025-02-26T000000.html"
              test="count(hl7:statusCode[@code = 'completed']) &lt;= 1">(plCdaCardiacArrestDisorderEntry): element hl7:statusCode[@code = 'completed'] appears too often [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.253
Context: *[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.253']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.253']]/hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.253']
Item: (plCdaCardiacArrestDisorderEntry)
-->

   <rule fpi="RULC-1"
         context="*[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.253']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.253']]/hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.253']"
         id="d16e9542-false-d37529e0">
      <assert role="error"
              see="https://www.csioz.gov.pl/HL7POL/pl-cda-html-pl-PL/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.253-2025-02-26T000000.html"
              test="string(@root) = ('2.16.840.1.113883.3.4424.13.10.4.253')">(plCdaCardiacArrestDisorderEntry): The value for root SHALL be '2.16.840.1.113883.3.4424.13.10.4.253'. Found: "<value-of select="@root"/>"</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.253
Context: *[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.253']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.253']]/hl7:code[(@code = '410429000' and @codeSystem = '2.16.840.1.113883.6.96')]
Item: (plCdaCardiacArrestDisorderEntry)
-->

   <rule fpi="RULC-1"
         context="*[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.253']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.253']]/hl7:code[(@code = '410429000' and @codeSystem = '2.16.840.1.113883.6.96')]"
         id="d16e9547-false-d37541e0">
      <assert role="error"
              see="https://www.csioz.gov.pl/HL7POL/pl-cda-html-pl-PL/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.253-2025-02-26T000000.html"
              test="@nullFlavor or (@code='410429000' and @codeSystem='2.16.840.1.113883.6.96' and @displayName='Cardiac arrest (disorder)' and @codeSystemName='SNOMED-CT')">(plCdaCardiacArrestDisorderEntry): The element value SHALL be one of 'code '410429000' codeSystem '2.16.840.1.113883.6.96' displayName='Cardiac arrest (disorder)' codeSystemName='SNOMED-CT''.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.253
Context: *[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.253']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.253']]/hl7:statusCode[@code = 'completed']
Item: (plCdaCardiacArrestDisorderEntry)
-->

   <rule fpi="RULC-1"
         context="*[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.253']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.253']]/hl7:statusCode[@code = 'completed']"
         id="d16e9553-false-d37555e0">
      <assert role="error"
              see="https://www.csioz.gov.pl/HL7POL/pl-cda-html-pl-PL/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.4.253-2025-02-26T000000.html"
              test="@nullFlavor or (@code='completed')">(plCdaCardiacArrestDisorderEntry): The element value SHALL be one of 'code 'completed''.</assert>
   </rule>
</pattern>
