<!--  Functional status section: 2.16.840.1.113883.10.20.1.5 -->

<!-- errors -->

<pattern id='p-2.16.840.1.113883.10.20.1.5-errors' see='#p-2.16.840.1.113883.10.20.1.5-errors'>
	<title>Functional status section - errors validation phase</title>
	<rule context='*[cda:templateId/@root="2.16.840.1.113883.10.20.1.5"]'>
	<assert test="self::cda:section">The root of a Functional Status section shall be 'section' in the HL7 namespace.</assert>
	<assert test="cda:text">The Functional Status section SHALL contain a narrative block.</assert>
	<assert test="cda:code[@code='47420-5'][@codeSystem='2.16.840.1.113883.6.1']">The value for Section / code SHALL be '47420-5' 'Functional status assessment' 2.16.840.1.113883.6.1 LOINC STATIC.</assert>
	<assert test="cda:title">The Functional Status section SHALL contain Section / title.</assert>
	
	</rule>
</pattern>

<!-- warning -->

<pattern id='p-2.16.840.1.113883.10.20.1.5-warning' see='#p-2.16.840.1.113883.10.20.1.5-warning'>
	<title>Functional status section - warning validation phase</title>
	<rule context='*[cda:templateId/@root="2.16.840.1.113883.10.20.1.5"]'>
	<assert test='descendant::*[cda:templateId/@root="2.16.840.1.113883.10.20.1.27"] | descendant::*[cda:templateId/@root="2.16.840.1.113883.10.20.1.32"]'>The Functional Status section SHOULD include one or more problem acts (templateId 2.16.840.1.113883.10.20.1.27) and/or result organizers (templateId 2.16.840.1.113883.10.20.1.32).</assert>
	<assert test="contains(translate(cda:title,'QWERTYUIOPASDFGHJKLZXCVBNM','qwertyuiopasdfghjklzxcvbnm'),'functional status')">Section / title SHOULD be valued with a case-insensitive language-insensitive text string containing “functional status”.</assert>
	</rule>
</pattern>

<!-- manual -->

<pattern id='p-2.16.840.1.113883.10.20.1.5-manual' see='#p-2.16.840.1.113883.10.20.1.5-manual'>
	<title>Functional status section - manual validation phase</title>
	<rule context='*[cda:templateId/@root="2.16.840.1.113883.10.20.1.5"]'>
	<report test='.'></report>
	</rule>
</pattern>

