source: qrda/schematron/templates/2.16.840.1.113883.10.20.12.ent@ 906

Last change on this file since 906 was 906, checked in by George Lilly, 14 years ago

initial QRDA schematron checking

File size: 14.8 KB
Line 
1<!-- HL7 QRDA Category I Header (Section 2) -->
2
3<!-- errors -->
4 <pattern id="p-2.16.840.1.113883.10.20.12-errors">
5 <title>HL7 QRDA Category I Header (Section 2) - errors validation phase</title>
6
7 <rule context='/'>
8 <assert test='.//cda:templateId/@root="2.16.840.1.113883.10.20.12"'>
9 Error: CONF-QRDA-I-5: The value of one ClinicalDocument/templateId/@root SHALL be
10 2.16.840.1.113883.10.20.12 representing conformance to the generic
11 QRDA Category I framework constraints.
12 </assert>
13 </rule>
14
15 <rule context='*[cda:templateId/@root="2.16.840.1.113883.10.20.12"]'>
16 <assert test='cda:realmCode[@code = "US"]'>
17 Error: CONF-QRDA-I-2: The realmCode element SHALL be present where the value of @code is US.
18 </assert>
19 <assert test='cda:typeId[@root = "2.16.840.1.113883.1.3" and @extension = "POCD_HD000040"]'>
20 Error: CONF-QRDA-I-3: The value of typeId/@root SHALL be 2.16.840.1.113883.1.3 and value of
21 typeId/@extension SHALL be POCD_HD000040.
22 </assert>
23 <assert test='count(cda:code) = 1 and cda:code[@code="55182-0" and @codeSystem="2.16.840.1.113883.6.1"]'>
24 Error: CONF-QRDA-I-6: A QRDA Category I report SHALL contain exactly one
25 ClinicalDocument/code with a value of 55182-0 2.16.840.1.113883.6.1
26 LOINC STATIC.
27 </assert>
28 <assert test="contains(translate(cda:title,'QWERTYUIOPASDFGHJKLZXCVBNM','qwertyuiopasdfghjklzxcvbnm'),'qrda incidence report') or
29 contains(translate(cda:title,'QWERTYUIOPASDFGHJKLZXCVBNM','qwertyuiopasdfghjklzxcvbnm'),'quality measure report')">
30 Error: CONF-QRDA-I-7: A QRDA Category I report SHALL contain exactly one
31 ClinicalDocument/title element valued with a case-insensitive, text
32 string containing "QRDA Incidence Report" or "Quality measure
33 Report".
34 </assert>
35 <assert test='count(cda:recordTarget/cda:patientRole) = 1'>
36 Error: CONF-QRDA-I-8: A QRDA Category I report SHALL contain exactly one
37 ClinicalDocument/recordTarget/PatientRole.
38 </assert>
39 <assert test='cda:author/cda:assignedAuthor/cda:assignedPerson or
40 cda:author/cda:assignedAuthor/cda:assignedAuthoringDevice '>
41 Error: CONF-QRDA-I-9: A QRDA Category I report SHALL contain one or more
42 ClinicalDocument/author/assignedAuthor/assignedPerson and/or
43 ClinicalDocument/author/assignedAuthor/assignedAuthoringDevice.
44 </assert>
45 <assert test='count(cda:informant) = 1'>
46 Error: CONF-QRDA-I-10: A QRDA Category I report SHALL contain exactly one
47 ClinicalDocument/informant, which represents the reporting facility.
48 CONF-QRDA-I-11: An organization source of information SHALL be represented with
49 informant.
50 </assert>
51 <assert test='cda:custodian/cda:assignedCustodian/cda:representedCustodianOrganization/cda:id/@root or
52 cda:custodian/cda:assignedCustodian/cda:representedCustodianOrganization/cda:id[@nullFlavor="MSK"]'>
53 Error: CONF-QRDA-I-12: A QRDA Category I report SHALL contain exactly one
54 custodian/assignedCustodian/representedCustodianOrganization/
55 id element.
56 CONF-QRDA-I-13: The value of custodian/assignedCustodian/
57 representedCustodianOrganization/id element @root SHALL be the id
58 root of the custodian organization.
59 </assert>
60 <assert test='not(cda:legalAuthenticator) or count(cda:legalAuthenticator/cda:time) = 1'>
61 Error: CONF-QRDA-I-15: If present, a QRDA Category I report legalAuthenticator SHALL
62 contain exactly one ClinicalDocument/legalAuthenticator/time element.
63 </assert>
64 <assert test='not(cda:legalAuthenticator) or count(cda:legalAuthenticator/cda:signatureCode) = 1'>
65 Error: CONF-QRDA-I-16: If present, a QRDA Category I report legalAuthenticator SHALL
66 contain exactly one signatureCode element.
67 </assert>
68 <assert test='not(cda:legalAuthenticator) or
69 cda:legalAuthenticator/cda:signatureCode[@code="S"] or
70 cda:legalAuthenticator/cda:signatureCode[@nullFlavor="MSK"]'>
71 Error: CONF-QRDA-I-17: The value of a QRDA ClinicalDocument/signatureCode/@code
72 SHALL be S.
73 </assert>
74 <assert test='not(cda:legalAuthenticator) or
75 cda:legalAuthenticator/cda:assignedEntity'>
76 Error: CONF-QRDA-I-18: If present, a QRDA Category I report legalAuthenticator SHALL
77 contain exactly one assignedEntity element that represents the legal
78 authenticator of the document.
79 </assert>
80 <assert test='not(cda:legalAuthenticator) or
81 cda:legalAuthenticator/cda:assignedEntity/cda:id'>
82 Error: CONF-QRDA-I-19: The ClinicalDocument/legalAuthenticator/assigned entity
83 SHALL contain an id element.
84 </assert>
85 <assert test='cda:component/cda:structuredBody'>
86 Error: CONF-QRDA-I-20: A QRDA Category I report SHALL contain exactly one
87 ClinicalDocument/component/structuredBody.
88 </assert>
89<!--
90
91Changed as per email discussion between Len Gallagher and Liora Alschuler
92
93 <assert test='count(cda:component/cda:structuredBody/cda:component/cda:section/cda:code[@code="55186-1" and @codeSystem="2.16.840.1.113883.6.1"]) &gt; 0'>
94 Error: CONF-QRDA-I-21: A QRDA Category I report SHALL contain at least one and MAY contain
95 more than one non-nested top-level Measure section each containing
96 information about a single measure.
97 </assert>
98-->
99
100 <assert test='count(.//cda:section/cda:code[@code="55186-1" and @codeSystem="2.16.840.1.113883.6.1"]) &gt; 0'>
101 Error: CONF-QRDA-I-21: A QRDA Category I report SHALL contain at least one and MAY contain
102 more than one Measure section each containing information about a single measure.
103 </assert>
104
105 </rule>
106
107
108<!-- Measure Section -->
109
110 <rule context='*[cda:code[@code="55186-1" and @codeSystem="2.16.840.1.113883.6.1"]]'>
111<!--
112 <assert test='self::/cda:ClinicalDocument/cda:component/cda:structuredBody/cda:component/cda:section or
113 parent::cda:section[@code="55185-3" and @codeSystem="2.16.840.1.113883.6.1"]/cda:component'>
114 Error: CONF-QRDA-I-22: The Measure section SHALL be a top-level section if it is not part of a
115 measure set.
116 </assert>
117-->
118 <assert test='self::cda:section[parent::cda:component[parent::cda:structuredBody[parent::cda:component[parent::cda:ClinicalDocument]]]] or
119 parent::cda:section[@code="55185-3" and @codeSystem="2.16.840.1.113883.6.1"]/cda:component'>
120 Error: CONF-QRDA-I-22: The Measure section SHALL be a top-level section if it is not part of a
121 measure set.
122 </assert>
123
124 <assert test='cda:templateId'>
125 Error: CONF-QRDA-I-33: The Measure section SHALL contain at least one templateId uniquely
126 identifying each Measure name and version
127 </assert>
128 <assert test='not(parent::cda:section[@code="55185-3" and @codeSystem="2.16.840.1.113883.6.1"]/cda:entry) or
129 contains(translate(cda:title,"QWERTYUIOPASDFGHJKLZXCVBNM","qwertyuiopasdfghjklzxcvbnm"),"measure section: ")'>
130 Error: CONF-QRDA-I-36: A non-nested Measure section SHALL be valued with section/title
131 with a case-insensitive, text string containing "measure section:
132 &lt;measure name&gt;".
133 </assert>
134 <assert test='not(parent::cda:ClinicalDocument/cda:component/cda:structuredBody/cda:component/cda:section) or
135 contains(translate(cda:title,"QWERTYUIOPASDFGHJKLZXCVBNM","qwertyuiopasdfghjklzxcvbnm"),"measure section")'>
136 Error: CONF-QRDA-I-37: A nested Measure section SHALL be valued with section/title with
137 a case-insensitive, text string containing "measure section".
138 </assert>
139 <assert test='count(.//cda:section[cda:code[@code = "55187-9" and @codeSystem="2.16.840.1.113883.6.1"]]) = 1'>
140 Error: CONF-QRDA-I-39: A Measure section SHALL contain exactly one nested Reporting
141 Parameters section (as described in Section 2.4.3 Reporting Parameters
142 Section).
143 </assert>
144 <assert test='count(.//cda:section[cda:code[@code = "55188-7" and @codeSystem="2.16.840.1.113883.6.1"]]) = 1'>
145 Error: CONF-QRDA-I-40: A Measure section SHALL contain exactly one nested Patient Data
146 section (as described in Section 2.4.4 Patient Data Section).
147 </assert>
148 <assert test='cda:entry/cda:act[@classCode="ACT" and @moodCode="DEF"]'>
149 Error: CONF-QRDA-I-42: Each measure SHALL be represented with act.
150 CONF-QRDA-I-43: For each act in the Measure section, the value for act/@classCode
151 in a measure act SHALL be ACT 2.16.840.1.113883.5.6 ActClass STATIC.
152 CONF-QRDA-I-44: For each act in the Measure section the act/@moodCode in a
153 measure act SHALL be DEF 2.16.840.1.113883.5.1001 ActMood STATIC.
154 </assert>
155 </rule>
156
157<!-- Measure -->
158
159 <rule context='*[cda:code[@code="55186-1" and @codeSystem="2.16.840.1.113883.6.1"]]/cda:entry/cda:act[@classCode="ACT" and @moodCode="DEF"]'>
160 <assert test='cda:code'>
161 Error: CONF-QRDA-I-45: For each act in the Measure section there SHALL be an act/code
162 reflecting the measure name and version.
163 </assert>
164 </rule>
165
166<!-- Measure Set Section -->
167
168 <rule context='*[cda:code[@code="55185-3" and @codeSystem="2.16.840.1.113883.6.1"]]'>
169 <assert test='count(.//cda:section[cda:code[@code="55186-1" and @codeSystem="2.16.840.1.113883.6.1"]]) = 1'>
170 Error: CONF-QRDA-I-24: The Measure Set section SHALL contain one nested Measure section
171 and SHALL NOT contain more than one nested Measure section.
172 </assert>
173 <assert test='cda:templateId'>
174 Error: CONF-QRDA-I-26: The Measure Set section SHALL contain a templateId uniquely
175 identifying the Measure Set name and version.
176 </assert>
177 <assert test="contains(translate(cda:title,'QWERTYUIOPASDFGHJKLZXCVBNM','qwertyuiopasdfghjklzxcvbnm'),'measure set: ')">
178 Error: CONF-QRDA-I-29: The Measure Set section SHALL be valued with section/title with a
179 case-insensitive, text string containing "Measure set: &lt;measure set
180 name&gt;".
181 </assert>
182 <assert test='count(.//cda:section/cda:code[@code="55186-1" and @codeSystem="2.16.840.1.113883.6.1"]) &gt; 0 '>
183 Error: CONF-QRDA-I-31: The nested Measure section SHALL contain at least one measure that
184 belongs to the measure set.
185 </assert>
186 </rule>
187
188<!-- Reporting Parameters Section -->
189
190 <rule context='*[cda:code[@code="55187-9" and @codeSystem="2.16.840.1.113883.6.1"]]'>
191 <assert test='contains(translate(cda:title,"QWERTYUIOPASDFGHJKLZXCVBNM","qwertyuiopasdfghjklzxcvbnm"),"reporting parameters")'>
192 Error: CONF-QRDA-I-49: The Reporting Parameters section SHALL be valued with
193 section/title with a case-insensitive, text string containing "Reporting
194 Parameters".
195 </assert>
196 <assert test='cda:entry/cda:act[@classCode="ACT" and @moodCode="EVN"]/cda:code[@code="252116004" and @codeSystem="2.16.840.1.113883.6.96"]'>
197 Error: CONF-QRDA-I-50: The Reporting Parameters section SHALL contain exactly one
198 Observation Parameters Act, represented as an act.
199 CONF-QRDA-I-51: The value for act/@classCode in an Observation Parameters Act
200 SHALL be ACT 2.16.840.1.113883.5.6 ActClass STATIC.
201 CONF-QRDA-I-52: The value for act/@moodCode in an Observation Parameters Act
202 SHALL be EVN 2.16.840.1.113883.5.1001 ActMood STATIC.
203 CONF-QRDA-I-53: The value for act/code SHALL be 252116004 Observation
204 Parameters 2.16.840.1.113883.6.96 SNOMED-CT STATIC.
205 </assert>
206 <assert test='cda:entry/cda:act[@classCode="ACT" and @moodCode="EVN"][cda:code[@code="252116004" and @codeSystem="2.16.840.1.113883.6.96"]]/cda:effectiveTime[cda:low and cda:high]'>
207 Error: CONF-QRDA-I-54: The reporting time period SHALL be represented with an
208 effectiveTime/low element combined with a high element representing
209 respectively the first and last days of the period reported.
210 </assert>
211 </rule>
212
213<!-- Patient Data Section -->
214
215 <rule context='*[cda:code[@code="55188-7" and @codeSystem="2.16.840.1.113883.6.1"]]'>
216 <assert test='contains(translate(cda:title,"QWERTYUIOPASDFGHJKLZXCVBNM","qwertyuiopasdfghjklzxcvbnm"),"patient data")'>
217 Error: CONF-QRDA-I-57: The Patient Data section SHALL be valued with section/title with a
218 case-insensitive, text string containing "Patient Data".
219 </assert>
220
221 </rule>
222
223 </pattern>
224
225 <pattern id="p-2.16.840.1.113883.10.20.12-warnings">
226 <title>HL7 QRDA Category I Header (Section 2) - warning validation phase</title>
227 <rule context='*[cda:templateId/@root="2.16.840.1.113883.10.20.12"]'>
228 <assert test='count(cda:legalAuthenticator) = 1'>
229 Warning: CONF-QRDA-I-14: A QRDA Category I report SHOULD contain exactly one
230 legalAuthenticator element.
231 </assert>
232 </rule>
233 </pattern>
234
235 <pattern id="p-2.16.840.1.113883.10.20.12-notes">
236 <title>HL7 QRDA Category I Header (Section 2) - note validation phase</title>
237 <rule context='*[cda:templateId/@root="2.16.840.1.113883.10.20.12"]'>
238 <assert test='count(cda:component/cda:structuredBody/cda:component/cda:section/cda:code[@code="55186-1" and @codeSystem="2.16.840.1.113883.6.1"]) &gt; 1'>
239 Note: CONF-QRDA-I-21: A QRDA Category I report ... MAY contain
240 more than one non-nested top-level Measure section each containing
241 information about a single measure.
242 </assert>
243 <assert test='.//cda:section/cda:code[@code="55185-3" and @codeSystem="2.16.840.1.113883.6.1"]'>
244 Note: CONF-QRDA-I-23: A QRDA Category I report MAY contain one or more Measure Set
245 sections.
246 </assert>
247 <assert test='cda:component/cda:structuredBody/cda:component/cda:section/cda:code[@code="55186-1" and @codeSystem="2.16.840.1.113883.6.1"] and
248 .//cda:section/cda:code[@code="55185-3" and @codeSystem="2.16.840.1.113883.6.1"]'>
249 Note: CONF-QRDA-I-25: A QRDA Category I report MAY contain both Measure Set sections and
250 individual top-level Measure sections.
251 </assert>
252
253 </rule>
254
255<!-- Measure Section -->
256
257 <rule context='*[cda:code[@code="55186-1" and @codeSystem="2.16.840.1.113883.6.1"]]'>
258
259 <assert test='cda:text'>
260 Note: CONF-QRDA-I-41: The Measure section MAY contain a section/text element for the
261 description of the measure(s).
262 </assert>
263 </rule>
264
265<!-- Measure -->
266
267 <rule context='*[cda:code[@code="55186-1" and @codeSystem="2.16.840.1.113883.6.1"]]/cda:entry/cda:act[@classCode="ACT" and @moodCode="DEF"]'>
268 <assert test='cda:text'>
269 Note: CONF-QRDA-I-46: Each measure act MAY contain an act/text element containing a
270 description of the measure.
271 </assert>
272 </rule>
273
274<!-- Measure Set Section -->
275
276 <rule context='*[cda:code[@code="55185-3" and @codeSystem="2.16.840.1.113883.6.1"]]'>
277 <assert test='cda:text'>
278 Note: CONF-QRDA-I-30: The Measure Set section MAY contain a section/text element for
279 the description of the measure set or MAY contain a formal representation of
280 a description of the measure set.
281 </assert>
282 </rule>
283 </pattern>
284
Note: See TracBrowser for help on using the repository browser.