<?xml version="1.0" encoding="UTF-8"?>
<!--
Template derived pattern
===========================================
ID: 2.16.840.1.113883.3.4424.13.10.1.48
Name: [1] Karta medycznych czynności ratunkowych
Description: Szablon CDA karty medycznych czynności ratunkowych
-->
<pattern xmlns="http://purl.oclc.org/dsdl/schematron"
         id="template-2.16.840.1.113883.3.4424.13.10.1.48-2025-02-26T000000">
   <title>[1] Karta medycznych czynności ratunkowych</title>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.1.48
Context: /
Item: (plCdaParamedicRescueSummaryNote)
-->

   <rule fpi="RULC-1" context="/" id="d16e3-false-d125e0">
      <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.1.48-2025-02-26T000000.html"
              test="count(hl7:ClinicalDocument[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.1.48']]) &gt;= 1">(plCdaParamedicRescueSummaryNote): element hl7:ClinicalDocument[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.1.48']] 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.1.48-2025-02-26T000000.html"
              test="count(hl7:ClinicalDocument[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.1.48']]) &lt;= 1">(plCdaParamedicRescueSummaryNote): element hl7:ClinicalDocument[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.1.48']] appears too often [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.1.48
Context: /hl7:ClinicalDocument[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.1.48']]
Item: (plCdaParamedicRescueSummaryNote)
-->

   <rule fpi="RULC-1"
         context="/hl7:ClinicalDocument[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.1.48']]"
         id="d16e418-false-d613e0">
      <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.1.48-2025-02-26T000000.html"
              test="string(@classCode) = ('DOCCLIN') or not(@classCode)">(plCdaParamedicRescueSummaryNote): The value for classCode SHALL be 'DOCCLIN'. 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.1.48-2025-02-26T000000.html"
              test="string(@moodCode) = ('EVN') or not(@moodCode)">(plCdaParamedicRescueSummaryNote): The value for moodCode SHALL be 'EVN'. Found: "<value-of select="@moodCode"/>"</assert>
      <let name="versionLabel" value="'1.3.2'"/>
      <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.1.48-2025-02-26T000000.html"
              test="count(hl7:templateId[@root and @extension=$versionLabel])=1">(plCdaParamedicRescueSummaryNote): Nie występuje prawidłowe oznaczenie zgodności dokumentu z daną wersją wydania Polskiej Implementacji Krajowej HL7 CDA.</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.1.48-2025-02-26T000000.html"
              test="/processing-instruction('xml-stylesheet') = concat('href=&#34;CDA_PL_IG_',/hl7:ClinicalDocument/hl7:templateId[@extension]/@extension,'.xsl&#34; type=&#34;text/xsl&#34;')">(plCdaParamedicRescueSummaryNote): Nieprawidłowe wskazanie transformaty generującej warstwę prezentacyjną dokumentu.</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.1.48-2025-02-26T000000.html"
              test="count(hl7:typeId[@root = '2.16.840.1.113883.1.3'][@extension = 'POCD_HD000040']) &gt;= 1">(plCdaParamedicRescueSummaryNote): element hl7:typeId[@root = '2.16.840.1.113883.1.3'][@extension = 'POCD_HD000040'] 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.1.48-2025-02-26T000000.html"
              test="count(hl7:typeId[@root = '2.16.840.1.113883.1.3'][@extension = 'POCD_HD000040']) &lt;= 1">(plCdaParamedicRescueSummaryNote): element hl7:typeId[@root = '2.16.840.1.113883.1.3'][@extension = 'POCD_HD000040'] 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.1.48-2025-02-26T000000.html"
              test="count(hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.1.48']) &gt;= 1">(plCdaParamedicRescueSummaryNote): element hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.1.48'] 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.1.48-2025-02-26T000000.html"
              test="count(hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.1.48']) &lt;= 1">(plCdaParamedicRescueSummaryNote): element hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.1.48'] 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.1.48-2025-02-26T000000.html"
              test="count(hl7:id) &gt;= 1">(plCdaParamedicRescueSummaryNote): element hl7:id is required [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.1.48-2025-02-26T000000.html"
              test="count(hl7:id) &lt;= 1">(plCdaParamedicRescueSummaryNote): element hl7:id 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.1.48-2025-02-26T000000.html"
              test="count(hl7:code[(@code = '101135-2' and @codeSystem = '2.16.840.1.113883.6.1')]) &gt;= 1">(plCdaParamedicRescueSummaryNote): element hl7:code[(@code = '101135-2' and @codeSystem = '2.16.840.1.113883.6.1')] 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.1.48-2025-02-26T000000.html"
              test="count(hl7:code[(@code = '101135-2' and @codeSystem = '2.16.840.1.113883.6.1')]) &lt;= 1">(plCdaParamedicRescueSummaryNote): element hl7:code[(@code = '101135-2' and @codeSystem = '2.16.840.1.113883.6.1')] 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.1.48-2025-02-26T000000.html"
              test="count(hl7:title[not(@nullFlavor)]) &gt;= 1">(plCdaParamedicRescueSummaryNote): element hl7:title[not(@nullFlavor)] 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.1.48-2025-02-26T000000.html"
              test="count(hl7:title[not(@nullFlavor)]) &lt;= 1">(plCdaParamedicRescueSummaryNote): element hl7:title[not(@nullFlavor)] 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.1.48-2025-02-26T000000.html"
              test="count(hl7:effectiveTime[not(@nullFlavor)]) &gt;= 1">(plCdaParamedicRescueSummaryNote): element hl7:effectiveTime[not(@nullFlavor)] 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.1.48-2025-02-26T000000.html"
              test="count(hl7:effectiveTime[not(@nullFlavor)]) &lt;= 1">(plCdaParamedicRescueSummaryNote): element hl7:effectiveTime[not(@nullFlavor)] 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.1.48-2025-02-26T000000.html"
              test="count(hl7:confidentialityCode[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.1.11.16926-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]) &gt;= 1">(plCdaParamedicRescueSummaryNote): element hl7:confidentialityCode[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.1.11.16926-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)] 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.1.48-2025-02-26T000000.html"
              test="count(hl7:confidentialityCode[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.1.11.16926-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]) &lt;= 1">(plCdaParamedicRescueSummaryNote): element hl7:confidentialityCode[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.1.11.16926-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)] 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.1.48-2025-02-26T000000.html"
              test="count(hl7:languageCode[@code = 'pl-PL']) &gt;= 1">(plCdaParamedicRescueSummaryNote): element hl7:languageCode[@code = 'pl-PL'] 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.1.48-2025-02-26T000000.html"
              test="count(hl7:languageCode[@code = 'pl-PL']) &lt;= 1">(plCdaParamedicRescueSummaryNote): element hl7:languageCode[@code = 'pl-PL'] 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.1.48-2025-02-26T000000.html"
              test="count(hl7:setId[not(@nullFlavor)]) &gt;= 1">(plCdaParamedicRescueSummaryNote): element hl7:setId[not(@nullFlavor)] 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.1.48-2025-02-26T000000.html"
              test="count(hl7:setId[not(@nullFlavor)]) &lt;= 1">(plCdaParamedicRescueSummaryNote): element hl7:setId[not(@nullFlavor)] 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.1.48-2025-02-26T000000.html"
              test="count(hl7:versionNumber[not(@nullFlavor)]) &gt;= 1">(plCdaParamedicRescueSummaryNote): element hl7:versionNumber[not(@nullFlavor)] 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.1.48-2025-02-26T000000.html"
              test="count(hl7:versionNumber[not(@nullFlavor)]) &lt;= 1">(plCdaParamedicRescueSummaryNote): element hl7:versionNumber[not(@nullFlavor)] 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.1.48-2025-02-26T000000.html"
              test="count(hl7:recordTarget[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.2.3']]) &gt;= 1">(plCdaParamedicRescueSummaryNote): element hl7:recordTarget[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.2.3']] 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.1.48-2025-02-26T000000.html"
              test="count(hl7:recordTarget[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.2.3']]) &lt;= 1">(plCdaParamedicRescueSummaryNote): element hl7:recordTarget[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.2.3']] 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.1.48-2025-02-26T000000.html"
              test="count(hl7:author[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.2.130']]) &gt;= 1">(plCdaParamedicRescueSummaryNote): element hl7:author[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.2.130']] 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.1.48-2025-02-26T000000.html"
              test="count(hl7:author[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.2.130']]) &lt;= 1">(plCdaParamedicRescueSummaryNote): element hl7:author[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.2.130']] 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.1.48-2025-02-26T000000.html"
              test="count(hl7:custodian[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.2.5']]) &gt;= 1">(plCdaParamedicRescueSummaryNote): element hl7:custodian[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.2.5']] 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.1.48-2025-02-26T000000.html"
              test="count(hl7:custodian[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.2.5']]) &lt;= 1">(plCdaParamedicRescueSummaryNote): element hl7:custodian[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.2.5']] 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.1.48-2025-02-26T000000.html"
              test="count(hl7:legalAuthenticator[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.2.6']]) &gt;= 1">(plCdaParamedicRescueSummaryNote): element hl7:legalAuthenticator[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.2.6']] 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.1.48-2025-02-26T000000.html"
              test="count(hl7:legalAuthenticator[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.2.6']]) &lt;= 1">(plCdaParamedicRescueSummaryNote): element hl7:legalAuthenticator[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.2.6']] 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.1.48-2025-02-26T000000.html"
              test="count(hl7:participant[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.2.19']]) &lt;= 1">(plCdaParamedicRescueSummaryNote): element hl7:participant[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.2.19']] 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.1.48-2025-02-26T000000.html"
              test="count(hl7:relatedDocument[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.2.7']]) &lt;= 1">(plCdaParamedicRescueSummaryNote): element hl7:relatedDocument[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.2.7']] 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.1.48-2025-02-26T000000.html"
              test="count(hl7:componentOf[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.2.134']]) &gt;= 1">(plCdaParamedicRescueSummaryNote): element hl7:componentOf[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.2.134']] 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.1.48-2025-02-26T000000.html"
              test="count(hl7:componentOf[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.2.134']]) &lt;= 1">(plCdaParamedicRescueSummaryNote): element hl7:componentOf[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.2.134']] 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.1.48-2025-02-26T000000.html"
              test="count(hl7:component[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.2.130']]) &gt;= 1">(plCdaParamedicRescueSummaryNote): element hl7:component[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.2.130']] 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.1.48-2025-02-26T000000.html"
              test="count(hl7:component[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.2.130']]) &lt;= 1">(plCdaParamedicRescueSummaryNote): element hl7:component[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.2.130']] appears too often [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.1.48
Context: /hl7:ClinicalDocument[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.1.48']]/hl7:typeId[@root = '2.16.840.1.113883.1.3'][@extension = 'POCD_HD000040']
Item: (plCdaParamedicRescueSummaryNote)
-->

   <rule fpi="RULC-1"
         context="/hl7:ClinicalDocument[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.1.48']]/hl7:typeId[@root = '2.16.840.1.113883.1.3'][@extension = 'POCD_HD000040']"
         id="d16e424-false-d1125e0">
      <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.1.48-2025-02-26T000000.html"
              test="string(@extension) = ('POCD_HD000040')">(plCdaParamedicRescueSummaryNote): The value for extension SHALL be 'POCD_HD000040'. Found: "<value-of select="@extension"/>"</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.1.48-2025-02-26T000000.html"
              test="string(@root) = ('2.16.840.1.113883.1.3')">(plCdaParamedicRescueSummaryNote): The value for root SHALL be '2.16.840.1.113883.1.3'. Found: "<value-of select="@root"/>"</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.1.48
Context: /hl7:ClinicalDocument[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.1.48']]/hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.1.48']
Item: (plCdaParamedicRescueSummaryNote)
-->

   <rule fpi="RULC-1"
         context="/hl7:ClinicalDocument[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.1.48']]/hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.1.48']"
         id="d16e429-false-d1142e0">
      <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.1.48-2025-02-26T000000.html"
              test="string(@root) = ('2.16.840.1.113883.3.4424.13.10.1.48')">(plCdaParamedicRescueSummaryNote): The value for root SHALL be '2.16.840.1.113883.3.4424.13.10.1.48'. Found: "<value-of select="@root"/>"</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.1.48
Context: /hl7:ClinicalDocument[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.1.48']]/hl7:id
Item: (plCdaParamedicRescueSummaryNote)
-->

   <rule fpi="RULC-1"
         context="/hl7:ClinicalDocument[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.1.48']]/hl7:id"
         id="d16e434-false-d1153e0">
      <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.1.48-2025-02-26T000000.html"
              test="@root">(plCdaParamedicRescueSummaryNote): attribute @root 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.1.48-2025-02-26T000000.html"
              test="not(@root) or matches(@root,'^[0-2](\.(0|[1-9]\d*))*$') or matches(@root,'^[A-Fa-f\d]{8}-[A-Fa-f\d]{4}-[A-Fa-f\d]{4}-[A-Fa-f\d]{4}-[A-Fa-f\d]{12}$') or matches(@root,'^[A-Za-z][A-Za-z\d\-]*$')">(plCdaParamedicRescueSummaryNote): Attribute @root SHALL be of data type 'uid'  - '<value-of select="@root"/>'</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.1.48-2025-02-26T000000.html"
              test="@extension">(plCdaParamedicRescueSummaryNote): attribute @extension 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.1.48-2025-02-26T000000.html"
              test="not(@extension) or string-length(@extension)&gt;0">(plCdaParamedicRescueSummaryNote): Attribute @extension SHALL be of data type 'st'  - '<value-of select="@extension"/>'</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.1.48
Context: /hl7:ClinicalDocument[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.1.48']]/hl7:code[(@code = '101135-2' and @codeSystem = '2.16.840.1.113883.6.1')]
Item: (plCdaParamedicRescueSummaryNote)
-->

   <rule fpi="RULC-1"
         context="/hl7:ClinicalDocument[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.1.48']]/hl7:code[(@code = '101135-2' and @codeSystem = '2.16.840.1.113883.6.1')]"
         id="d16e442-false-d1172e0">
      <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.1.48-2025-02-26T000000.html"
              test="@nullFlavor or (@code='101135-2' and @codeSystem='2.16.840.1.113883.6.1' and @displayName='Ambulance Discharge summary' and @codeSystemName='LOINC')">(plCdaParamedicRescueSummaryNote): The element value SHALL be one of 'code '101135-2' codeSystem '2.16.840.1.113883.6.1' displayName='Ambulance Discharge summary' codeSystemName='LOINC''.</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.1.48-2025-02-26T000000.html"
              test="@code">(plCdaParamedicRescueSummaryNote): attribute @code 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.1.48-2025-02-26T000000.html"
              test="not(@code) or (string-length(@code) &gt; 0 and not(matches(@code,'\s')))">(plCdaParamedicRescueSummaryNote): Attribute @code SHALL be of data type 'cs'  - '<value-of select="@code"/>'</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.1.48-2025-02-26T000000.html"
              test="@displayName">(plCdaParamedicRescueSummaryNote): attribute @displayName 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.1.48-2025-02-26T000000.html"
              test="not(@displayName) or string-length(@displayName)&gt;0">(plCdaParamedicRescueSummaryNote): Attribute @displayName SHALL be of data type 'st'  - '<value-of select="@displayName"/>'</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.1.48-2025-02-26T000000.html"
              test="count(hl7:translation[(@code = '00.50' and @codeSystem = '2.16.840.1.113883.3.4424.11.1.32')]) &gt;= 1">(plCdaParamedicRescueSummaryNote): element hl7:translation[(@code = '00.50' and @codeSystem = '2.16.840.1.113883.3.4424.11.1.32')] 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.1.48-2025-02-26T000000.html"
              test="count(hl7:translation[(@code = '00.50' and @codeSystem = '2.16.840.1.113883.3.4424.11.1.32')]) &lt;= 1">(plCdaParamedicRescueSummaryNote): element hl7:translation[(@code = '00.50' and @codeSystem = '2.16.840.1.113883.3.4424.11.1.32')] appears too often [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.1.48
Context: /hl7:ClinicalDocument[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.1.48']]/hl7:code[(@code = '101135-2' and @codeSystem = '2.16.840.1.113883.6.1')]/hl7:translation[(@code = '00.50' and @codeSystem = '2.16.840.1.113883.3.4424.11.1.32')]
Item: (plCdaParamedicRescueSummaryNote)
-->

   <rule fpi="RULC-1"
         context="/hl7:ClinicalDocument[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.1.48']]/hl7:code[(@code = '101135-2' and @codeSystem = '2.16.840.1.113883.6.1')]/hl7:translation[(@code = '00.50' and @codeSystem = '2.16.840.1.113883.3.4424.11.1.32')]"
         id="d16e450-false-d1205e0">
      <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.1.48-2025-02-26T000000.html"
              test="@nullFlavor or (@code='00.50' and @codeSystem='2.16.840.1.113883.3.4424.11.1.32' and @displayName='Karta medycznych czynności ratunkowych' and @codeSystemName='KLAS_DOK_P1')">(plCdaParamedicRescueSummaryNote): The element value SHALL be one of 'code '00.50' codeSystem '2.16.840.1.113883.3.4424.11.1.32' displayName='Karta medycznych czynności ratunkowych' codeSystemName='KLAS_DOK_P1''.</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.1.48-2025-02-26T000000.html"
              test="@code">(plCdaParamedicRescueSummaryNote): attribute @code 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.1.48-2025-02-26T000000.html"
              test="not(@code) or (string-length(@code) &gt; 0 and not(matches(@code,'\s')))">(plCdaParamedicRescueSummaryNote): Attribute @code SHALL be of data type 'cs'  - '<value-of select="@code"/>'</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.1.48-2025-02-26T000000.html"
              test="@displayName">(plCdaParamedicRescueSummaryNote): attribute @displayName 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.1.48-2025-02-26T000000.html"
              test="not(@displayName) or string-length(@displayName)&gt;0">(plCdaParamedicRescueSummaryNote): Attribute @displayName SHALL be of data type 'st'  - '<value-of select="@displayName"/>'</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.1.48
Context: /hl7:ClinicalDocument[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.1.48']]/hl7:title[not(@nullFlavor)]
Item: (plCdaParamedicRescueSummaryNote)
-->

   <rule fpi="RULC-1"
         context="/hl7:ClinicalDocument[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.1.48']]/hl7:title[not(@nullFlavor)]"
         id="d16e460-false-d1228e0">
      <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.1.48-2025-02-26T000000.html"
              test="text()='Karta medycznych czynności ratunkowych'">(plCdaParamedicRescueSummaryNote): the element content of hl7:title[not(@nullFlavor)] SHALL be ''Karta medycznych czynności ratunkowych''. Found: "<value-of select="."/>"</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.1.48
Context: /hl7:ClinicalDocument[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.1.48']]/hl7:effectiveTime[not(@nullFlavor)]
Item: (plCdaParamedicRescueSummaryNote)
-->

   <rule fpi="RULC-1"
         context="/hl7:ClinicalDocument[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.1.48']]/hl7:effectiveTime[not(@nullFlavor)]"
         id="d16e466-false-d1239e0">
      <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.1.48-2025-02-26T000000.html"
              test="concat(substring(@value,1,4),'-',substring(@value,5,2),'-',substring(@value,7,2)) castable as xs:date">(plCdaParamedicRescueSummaryNote): Pierwsze 8 cyfr daty powinno być w formacie YYYYMMDD.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.1.48
Context: /hl7:ClinicalDocument[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.1.48']]/hl7:confidentialityCode[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.1.11.16926-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]
Item: (plCdaParamedicRescueSummaryNote)
-->

   <rule fpi="RULC-1"
         context="/hl7:ClinicalDocument[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.1.48']]/hl7:confidentialityCode[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.1.11.16926-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]"
         id="d16e472-false-d1250e0">
      <let name="theCode" value="@code"/>
      <let name="theCodeSystem" value="@codeSystem"/>
      <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.1.48-2025-02-26T000000.html"
              test="@nullFlavor or exists(doc('include/voc-2.16.840.1.113883.1.11.16926-DYNAMIC.xml')//valueSet[1][conceptList/concept[@code = $theCode][@codeSystem = $theCodeSystem]])">(plCdaParamedicRescueSummaryNote): The element value SHALL be one of '2.16.840.1.113883.1.11.16926 x_BasicConfidentialityKind (DYNAMIC)'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.1.48
Context: /hl7:ClinicalDocument[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.1.48']]/hl7:languageCode[@code = 'pl-PL']
Item: (plCdaParamedicRescueSummaryNote)
-->

   <rule fpi="RULC-1"
         context="/hl7:ClinicalDocument[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.1.48']]/hl7:languageCode[@code = 'pl-PL']"
         id="d16e477-false-d1268e0">
      <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.1.48-2025-02-26T000000.html"
              test="@nullFlavor or (@code='pl-PL')">(plCdaParamedicRescueSummaryNote): The element value SHALL be one of 'code 'pl-PL''.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.1.48
Context: /hl7:ClinicalDocument[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.1.48']]/hl7:setId[not(@nullFlavor)]
Item: (plCdaParamedicRescueSummaryNote)
-->

   <rule fpi="RULC-1"
         context="/hl7:ClinicalDocument[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.1.48']]/hl7:setId[not(@nullFlavor)]"
         id="d16e482-false-d1281e0">
      <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.1.48-2025-02-26T000000.html"
              test="@root">(plCdaParamedicRescueSummaryNote): attribute @root 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.1.48-2025-02-26T000000.html"
              test="not(@root) or matches(@root,'^[0-2](\.(0|[1-9]\d*))*$') or matches(@root,'^[A-Fa-f\d]{8}-[A-Fa-f\d]{4}-[A-Fa-f\d]{4}-[A-Fa-f\d]{4}-[A-Fa-f\d]{12}$') or matches(@root,'^[A-Za-z][A-Za-z\d\-]*$')">(plCdaParamedicRescueSummaryNote): Attribute @root SHALL be of data type 'uid'  - '<value-of select="@root"/>'</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.1.48-2025-02-26T000000.html"
              test="@extension">(plCdaParamedicRescueSummaryNote): attribute @extension 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.1.48-2025-02-26T000000.html"
              test="not(@extension) or string-length(@extension)&gt;0">(plCdaParamedicRescueSummaryNote): Attribute @extension SHALL be of data type 'st'  - '<value-of select="@extension"/>'</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.1.48
Context: /hl7:ClinicalDocument[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.1.48']]/hl7:versionNumber[not(@nullFlavor)]
Item: (plCdaParamedicRescueSummaryNote)
-->
</pattern>
