<?xml version="1.0" encoding="UTF-8"?>
<!--
Template derived pattern
===========================================
ID: 2.16.840.1.113883.3.4424.13.10.4.241
Name: [4] Ocena w skali Revised Trauma Score (RTS)
Description: Ocena w skali Revised Trauma Score (RTS)
-->
<pattern xmlns="http://purl.oclc.org/dsdl/schematron"
         id="template-2.16.840.1.113883.3.4424.13.10.4.241-2025-02-26T000000-closed">
   <title>[4] Ocena w skali Revised Trauma Score (RTS)</title>

   <!-- Checking undefined contents for template/element @isClosed="true". Match context that we did not already match -->
   <rule fpi="RUL-QQQ"
         context="*[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.241']]]/*[not(@xsi:nil = 'true')][not(self::hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.241']])]"
         id="d16e8115-true-d32936e0">
      <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.241-2025-02-26T000000.html"
              test="not(.)">(plCdaRevisedTraumaScoreEntry)/d16e8115-true-d32936e0: '<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.241']] (rule-reference: d16e8115-true-d32936e0)</assert>
   </rule>

   <!-- Checking undefined contents for template/element @isClosed="true". Match context that we did not already match -->
   <rule fpi="RUL-QQQ"
         context="*[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.241']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.241']]/*[not(@xsi:nil = 'true')][not(self::hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.241'] | self::hl7:code[(@code = 'RTS' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.10')] | self::hl7:statusCode[@code = 'completed'] | self::hl7:value[not(@nullFlavor)] | self::hl7:entryRelationship[hl7:observation/hl7:code/@code='RTSO'] | self::hl7:entryRelationship[hl7:observation/hl7:code/@code='RTSC'] | self::hl7:entryRelationship[hl7:observation/hl7:code/@code='RTSG'])]"
         id="d16e8179-true-d32975e0">
      <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.241-2025-02-26T000000.html"
              test="not(.)">(plCdaRevisedTraumaScoreEntry)/d16e8179-true-d32975e0: '<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.241'] | hl7:code[(@code = 'RTS' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.10')] | hl7:statusCode[@code = 'completed'] | hl7:value[not(@nullFlavor)] | hl7:entryRelationship[hl7:observation/hl7:code/@code='RTSO'] | hl7:entryRelationship[hl7:observation/hl7:code/@code='RTSC'] | hl7:entryRelationship[hl7:observation/hl7:code/@code='RTSG'] (rule-reference: d16e8179-true-d32975e0)</assert>
   </rule>

   <!-- Checking undefined contents for template/element @isClosed="true". Match context that we did not already match -->
   <rule fpi="RUL-QQQ"
         context="*[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.241']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.241']]/hl7:entryRelationship[hl7:observation/hl7:code/@code='RTSO']/*[not(@xsi:nil = 'true')][not(self::hl7:observation[hl7:code[(@code = 'RTSO' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.10')]])]"
         id="d16e8203-true-d33012e0">
      <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.241-2025-02-26T000000.html"
              test="not(.)">(plCdaRevisedTraumaScoreEntry)/d16e8203-true-d33012e0: '<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 = 'RTSO' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.10')]] (rule-reference: d16e8203-true-d33012e0)</assert>
   </rule>

   <!-- Checking undefined contents for template/element @isClosed="true". Match context that we did not already match -->
   <rule fpi="RUL-QQQ"
         context="*[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.241']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.241']]/hl7:entryRelationship[hl7:observation/hl7:code/@code='RTSO']/hl7:observation[hl7:code[(@code = 'RTSO' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.10')]]/*[not(@xsi:nil = 'true')][not(self::hl7:code[(@code = 'RTSO' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.10')] | self::hl7:statusCode[@code = 'completed'] | self::hl7:value[not(@nullFlavor)])]"
         id="d16e8207-true-d33041e0">
      <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.241-2025-02-26T000000.html"
              test="not(.)">(plCdaRevisedTraumaScoreEntry)/d16e8207-true-d33041e0: '<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 = 'RTSO' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.10')] | hl7:statusCode[@code = 'completed'] | hl7:value[not(@nullFlavor)] (rule-reference: d16e8207-true-d33041e0)</assert>
   </rule>

   <!-- Checking undefined contents for template/element @isClosed="true". Match context that we did not already match -->
   <rule fpi="RUL-QQQ"
         context="*[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.241']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.241']]/hl7:entryRelationship[hl7:observation/hl7:code/@code='RTSC']/*[not(@xsi:nil = 'true')][not(self::hl7:observation[hl7:code[(@code = 'RTSC' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.10')]])]"
         id="d16e8227-true-d33072e0">
      <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.241-2025-02-26T000000.html"
              test="not(.)">(plCdaRevisedTraumaScoreEntry)/d16e8227-true-d33072e0: '<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 = 'RTSC' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.10')]] (rule-reference: d16e8227-true-d33072e0)</assert>
   </rule>

   <!-- Checking undefined contents for template/element @isClosed="true". Match context that we did not already match -->
   <rule fpi="RUL-QQQ"
         context="*[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.241']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.241']]/hl7:entryRelationship[hl7:observation/hl7:code/@code='RTSC']/hl7:observation[hl7:code[(@code = 'RTSC' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.10')]]/*[not(@xsi:nil = 'true')][not(self::hl7:code[(@code = 'RTSC' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.10')] | self::hl7:statusCode[@code = 'completed'] | self::hl7:value[not(@nullFlavor)])]"
         id="d16e8231-true-d33101e0">
      <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.241-2025-02-26T000000.html"
              test="not(.)">(plCdaRevisedTraumaScoreEntry)/d16e8231-true-d33101e0: '<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 = 'RTSC' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.10')] | hl7:statusCode[@code = 'completed'] | hl7:value[not(@nullFlavor)] (rule-reference: d16e8231-true-d33101e0)</assert>
   </rule>

   <!-- Checking undefined contents for template/element @isClosed="true". Match context that we did not already match -->
   <rule fpi="RUL-QQQ"
         context="*[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.241']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.241']]/hl7:entryRelationship[hl7:observation/hl7:code/@code='RTSG']/*[not(@xsi:nil = 'true')][not(self::hl7:observation[hl7:code[(@code = 'RTSG' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.10')]])]"
         id="d16e8251-true-d33132e0">
      <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.241-2025-02-26T000000.html"
              test="not(.)">(plCdaRevisedTraumaScoreEntry)/d16e8251-true-d33132e0: '<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 = 'RTSG' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.10')]] (rule-reference: d16e8251-true-d33132e0)</assert>
   </rule>

   <!-- Checking undefined contents for template/element @isClosed="true". Match context that we did not already match -->
   <rule fpi="RUL-QQQ"
         context="*[hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.241']]]/hl7:observation[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.241']]/hl7:entryRelationship[hl7:observation/hl7:code/@code='RTSG']/hl7:observation[hl7:code[(@code = 'RTSG' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.10')]]/*[not(@xsi:nil = 'true')][not(self::hl7:code[(@code = 'RTSG' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.10')] | self::hl7:statusCode[@code = 'completed'] | self::hl7:value[not(@nullFlavor)])]"
         id="d16e8255-true-d33161e0">
      <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.241-2025-02-26T000000.html"
              test="not(.)">(plCdaRevisedTraumaScoreEntry)/d16e8255-true-d33161e0: '<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 = 'RTSG' and @codeSystem = '2.16.840.1.113883.3.4424.13.5.30.10')] | hl7:statusCode[@code = 'completed'] | hl7:value[not(@nullFlavor)] (rule-reference: d16e8255-true-d33161e0)</assert>
   </rule>
</pattern>
