<?xml version="1.0" encoding="UTF-8"?>
<!--
Template derived pattern
===========================================
ID: 2.16.840.1.113883.3.4424.13.10.4.324
Name: [4] Obrażenia pacjenta
Description: Obrażenia pacjenta
-->
<pattern xmlns="http://purl.oclc.org/dsdl/schematron"
         id="template-2.16.840.1.113883.3.4424.13.10.4.324-2025-02-26T000000-closed">
   <title>[4] Obrażenia pacjenta</title>

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

   <!-- Checking undefined contents for template/element @isClosed="true". Match context that we did not already match -->
   <rule fpi="RUL-QQQ"
         context="*[hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.324']]]/hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.324']]/*[not(@xsi:nil = 'true')][not(self::hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.324'] | self::hl7:code[(@code = '417163006' and @codeSystem = '2.16.840.1.113883.6.96')] | self::hl7:statusCode[@code = 'completed'] | self::hl7:component[hl7:observation/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.274'] | self::hl7:component[hl7:observation/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.327'] | self::hl7:component[hl7:observation/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.328'] | self::hl7:component[hl7:observation/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.329'])]"
         id="d16e14553-true-d55741e0">
      <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.324-2025-02-26T000000.html"
              test="not(.)">(plCdaPatientInjuriesEntry)/d16e14553-true-d55741e0: '<value-of select="name(..)"/>' is defined as closed, and this element '<name/>' is not allowed, or not allowed with this content. This may concern the templateId, code or id. Expected in this context:  hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.324'] | hl7:code[(@code = '417163006' and @codeSystem = '2.16.840.1.113883.6.96')] | hl7:statusCode[@code = 'completed'] | hl7:component[hl7:observation/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.274'] | hl7:component[hl7:observation/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.327'] | hl7:component[hl7:observation/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.328'] | hl7:component[hl7:observation/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.329'] (rule-reference: d16e14553-true-d55741e0)</assert>
   </rule>

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

   <!-- Checking undefined contents for template/element @isClosed="true". Match context that we did not already match -->
   <rule fpi="RUL-QQQ"
         context="*[hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.324']]]/hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.324']]/hl7:component[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']]/*[not(@xsi:nil = 'true')][not(self::hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.274'] | self::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)] | self::hl7:statusCode[@code = 'completed'] | self::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)] | self::hl7:entryRelationship[hl7:observation/hl7:code/@code=('O1S','O2S','O3S','O4S')] | self::hl7:entryRelationship[hl7:observation/hl7:code/@code='OWZ'] | self::hl7:entryRelationship[hl7:observation/hl7:code/@code=('PRUNW','AKPKL','RZK','URK','ZKUNN','ZPKKM')])]"
         id="d55764e3-true-d55825e0">
      <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.324-2025-02-26T000000.html"
              test="not(.)">(plCdaPatientInjuriesEntry)/d55764e3-true-d55825e0: '<value-of select="name(..)"/>' is defined as closed, and this element '<name/>' is not allowed, or not allowed with this content. This may concern the templateId, code or id. Expected in this context:  hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.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)] | hl7:statusCode[@code = 'completed'] | 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:entryRelationship[hl7:observation/hl7:code/@code=('O1S','O2S','O3S','O4S')] | hl7:entryRelationship[hl7:observation/hl7:code/@code='OWZ'] | hl7:entryRelationship[hl7:observation/hl7:code/@code=('PRUNW','AKPKL','RZK','URK','ZKUNN','ZPKKM')] (rule-reference: d55764e3-true-d55825e0)</assert>
   </rule>

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

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

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

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

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

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

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

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

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

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

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

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

   <!-- Checking undefined contents for template/element @isClosed="true". Match context that we did not already match -->
   <rule fpi="RUL-QQQ"
         context="*[hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.324']]]/hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.324']]/hl7:component[hl7:observation/hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.328']/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.328']]/*[not(@xsi:nil = 'true')][not(self::hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.328'] | self::hl7:code[(@code = 'OWZ' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.13')] | self::hl7:statusCode[@code = 'completed'])]"
         id="d56218e3-true-d56261e0">
      <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.324-2025-02-26T000000.html"
              test="not(.)">(plCdaPatientInjuriesEntry)/d56218e3-true-d56261e0: '<value-of select="name(..)"/>' is defined as closed, and this element '<name/>' is not allowed, or not allowed with this content. This may concern the templateId, code or id. Expected in this context:  hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.328'] | hl7:code[(@code = 'OWZ' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.13')] | hl7:statusCode[@code = 'completed'] (rule-reference: d56218e3-true-d56261e0)</assert>
   </rule>

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

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