<?xml version="1.0" encoding="UTF-8"?>
<!--
Template derived pattern
===========================================
ID: 2.16.840.1.113883.3.4424.13.10.4.284
Name: [4] Wezwanie, powód wezwania
Description: Wezwanie, powód wezwania
-->
<pattern xmlns="http://purl.oclc.org/dsdl/schematron"
         id="template-2.16.840.1.113883.3.4424.13.10.4.284-2025-02-26T000000">
   <title>[4] Wezwanie, powód wezwania</title>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.284
Context: *[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.284']]]
Item: (plCdaReasonForAmbulanceDispatchEntry)
-->

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

   <rule fpi="RULC-1"
         context="*[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.284']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.284']]"
         id="d16e13250-false-d51186e0">
      <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.284-2025-02-26T000000.html"
              test="string(@classCode) = ('OBS')">(plCdaReasonForAmbulanceDispatchEntry): 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.284-2025-02-26T000000.html"
              test="string(@moodCode) = ('EVN')">(plCdaReasonForAmbulanceDispatchEntry): 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.284-2025-02-26T000000.html"
              test="count(hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.284']) &gt;= 1">(plCdaReasonForAmbulanceDispatchEntry): element hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.284'] 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.284-2025-02-26T000000.html"
              test="count(hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.284']) &lt;= 1">(plCdaReasonForAmbulanceDispatchEntry): element hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.284'] 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.284-2025-02-26T000000.html"
              test="count(hl7:code[(@code = 'Id' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.1')]) &gt;= 1">(plCdaReasonForAmbulanceDispatchEntry): element hl7:code[(@code = 'Id' 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.284-2025-02-26T000000.html"
              test="count(hl7:code[(@code = 'Id' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.1')]) &lt;= 1">(plCdaReasonForAmbulanceDispatchEntry): element hl7:code[(@code = 'Id' 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.284-2025-02-26T000000.html"
              test="count(hl7:statusCode[@code = 'completed']) &gt;= 1">(plCdaReasonForAmbulanceDispatchEntry): 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.284-2025-02-26T000000.html"
              test="count(hl7:statusCode[@code = 'completed']) &lt;= 1">(plCdaReasonForAmbulanceDispatchEntry): 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.284-2025-02-26T000000.html"
              test="count(hl7:value[not(@nullFlavor)]) &gt;= 1">(plCdaReasonForAmbulanceDispatchEntry): element hl7:value[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.284-2025-02-26T000000.html"
              test="count(hl7:value[not(@nullFlavor)]) &lt;= 1">(plCdaReasonForAmbulanceDispatchEntry): element hl7:value[not(@nullFlavor)] appears too often [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.284
Context: *[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.284']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.284']]/hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.284']
Item: (plCdaReasonForAmbulanceDispatchEntry)
-->

   <rule fpi="RULC-1"
         context="*[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.284']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.284']]/hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.284']"
         id="d16e13256-false-d51238e0">
      <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.284-2025-02-26T000000.html"
              test="string(@root) = ('2.16.840.1.113883.3.4424.13.10.4.284')">(plCdaReasonForAmbulanceDispatchEntry): The value for root SHALL be '2.16.840.1.113883.3.4424.13.10.4.284'. Found: "<value-of select="@root"/>"</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.284
Context: *[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.284']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.284']]/hl7:code[(@code = 'Id' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.1')]
Item: (plCdaReasonForAmbulanceDispatchEntry)
-->

   <rule fpi="RULC-1"
         context="*[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.284']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.284']]/hl7:code[(@code = 'Id' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.1')]"
         id="d16e13261-false-d51250e0">
      <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.284-2025-02-26T000000.html"
              test="@nullFlavor or (@code='Id' and @codeSystem='2.16.840.1.113883.3.4424.13.5.30.1' and @displayName='Powód wezwania' and @codeSystemName='WpisDoKMCR_KMLZRM')">(plCdaReasonForAmbulanceDispatchEntry): The element value SHALL be one of 'code 'Id' codeSystem '2.16.840.1.113883.3.4424.13.5.30.1' displayName='Powód wezwania' codeSystemName='WpisDoKMCR_KMLZRM''.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.284
Context: *[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.284']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.284']]/hl7:statusCode[@code = 'completed']
Item: (plCdaReasonForAmbulanceDispatchEntry)
-->

   <rule fpi="RULC-1"
         context="*[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.284']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.284']]/hl7:statusCode[@code = 'completed']"
         id="d16e13266-false-d51264e0">
      <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.284-2025-02-26T000000.html"
              test="@nullFlavor or (@code='completed')">(plCdaReasonForAmbulanceDispatchEntry): 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.284
Context: *[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.284']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.284']]/hl7:value[not(@nullFlavor)]
Item: (plCdaReasonForAmbulanceDispatchEntry)
-->
</pattern>
