<?xml version="1.0" encoding="UTF-8"?>
<!--
Template derived pattern
===========================================
ID: 2.16.840.1.113883.3.4424.13.10.4.2
Name: [4] Rozpoznania dodatkowe
Description: Szablon CDA dla rozpoznań dodatkowych
-->
<pattern xmlns="http://purl.oclc.org/dsdl/schematron"
         id="template-2.16.840.1.113883.3.4424.13.10.4.2-2018-09-30T000000">
   <title>[4] Rozpoznania dodatkowe</title>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.2
Context: *[hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.2']]]
Item: (plCdaSecondaryDiagnosis)
-->

   <rule fpi="RULC-1"
         context="*[hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.2']]]"
         id="d16e5122-false-d22292e0">
      <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.2-2018-09-30T000000.html"
              test="count(hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.2']]) &gt;= 1">(plCdaSecondaryDiagnosis): element hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.2']] is mandatory [min 1x].</assert>
      <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.2-2018-09-30T000000.html"
              test="count(hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.2']]) &lt;= 1">(plCdaSecondaryDiagnosis): element hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.2']] appears too often [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.2
Context: *[hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.2']]]/hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.2']]
Item: (plCdaSecondaryDiagnosis)
-->

   <rule fpi="RULC-1"
         context="*[hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.2']]]/hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.2']]"
         id="d16e5160-false-d22309e0">
      <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.2-2018-09-30T000000.html"
              test="string(@classCode) = ('BATTERY')">(plCdaSecondaryDiagnosis): The value for classCode SHALL be 'BATTERY'. Found: "<value-of select="@classCode"/>"</assert>
      <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.2-2018-09-30T000000.html"
              test="string(@moodCode) = ('EVN')">(plCdaSecondaryDiagnosis): The value for moodCode SHALL be 'EVN'. Found: "<value-of select="@moodCode"/>"</assert>
      <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.2-2018-09-30T000000.html"
              test="count(hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.2']) &gt;= 1">(plCdaSecondaryDiagnosis): element hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.2'] is mandatory [min 1x].</assert>
      <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.2-2018-09-30T000000.html"
              test="count(hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.2']) &lt;= 1">(plCdaSecondaryDiagnosis): element hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.2'] appears too often [max 1x].</assert>
      <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.2-2018-09-30T000000.html"
              test="count(hl7:code[(@code = '85097005' and @codeSystem = '2.16.840.1.113883.6.96') or @nullFlavor]) &lt;= 1">(plCdaSecondaryDiagnosis): element hl7:code[(@code = '85097005' and @codeSystem = '2.16.840.1.113883.6.96') or @nullFlavor] appears too often [max 1x].</assert>
      <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.2-2018-09-30T000000.html"
              test="count(hl7:statusCode[@code = 'completed']) &gt;= 1">(plCdaSecondaryDiagnosis): element hl7:statusCode[@code = 'completed'] is mandatory [min 1x].</assert>
      <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.2-2018-09-30T000000.html"
              test="count(hl7:statusCode[@code = 'completed']) &lt;= 1">(plCdaSecondaryDiagnosis): element hl7:statusCode[@code = 'completed'] appears too often [max 1x].</assert>
      <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.2-2018-09-30T000000.html"
              test="count(hl7:component[not(@nullFlavor)][hl7:observation[@classCode = 'OBS'][@moodCode = 'EVN']]) &gt;= 1">(plCdaSecondaryDiagnosis): element hl7:component[not(@nullFlavor)][hl7:observation[@classCode = 'OBS'][@moodCode = 'EVN']] is mandatory [min 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.2
Context: *[hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.2']]]/hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.2']]/hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.2']
Item: (plCdaSecondaryDiagnosis)
-->

   <rule fpi="RULC-1"
         context="*[hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.2']]]/hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.2']]/hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.2']"
         id="d16e5166-false-d22357e0">
      <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.2-2018-09-30T000000.html"
              test="string(@root) = ('2.16.840.1.113883.3.4424.13.10.4.2')">(plCdaSecondaryDiagnosis): The value for root SHALL be '2.16.840.1.113883.3.4424.13.10.4.2'. Found: "<value-of select="@root"/>"</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.2
Context: *[hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.2']]]/hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.2']]/hl7:code[(@code = '85097005' and @codeSystem = '2.16.840.1.113883.6.96') or @nullFlavor]
Item: (plCdaSecondaryDiagnosis)
-->

   <rule fpi="RULC-1"
         context="*[hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.2']]]/hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.2']]/hl7:code[(@code = '85097005' and @codeSystem = '2.16.840.1.113883.6.96') or @nullFlavor]"
         id="d16e5171-false-d22369e0">
      <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.2-2018-09-30T000000.html"
              test="@nullFlavor or (@code='85097005' and @codeSystem='2.16.840.1.113883.6.96' and @displayName='Secondary diagnosis' and @codeSystemName='SNOMED CT')">(plCdaSecondaryDiagnosis): The element value SHALL be one of 'code '85097005' codeSystem '2.16.840.1.113883.6.96' displayName='Secondary diagnosis' codeSystemName='SNOMED CT''.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.2
Context: *[hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.2']]]/hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.2']]/hl7:statusCode[@code = 'completed']
Item: (plCdaSecondaryDiagnosis)
-->

   <rule fpi="RULC-1"
         context="*[hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.2']]]/hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.2']]/hl7:statusCode[@code = 'completed']"
         id="d16e5176-false-d22383e0">
      <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.2-2018-09-30T000000.html"
              test="@nullFlavor or (@code='completed')">(plCdaSecondaryDiagnosis): The element value SHALL be one of 'code 'completed''.</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.2
Context: *[hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.2']]]/hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.2']]/hl7:component[not(@nullFlavor)][hl7:observation[@classCode = 'OBS'][@moodCode = 'EVN']]
Item: (plCdaSecondaryDiagnosis)
-->

   <rule fpi="RULC-1"
         context="*[hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.2']]]/hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.2']]/hl7:component[not(@nullFlavor)][hl7:observation[@classCode = 'OBS'][@moodCode = 'EVN']]"
         id="d16e5182-false-d22396e0">
      <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.2-2018-09-30T000000.html"
              test="string(@typeCode) = ('COMP') or not(@typeCode)">(plCdaSecondaryDiagnosis): The value for typeCode SHALL be 'COMP'. Found: "<value-of select="@typeCode"/>"</assert>
      <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.2-2018-09-30T000000.html"
              test="count(hl7:observation[not(@nullFlavor)][@classCode = 'OBS'][@moodCode = 'EVN']) &gt;= 1">(plCdaSecondaryDiagnosis): element hl7:observation[not(@nullFlavor)][@classCode = 'OBS'][@moodCode = 'EVN'] is mandatory [min 1x].</assert>
      <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.2-2018-09-30T000000.html"
              test="count(hl7:observation[not(@nullFlavor)][@classCode = 'OBS'][@moodCode = 'EVN']) &lt;= 1">(plCdaSecondaryDiagnosis): element hl7:observation[not(@nullFlavor)][@classCode = 'OBS'][@moodCode = 'EVN'] appears too often [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.2
Context: *[hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.2']]]/hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.2']]/hl7:component[not(@nullFlavor)][hl7:observation[@classCode = 'OBS'][@moodCode = 'EVN']]/hl7:observation[not(@nullFlavor)][@classCode = 'OBS'][@moodCode = 'EVN']
Item: (plCdaSecondaryDiagnosis)
-->

   <rule fpi="RULC-1"
         context="*[hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.2']]]/hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.2']]/hl7:component[not(@nullFlavor)][hl7:observation[@classCode = 'OBS'][@moodCode = 'EVN']]/hl7:observation[not(@nullFlavor)][@classCode = 'OBS'][@moodCode = 'EVN']"
         id="d16e5186-false-d22416e0">
      <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.2-2018-09-30T000000.html"
              test="string(@classCode) = ('OBS')">(plCdaSecondaryDiagnosis): The value for classCode SHALL be 'OBS'. Found: "<value-of select="@classCode"/>"</assert>
      <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.2-2018-09-30T000000.html"
              test="string(@moodCode) = ('EVN')">(plCdaSecondaryDiagnosis): The value for moodCode SHALL be 'EVN'. Found: "<value-of select="@moodCode"/>"</assert>
      <let name="elmcount"
           value="count(hl7:code[@codeSystem='2.16.840.1.113883.6.3'] | hl7:code[@codeSystem='2.16.840.1.113883.6.260'])"/>
      <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.2-2018-09-30T000000.html"
              test="$elmcount &gt;= 1">(plCdaSecondaryDiagnosis): choice (hl7:code[@codeSystem='2.16.840.1.113883.6.3']  or  hl7:code[@codeSystem='2.16.840.1.113883.6.260']) does not contain enough elements [min 1x]</assert>
      <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.2-2018-09-30T000000.html"
              test="$elmcount &lt;= 1">(plCdaSecondaryDiagnosis): choice (hl7:code[@codeSystem='2.16.840.1.113883.6.3']  or  hl7:code[@codeSystem='2.16.840.1.113883.6.260']) contains too many elements [max 1x]</assert>
      <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.2-2018-09-30T000000.html"
              test="count(hl7:code[@codeSystem='2.16.840.1.113883.6.3']) &lt;= 1">(plCdaSecondaryDiagnosis): element hl7:code[@codeSystem='2.16.840.1.113883.6.3'] appears too often [max 1x].</assert>
      <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.2-2018-09-30T000000.html"
              test="count(hl7:code[@codeSystem='2.16.840.1.113883.6.260']) &lt;= 1">(plCdaSecondaryDiagnosis): element hl7:code[@codeSystem='2.16.840.1.113883.6.260'] appears too often [max 1x].</assert>
      <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.2-2018-09-30T000000.html"
              test="count(hl7:targetSiteCode[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.80-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem) or @nullFlavor]) &lt;= 1">(plCdaSecondaryDiagnosis): element hl7:targetSiteCode[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.80-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem) or @nullFlavor] appears too often [max 1x].</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.2
Context: *[hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.2']]]/hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.2']]/hl7:component[not(@nullFlavor)][hl7:observation[@classCode = 'OBS'][@moodCode = 'EVN']]/hl7:observation[not(@nullFlavor)][@classCode = 'OBS'][@moodCode = 'EVN']/hl7:code[@codeSystem='2.16.840.1.113883.6.3']
Item: (plCdaSecondaryDiagnosis)
-->

   <rule fpi="RULC-1"
         context="*[hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.2']]]/hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.2']]/hl7:component[not(@nullFlavor)][hl7:observation[@classCode = 'OBS'][@moodCode = 'EVN']]/hl7:observation[not(@nullFlavor)][@classCode = 'OBS'][@moodCode = 'EVN']/hl7:code[@codeSystem='2.16.840.1.113883.6.3']"
         id="d16e5194-false-d22455e0">
      <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.2-2018-09-30T000000.html"
              test="@nullFlavor or (@codeSystem='2.16.840.1.113883.6.3' and @codeSystemName='icd10')">(plCdaSecondaryDiagnosis): The element value SHALL be one of 'codeSystem '2.16.840.1.113883.6.3' codeSystemName='icd10''.</assert>
      <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.2-2018-09-30T000000.html"
              test="@code">(plCdaSecondaryDiagnosis): attribute @code SHALL be present.</assert>
      <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.2-2018-09-30T000000.html"
              test="not(@code) or string-length(@code)&gt;0">(plCdaSecondaryDiagnosis): Attribute @code SHALL be of data type 'st'  - '<value-of select="@code"/>'</assert>
      <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.2-2018-09-30T000000.html"
              test="@displayName">(plCdaSecondaryDiagnosis): attribute @displayName SHALL be present.</assert>
      <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.2-2018-09-30T000000.html"
              test="not(@displayName) or string-length(@displayName)&gt;0">(plCdaSecondaryDiagnosis): Attribute @displayName SHALL be of data type 'st'  - '<value-of select="@displayName"/>'</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.2
Context: *[hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.2']]]/hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.2']]/hl7:component[not(@nullFlavor)][hl7:observation[@classCode = 'OBS'][@moodCode = 'EVN']]/hl7:observation[not(@nullFlavor)][@classCode = 'OBS'][@moodCode = 'EVN']/hl7:code[@codeSystem='2.16.840.1.113883.6.260']
Item: (plCdaSecondaryDiagnosis)
-->

   <rule fpi="RULC-1"
         context="*[hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.2']]]/hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.2']]/hl7:component[not(@nullFlavor)][hl7:observation[@classCode = 'OBS'][@moodCode = 'EVN']]/hl7:observation[not(@nullFlavor)][@classCode = 'OBS'][@moodCode = 'EVN']/hl7:code[@codeSystem='2.16.840.1.113883.6.260']"
         id="d16e5203-false-d22476e0">
      <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.2-2018-09-30T000000.html"
              test="@nullFlavor or (@codeSystem='2.16.840.1.113883.6.260' and @codeSystemName='icd10DualCoding')">(plCdaSecondaryDiagnosis): The element value SHALL be one of 'codeSystem '2.16.840.1.113883.6.260' codeSystemName='icd10DualCoding''.</assert>
      <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.2-2018-09-30T000000.html"
              test="@code">(plCdaSecondaryDiagnosis): attribute @code SHALL be present.</assert>
      <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.2-2018-09-30T000000.html"
              test="not(@code) or string-length(@code)&gt;0">(plCdaSecondaryDiagnosis): Attribute @code SHALL be of data type 'st'  - '<value-of select="@code"/>'</assert>
      <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.2-2018-09-30T000000.html"
              test="@displayName">(plCdaSecondaryDiagnosis): attribute @displayName SHALL be present.</assert>
      <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.2-2018-09-30T000000.html"
              test="not(@displayName) or string-length(@displayName)&gt;0">(plCdaSecondaryDiagnosis): Attribute @displayName SHALL be of data type 'st'  - '<value-of select="@displayName"/>'</assert>
   </rule>
   <!--
Template derived rules for ID: 2.16.840.1.113883.3.4424.13.10.4.2
Context: *[hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.2']]]/hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.2']]/hl7:component[not(@nullFlavor)][hl7:observation[@classCode = 'OBS'][@moodCode = 'EVN']]/hl7:observation[not(@nullFlavor)][@classCode = 'OBS'][@moodCode = 'EVN']/hl7:targetSiteCode[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.80-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem) or @nullFlavor]
Item: (plCdaSecondaryDiagnosis)
-->

   <rule fpi="RULC-1"
         context="*[hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.2']]]/hl7:organizer[hl7:templateId[@root = '2.16.840.1.113883.3.4424.13.10.4.2']]/hl7:component[not(@nullFlavor)][hl7:observation[@classCode = 'OBS'][@moodCode = 'EVN']]/hl7:observation[not(@nullFlavor)][@classCode = 'OBS'][@moodCode = 'EVN']/hl7:targetSiteCode[concat(@code, @codeSystem) = doc('include/voc-2.16.840.1.113883.3.4424.13.11.80-DYNAMIC.xml')//valueSet[1]/conceptList/concept/concat(@code, @codeSystem) or @nullFlavor]"
         id="d16e5213-false-d22502e0">
      <let name="theCode" value="@code"/>
      <let name="theCodeSystem" value="@codeSystem"/>
      <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.2-2018-09-30T000000.html"
              test="@nullFlavor or exists(doc('include/voc-2.16.840.1.113883.3.4424.13.11.80-DYNAMIC.xml')//valueSet[1][conceptList/concept[@code = $theCode][@codeSystem = $theCodeSystem]])">(plCdaSecondaryDiagnosis): The element value SHALL be one of '2.16.840.1.113883.3.4424.13.11.80 Strona ciała w rozpoznaniu (DYNAMIC)'.</assert>
   </rule>
</pattern>
