<?xml version="1.0" encoding="UTF-8"?>
<!--
Template derived pattern
===========================================
ID: 2.16.840.1.113883.3.4424.13.10.4.325
Name: [4] Uprawnienia i dane płatnika na karcie medycznych czynności ratunkowych
Description: Uprawnienia i dane płatnika na karcie medycznych czynności ratunkowych
-->
<pattern xmlns="http://purl.oclc.org/dsdl/schematron"
         id="template-2.16.840.1.113883.3.4424.13.10.4.325-2025-02-26T000000-closed">
   <title>[4] Uprawnienia i dane płatnika na karcie medycznych czynności ratunkowych</title>

   <!-- Checking undefined contents for template/element @isClosed="true". Match context that we did not already match -->
   <rule fpi="RUL-QQQ"
         context="*[hl7:act[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.325']]]/*[not(@xsi:nil = 'true')][not(self::hl7:act[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.325']])]"
         id="d16e14606-true-d56727e0">
      <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.325-2025-02-26T000000.html"
              test="not(.)">(plCdaParamedicRescueSummaryNoteCoverageActivityEntry)/d16e14606-true-d56727e0: '<value-of select="name(..)"/>' is defined as closed, and this element '<name/>' is not allowed, or not allowed with this content. This may concern the templateId, code or id. Expected in this context:  hl7:act[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.325']] (rule-reference: d16e14606-true-d56727e0)</assert>
   </rule>

   <!-- Checking undefined contents for template/element @isClosed="true". Match context that we did not already match -->
   <rule fpi="RUL-QQQ"
         context="*[hl7:act[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.325']]]/hl7:act[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.325']]/*[not(@xsi:nil = 'true')][not(self::hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.325'] | self::hl7:id | self::hl7:code[(@code = '48768-6' and @codeSystem = '2.16.840.1.113883.6.1')] | self::hl7:statusCode[@code = 'completed'] | self::hl7:entryRelationship[hl7:act[hl7:code[(@code = 'PUBLICPOL' and @codeSystem = '2.16.840.1.113883.5.4')]]])]"
         id="d16e14653-true-d56770e0">
      <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.325-2025-02-26T000000.html"
              test="not(.)">(plCdaParamedicRescueSummaryNoteCoverageActivityEntry)/d16e14653-true-d56770e0: '<value-of select="name(..)"/>' is defined as closed, and this element '<name/>' is not allowed, or not allowed with this content. This may concern the templateId, code or id. Expected in this context:  hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.325'] | hl7:id | hl7:code[(@code = '48768-6' and @codeSystem = '2.16.840.1.113883.6.1')] | hl7:statusCode[@code = 'completed'] | hl7:entryRelationship[hl7:act[hl7:code[(@code = 'PUBLICPOL' and @codeSystem = '2.16.840.1.113883.5.4')]]] (rule-reference: d16e14653-true-d56770e0)</assert>
   </rule>

   <!-- Checking undefined contents for template/element @isClosed="true". Match context that we did not already match -->
   <rule fpi="RUL-QQQ"
         context="*[hl7:act[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.325']]]/hl7:act[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.325']]/hl7:entryRelationship[hl7:act[hl7:code[(@code = 'PUBLICPOL' and @codeSystem = '2.16.840.1.113883.5.4')]]]/*[not(@xsi:nil = 'true')][not(self::hl7:act[hl7:code[(@code = 'PUBLICPOL' and @codeSystem = '2.16.840.1.113883.5.4')]])]"
         id="d16e14677-true-d56815e0">
      <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.325-2025-02-26T000000.html"
              test="not(.)">(plCdaParamedicRescueSummaryNoteCoverageActivityEntry)/d16e14677-true-d56815e0: '<value-of select="name(..)"/>' is defined as closed, and this element '<name/>' is not allowed, or not allowed with this content. This may concern the templateId, code or id. Expected in this context:  hl7:act[hl7:code[(@code = 'PUBLICPOL' and @codeSystem = '2.16.840.1.113883.5.4')]] (rule-reference: d16e14677-true-d56815e0)</assert>
   </rule>

   <!-- Checking undefined contents for template/element @isClosed="true". Match context that we did not already match -->
   <rule fpi="RUL-QQQ"
         context="*[hl7:act[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.325']]]/hl7:act[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.325']]/hl7:entryRelationship[hl7:act[hl7:code[(@code = 'PUBLICPOL' and @codeSystem = '2.16.840.1.113883.5.4')]]]/hl7:act[hl7:code[(@code = 'PUBLICPOL' and @codeSystem = '2.16.840.1.113883.5.4')]]/*[not(@xsi:nil = 'true')][not(self::hl7:id[@nullFlavor = 'NA'] | self::hl7:code[(@code = 'PUBLICPOL' and @codeSystem = '2.16.840.1.113883.5.4')] | self::hl7:statusCode[@code = 'completed'] | self::hl7:performer[@typeCode = 'PRF'][hl7:assignedEntity])]"
         id="d56796e6-true-d56849e0">
      <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.325-2025-02-26T000000.html"
              test="not(.)">(plCdaParamedicRescueSummaryNoteCoverageActivityEntry)/d56796e6-true-d56849e0: '<value-of select="name(..)"/>' is defined as closed, and this element '<name/>' is not allowed, or not allowed with this content. This may concern the templateId, code or id. Expected in this context:  hl7:id[@nullFlavor = 'NA'] | hl7:code[(@code = 'PUBLICPOL' and @codeSystem = '2.16.840.1.113883.5.4')] | hl7:statusCode[@code = 'completed'] | hl7:performer[@typeCode = 'PRF'][hl7:assignedEntity] (rule-reference: d56796e6-true-d56849e0)</assert>
   </rule>

   <!-- Checking undefined contents for template/element @isClosed="true". Match context that we did not already match -->
   <rule fpi="RUL-QQQ"
         context="*[hl7:act[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.325']]]/hl7:act[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.325']]/hl7:entryRelationship[hl7:act[hl7:code[(@code = 'PUBLICPOL' and @codeSystem = '2.16.840.1.113883.5.4')]]]/hl7:act[hl7:code[(@code = 'PUBLICPOL' and @codeSystem = '2.16.840.1.113883.5.4')]]/hl7:performer[@typeCode = 'PRF'][hl7:assignedEntity]/*[not(@xsi:nil = 'true')][not(self::hl7:assignedEntity)]"
         id="d56796e34-true-d56880e0">
      <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.325-2025-02-26T000000.html"
              test="not(.)">(plCdaParamedicRescueSummaryNoteCoverageActivityEntry)/d56796e34-true-d56880e0: '<value-of select="name(..)"/>' is defined as closed, and this element '<name/>' is not allowed, or not allowed with this content. This may concern the templateId, code or id. Expected in this context:  hl7:assignedEntity (rule-reference: d56796e34-true-d56880e0)</assert>
   </rule>

   <!-- Checking undefined contents for template/element @isClosed="true". Match context that we did not already match -->
   <rule fpi="RUL-QQQ"
         context="*[hl7:act[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.325']]]/hl7:act[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.325']]/hl7:entryRelationship[hl7:act[hl7:code[(@code = 'PUBLICPOL' and @codeSystem = '2.16.840.1.113883.5.4')]]]/hl7:act[hl7:code[(@code = 'PUBLICPOL' and @codeSystem = '2.16.840.1.113883.5.4')]]/hl7:performer[@typeCode = 'PRF'][hl7:assignedEntity]/hl7:assignedEntity/*[not(@xsi:nil = 'true')][not(self::hl7:id[@root='2.16.840.1.113883.3.4424.3.1'] | self::hl7:id[@root='1.0.3166.1'] | self::hl7:id[@root='2.16.840.1.113883.3.4424.11.1.49'])]"
         id="d56796e38-true-d56889e0">
      <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.325-2025-02-26T000000.html"
              test="not(.)">(plCdaParamedicRescueSummaryNoteCoverageActivityEntry)/d56796e38-true-d56889e0: '<value-of select="name(..)"/>' is defined as closed, and this element '<name/>' is not allowed, or not allowed with this content. This may concern the templateId, code or id. Expected in this context:  hl7:id[@root='2.16.840.1.113883.3.4424.3.1'] | hl7:id[@root='1.0.3166.1'] | hl7:id[@root='2.16.840.1.113883.3.4424.11.1.49'] (rule-reference: d56796e38-true-d56889e0)</assert>
   </rule>
</pattern>
