<?xml version="1.0" encoding="UTF-8"?>
<!--
Template derived pattern
===========================================
ID: 2.16.840.1.113883.3.4424.13.10.4.301
Name: [4] Wezwanie zespołu ratownictwa medycznego
Description: Wezwanie zespołu ratownictwa medycznego
-->
<pattern xmlns="http://purl.oclc.org/dsdl/schematron"
         id="template-2.16.840.1.113883.3.4424.13.10.4.301-2025-02-26T000000">
   <title>[4] Wezwanie zespołu ratownictwa medycznego</title>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.301
Context: *[hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']]]
Item: (plCdaEmergencyMedicalServiceEncounter)
-->

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

   <rule fpi="RULC-1"
         context="*[hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']]]/hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']]"
         id="d16e14166-false-d53906e0">
      <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.301-2025-02-26T000000.html"
              test="string(@classCode) = ('ENC')">(plCdaEmergencyMedicalServiceEncounter): The value for classCode SHALL be 'ENC'. 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.301-2025-02-26T000000.html"
              test="string(@moodCode) = ('EVN')">(plCdaEmergencyMedicalServiceEncounter): 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.301-2025-02-26T000000.html"
              test="count(hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']) &gt;= 1">(plCdaEmergencyMedicalServiceEncounter): element hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301'] 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.301-2025-02-26T000000.html"
              test="count(hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']) &lt;= 1">(plCdaEmergencyMedicalServiceEncounter): element hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301'] 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.301-2025-02-26T000000.html"
              test="count(hl7:id[not(@nullFlavor)]) &gt;= 1">(plCdaEmergencyMedicalServiceEncounter): element hl7:id[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.4.301-2025-02-26T000000.html"
              test="count(hl7:id[not(@nullFlavor)]) &lt;= 1">(plCdaEmergencyMedicalServiceEncounter): element hl7:id[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.4.301-2025-02-26T000000.html"
              test="count(hl7:code[(@code = 'I' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.1')]) &gt;= 1">(plCdaEmergencyMedicalServiceEncounter): element hl7:code[(@code = 'I' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.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.4.301-2025-02-26T000000.html"
              test="count(hl7:code[(@code = 'I' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.1')]) &lt;= 1">(plCdaEmergencyMedicalServiceEncounter): element hl7:code[(@code = 'I' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.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.4.301-2025-02-26T000000.html"
              test="count(hl7:statusCode[@code = 'completed']) &gt;= 1">(plCdaEmergencyMedicalServiceEncounter): 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.301-2025-02-26T000000.html"
              test="count(hl7:statusCode[@code = 'completed']) &lt;= 1">(plCdaEmergencyMedicalServiceEncounter): element hl7:statusCode[@code = 'completed'] 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.301-2025-02-26T000000.html"
              test="count(hl7:performer[hl7:assignedEntity[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.2.133']]]) &gt;= 1">(plCdaEmergencyMedicalServiceEncounter): element hl7:performer[hl7:assignedEntity[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.2.133']]] 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.301-2025-02-26T000000.html"
              test="count(hl7:participant[@typeCode='INF'][not(@nullFlavor)]) &gt;= 1">(plCdaEmergencyMedicalServiceEncounter): element hl7:participant[@typeCode='INF'][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.4.301-2025-02-26T000000.html"
              test="count(hl7:participant[@typeCode='INF'][not(@nullFlavor)]) &lt;= 1">(plCdaEmergencyMedicalServiceEncounter): element hl7:participant[@typeCode='INF'][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.4.301-2025-02-26T000000.html"
              test="count(hl7:participant[@typeCode='LOC'][not(@nullFlavor)]) &gt;= 1">(plCdaEmergencyMedicalServiceEncounter): element hl7:participant[@typeCode='LOC'][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.4.301-2025-02-26T000000.html"
              test="count(hl7:participant[@typeCode='LOC'][not(@nullFlavor)]) &lt;= 1">(plCdaEmergencyMedicalServiceEncounter): element hl7:participant[@typeCode='LOC'][not(@nullFlavor)] appears too often [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.301
Context: *[hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']]]/hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']]/hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']
Item: (plCdaEmergencyMedicalServiceEncounter)
-->

   <rule fpi="RULC-1"
         context="*[hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']]]/hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']]/hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']"
         id="d16e14172-false-d53984e0">
      <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.301-2025-02-26T000000.html"
              test="string(@root) = ('2.16.840.1.113883.3.4424.13.10.4.301')">(plCdaEmergencyMedicalServiceEncounter): The value for root SHALL be '2.16.840.1.113883.3.4424.13.10.4.301'. Found: "<value-of select="@root"/>"</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.301
Context: *[hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']]]/hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']]/hl7:id[not(@nullFlavor)]
Item: (plCdaEmergencyMedicalServiceEncounter)
-->

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.301
Context: *[hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']]]/hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']]/hl7:code[(@code = 'I' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.1')]
Item: (plCdaEmergencyMedicalServiceEncounter)
-->

   <rule fpi="RULC-1"
         context="*[hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']]]/hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']]/hl7:code[(@code = 'I' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.1')]"
         id="d16e14179-false-d54004e0">
      <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.301-2025-02-26T000000.html"
              test="@nullFlavor or (@code='I' and @codeSystem='2.16.840.1.113883.3.4424.13.5.30.1' and @displayName='Wezwanie' and @codeSystemName='WpisDoKMCR_KMLZRM')">(plCdaEmergencyMedicalServiceEncounter): The element value SHALL be one of 'code 'I' codeSystem '2.16.840.1.113883.3.4424.13.5.30.1' displayName='Wezwanie' codeSystemName='WpisDoKMCR_KMLZRM''.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.301
Context: *[hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']]]/hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']]/hl7:statusCode[@code = 'completed']
Item: (plCdaEmergencyMedicalServiceEncounter)
-->

   <rule fpi="RULC-1"
         context="*[hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']]]/hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']]/hl7:statusCode[@code = 'completed']"
         id="d16e14185-false-d54018e0">
      <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.301-2025-02-26T000000.html"
              test="@nullFlavor or (@code='completed')">(plCdaEmergencyMedicalServiceEncounter): The element value SHALL be one of 'code 'completed''.</assert>
   </rule>

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.301
Context: *[hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']]]/hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']]/hl7:performer[hl7:assignedEntity[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.2.133']]]
Item: (plCdaEmergencyMedicalServiceEncounter)
-->
   <rule fpi="RULC-1"
         context="*[hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']]]/hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']]/hl7:performer[hl7:assignedEntity[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.2.133']]]">
      <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.301-2025-02-26T000000.html"
              test="string(@typeCode) = ('PRF') or not(@typeCode)">(plCdaEmergencyMedicalServiceEncounter): The value for typeCode SHALL be 'PRF'. Found: "<value-of select="@typeCode"/>"</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.301
Context: *[hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']]]/hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']]/hl7:participant[@typeCode='INF'][not(@nullFlavor)]
Item: (plCdaEmergencyMedicalServiceEncounter)
-->

   <rule fpi="RULC-1"
         context="*[hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']]]/hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']]/hl7:participant[@typeCode='INF'][not(@nullFlavor)]"
         id="d16e14195-false-d54052e0">
      <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.301-2025-02-26T000000.html"
              test="string(@typeCode) = ('INF')">(plCdaEmergencyMedicalServiceEncounter): The value for typeCode SHALL be 'INF'. Found: "<value-of select="@typeCode"/>"</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.301-2025-02-26T000000.html"
              test="count(hl7:participantRole[hl7:code[(@code = 'If' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.1')]]) &gt;= 1">(plCdaEmergencyMedicalServiceEncounter): element hl7:participantRole[hl7:code[(@code = 'If' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.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.4.301-2025-02-26T000000.html"
              test="count(hl7:participantRole[hl7:code[(@code = 'If' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.1')]]) &lt;= 1">(plCdaEmergencyMedicalServiceEncounter): element hl7:participantRole[hl7:code[(@code = 'If' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.1')]] appears too often [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.301
Context: *[hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']]]/hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']]/hl7:participant[@typeCode='INF'][not(@nullFlavor)]/hl7:participantRole[hl7:code[(@code = 'If' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.1')]]
Item: (plCdaEmergencyMedicalServiceEncounter)
-->

   <rule fpi="RULC-1"
         context="*[hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']]]/hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']]/hl7:participant[@typeCode='INF'][not(@nullFlavor)]/hl7:participantRole[hl7:code[(@code = 'If' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.1')]]"
         id="d16e14199-false-d54074e0">
      <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.301-2025-02-26T000000.html"
              test="string(@classCode) = ('ROL') or not(@classCode)">(plCdaEmergencyMedicalServiceEncounter): The value for classCode SHALL be 'ROL'. 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.301-2025-02-26T000000.html"
              test="count(hl7:id[not(@nullFlavor)]) &gt;= 1">(plCdaEmergencyMedicalServiceEncounter): element hl7:id[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.4.301-2025-02-26T000000.html"
              test="count(hl7:id[not(@nullFlavor)]) &lt;= 1">(plCdaEmergencyMedicalServiceEncounter): element hl7:id[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.4.301-2025-02-26T000000.html"
              test="count(hl7:code[(@code = 'If' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.1')]) &gt;= 1">(plCdaEmergencyMedicalServiceEncounter): element hl7:code[(@code = 'If' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.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.4.301-2025-02-26T000000.html"
              test="count(hl7:code[(@code = 'If' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.1')]) &lt;= 1">(plCdaEmergencyMedicalServiceEncounter): element hl7:code[(@code = 'If' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.1')] appears too often [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.301
Context: *[hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']]]/hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']]/hl7:participant[@typeCode='INF'][not(@nullFlavor)]/hl7:participantRole[hl7:code[(@code = 'If' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.1')]]/hl7:id[not(@nullFlavor)]
Item: (plCdaEmergencyMedicalServiceEncounter)
-->

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.301
Context: *[hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']]]/hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']]/hl7:participant[@typeCode='INF'][not(@nullFlavor)]/hl7:participantRole[hl7:code[(@code = 'If' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.1')]]/hl7:code[(@code = 'If' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.1')]
Item: (plCdaEmergencyMedicalServiceEncounter)
-->

   <rule fpi="RULC-1"
         context="*[hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']]]/hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']]/hl7:participant[@typeCode='INF'][not(@nullFlavor)]/hl7:participantRole[hl7:code[(@code = 'If' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.1')]]/hl7:code[(@code = 'If' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.1')]"
         id="d16e14205-false-d54112e0">
      <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.301-2025-02-26T000000.html"
              test="@nullFlavor or (@code='If' and @codeSystem='2.16.840.1.113883.3.4424.13.5.30.1' and @displayName='Kod dyspozytora medycznego zlecejącego wyjazd' and @codeSystemName='WpisDoKMCR_KMLZRM')">(plCdaEmergencyMedicalServiceEncounter): The element value SHALL be one of 'code 'If' codeSystem '2.16.840.1.113883.3.4424.13.5.30.1' displayName='Kod dyspozytora medycznego zlecejącego wyjazd' codeSystemName='WpisDoKMCR_KMLZRM''.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.301
Context: *[hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']]]/hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']]/hl7:participant[@typeCode='LOC'][not(@nullFlavor)]
Item: (plCdaEmergencyMedicalServiceEncounter)
-->

   <rule fpi="RULC-1"
         context="*[hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']]]/hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']]/hl7:participant[@typeCode='LOC'][not(@nullFlavor)]"
         id="d16e14212-false-d54123e0">
      <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.301-2025-02-26T000000.html"
              test="string(@typeCode) = ('LOC')">(plCdaEmergencyMedicalServiceEncounter): The value for typeCode SHALL be 'LOC'. Found: "<value-of select="@typeCode"/>"</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.301-2025-02-26T000000.html"
              test="count(hl7:participantRole[hl7:code[(@code = 'Ia' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.1')]]) &gt;= 1">(plCdaEmergencyMedicalServiceEncounter): element hl7:participantRole[hl7:code[(@code = 'Ia' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.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.4.301-2025-02-26T000000.html"
              test="count(hl7:participantRole[hl7:code[(@code = 'Ia' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.1')]]) &lt;= 1">(plCdaEmergencyMedicalServiceEncounter): element hl7:participantRole[hl7:code[(@code = 'Ia' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.1')]] appears too often [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.301
Context: *[hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']]]/hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']]/hl7:participant[@typeCode='LOC'][not(@nullFlavor)]/hl7:participantRole[hl7:code[(@code = 'Ia' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.1')]]
Item: (plCdaEmergencyMedicalServiceEncounter)
-->

   <rule fpi="RULC-1"
         context="*[hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']]]/hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']]/hl7:participant[@typeCode='LOC'][not(@nullFlavor)]/hl7:participantRole[hl7:code[(@code = 'Ia' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.1')]]"
         id="d16e14216-false-d54145e0">
      <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.301-2025-02-26T000000.html"
              test="string(@classCode) = ('SDLOC')">(plCdaEmergencyMedicalServiceEncounter): The value for classCode SHALL be 'SDLOC'. 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.301-2025-02-26T000000.html"
              test="count(hl7:code[(@code = 'Ia' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.1')]) &gt;= 1">(plCdaEmergencyMedicalServiceEncounter): element hl7:code[(@code = 'Ia' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.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.4.301-2025-02-26T000000.html"
              test="count(hl7:code[(@code = 'Ia' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.1')]) &lt;= 1">(plCdaEmergencyMedicalServiceEncounter): element hl7:code[(@code = 'Ia' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.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.4.301-2025-02-26T000000.html"
              test="count(hl7:addr[not(@nullFlavor)]) &gt;= 1">(plCdaEmergencyMedicalServiceEncounter): element hl7:addr[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.4.301-2025-02-26T000000.html"
              test="count(hl7:addr[not(@nullFlavor)]) &lt;= 1">(plCdaEmergencyMedicalServiceEncounter): element hl7:addr[not(@nullFlavor)] appears too often [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.301
Context: *[hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']]]/hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']]/hl7:participant[@typeCode='LOC'][not(@nullFlavor)]/hl7:participantRole[hl7:code[(@code = 'Ia' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.1')]]/hl7:code[(@code = 'Ia' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.1')]
Item: (plCdaEmergencyMedicalServiceEncounter)
-->

   <rule fpi="RULC-1"
         context="*[hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']]]/hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']]/hl7:participant[@typeCode='LOC'][not(@nullFlavor)]/hl7:participantRole[hl7:code[(@code = 'Ia' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.1')]]/hl7:code[(@code = 'Ia' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.1')]"
         id="d16e14220-false-d54175e0">
      <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.301-2025-02-26T000000.html"
              test="@nullFlavor or (@code='Ia' and @codeSystem='2.16.840.1.113883.3.4424.13.5.30.1' and @displayName='Adres wezwania' and @codeSystemName='WpisDoKMCR_KMLZRM')">(plCdaEmergencyMedicalServiceEncounter): The element value SHALL be one of 'code 'Ia' codeSystem '2.16.840.1.113883.3.4424.13.5.30.1' displayName='Adres wezwania' codeSystemName='WpisDoKMCR_KMLZRM''.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.301
Context: *[hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']]]/hl7:encounter[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.301']]/hl7:participant[@typeCode='LOC'][not(@nullFlavor)]/hl7:participantRole[hl7:code[(@code = 'Ia' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.1')]]/hl7:addr[not(@nullFlavor)]
Item: (plCdaEmergencyMedicalServiceEncounter)
-->
</pattern>
