<!--  Procedures section: 2.16.840.1.113883.10.20.1.12 -->

<!-- errors -->

<pattern id='p-2.16.840.1.113883.10.20.1.12-errors' see='#p-2.16.840.1.113883.10.20.1.12-errors'>
	<title>Procedures section - errors validation phase</title>
	<rule context='*[cda:templateId/@root="2.16.840.1.113883.10.20.1.12"]'>
	<assert test="cda:text">The Procedures section SHALL contain a narrative block.</assert>
	<assert test="cda:code[@code='47519-4'][@codeSystem='2.16.840.1.113883.6.1']">The procedure section SHALL contain Section / code. The value for "Section / code" SHALL be "47519-4" "History of procedures" 2.16.840.1.113883.6.1 LOINC STATIC.</assert>
	<assert test="cda:title">The procedure section SHALL contain Section / title.</assert>
	</rule>

	<rule context='*[cda:templateId/@root="2.16.840.1.113883.10.20.1.12"]'>
	<!-- KH: I don't see this in the spec -->
	<assert test="self::cda:section">The root of a Procedures section shall be 'section' in the HL7 namespace.</assert>
	</rule>
</pattern>

<!-- warning -->

<pattern id='p-2.16.840.1.113883.10.20.1.12-warning' see='#p-2.16.840.1.113883.10.20.1.12-warning'>
	<title>Procedures section - warning validation phase</title>
	<rule context='*[cda:templateId/@root="2.16.840.1.113883.10.20.1.12"]'>
	<assert test=".//cda:templateId[@root='2.16.840.1.113883.10.20.1.29']">The procedure section SHOULD contain clinical statements, which SHOULD include one or more procedure activities (templateId 2.16.840.1.113883.10.20.1.29).</assert>
	<assert test="contains(translate(cda:title,'QWERTYUIOPASDFGHJKLZXCVBNM','qwertyuiopasdfghjklzxcvbnm'),'procedures')">Section / title SHOULD be valued with a case-insensitive language-insensitive text string containing “procedures”.</assert>
	</rule>
</pattern>

<!-- manual -->

<pattern id='p-2.16.840.1.113883.10.20.1.12-manual' see='#p-2.16.840.1.113883.10.20.1.12-manual'>
	<title>Procedures section - manual validation phase</title>
	<rule context='*[cda:templateId/@root="2.16.840.1.113883.10.20.1.12"]'>
	<report test='.'></report>
	</rule>
</pattern>

