<?xml version="1.0" encoding="UTF-8"?>
<!--
Template derived pattern
===========================================
ID: 2.16.840.1.113883.3.4424.13.10.2.1
Name: [2] Osoba (bazowy)
Description: Szablon struktury CDA dla osoby.
-->
<pattern xmlns="http://purl.oclc.org/dsdl/schematron"
         id="template-2.16.840.1.113883.3.4424.13.10.2.1-2018-06-30T000000">
   <title>[2] Osoba (bazowy)</title>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.2.1
Context: *[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.1']
Item: (plCdaBasePerson)
-->

   <rule context="*[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.1']"
         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.1-2018-06-30T000000.html"
              test="count(hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.2.1'])&gt;=1 and not(hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.2.1']/@nullFlavor)">(plCdaBasePerson): element hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.2.1'] 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.1-2018-06-30T000000.html"
              test="count(hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.2.1'])&lt;=1">(plCdaBasePerson): element 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.1-2018-06-30T000000.html"
              test="count(hl7:name)&gt;=1 ">(plCdaBasePerson): element hl7:name 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.1-2018-06-30T000000.html"
              test="count(hl7:name)&lt;=1">(plCdaBasePerson): element hl7:name występuje zbyt często [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.2.1
Context: *[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.1']/hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.2.1']
Item: (plCdaBasePerson)
-->

   <rule context="*[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.2.1']/hl7:templateId[@root='2.16.840.1.113883.3.4424.13.10.2.1']"
         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.1-2018-06-30T000000.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)">(plCdaBasePerson): 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.1-2018-06-30T000000.html"
              test="string(@root)='2.16.840.1.113883.3.4424.13.10.2.1'">(plCdaBasePerson): Wartość dla @root MUSI wynosić '2.16.840.1.113883.3.4424.13.10.2.1'.</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.1-2018-06-30T000000.html"
              test="not(@root) or matches(@root,'^[0-2](\.(0|[1-9][0-9]*))*$')">(plCdaBasePerson): Atrybut @root MUSI być typu 'oid'</assert>
   </rule>
</pattern>
