<?xml version="1.0" encoding="UTF-8"?>
<!--
Template derived pattern
===========================================
ID: 2.16.840.1.113883.3.4424.13.10.4.274
Name: [4] Ocena obrażeń ciała
Description: Ocena obrażeń ciała
-->
<pattern xmlns="http://purl.oclc.org/dsdl/schematron"
         id="template-2.16.840.1.113883.3.4424.13.10.4.274-2025-02-26T000000">
   <title>[4] Ocena obrażeń ciała</title>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.274
Context: *[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]]
Item: (plCdaInjuryDisorderEntry)
-->

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

   <rule fpi="RULC-1"
         context="*[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]"
         id="d16e10693-false-d41633e0">
      <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.274-2025-02-26T000000.html"
              test="string(@classCode) = ('OBS')">(plCdaInjuryDisorderEntry): 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.274-2025-02-26T000000.html"
              test="string(@moodCode) = ('EVN')">(plCdaInjuryDisorderEntry): 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.274-2025-02-26T000000.html"
              test="count(hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']) &gt;= 1">(plCdaInjuryDisorderEntry): element hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274'] 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.274-2025-02-26T000000.html"
              test="count(hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']) &lt;= 1">(plCdaInjuryDisorderEntry): element hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274'] 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.274-2025-02-26T000000.html"
              test="count(hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.240-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]) &gt;= 1">(plCdaInjuryDisorderEntry): element hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.240-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.4.274-2025-02-26T000000.html"
              test="count(hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.240-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]) &lt;= 1">(plCdaInjuryDisorderEntry): element hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.240-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.4.274-2025-02-26T000000.html"
              test="count(hl7:statusCode[@code = 'completed']) &gt;= 1">(plCdaInjuryDisorderEntry): 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.274-2025-02-26T000000.html"
              test="count(hl7:statusCode[@code = 'completed']) &lt;= 1">(plCdaInjuryDisorderEntry): 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.274-2025-02-26T000000.html"
              test="count(hl7:targetSiteCode[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.241-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]) &gt;= 1">(plCdaInjuryDisorderEntry): element hl7:targetSiteCode[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.241-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.4.274-2025-02-26T000000.html"
              test="count(hl7:targetSiteCode[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.241-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]) &lt;= 1">(plCdaInjuryDisorderEntry): element hl7:targetSiteCode[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.241-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.4.274-2025-02-26T000000.html"
              test="count(hl7:entryRelationship[hl7:observation/hl7:code/@code='OWZ']) &lt;= 1">(plCdaInjuryDisorderEntry): element hl7:entryRelationship[hl7:observation/hl7:code/@code='OWZ'] appears too often [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.274
Context: *[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]/hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']
Item: (plCdaInjuryDisorderEntry)
-->

   <rule fpi="RULC-1"
         context="*[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]/hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']"
         id="d16e10699-false-d41698e0">
      <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.274-2025-02-26T000000.html"
              test="string(@root) = ('2.16.840.1.113883.3.4424.13.10.4.274')">(plCdaInjuryDisorderEntry): The value for root SHALL be '2.16.840.1.113883.3.4424.13.10.4.274'. Found: "<value-of select="@root"/>"</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.274
Context: *[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]/hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.240-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]
Item: (plCdaInjuryDisorderEntry)
-->

   <rule fpi="RULC-1"
         context="*[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]/hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.240-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]"
         id="d16e10704-false-d41712e0">
      <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.4.274-2025-02-26T000000.html"
              test="@nullFlavor or exists(doc('include/voc-2.16.840.1.113883.3.4424.13.11.240-DYNAMIC.xml')//valueSet[1][conceptList/concept[@code = $theCode][@codeSystem = $theCodeSystem]])">(plCdaInjuryDisorderEntry): The element value SHALL be one of '2.16.840.1.113883.3.4424.13.11.240 Rodzaj obrażenia (DYNAMIC)'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.274
Context: *[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]/hl7:statusCode[@code = 'completed']
Item: (plCdaInjuryDisorderEntry)
-->

   <rule fpi="RULC-1"
         context="*[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]/hl7:statusCode[@code = 'completed']"
         id="d16e10711-false-d41730e0">
      <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.274-2025-02-26T000000.html"
              test="@nullFlavor or (@code='completed')">(plCdaInjuryDisorderEntry): 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.274
Context: *[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]/hl7:targetSiteCode[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.241-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]
Item: (plCdaInjuryDisorderEntry)
-->

   <rule fpi="RULC-1"
         context="*[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]/hl7:targetSiteCode[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.241-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]"
         id="d16e10717-false-d41746e0">
      <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.4.274-2025-02-26T000000.html"
              test="@nullFlavor or exists(doc('include/voc-2.16.840.1.113883.3.4424.13.11.241-DYNAMIC.xml')//valueSet[1][conceptList/concept[@code = $theCode][@codeSystem = $theCodeSystem]])">(plCdaInjuryDisorderEntry): The element value SHALL be one of '2.16.840.1.113883.3.4424.13.11.241 Obszar ciała (DYNAMIC)'.</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.274-2025-02-26T000000.html"
              test="count(hl7:qualifier[hl7:name/@code='106233006'][not(@nullFlavor)]) &gt;= 1">(plCdaInjuryDisorderEntry): element hl7:qualifier[hl7:name/@code='106233006'][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.274-2025-02-26T000000.html"
              test="count(hl7:qualifier[hl7:name/@code='106233006'][not(@nullFlavor)]) &lt;= 1">(plCdaInjuryDisorderEntry): element hl7:qualifier[hl7:name/@code='106233006'][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.274-2025-02-26T000000.html"
              test="count(hl7:qualifier[hl7:name/@code='272425003'][not(@nullFlavor)]) &gt;= 1">(plCdaInjuryDisorderEntry): element hl7:qualifier[hl7:name/@code='272425003'][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.274-2025-02-26T000000.html"
              test="count(hl7:qualifier[hl7:name/@code='272425003'][not(@nullFlavor)]) &lt;= 1">(plCdaInjuryDisorderEntry): element hl7:qualifier[hl7:name/@code='272425003'][not(@nullFlavor)] appears too often [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.274
Context: *[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]/hl7:targetSiteCode[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.241-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]/hl7:qualifier[hl7:name/@code='106233006'][not(@nullFlavor)]
Item: (plCdaInjuryDisorderEntry)
-->

   <rule fpi="RULC-1"
         context="*[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]/hl7:targetSiteCode[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.241-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]/hl7:qualifier[hl7:name/@code='106233006'][not(@nullFlavor)]"
         id="d16e10723-false-d41773e0">
      <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.274-2025-02-26T000000.html"
              test="count(hl7:name[(@code = '106233006' and @codeSystem = '2.16.840.1.113883.6.96')]) &gt;= 1">(plCdaInjuryDisorderEntry): element hl7:name[(@code = '106233006' 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.274-2025-02-26T000000.html"
              test="count(hl7:name[(@code = '106233006' and @codeSystem = '2.16.840.1.113883.6.96')]) &lt;= 1">(plCdaInjuryDisorderEntry): element hl7:name[(@code = '106233006' 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.274-2025-02-26T000000.html"
              test="count(hl7:value[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.243-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]) &gt;= 1">(plCdaInjuryDisorderEntry): element hl7:value[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.243-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.4.274-2025-02-26T000000.html"
              test="count(hl7:value[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.243-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]) &lt;= 1">(plCdaInjuryDisorderEntry): element hl7:value[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.243-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)] appears too often [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.274
Context: *[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]/hl7:targetSiteCode[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.241-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]/hl7:qualifier[hl7:name/@code='106233006'][not(@nullFlavor)]/hl7:name[(@code = '106233006' and @codeSystem = '2.16.840.1.113883.6.96')]
Item: (plCdaInjuryDisorderEntry)
-->

   <rule fpi="RULC-1"
         context="*[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]/hl7:targetSiteCode[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.241-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]/hl7:qualifier[hl7:name/@code='106233006'][not(@nullFlavor)]/hl7:name[(@code = '106233006' and @codeSystem = '2.16.840.1.113883.6.96')]"
         id="d16e10725-false-d41802e0">
      <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.274-2025-02-26T000000.html"
              test="@nullFlavor or (@code='106233006' and @codeSystem='2.16.840.1.113883.6.96' and @displayName='Topographical modifier (qualifier value)' and @codeSystemName='SNOMED-CT')">(plCdaInjuryDisorderEntry): The element value SHALL be one of 'code '106233006' codeSystem '2.16.840.1.113883.6.96' displayName='Topographical modifier (qualifier value)' codeSystemName='SNOMED-CT''.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.274
Context: *[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]/hl7:targetSiteCode[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.241-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]/hl7:qualifier[hl7:name/@code='106233006'][not(@nullFlavor)]/hl7:value[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.243-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]
Item: (plCdaInjuryDisorderEntry)
-->

   <rule fpi="RULC-1"
         context="*[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]/hl7:targetSiteCode[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.241-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]/hl7:qualifier[hl7:name/@code='106233006'][not(@nullFlavor)]/hl7:value[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.243-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]"
         id="d16e10730-false-d41818e0">
      <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.4.274-2025-02-26T000000.html"
              test="@nullFlavor or exists(doc('include/voc-2.16.840.1.113883.3.4424.13.11.243-DYNAMIC.xml')//valueSet[1][conceptList/concept[@code = $theCode][@codeSystem = $theCodeSystem]])">(plCdaInjuryDisorderEntry): The element value SHALL be one of '2.16.840.1.113883.3.4424.13.11.243 Strona ciała (DYNAMIC)'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.274
Context: *[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]/hl7:targetSiteCode[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.241-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]/hl7:qualifier[hl7:name/@code='272425003'][not(@nullFlavor)]
Item: (plCdaInjuryDisorderEntry)
-->

   <rule fpi="RULC-1"
         context="*[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]/hl7:targetSiteCode[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.241-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]/hl7:qualifier[hl7:name/@code='272425003'][not(@nullFlavor)]"
         id="d16e10738-false-d41833e0">
      <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.274-2025-02-26T000000.html"
              test="count(hl7:name[(@code = '272425003' and @codeSystem = '2.16.840.1.113883.6.96')]) &gt;= 1">(plCdaInjuryDisorderEntry): element hl7:name[(@code = '272425003' 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.274-2025-02-26T000000.html"
              test="count(hl7:name[(@code = '272425003' and @codeSystem = '2.16.840.1.113883.6.96')]) &lt;= 1">(plCdaInjuryDisorderEntry): element hl7:name[(@code = '272425003' 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.274-2025-02-26T000000.html"
              test="count(hl7:value[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.242-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]) &gt;= 1">(plCdaInjuryDisorderEntry): element hl7:value[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.242-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.4.274-2025-02-26T000000.html"
              test="count(hl7:value[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.242-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]) &lt;= 1">(plCdaInjuryDisorderEntry): element hl7:value[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.242-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)] appears too often [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.274
Context: *[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]/hl7:targetSiteCode[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.241-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]/hl7:qualifier[hl7:name/@code='272425003'][not(@nullFlavor)]/hl7:name[(@code = '272425003' and @codeSystem = '2.16.840.1.113883.6.96')]
Item: (plCdaInjuryDisorderEntry)
-->

   <rule fpi="RULC-1"
         context="*[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]/hl7:targetSiteCode[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.241-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]/hl7:qualifier[hl7:name/@code='272425003'][not(@nullFlavor)]/hl7:name[(@code = '272425003' and @codeSystem = '2.16.840.1.113883.6.96')]"
         id="d16e10740-false-d41862e0">
      <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.274-2025-02-26T000000.html"
              test="@nullFlavor or (@code='272425003' and @codeSystem='2.16.840.1.113883.6.96' and @displayName='General site descriptor (qualifier value)' and @codeSystemName='SNOMED-CT')">(plCdaInjuryDisorderEntry): The element value SHALL be one of 'code '272425003' codeSystem '2.16.840.1.113883.6.96' displayName='General site descriptor (qualifier value)' codeSystemName='SNOMED-CT''.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.274
Context: *[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]/hl7:targetSiteCode[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.241-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]/hl7:qualifier[hl7:name/@code='272425003'][not(@nullFlavor)]/hl7:value[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.242-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]
Item: (plCdaInjuryDisorderEntry)
-->

   <rule fpi="RULC-1"
         context="*[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]/hl7:targetSiteCode[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.241-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]/hl7:qualifier[hl7:name/@code='272425003'][not(@nullFlavor)]/hl7:value[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.242-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]"
         id="d16e10745-false-d41878e0">
      <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.4.274-2025-02-26T000000.html"
              test="@nullFlavor or exists(doc('include/voc-2.16.840.1.113883.3.4424.13.11.242-DYNAMIC.xml')//valueSet[1][conceptList/concept[@code = $theCode][@codeSystem = $theCodeSystem]])">(plCdaInjuryDisorderEntry): The element value SHALL be one of '2.16.840.1.113883.3.4424.13.11.242 Widok ciała (DYNAMIC)'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.274
Context: *[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]/hl7:entryRelationship[hl7:observation/hl7:code/@code=('O1S','O2S','O3S','O4S')]
Item: (plCdaInjuryDisorderEntry)
-->

   <rule fpi="RULC-1"
         context="*[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]/hl7:entryRelationship[hl7:observation/hl7:code/@code=('O1S','O2S','O3S','O4S')]"
         id="d16e10754-false-d41893e0">
      <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.274-2025-02-26T000000.html"
              test="string(@typeCode) = ('COMP')">(plCdaInjuryDisorderEntry): The value for typeCode SHALL be 'COMP'. 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.274-2025-02-26T000000.html"
              test="count(hl7:observation[hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.246-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]]) &gt;= 1">(plCdaInjuryDisorderEntry): element hl7:observation[hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.246-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.4.274-2025-02-26T000000.html"
              test="count(hl7:observation[hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.246-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]]) &lt;= 1">(plCdaInjuryDisorderEntry): element hl7:observation[hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.246-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]] appears too often [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.274
Context: *[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]/hl7:entryRelationship[hl7:observation/hl7:code/@code=('O1S','O2S','O3S','O4S')]/hl7:observation[hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.246-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]]
Item: (plCdaInjuryDisorderEntry)
-->

   <rule fpi="RULC-1"
         context="*[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]/hl7:entryRelationship[hl7:observation/hl7:code/@code=('O1S','O2S','O3S','O4S')]/hl7:observation[hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.246-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]]"
         id="d16e10758-false-d41919e0">
      <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.274-2025-02-26T000000.html"
              test="string(@classCode) = ('OBS')">(plCdaInjuryDisorderEntry): 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.274-2025-02-26T000000.html"
              test="string(@moodCode) = ('EVN')">(plCdaInjuryDisorderEntry): 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.274-2025-02-26T000000.html"
              test="count(hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.246-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]) &gt;= 1">(plCdaInjuryDisorderEntry): element hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.246-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.4.274-2025-02-26T000000.html"
              test="count(hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.246-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]) &lt;= 1">(plCdaInjuryDisorderEntry): element hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.246-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.4.274-2025-02-26T000000.html"
              test="count(hl7:statusCode[@code = 'completed']) &gt;= 1">(plCdaInjuryDisorderEntry): 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.274-2025-02-26T000000.html"
              test="count(hl7:statusCode[@code = 'completed']) &lt;= 1">(plCdaInjuryDisorderEntry): 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.274-2025-02-26T000000.html"
              test="count(hl7:value[not(@nullFlavor)]) &gt;= 1">(plCdaInjuryDisorderEntry): 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.274-2025-02-26T000000.html"
              test="count(hl7:value[not(@nullFlavor)]) &lt;= 1">(plCdaInjuryDisorderEntry): 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.274
Context: *[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]/hl7:entryRelationship[hl7:observation/hl7:code/@code=('O1S','O2S','O3S','O4S')]/hl7:observation[hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.246-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]]/hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.246-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]
Item: (plCdaInjuryDisorderEntry)
-->

   <rule fpi="RULC-1"
         context="*[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]/hl7:entryRelationship[hl7:observation/hl7:code/@code=('O1S','O2S','O3S','O4S')]/hl7:observation[hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.246-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]]/hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.246-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]"
         id="d16e10764-false-d41966e0">
      <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.4.274-2025-02-26T000000.html"
              test="@nullFlavor or exists(doc('include/voc-2.16.840.1.113883.3.4424.13.11.246-DYNAMIC.xml')//valueSet[1][conceptList/concept[@code = $theCode][@codeSystem = $theCodeSystem]])">(plCdaInjuryDisorderEntry): The element value SHALL be one of '2.16.840.1.113883.3.4424.13.11.246 Rodzaje obserwacji związanych z oparzeniami ciała (DYNAMIC)'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.274
Context: *[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]/hl7:entryRelationship[hl7:observation/hl7:code/@code=('O1S','O2S','O3S','O4S')]/hl7:observation[hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.246-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]]/hl7:statusCode[@code = 'completed']
Item: (plCdaInjuryDisorderEntry)
-->

   <rule fpi="RULC-1"
         context="*[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]/hl7:entryRelationship[hl7:observation/hl7:code/@code=('O1S','O2S','O3S','O4S')]/hl7:observation[hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.246-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]]/hl7:statusCode[@code = 'completed']"
         id="d16e10771-false-d41984e0">
      <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.274-2025-02-26T000000.html"
              test="@nullFlavor or (@code='completed')">(plCdaInjuryDisorderEntry): 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.274
Context: *[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]/hl7:entryRelationship[hl7:observation/hl7:code/@code=('O1S','O2S','O3S','O4S')]/hl7:observation[hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.246-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]]/hl7:value[not(@nullFlavor)]
Item: (plCdaInjuryDisorderEntry)
-->

   <rule fpi="RULC-1"
         context="*[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]/hl7:entryRelationship[hl7:observation/hl7:code/@code=('O1S','O2S','O3S','O4S')]/hl7:observation[hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.246-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]]/hl7:value[not(@nullFlavor)]"
         id="d16e10776-false-d41997e0">
      <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.274-2025-02-26T000000.html"
              test="@value">(plCdaInjuryDisorderEntry): attribute @value 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.274-2025-02-26T000000.html"
              test="not(@value) or matches(string(@value), '^[-+]?\d*\.?[0-9]+([eE][-+]?\d+)?$')">(plCdaInjuryDisorderEntry): Attribute @value is not a valid real number <value-of select="@value"/>
      </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.274-2025-02-26T000000.html"
              test="string(@unit) = ('%')">(plCdaInjuryDisorderEntry): The value for unit SHALL be '%'. Found: "<value-of select="@unit"/>"</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.274
Context: *[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]/hl7:entryRelationship[hl7:observation/hl7:code/@code='OWZ']
Item: (plCdaInjuryDisorderEntry)
-->

   <rule fpi="RULC-1"
         context="*[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]/hl7:entryRelationship[hl7:observation/hl7:code/@code='OWZ']"
         id="d16e10790-false-d42011e0">
      <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.274-2025-02-26T000000.html"
              test="string(@typeCode) = ('COMP')">(plCdaInjuryDisorderEntry): The value for typeCode SHALL be 'COMP'. 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.274-2025-02-26T000000.html"
              test="count(hl7:observation[hl7:code[(@code = 'OWZ' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.13')]]) &gt;= 1">(plCdaInjuryDisorderEntry): element hl7:observation[hl7:code[(@code = 'OWZ' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.13')]] 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.274-2025-02-26T000000.html"
              test="count(hl7:observation[hl7:code[(@code = 'OWZ' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.13')]]) &lt;= 1">(plCdaInjuryDisorderEntry): element hl7:observation[hl7:code[(@code = 'OWZ' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.13')]] appears too often [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.274
Context: *[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]/hl7:entryRelationship[hl7:observation/hl7:code/@code='OWZ']/hl7:observation[hl7:code[(@code = 'OWZ' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.13')]]
Item: (plCdaInjuryDisorderEntry)
-->

   <rule fpi="RULC-1"
         context="*[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]/hl7:entryRelationship[hl7:observation/hl7:code/@code='OWZ']/hl7:observation[hl7:code[(@code = 'OWZ' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.13')]]"
         id="d16e10794-false-d42033e0">
      <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.274-2025-02-26T000000.html"
              test="string(@classCode) = ('OBS')">(plCdaInjuryDisorderEntry): 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.274-2025-02-26T000000.html"
              test="string(@moodCode) = ('EVN')">(plCdaInjuryDisorderEntry): 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.274-2025-02-26T000000.html"
              test="count(hl7:code[(@code = 'OWZ' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.13')]) &gt;= 1">(plCdaInjuryDisorderEntry): element hl7:code[(@code = 'OWZ' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.13')] 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.274-2025-02-26T000000.html"
              test="count(hl7:code[(@code = 'OWZ' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.13')]) &lt;= 1">(plCdaInjuryDisorderEntry): element hl7:code[(@code = 'OWZ' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.13')] 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.274-2025-02-26T000000.html"
              test="count(hl7:statusCode[@code = 'completed']) &gt;= 1">(plCdaInjuryDisorderEntry): 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.274-2025-02-26T000000.html"
              test="count(hl7:statusCode[@code = 'completed']) &lt;= 1">(plCdaInjuryDisorderEntry): 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.274
Context: *[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]/hl7:entryRelationship[hl7:observation/hl7:code/@code='OWZ']/hl7:observation[hl7:code[(@code = 'OWZ' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.13')]]/hl7:code[(@code = 'OWZ' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.13')]
Item: (plCdaInjuryDisorderEntry)
-->

   <rule fpi="RULC-1"
         context="*[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]/hl7:entryRelationship[hl7:observation/hl7:code/@code='OWZ']/hl7:observation[hl7:code[(@code = 'OWZ' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.13')]]/hl7:code[(@code = 'OWZ' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.13')]"
         id="d16e10800-false-d42068e0">
      <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.274-2025-02-26T000000.html"
              test="@nullFlavor or (@code='OWZ' and @codeSystem='2.16.840.1.113883.3.4424.13.5.30.13' and @displayName='Obecność oparzeń wziewnych' and @codeSystemName='ObjawyKliniczne')">(plCdaInjuryDisorderEntry): The element value SHALL be one of 'code 'OWZ' codeSystem '2.16.840.1.113883.3.4424.13.5.30.13' displayName='Obecność oparzeń wziewnych' codeSystemName='ObjawyKliniczne''.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.274
Context: *[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]/hl7:entryRelationship[hl7:observation/hl7:code/@code='OWZ']/hl7:observation[hl7:code[(@code = 'OWZ' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.13')]]/hl7:statusCode[@code = 'completed']
Item: (plCdaInjuryDisorderEntry)
-->

   <rule fpi="RULC-1"
         context="*[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]/hl7:entryRelationship[hl7:observation/hl7:code/@code='OWZ']/hl7:observation[hl7:code[(@code = 'OWZ' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.13')]]/hl7:statusCode[@code = 'completed']"
         id="d16e10805-false-d42082e0">
      <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.274-2025-02-26T000000.html"
              test="@nullFlavor or (@code='completed')">(plCdaInjuryDisorderEntry): 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.274
Context: *[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]/hl7:entryRelationship[hl7:observation/hl7:code/@code=('PRUNW','AKPKL','RZK','URK','ZKUNN','ZPKKM')]
Item: (plCdaInjuryDisorderEntry)
-->

   <rule fpi="RULC-1"
         context="*[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]/hl7:entryRelationship[hl7:observation/hl7:code/@code=('PRUNW','AKPKL','RZK','URK','ZKUNN','ZPKKM')]"
         id="d16e10812-false-d42093e0">
      <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.274-2025-02-26T000000.html"
              test="string(@typeCode) = ('COMP')">(plCdaInjuryDisorderEntry): The value for typeCode SHALL be 'COMP'. 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.274-2025-02-26T000000.html"
              test="count(hl7:observation[hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.247-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]]) &gt;= 1">(plCdaInjuryDisorderEntry): element hl7:observation[hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.247-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.4.274-2025-02-26T000000.html"
              test="count(hl7:observation[hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.247-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]]) &lt;= 1">(plCdaInjuryDisorderEntry): element hl7:observation[hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.247-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]] appears too often [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.274
Context: *[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]/hl7:entryRelationship[hl7:observation/hl7:code/@code=('PRUNW','AKPKL','RZK','URK','ZKUNN','ZPKKM')]/hl7:observation[hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.247-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]]
Item: (plCdaInjuryDisorderEntry)
-->

   <rule fpi="RULC-1"
         context="*[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]/hl7:entryRelationship[hl7:observation/hl7:code/@code=('PRUNW','AKPKL','RZK','URK','ZKUNN','ZPKKM')]/hl7:observation[hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.247-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]]"
         id="d16e10816-false-d42119e0">
      <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.274-2025-02-26T000000.html"
              test="string(@classCode) = ('OBS')">(plCdaInjuryDisorderEntry): 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.274-2025-02-26T000000.html"
              test="string(@moodCode) = ('EVN')">(plCdaInjuryDisorderEntry): 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.274-2025-02-26T000000.html"
              test="count(hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.247-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]) &gt;= 1">(plCdaInjuryDisorderEntry): element hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.247-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.4.274-2025-02-26T000000.html"
              test="count(hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.247-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]) &lt;= 1">(plCdaInjuryDisorderEntry): element hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.247-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.4.274-2025-02-26T000000.html"
              test="count(hl7:statusCode[@code = 'completed']) &gt;= 1">(plCdaInjuryDisorderEntry): 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.274-2025-02-26T000000.html"
              test="count(hl7:statusCode[@code = 'completed']) &lt;= 1">(plCdaInjuryDisorderEntry): 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.274
Context: *[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]/hl7:entryRelationship[hl7:observation/hl7:code/@code=('PRUNW','AKPKL','RZK','URK','ZKUNN','ZPKKM')]/hl7:observation[hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.247-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]]/hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.247-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]
Item: (plCdaInjuryDisorderEntry)
-->

   <rule fpi="RULC-1"
         context="*[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]/hl7:entryRelationship[hl7:observation/hl7:code/@code=('PRUNW','AKPKL','RZK','URK','ZKUNN','ZPKKM')]/hl7:observation[hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.247-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]]/hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.247-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]"
         id="d16e10822-false-d42158e0">
      <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.4.274-2025-02-26T000000.html"
              test="@nullFlavor or exists(doc('include/voc-2.16.840.1.113883.3.4424.13.11.247-DYNAMIC.xml')//valueSet[1][conceptList/concept[@code = $theCode][@codeSystem = $theCodeSystem]])">(plCdaInjuryDisorderEntry): The element value SHALL be one of '2.16.840.1.113883.3.4424.13.11.247 Rodzaje obserwacji związanych z ciężkimi urazami (DYNAMIC)'.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.274
Context: *[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]/hl7:entryRelationship[hl7:observation/hl7:code/@code=('PRUNW','AKPKL','RZK','URK','ZKUNN','ZPKKM')]/hl7:observation[hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.247-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]]/hl7:statusCode[@code = 'completed']
Item: (plCdaInjuryDisorderEntry)
-->

   <rule fpi="RULC-1"
         context="*[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274']]/hl7:entryRelationship[hl7:observation/hl7:code/@code=('PRUNW','AKPKL','RZK','URK','ZKUNN','ZPKKM')]/hl7:observation[hl7:code[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.247-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem)]]/hl7:statusCode[@code = 'completed']"
         id="d16e10829-false-d42176e0">
      <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.274-2025-02-26T000000.html"
              test="@nullFlavor or (@code='completed')">(plCdaInjuryDisorderEntry): The element value SHALL be one of 'code 'completed''.</assert>
   </rule>
</pattern>
