<?xml version="1.0" encoding="UTF-8"?>
<!--
Template derived pattern
===========================================
ID: 2.16.840.1.113883.3.4424.13.10.2.6
Name: [2] Wystawca dokumentu (bazowy)
Description: BAzowy szablon struktury CDA dla wystawcy dokumentu
-->
<pattern xmlns="http://purl.oclc.org/dsdl/schematron"
         id="template-2.16.840.1.113883.3.4424.13.10.2.6-2020-06-08T000000">
   <title>[2] Wystawca dokumentu (bazowy)</title>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.2.6
Context: *[hl7:legalAuthenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.6']]
Item: (plCdaBaseLegalAuthenticator)
-->

   <rule context="*[hl7:legalAuthenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.6']]"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.2.6-2020-06-08T000000.html"
              test="count(hl7:legalAuthenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.6'])&lt;=1">(plCdaBaseLegalAuthenticator): element hl7:legalAuthenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.6'] występuje zbyt często [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.2.6
Context: *[hl7:legalAuthenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.6']]/hl7:legalAuthenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.6']
Item: (plCdaBaseLegalAuthenticator)
-->

   <rule context="*[hl7:legalAuthenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.6']]/hl7:legalAuthenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.6']"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.2.6-2020-06-08T000000.html"
              test="string(@typeCode)='LA' or not(@typeCode)">(plCdaBaseLegalAuthenticator): Wartość dla @typeCode MUSI wynosić 'LA'.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.2.6-2020-06-08T000000.html"
              test="string(@contextControlCode)='OP' or not(@contextControlCode)">(plCdaBaseLegalAuthenticator): Wartość dla @contextControlCode MUSI wynosić 'OP'.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.2.6-2020-06-08T000000.html"
              test="count(hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.2.6'])&gt;=1 and not(hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.2.6']/@nullFlavor)">(plCdaBaseLegalAuthenticator): element hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.2.6'] jest mandatory [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.2.6-2020-06-08T000000.html"
              test="count(hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.2.6'])&lt;=1">(plCdaBaseLegalAuthenticator): element hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.2.6'] występuje zbyt często [max 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.2.6-2020-06-08T000000.html"
              test="count(hl7:time)&gt;=1 ">(plCdaBaseLegalAuthenticator): element hl7:time jest required [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.2.6-2020-06-08T000000.html"
              test="count(hl7:time)&lt;=1">(plCdaBaseLegalAuthenticator): element hl7:time występuje zbyt często [max 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.2.6-2020-06-08T000000.html"
              test="count(hl7:signatureCode[@code=doc('include/voc-2.16.840.1.113883.1.11.10282-DYNAMIC.xml')/*/valueSet/conceptList/*/@code or @nullFlavor])&gt;=1 ">(plCdaBaseLegalAuthenticator): element hl7:signatureCode[@code=doc('include/voc-2.16.840.1.113883.1.11.10282-DYNAMIC.xml')/*/valueSet/conceptList/*/@code or @nullFlavor] jest required [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.2.6-2020-06-08T000000.html"
              test="count(hl7:signatureCode[@code=doc('include/voc-2.16.840.1.113883.1.11.10282-DYNAMIC.xml')/*/valueSet/conceptList/*/@code or @nullFlavor])&lt;=1">(plCdaBaseLegalAuthenticator): element hl7:signatureCode[@code=doc('include/voc-2.16.840.1.113883.1.11.10282-DYNAMIC.xml')/*/valueSet/conceptList/*/@code or @nullFlavor] występuje zbyt często [max 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.2.6-2020-06-08T000000.html"
              test="count(hl7:assignedEntity)&gt;=1 and not(hl7:assignedEntity/@nullFlavor)">(plCdaBaseLegalAuthenticator): element hl7:assignedEntity jest mandatory [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.2.6-2020-06-08T000000.html"
              test="count(hl7:assignedEntity)&lt;=1">(plCdaBaseLegalAuthenticator): element hl7:assignedEntity występuje zbyt często [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.2.6
Context: *[hl7:legalAuthenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.6']]/hl7:legalAuthenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.6']/hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.2.6']
Item: (plCdaBaseLegalAuthenticator)
-->

   <rule context="*[hl7:legalAuthenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.6']]/hl7:legalAuthenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.6']/hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.2.6']"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.2.6-2020-06-08T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='II' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(plCdaBaseLegalAuthenticator): Jeśli występuje instrukcja @xsi:type, to MUSI mieć wartość "{urn:hl7-org:v3}:II", znaleziono "{<value-of select="namespace-uri-from-QName(resolve-QName(@xsi:type,.))"/>}:<value-of select="local-name-from-QName(resolve-QName(@xsi:type,.))"/>"</assert>
      <extends rule="II"/>
      <let name="theValue" value="@value"/>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.2.6-2020-06-08T000000.html"
              test="string(@root)='2.16.840.1.113883.3.4424.13.10.2.6'">(plCdaBaseLegalAuthenticator): Wartość dla @root MUSI wynosić '2.16.840.1.113883.3.4424.13.10.2.6'.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.2.6-2020-06-08T000000.html"
              test="not(@root) or matches(@root,'^[0-2](\.(0|[1-9][0-9]*))*$')">(plCdaBaseLegalAuthenticator): Atrybut @root MUSI być typu 'oid'</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.2.6
Context: *[hl7:legalAuthenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.6']]/hl7:legalAuthenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.6']/hl7:time
Item: (plCdaBaseLegalAuthenticator)
-->

   <rule context="*[hl7:legalAuthenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.6']]/hl7:legalAuthenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.6']/hl7:time"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.2.6-2020-06-08T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='TS' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(plCdaBaseLegalAuthenticator): Jeśli występuje instrukcja @xsi:type, to MUSI mieć wartość "{urn:hl7-org:v3}:TS", znaleziono "{<value-of select="namespace-uri-from-QName(resolve-QName(@xsi:type,.))"/>}:<value-of select="local-name-from-QName(resolve-QName(@xsi:type,.))"/>"</assert>
      <extends rule="TS"/>
      <let name="theValue" value="@value"/>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.2.6
Context: *[hl7:legalAuthenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.6']]/hl7:legalAuthenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.6']/hl7:signatureCode[@code=doc('include/voc-2.16.840.1.113883.1.11.10282-DYNAMIC.xml')/*/valueSet/conceptList/*/@code or @nullFlavor]
Item: (plCdaBaseLegalAuthenticator)
-->

   <rule context="*[hl7:legalAuthenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.6']]/hl7:legalAuthenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.6']/hl7:signatureCode[@code=doc('include/voc-2.16.840.1.113883.1.11.10282-DYNAMIC.xml')/*/valueSet/conceptList/*/@code or @nullFlavor]"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.2.6-2020-06-08T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='CS' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(plCdaBaseLegalAuthenticator): Jeśli występuje instrukcja @xsi:type, to MUSI mieć wartość "{urn:hl7-org:v3}:CS", znaleziono "{<value-of select="namespace-uri-from-QName(resolve-QName(@xsi:type,.))"/>}:<value-of select="local-name-from-QName(resolve-QName(@xsi:type,.))"/>"</assert>
      <extends rule="CS"/>
      <let name="theValue" value="@value"/>
      <let name="theCode" value="@code"/>
      <let name="theCodeSystem" value="@codeSystem"/>
      <let name="theCodeSystemVersion" value="@codeSystemVersion"/>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.2.6-2020-06-08T000000.html"
              test="@nullFlavor or exists(doc('include/voc-2.16.840.1.113883.1.11.10282-DYNAMIC.xml')/*/valueSet/conceptList/concept[@code = $theCode] or completeCodeSystem)">(plCdaBaseLegalAuthenticator): Wartość elementu MUSI wynosić ParticipationSignature (DYNAMICZNE).</assert>
      <let name="theNullFlavor" value="@nullFlavor"/>
      <let name="validNullFlavorsFound"
           value="exists(doc('include/voc-2.16.840.1.113883.1.11.10282-DYNAMIC.xml')/*/valueSet/conceptList/exception[@code = $theNullFlavor][@codeSystem = '2.16.840.1.113883.5.1008'])"/>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.2.6-2020-06-08T000000.html"
              test="not(@nullFlavor) or not(empty(($validNullFlavorsFound))) ">(plCdaBaseLegalAuthenticator): Kod braku danych dla @code MUSI pochodzić ze zbioru dopuszczalnych kodów braku danych zdefiniowanych dla tego atrybutu lub powiązanych ze zbiorem wartości ParticipationSignature (DYNAMICZNE)</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.2.6
Context: *[hl7:legalAuthenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.6']]/hl7:legalAuthenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.6']/hl7:assignedEntity
Item: (plCdaBaseLegalAuthenticator)
-->

   <rule context="*[hl7:legalAuthenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.6']]/hl7:legalAuthenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.6']/hl7:assignedEntity"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.2.6-2020-06-08T000000.html"
              test="string(@classCode)='ASSIGNED' or not(@classCode)">(plCdaBaseLegalAuthenticator): Wartość dla @classCode MUSI wynosić 'ASSIGNED'.</assert>
      <report role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.2.6-2020-06-08T000000.html"
              test="not(hl7:assignedPerson/hl7:name) and not(hl7:id[@root=/hl7:ClinicalDocument/hl7:author/hl7:assignedAuthor/hl7:id/@root and @extension=/hl7:ClinicalDocument/hl7:author/hl7:assignedAuthor/hl7:id/@extension])">(plCdaBaseLegalAuthenticator): Jeśli wystawca dokumentu jest również jego autorem to identyfikator wystawcy musi być taki sam jak identyfikator autora. W przeciwnym wypadku należy podać dane personalne wystawcy dokumentu.</report>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.2.6-2020-06-08T000000.html"
              test="count(hl7:id)&gt;=1 and not(hl7:id/@nullFlavor)">(plCdaBaseLegalAuthenticator): element hl7:id jest mandatory [min 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.2.6-2020-06-08T000000.html"
              test="count(hl7:code)&lt;=1">(plCdaBaseLegalAuthenticator): element hl7:code występuje zbyt często [max 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.2.6-2020-06-08T000000.html"
              test="count(hl7:assignedPerson[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.1'])&lt;=1">(plCdaBaseLegalAuthenticator): element hl7:assignedPerson[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.1'] występuje zbyt często [max 1x].</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.2.6-2020-06-08T000000.html"
              test="count(hl7:representedOrganization[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.2'])&lt;=1">(plCdaBaseLegalAuthenticator): element hl7:representedOrganization[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.2'] występuje zbyt często [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.2.6
Context: *[hl7:legalAuthenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.6']]/hl7:legalAuthenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.6']/hl7:assignedEntity/hl7:id
Item: (plCdaBaseLegalAuthenticator)
-->

   <rule context="*[hl7:legalAuthenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.6']]/hl7:legalAuthenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.6']/hl7:assignedEntity/hl7:id"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.2.6-2020-06-08T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='II' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(plCdaBaseLegalAuthenticator): Jeśli występuje instrukcja @xsi:type, to MUSI mieć wartość "{urn:hl7-org:v3}:II", znaleziono "{<value-of select="namespace-uri-from-QName(resolve-QName(@xsi:type,.))"/>}:<value-of select="local-name-from-QName(resolve-QName(@xsi:type,.))"/>"</assert>
      <extends rule="II"/>
      <let name="theValue" value="@value"/>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.2.6-2020-06-08T000000.html"
              test="@root">(plCdaBaseLegalAuthenticator): atrybut @root MUSI wystąpić.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.2.6-2020-06-08T000000.html"
              test="not(@root) or matches(@root,'^[0-2](\.(0|[1-9][0-9]*))*$')">(plCdaBaseLegalAuthenticator): Atrybut @root MUSI być typu 'oid'</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.2.6-2020-06-08T000000.html"
              test="@extension">(plCdaBaseLegalAuthenticator): atrybut @extension MUSI wystąpić.</assert>
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.2.6-2020-06-08T000000.html"
              test="not(@extension) or string-length(@extension)&gt;0">(plCdaBaseLegalAuthenticator): Atrybut @extension MUSI być typu 'st'</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.2.6
Context: *[hl7:legalAuthenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.6']]/hl7:legalAuthenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.6']/hl7:assignedEntity/hl7:code
Item: (plCdaBaseLegalAuthenticator)
-->

   <rule context="*[hl7:legalAuthenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.6']]/hl7:legalAuthenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.6']/hl7:assignedEntity/hl7:code"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.2.6-2020-06-08T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='CE' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(plCdaBaseLegalAuthenticator): Jeśli występuje instrukcja @xsi:type, to MUSI mieć wartość "{urn:hl7-org:v3}:CE", znaleziono "{<value-of select="namespace-uri-from-QName(resolve-QName(@xsi:type,.))"/>}:<value-of select="local-name-from-QName(resolve-QName(@xsi:type,.))"/>"</assert>
      <extends rule="CE"/>
      <let name="theValue" value="@value"/>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.2.6
Context: *[hl7:legalAuthenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.6']]/hl7:legalAuthenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.6']/hl7:assignedEntity/hl7:addr
Item: (plCdaBaseLegalAuthenticator)
-->

   <rule context="*[hl7:legalAuthenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.6']]/hl7:legalAuthenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.6']/hl7:assignedEntity/hl7:addr"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.2.6-2020-06-08T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='AD' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(plCdaBaseLegalAuthenticator): Jeśli występuje instrukcja @xsi:type, to MUSI mieć wartość "{urn:hl7-org:v3}:AD", znaleziono "{<value-of select="namespace-uri-from-QName(resolve-QName(@xsi:type,.))"/>}:<value-of select="local-name-from-QName(resolve-QName(@xsi:type,.))"/>"</assert>
      <extends rule="AD.PL"/>
      <let name="theValue" value="@value"/>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.2.6
Context: *[hl7:legalAuthenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.6']]/hl7:legalAuthenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.6']/hl7:assignedEntity/hl7:telecom
Item: (plCdaBaseLegalAuthenticator)
-->

   <rule context="*[hl7:legalAuthenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.6']]/hl7:legalAuthenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.6']/hl7:assignedEntity/hl7:telecom"
         id="tmp-">
      <assert role="error"
              see="https://www.cez.gov.pl/HL7POL-1.3.2/plcda-html-1.3.2/plcda-html/plcda-html-develop/tmp-2.16.840.1.113883.3.4424.13.10.2.6-2020-06-08T000000.html"
              test="(local-name-from-QName(resolve-QName(@xsi:type,.))='TEL' and namespace-uri-from-QName(resolve-QName(@xsi:type,.))='urn:hl7-org:v3') or not(@xsi:type)">(plCdaBaseLegalAuthenticator): Jeśli występuje instrukcja @xsi:type, to MUSI mieć wartość "{urn:hl7-org:v3}:TEL", znaleziono "{<value-of select="namespace-uri-from-QName(resolve-QName(@xsi:type,.))"/>}:<value-of select="local-name-from-QName(resolve-QName(@xsi:type,.))"/>"</assert>
      <extends rule="TEL"/>
      <let name="theValue" value="@value"/>
   </rule>

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.2.6
Context: *[hl7:legalAuthenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.6']]/hl7:legalAuthenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.6']/hl7:assignedEntity/hl7:assignedPerson[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.1']
Item: (plCdaBaseLegalAuthenticator)
-->

   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.2.6
Context: *[hl7:legalAuthenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.6']]/hl7:legalAuthenticator[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.6']/hl7:assignedEntity/hl7:representedOrganization[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.2']
Item: (plCdaBaseLegalAuthenticator)
--></pattern>
