<!--  Results section: 2.16.840.1.113883.10.20.1.14 -->

<!-- errors -->

<pattern id='p-2.16.840.1.113883.10.20.1.14-errors' see='#p-2.16.840.1.113883.10.20.1.14-errors'>
	<title>Results section - errors validation phase</title>

	<rule context='*[cda:templateId/@root="2.16.840.1.113883.10.20.1.14"]'>
	<assert test="self::cda:section">The root of a Results section shall be section in the HL7 namespace.</assert>
	<assert test="cda:text">The Results section SHALL contain a narrative block.</assert>
	<assert test="cda:code">The result section SHALL contain Section / code.</assert>
	<assert test="cda:code[@code='30954-2'][@codeSystem='2.16.840.1.113883.6.1']">The value for Section / code SHALL be 30954-2 Relevant diagnostic tests and/or laboratory data 2.16.840.1.113883.6.1 LOINC STATIC.</assert>
	<assert test="cda:title">The results section SHALL contain Section / title.</assert>
	</rule>
	
</pattern>

<!-- warning -->

<pattern id='p-2.16.840.1.113883.10.20.1.14-warning' see='#p-2.16.840.1.113883.10.20.1.14-warning'>
	<title>Results section - warning validation phase</title>
	<rule context='*[cda:templateId/@root="2.16.840.1.113883.10.20.1.14"]'>
	<assert test='.//cda:templateId[@root="2.16.840.1.113883.10.20.1.32"]'>The Results section SHOULD include one or more result organizers (templateId 2.16.840.1.113883.10.20.1.32).</assert>	
	<assert test="contains(translate(cda:title,'QWERTYUIOPASDFGHJKLZXCVBNM','qwertyuiopasdfghjklzxcvbnm'),'results')">Section / title SHOULD be valued with a case-insensitive language-insensitive text string containing “results”.</assert>
	</rule>
</pattern>

<!-- manual -->

<pattern id='p-2.16.840.1.113883.10.20.1.14-manual' see='#p-2.16.840.1.113883.10.20.1.14-manual'>
	<title>Results section - manual validation phase</title>
	<rule context='*[cda:templateId/@root="2.16.840.1.113883.10.20.1.14"]'>
	<report test='.'></report>
	</rule>
</pattern>

