<?xml version="1.0" encoding="UTF-8"?>
<!--
Template derived pattern
===========================================
ID: 2.16.840.1.113883.3.4424.13.10.2.19
Name: [2] Dane ubezpieczyciela publicznego (bazowy)
Description: Bazowy szablon struktury CDA dla danych ubezpieczyciela publicznego
-->
<pattern xmlns="http://purl.oclc.org/dsdl/schematron"
         id="template-2.16.840.1.113883.3.4424.13.10.2.19-2018-06-30T000000-closed">
   <title>[2] Dane ubezpieczyciela publicznego (bazowy)</title>

   <!-- Checking undefined contents for template/element @isClosed="true". Match context that we did not already match -->
   <rule fpi="RUL-QQQ"
         context="*[hl7:participant[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.2.19']]]/*[not(@xsi:nil = 'true')][not(self::hl7:participant[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.2.19']])]"
         id="d16e4733-true-d21800e0">
      <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.2.19-2018-06-30T000000.html"
              test="not(.)">(plCdaBasePublicUnderwriterParticipant)/d16e4733-true-d21800e0: '<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:participant[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.2.19']] (rule-reference: d16e4733-true-d21800e0)</assert>
   </rule>

   <!-- Checking undefined contents for template/element @isClosed="true". Match context that we did not already match -->
   <rule fpi="RUL-QQQ"
         context="*[hl7:participant[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.2.19']]]/hl7:participant[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.2.19']]/*[not(@xsi:nil = 'true')][not(self::hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.2.19'] | self::hl7:associatedEntity[@classCode = 'UNDWRT'])]"
         id="d16e4761-true-d21822e0">
      <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.2.19-2018-06-30T000000.html"
              test="not(.)">(plCdaBasePublicUnderwriterParticipant)/d16e4761-true-d21822e0: '<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.2.19'] | hl7:associatedEntity[@classCode = 'UNDWRT'] (rule-reference: d16e4761-true-d21822e0)</assert>
   </rule>

   <!-- Checking undefined contents for template/element @isClosed="true". Match context that we did not already match -->
   <rule fpi="RUL-QQQ"
         context="*[hl7:participant[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.2.19']]]/hl7:participant[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.2.19']]/hl7:associatedEntity[@classCode = 'UNDWRT']/*[not(@xsi:nil = 'true')][not(self::hl7:id[@root = '2.16.840.1.113883.3.4424.3.1'] | self::hl7:id[@root = '2.16.840.1.113883.3.4424.11.1.49'])]"
         id="d16e4772-true-d21843e0">
      <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.2.19-2018-06-30T000000.html"
              test="not(.)">(plCdaBasePublicUnderwriterParticipant)/d16e4772-true-d21843e0: '<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:id[@root = '2.16.840.1.113883.3.4424.3.1'] | hl7:id[@root = '2.16.840.1.113883.3.4424.11.1.49'] (rule-reference: d16e4772-true-d21843e0)</assert>
   </rule>
</pattern>
