health-data-standards 3.5.3 → 3.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (140) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -3
  3. data/README.md +10 -2
  4. data/lib/health-data-standards.rb +5 -28
  5. data/lib/health-data-standards/export/cat_1.rb +3 -2
  6. data/lib/health-data-standards/export/cat_1_r2.rb +11 -0
  7. data/lib/health-data-standards/ext/node.rb +1 -2
  8. data/lib/health-data-standards/import/bulk_record_importer.rb +4 -4
  9. data/lib/health-data-standards/import/bundle/importer.rb +62 -0
  10. data/lib/health-data-standards/import/c32/insurance_provider_importer.rb +10 -8
  11. data/lib/health-data-standards/import/cat1/patient_importer.rb +3 -3
  12. data/lib/health-data-standards/import/cat1/procedure_importer.rb +42 -0
  13. data/lib/health-data-standards/import/cda/medication_importer.rb +11 -11
  14. data/lib/health-data-standards/import/cda/section_importer.rb +13 -7
  15. data/lib/health-data-standards/models/cqm/aggregate_objects.rb +5 -1
  16. data/lib/health-data-standards/models/cqm/bundle.rb +5 -3
  17. data/lib/health-data-standards/models/cqm/measure.rb +1 -1
  18. data/lib/health-data-standards/models/entry.rb +5 -1
  19. data/lib/health-data-standards/models/record.rb +10 -0
  20. data/lib/health-data-standards/models/reference.rb +23 -0
  21. data/lib/health-data-standards/models/svs/value_set.rb +4 -3
  22. data/lib/health-data-standards/railtie.rb +1 -1
  23. data/lib/health-data-standards/tasks.rb +1 -0
  24. data/lib/health-data-standards/tasks/bundle.rake +84 -2
  25. data/lib/health-data-standards/util/vs_api.rb +40 -7
  26. data/lib/health-data-standards/validate/base_validator.rb +23 -0
  27. data/lib/health-data-standards/validate/data_validator.rb +85 -0
  28. data/lib/health-data-standards/validate/measure_validator.rb +127 -0
  29. data/lib/health-data-standards/validate/performance_rate_validator.rb +94 -0
  30. data/lib/health-data-standards/validate/reported_result_extractor.rb +170 -0
  31. data/lib/health-data-standards/validate/schema_validator.rb +24 -0
  32. data/lib/health-data-standards/validate/schematron/c_processor.rb +28 -0
  33. data/lib/health-data-standards/validate/schematron/java_processor.rb +93 -0
  34. data/lib/health-data-standards/validate/schematron_validator.rb +34 -0
  35. data/lib/health-data-standards/validate/validation_error.rb +10 -0
  36. data/lib/health-data-standards/validate/validators.rb +80 -0
  37. data/lib/hqmf-generator/fulfills.xml.erb +7 -0
  38. data/lib/hqmf-generator/hqmf-generator.rb +8 -3
  39. data/lib/hqmf-model/data_criteria.rb +3 -0
  40. data/lib/hqmf-model/types.rb +29 -0
  41. data/lib/hqmf-parser/2.0/data_criteria.rb +7 -0
  42. data/lib/hqmf-parser/2.0/types.rb +24 -0
  43. data/resources/schema/infrastructure/cda/CDA_SDTC.xsd +44 -0
  44. data/resources/schema/infrastructure/cda/POCD_MT000040_SDTC.xsd +1500 -0
  45. data/resources/schema/infrastructure/cda/SDTC.xsd +210 -0
  46. data/resources/schema/processable/coreschemas/NarrativeBlock.xsd +557 -0
  47. data/resources/schema/processable/coreschemas/datatypes-base_SDTC.xsd +1850 -0
  48. data/resources/schema/processable/coreschemas/datatypes.xsd +1375 -0
  49. data/resources/schema/processable/coreschemas/infrastructureRoot.xsd +27 -0
  50. data/resources/schema/processable/coreschemas/voc.xsd +2124 -0
  51. data/resources/schematron/iso-schematron-xslt1/ExtractSchFromRNG.xsl +75 -0
  52. data/resources/schematron/iso-schematron-xslt1/ExtractSchFromXSD.xsl +77 -0
  53. data/resources/schematron/iso-schematron-xslt1/iso_abstract_expand.xsl +297 -0
  54. data/resources/schematron/iso-schematron-xslt1/iso_dsdl_include.xsl +1509 -0
  55. data/resources/schematron/iso-schematron-xslt1/iso_schematron_message.xsl +55 -0
  56. data/resources/schematron/iso-schematron-xslt1/iso_schematron_skeleton_for_xslt1.xsl +1844 -0
  57. data/resources/schematron/iso-schematron-xslt1/iso_svrl_for_xslt1.xsl +605 -0
  58. data/resources/schematron/iso-schematron-xslt1/readme.txt +101 -0
  59. data/resources/schematron/iso-schematron-xslt1/schematron-skeleton-api.htm +723 -0
  60. data/resources/schematron/iso-schematron-xslt2/ExtractSchFromRNG-2.xsl +75 -0
  61. data/resources/schematron/iso-schematron-xslt2/ExtractSchFromXSD-2.xsl +77 -0
  62. data/resources/schematron/iso-schematron-xslt2/iso_abstract_expand.xsl +297 -0
  63. data/resources/schematron/iso-schematron-xslt2/iso_dsdl_include.xsl +1508 -0
  64. data/resources/schematron/iso-schematron-xslt2/iso_schematron_message_xslt2.xsl +55 -0
  65. data/resources/schematron/iso-schematron-xslt2/iso_schematron_skeleton_for_saxon.xsl +2299 -0
  66. data/resources/schematron/iso-schematron-xslt2/iso_svrl_for_xslt2.xsl +684 -0
  67. data/resources/schematron/iso-schematron-xslt2/readme.txt +100 -0
  68. data/resources/schematron/iso-schematron-xslt2/sch-messages-cs.xhtml +56 -0
  69. data/resources/schematron/iso-schematron-xslt2/sch-messages-de.xhtml +57 -0
  70. data/resources/schematron/iso-schematron-xslt2/sch-messages-en.xhtml +57 -0
  71. data/resources/schematron/iso-schematron-xslt2/sch-messages-fr.xhtml +54 -0
  72. data/resources/schematron/iso-schematron-xslt2/sch-messages-nl.xhtml +58 -0
  73. data/resources/schematron/iso-schematron-xslt2/schematron-skeleton-api.htm +723 -0
  74. data/resources/schematron/qrda/cat_1/CDAR2_QRDA_I_R1_D3_2015MAY_Schematron.sch +4676 -0
  75. data/resources/schematron/qrda/cat_1/voc.xml +1177 -0
  76. data/resources/schematron/qrda/cat_1_r2/QRDA Category I Release 2.sch +4069 -0
  77. data/resources/schematron/qrda/cat_1_r2/voc.xml +1065 -0
  78. data/resources/schematron/qrda/cat_3/QRDA Category III.sch +675 -0
  79. data/resources/schematron/qrda/cat_3/voc.xml +21 -0
  80. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.26.cat1.erb +18 -0
  81. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.32.cat1.erb +4 -0
  82. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.38.cat1.erb +5 -1
  83. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.4.cat1.erb +1 -0
  84. data/templates/cat1/_2.16.840.1.113883.10.20.24.3.64.cat1.erb +20 -0
  85. data/templates/cat1/_fulfills.cat1.erb +14 -0
  86. data/templates/cat1/_organization.cat1.erb +2 -1
  87. data/templates/cat1/_patient_data.cat1.erb +1 -1
  88. data/templates/cat1/show.cat1.erb +5 -4
  89. data/templates/cat3/_performance_rate.cat3.erb +5 -1
  90. data/templates/cat3/show.cat3.erb +1 -1
  91. metadata +128 -109
  92. data/lib/health-data-standards/export/ccr.rb +0 -417
  93. data/lib/health-data-standards/export/green_c32/entry.rb +0 -18
  94. data/lib/health-data-standards/export/green_c32/export_generator.rb +0 -23
  95. data/lib/health-data-standards/export/green_c32/record.rb +0 -18
  96. data/lib/health-data-standards/export/helper/gc32_view_helper.rb +0 -39
  97. data/lib/health-data-standards/import/ccr/patient_importer.rb +0 -238
  98. data/lib/health-data-standards/import/ccr/product_importer.rb +0 -60
  99. data/lib/health-data-standards/import/ccr/provider_importer.rb +0 -49
  100. data/lib/health-data-standards/import/ccr/result_importer.rb +0 -49
  101. data/lib/health-data-standards/import/ccr/section_importer.rb +0 -135
  102. data/lib/health-data-standards/import/ccr/simple_importer.rb +0 -30
  103. data/lib/health-data-standards/import/green_c32/advance_directive_importer.rb +0 -14
  104. data/lib/health-data-standards/import/green_c32/allergy_importer.rb +0 -20
  105. data/lib/health-data-standards/import/green_c32/care_goal_importer.rb +0 -26
  106. data/lib/health-data-standards/import/green_c32/condition_importer.rb +0 -38
  107. data/lib/health-data-standards/import/green_c32/encounter_importer.rb +0 -33
  108. data/lib/health-data-standards/import/green_c32/immunization_importer.rb +0 -23
  109. data/lib/health-data-standards/import/green_c32/medical_equipment_importer.rb +0 -24
  110. data/lib/health-data-standards/import/green_c32/medication_importer.rb +0 -68
  111. data/lib/health-data-standards/import/green_c32/patient_importer.rb +0 -14
  112. data/lib/health-data-standards/import/green_c32/procedure_importer.rb +0 -27
  113. data/lib/health-data-standards/import/green_c32/result_importer.rb +0 -43
  114. data/lib/health-data-standards/import/green_c32/section_importer.rb +0 -186
  115. data/lib/health-data-standards/import/green_c32/social_history_importer.rb +0 -13
  116. data/lib/health-data-standards/import/green_c32/support_importer.rb +0 -22
  117. data/lib/health-data-standards/import/green_c32/vital_sign_importer.rb +0 -21
  118. data/templates/gc32/_address.gc32.erb +0 -9
  119. data/templates/gc32/_advance_directive.gc32.erb +0 -5
  120. data/templates/gc32/_allergy.gc32.erb +0 -12
  121. data/templates/gc32/_care_goal.gc32.erb +0 -8
  122. data/templates/gc32/_condition.gc32.erb +0 -10
  123. data/templates/gc32/_encounter.gc32.erb +0 -28
  124. data/templates/gc32/_entry.gc32.erb +0 -3
  125. data/templates/gc32/_entry_attributes.gc32.erb +0 -10
  126. data/templates/gc32/_immunization.gc32.erb +0 -9
  127. data/templates/gc32/_insurance_provider.gc32.erb +0 -28
  128. data/templates/gc32/_medical_equipment.gc32.erb +0 -6
  129. data/templates/gc32/_medication.gc32.erb +0 -91
  130. data/templates/gc32/_name.gc32.erb +0 -11
  131. data/templates/gc32/_organization.gc32.erb +0 -10
  132. data/templates/gc32/_person_attributes.gc32.erb +0 -7
  133. data/templates/gc32/_procedure.gc32.erb +0 -9
  134. data/templates/gc32/_provider.gc32.erb +0 -9
  135. data/templates/gc32/_result.gc32.erb +0 -12
  136. data/templates/gc32/_social_history.gc32.erb +0 -6
  137. data/templates/gc32/_support.gc32.erb +0 -15
  138. data/templates/gc32/_telecom.gc32.erb +0 -1
  139. data/templates/gc32/_vital_sign.gc32.erb +0 -4
  140. data/templates/gc32/record.gc32.erb +0 -97
@@ -0,0 +1,605 @@
1
+ <?xml version="1.0" ?>
2
+ <!--
3
+ ISO_SVRL.xsl
4
+
5
+ Implementation of Schematron Validation Report Language from ISO Schematron
6
+ ISO/IEC 19757 Document Schema Definition Languages (DSDL)
7
+ Part 3: Rule-based validation Schematron
8
+ Annex D: Schematron Validation Report Language
9
+
10
+ This ISO Standard is available free as a Publicly Available Specification in PDF from ISO.
11
+ Also see www.schematron.com for drafts and other information.
12
+
13
+ This implementation of SVRL is designed to run with the "Skeleton" implementation
14
+ of Schematron which Oliver Becker devised. The skeleton code provides a
15
+ Schematron implementation but with named templates for handling all output;
16
+ the skeleton provides basic templates for output using this API, but client
17
+ validators can be written to import the skeleton and override the default output
18
+ templates as required. (In order to understand this, you must understand that
19
+ a named template such as "process-assert" in this XSLT stylesheet overrides and
20
+ replaces any template with the same name in the imported skeleton XSLT file.)
21
+
22
+ The other important thing to understand in this code is that there are different
23
+ versions of the Schematron skeleton. These track the development of Schematron through
24
+ Schematron 1.5, Schematron 1.6 and now ISO Schematron. One only skeleton must be
25
+ imported. The code has templates for the different skeletons commented out for
26
+ convenience. ISO Schematron has a different namespace than Schematron 1.5 and 1.6;
27
+ so the ISO Schematron skeleton has been written itself with an optional import
28
+ statement to in turn import the Schematron 1.6 skeleton. This will allow you to
29
+ validate with schemas from either namespace.
30
+
31
+
32
+ History:
33
+ 2010-04-14
34
+ * Add command line parameter 'terminate' which will terminate on first failed
35
+ assert and (optionally) successful report.
36
+ 2009-03-18
37
+ * Fix atrribute with space "see " which generates wrong name in some processors
38
+ 2008-08-11
39
+ * RJ Fix attribute/@select which saxon allows in XSLT 1
40
+ 2008-08-07
41
+ * RJ Add output-encoding attribute to specify final encoding to use
42
+ * Alter allow-foreign functionality so that Schematron span, emph and dir elements make
43
+ it to the output, for better formatting and because span can be used to mark up
44
+ semantically interesting information embedded in diagnostics, which reduces the
45
+ need to extend SVRL itself
46
+ * Diagnostic-reference had an invalid attribute @id that duplicated @diagnostic: removed
47
+ 2008-08-06
48
+ * RJ Fix invalid output: svrl:diagnostic-reference is not contained in an svrl:text
49
+ * Output comment to SVRL file giving filename if available (from command-line parameter)
50
+ 2008-08-04
51
+ * RJ move sch: prefix to schold: prefix to prevent confusion (we want people to
52
+ be able to switch from old namespace to new namespace without changing the
53
+ sch: prefix, so it is better to keep that prefix completely out of the XSLT)
54
+ * Extra signature fixes (PH)
55
+ 2008-08-03
56
+ * Repair missing class parameter on process-p
57
+ 2008-07-31
58
+ * Update skeleton names
59
+ 2007-04-03
60
+ * Add option generate-fired-rule (RG)
61
+ 2007-02-07
62
+ * Prefer true|false for parameters. But allow yes|no on some old for compatability
63
+ * DP Diagnostics output to svrl:text. Diagnosis put out after assertion text.
64
+ * Removed non-SVRL elements and attributes: better handled as an extra layer that invokes this one
65
+ * Add more formal parameters
66
+ * Correct confusion between $schemaVersion and $queryBinding
67
+ * Indent
68
+ * Validate against RNC schemas for XSLT 1 and 2 (with regex tests removed)
69
+ * Validate output with UniversalTest.sch against RNC schema for ISO SVRL
70
+
71
+ 2007-02-01
72
+ * DP. Update formal parameters of overriding named templates to handle more attributes.
73
+ * DP. Refactor handling of rich and linkable parameters to a named template.
74
+
75
+ 2007-01-22
76
+ * DP change svrl:ns to svrl:ns-in-attribute-value
77
+ * Change default when no queryBinding from "unknown" to "xslt"
78
+
79
+ 2007-01-18:
80
+ * Improve documentation
81
+ * KH Add command-line options to generate paths or not
82
+ * Use axsl:attribute rather than xsl:attribute to shut XSLT2 up
83
+ * Add extra command-line options to pass to the iso_schematron_skeleton
84
+
85
+ 2006-12-01: iso_svrl.xsl Rick Jelliffe,
86
+ * update namespace,
87
+ * update phase handling,
88
+ * add flag param to process-assert and process-report & @ flag on output
89
+
90
+ 2001: Conformance1-5.xsl Rick Jelliffe,
91
+ * Created, using the skeleton code contributed by Oliver Becker
92
+ -->
93
+ <!--
94
+ Derived from Conformance1-5.xsl.
95
+
96
+ Copyright (c) 2001-2010 Rick Jelliffe and Academia Sinica Computing Center, Taiwan
97
+
98
+ This software is provided 'as-is', without any express or implied warranty.
99
+ In no event will the authors be held liable for any damages arising from
100
+ the use of this software.
101
+
102
+ Permission is granted to anyone to use this software for any purpose,
103
+ including commercial applications, and to alter it and redistribute it freely,
104
+ subject to the following restrictions:
105
+
106
+ 1. The origin of this software must not be misrepresented; you must not claim
107
+ that you wrote the original software. If you use this software in a product,
108
+ an acknowledgment in the product documentation would be appreciated but is
109
+ not required.
110
+
111
+ 2. Altered source versions must be plainly marked as such, and must not be
112
+ misrepresented as being the original software.
113
+
114
+ 3. This notice may not be removed or altered from any source distribution.
115
+ -->
116
+
117
+ <!-- Ideas nabbed from schematrons by Francis N., Miloslav N. and David C. -->
118
+
119
+ <!-- The command-line parameters are:
120
+ phase NMTOKEN | "#ALL" (default) Select the phase for validation
121
+ allow-foreign "true" | "false" (default) Pass non-Schematron elements and rich markup to the generated stylesheet
122
+ diagnose= true | false|yes|no Add the diagnostics to the assertion test in reports (yes|no are obsolete)
123
+ generate-paths=true|false|yes|no generate the @location attribute with XPaths (yes|no are obsolete)
124
+ sch.exslt.imports semi-colon delimited string of filenames for some EXSLT implementations
125
+ optimize "visit-no-attributes" Use only when the schema has no attributes as the context nodes
126
+ generate-fired-rule "true"(default) | "false" Generate fired-rule elements
127
+ terminate= yes | no | true | false | assert Terminate on the first failed assertion or successful report
128
+ Note: whether any output at all is generated depends on the XSLT implementation.
129
+ -->
130
+
131
+ <xsl:stylesheet
132
+ version="1.0"
133
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
134
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
135
+ xmlns:axsl="http://www.w3.org/1999/XSL/TransformAlias"
136
+ xmlns:schold="http://www.ascc.net/xml/schematron"
137
+ xmlns:iso="http://purl.oclc.org/dsdl/schematron"
138
+ xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
139
+ >
140
+
141
+ <!-- Select the import statement and adjust the path as
142
+ necessary for your system.
143
+ If not XSLT2 then also remove svrl:active-pattern/@document="{document-uri()}" from process-pattern()
144
+ -->
145
+ <!--
146
+ <xsl:import href="iso_schematron_skeleton_for_saxon.xsl"/>
147
+ -->
148
+
149
+ <xsl:import href="iso_schematron_skeleton_for_xslt1.xsl"/>
150
+ <!--
151
+ <xsl:import href="iso_schematron_skeleton.xsl"/>
152
+ <xsl:import href="skeleton1-5.xsl"/>
153
+ <xsl:import href="skeleton1-6.xsl"/>
154
+ -->
155
+
156
+ <xsl:param name="diagnose" >true</xsl:param>
157
+ <xsl:param name="phase" >
158
+ <xsl:choose>
159
+ <!-- Handle Schematron 1.5 and 1.6 phases -->
160
+ <xsl:when test="//schold:schema/@defaultPhase">
161
+ <xsl:value-of select="//schold:schema/@defaultPhase"/>
162
+ </xsl:when>
163
+ <!-- Handle ISO Schematron phases -->
164
+ <xsl:when test="//iso:schema/@defaultPhase">
165
+ <xsl:value-of select="//iso:schema/@defaultPhase"/>
166
+ </xsl:when>
167
+ <xsl:otherwise>#ALL</xsl:otherwise>
168
+ </xsl:choose>
169
+ </xsl:param>
170
+ <xsl:param name="allow-foreign" >false</xsl:param>
171
+ <xsl:param name="generate-paths" >true</xsl:param>
172
+ <xsl:param name="generate-fired-rule" >true</xsl:param>
173
+ <xsl:param name="optimize"/>
174
+
175
+ <xsl:param name="output-encoding" ></xsl:param>
176
+
177
+ <!-- e.g. saxon file.xml file.xsl "sch.exslt.imports=.../string.xsl;.../math.xsl" -->
178
+ <xsl:param name="sch.exslt.imports" />
179
+
180
+
181
+
182
+ <!-- Experimental: If this file called, then must be generating svrl -->
183
+ <xsl:variable name="svrlTest" select="true()" />
184
+
185
+
186
+
187
+ <!-- ================================================================ -->
188
+
189
+ <xsl:template name="process-prolog">
190
+ <axsl:output method="xml" omit-xml-declaration="no" standalone="yes"
191
+ indent="yes">
192
+ <xsl:if test=" string-length($output-encoding) &gt; 0">
193
+ <xsl:attribute name="encoding"><xsl:value-of select=" $output-encoding" /></xsl:attribute>
194
+ </xsl:if>
195
+ </axsl:output>
196
+
197
+ </xsl:template>
198
+
199
+ <!-- Overrides skeleton.xsl -->
200
+ <xsl:template name="process-root">
201
+ <xsl:param name="title"/>
202
+ <xsl:param name="contents" />
203
+ <xsl:param name="queryBinding" >xslt1</xsl:param>
204
+ <xsl:param name="schemaVersion" />
205
+ <xsl:param name="id" />
206
+ <xsl:param name="version"/>
207
+ <!-- "Rich" parameters -->
208
+ <xsl:param name="fpi" />
209
+ <xsl:param name="icon" />
210
+ <xsl:param name="lang" />
211
+ <xsl:param name="see" />
212
+ <xsl:param name="space" />
213
+
214
+ <svrl:schematron-output title="{$title}" schemaVersion="{$schemaVersion}" >
215
+ <xsl:if test=" string-length( normalize-space( $phase )) &gt; 0 and
216
+ not( normalize-space( $phase ) = '#ALL') ">
217
+ <axsl:attribute name="phase">
218
+ <xsl:value-of select=" $phase " />
219
+ </axsl:attribute>
220
+ </xsl:if>
221
+ <xsl:if test=" $allow-foreign = 'true'">
222
+ </xsl:if>
223
+ <xsl:if test=" $allow-foreign = 'true'">
224
+
225
+ <xsl:call-template name='richParms'>
226
+ <xsl:with-param name="fpi" select="$fpi" />
227
+ <xsl:with-param name="icon" select="$icon"/>
228
+ <xsl:with-param name="lang" select="$lang"/>
229
+ <xsl:with-param name="see" select="$see" />
230
+ <xsl:with-param name="space" select="$space" />
231
+ </xsl:call-template>
232
+ </xsl:if>
233
+
234
+ <axsl:comment><axsl:value-of select="$archiveDirParameter"/> &#xA0;
235
+ <axsl:value-of select="$archiveNameParameter"/> &#xA0;
236
+ <axsl:value-of select="$fileNameParameter"/> &#xA0;
237
+ <axsl:value-of select="$fileDirParameter"/></axsl:comment>
238
+
239
+
240
+ <xsl:apply-templates mode="do-schema-p" />
241
+ <xsl:copy-of select="$contents" />
242
+ </svrl:schematron-output>
243
+ </xsl:template>
244
+
245
+
246
+ <xsl:template name="process-assert">
247
+ <xsl:param name="test"/>
248
+ <xsl:param name="diagnostics" />
249
+ <xsl:param name="id" />
250
+ <xsl:param name="flag" />
251
+ <!-- "Linkable" parameters -->
252
+ <xsl:param name="role"/>
253
+ <xsl:param name="subject"/>
254
+ <!-- "Rich" parameters -->
255
+ <xsl:param name="fpi" />
256
+ <xsl:param name="icon" />
257
+ <xsl:param name="lang" />
258
+ <xsl:param name="see" />
259
+ <xsl:param name="space" />
260
+ <svrl:failed-assert test="{$test}" >
261
+ <xsl:if test="string-length( $id ) &gt; 0">
262
+ <axsl:attribute name="id">
263
+ <xsl:value-of select=" $id " />
264
+ </axsl:attribute>
265
+ </xsl:if>
266
+ <xsl:if test=" string-length( $flag ) &gt; 0">
267
+ <axsl:attribute name="flag">
268
+ <xsl:value-of select=" $flag " />
269
+ </axsl:attribute>
270
+ </xsl:if>
271
+ <!-- Process rich attributes. -->
272
+ <xsl:call-template name="richParms">
273
+ <xsl:with-param name="fpi" select="$fpi"/>
274
+ <xsl:with-param name="icon" select="$icon"/>
275
+ <xsl:with-param name="lang" select="$lang"/>
276
+ <xsl:with-param name="see" select="$see" />
277
+ <xsl:with-param name="space" select="$space" />
278
+ </xsl:call-template>
279
+ <xsl:call-template name='linkableParms'>
280
+ <xsl:with-param name="role" select="$role" />
281
+ <xsl:with-param name="subject" select="$subject"/>
282
+ </xsl:call-template>
283
+ <xsl:if test=" $generate-paths = 'true' or $generate-paths= 'yes' ">
284
+ <!-- true/false is the new way -->
285
+ <axsl:attribute name="location">
286
+ <axsl:apply-templates select="." mode="schematron-get-full-path"/>
287
+ </axsl:attribute>
288
+ </xsl:if>
289
+
290
+ <svrl:text>
291
+ <xsl:apply-templates mode="text" />
292
+
293
+ </svrl:text>
294
+ <xsl:if test="$diagnose = 'yes' or $diagnose= 'true' ">
295
+ <!-- true/false is the new way -->
296
+ <xsl:call-template name="diagnosticsSplit">
297
+ <xsl:with-param name="str" select="$diagnostics"/>
298
+ </xsl:call-template>
299
+ </xsl:if>
300
+ </svrl:failed-assert>
301
+
302
+
303
+ <xsl:if test=" $terminate = 'yes' or $terminate = 'true' ">
304
+ <axsl:message terminate="yes">TERMINATING</axsl:message>
305
+ </xsl:if>
306
+ <xsl:if test=" $terminate = 'assert' ">
307
+ <axsl:message terminate="yes">TERMINATING</axsl:message>
308
+ </xsl:if>
309
+ </xsl:template>
310
+
311
+ <xsl:template name="process-report">
312
+ <xsl:param name="id"/>
313
+ <xsl:param name="test"/>
314
+ <xsl:param name="diagnostics"/>
315
+ <xsl:param name="flag" />
316
+ <!-- "Linkable" parameters -->
317
+ <xsl:param name="role"/>
318
+ <xsl:param name="subject"/>
319
+ <!-- "Rich" parameters -->
320
+ <xsl:param name="fpi" />
321
+ <xsl:param name="icon" />
322
+ <xsl:param name="lang" />
323
+ <xsl:param name="see" />
324
+ <xsl:param name="space" />
325
+ <svrl:successful-report test="{$test}" >
326
+ <xsl:if test=" string-length( $id ) &gt; 0">
327
+ <axsl:attribute name="id">
328
+ <xsl:value-of select=" $id " />
329
+ </axsl:attribute>
330
+ </xsl:if>
331
+ <xsl:if test=" string-length( $flag ) &gt; 0">
332
+ <axsl:attribute name="flag">
333
+ <xsl:value-of select=" $flag " />
334
+ </axsl:attribute>
335
+ </xsl:if>
336
+
337
+ <!-- Process rich attributes. -->
338
+ <xsl:call-template name="richParms">
339
+ <xsl:with-param name="fpi" select="$fpi"/>
340
+ <xsl:with-param name="icon" select="$icon"/>
341
+ <xsl:with-param name="lang" select="$lang"/>
342
+ <xsl:with-param name="see" select="$see" />
343
+ <xsl:with-param name="space" select="$space" />
344
+ </xsl:call-template>
345
+ <xsl:call-template name='linkableParms'>
346
+ <xsl:with-param name="role" select="$role" />
347
+ <xsl:with-param name="subject" select="$subject"/>
348
+ </xsl:call-template>
349
+ <xsl:if test=" $generate-paths = 'yes' or $generate-paths = 'true' ">
350
+ <!-- true/false is the new way -->
351
+ <axsl:attribute name="location">
352
+ <axsl:apply-templates select="." mode="schematron-get-full-path"/>
353
+ </axsl:attribute>
354
+ </xsl:if>
355
+
356
+ <svrl:text>
357
+ <xsl:apply-templates mode="text" />
358
+
359
+ </svrl:text>
360
+ <xsl:if test="$diagnose = 'yes' or $diagnose='true' ">
361
+ <!-- true/false is the new way -->
362
+ <xsl:call-template name="diagnosticsSplit">
363
+ <xsl:with-param name="str" select="$diagnostics"/>
364
+ </xsl:call-template>
365
+ </xsl:if>
366
+ </svrl:successful-report>
367
+
368
+
369
+ <xsl:if test=" $terminate = 'yes' or $terminate = 'true' ">
370
+ <axsl:message terminate="yes">TERMINATING</axsl:message>
371
+ </xsl:if>
372
+ </xsl:template>
373
+
374
+
375
+ <!-- Overrides skeleton -->
376
+ <xsl:template name="process-dir" >
377
+ <xsl:param name="value" />
378
+ <xsl:choose>
379
+ <xsl:when test=" $allow-foreign = 'true'">
380
+ <xsl:copy-of select="."/>
381
+ </xsl:when>
382
+
383
+ <xsl:otherwise>
384
+ <!-- We generate too much whitespace rather than risking concatenation -->
385
+ <axsl:text> </axsl:text>
386
+ <xsl:apply-templates mode="inline-text"/>
387
+ <axsl:text> </axsl:text>
388
+ </xsl:otherwise>
389
+ </xsl:choose>
390
+ </xsl:template>
391
+
392
+ <xsl:template name="process-diagnostic">
393
+ <xsl:param name="id"/>
394
+ <!-- Rich parameters -->
395
+ <xsl:param name="fpi" />
396
+ <xsl:param name="icon" />
397
+ <xsl:param name="lang" />
398
+ <xsl:param name="see" />
399
+ <xsl:param name="space" />
400
+ <svrl:diagnostic-reference diagnostic="{$id}" >
401
+
402
+ <xsl:call-template name="richParms">
403
+ <xsl:with-param name="fpi" select="$fpi"/>
404
+ <xsl:with-param name="icon" select="$icon"/>
405
+ <xsl:with-param name="lang" select="$lang"/>
406
+ <xsl:with-param name="see" select="$see" />
407
+ <xsl:with-param name="space" select="$space" />
408
+ </xsl:call-template>
409
+ <xsl:text>
410
+ </xsl:text>
411
+
412
+ <xsl:apply-templates mode="text"/>
413
+
414
+ </svrl:diagnostic-reference>
415
+ </xsl:template>
416
+
417
+
418
+ <!-- Overrides skeleton -->
419
+ <xsl:template name="process-emph" >
420
+ <xsl:param name="class" />
421
+ <xsl:choose>
422
+ <xsl:when test=" $allow-foreign = 'true'">
423
+ <xsl:copy-of select="."/>
424
+ </xsl:when>
425
+ <xsl:otherwise>
426
+ <!-- We generate too much whitespace rather than risking concatenation -->
427
+ <axsl:text> </axsl:text>
428
+ <xsl:apply-templates mode="inline-text"/>
429
+ <axsl:text> </axsl:text>
430
+ </xsl:otherwise>
431
+ </xsl:choose>
432
+ </xsl:template>
433
+
434
+ <xsl:template name="process-rule">
435
+ <xsl:param name="id"/>
436
+ <xsl:param name="context"/>
437
+ <xsl:param name="flag"/>
438
+ <!-- "Linkable" parameters -->
439
+ <xsl:param name="role"/>
440
+ <xsl:param name="subject"/>
441
+ <!-- "Rich" parameters -->
442
+ <xsl:param name="fpi" />
443
+ <xsl:param name="icon" />
444
+ <xsl:param name="lang" />
445
+ <xsl:param name="see" />
446
+ <xsl:param name="space" />
447
+ <xsl:if test=" $generate-fired-rule = 'true'">
448
+ <svrl:fired-rule context="{$context}" >
449
+ <!-- Process rich attributes. -->
450
+ <xsl:call-template name="richParms">
451
+ <xsl:with-param name="fpi" select="$fpi"/>
452
+ <xsl:with-param name="icon" select="$icon"/>
453
+ <xsl:with-param name="lang" select="$lang"/>
454
+ <xsl:with-param name="see" select="$see" />
455
+ <xsl:with-param name="space" select="$space" />
456
+ </xsl:call-template>
457
+ <xsl:if test=" string( $id )">
458
+ <xsl:attribute name="id">
459
+ <xsl:value-of select=" $id " />
460
+ </xsl:attribute>
461
+ </xsl:if>
462
+ <xsl:if test=" string-length( $role ) &gt; 0">
463
+ <xsl:attribute name="role">
464
+ <xsl:value-of select=" $role " />
465
+ </xsl:attribute>
466
+ </xsl:if>
467
+ </svrl:fired-rule>
468
+ </xsl:if>
469
+ </xsl:template>
470
+
471
+ <xsl:template name="process-ns">
472
+ <xsl:param name="prefix"/>
473
+ <xsl:param name="uri"/>
474
+ <svrl:ns-prefix-in-attribute-values uri="{$uri}" prefix="{$prefix}" />
475
+ </xsl:template>
476
+
477
+ <xsl:template name="process-p">
478
+ <xsl:param name="icon"/>
479
+ <xsl:param name="class"/>
480
+ <xsl:param name="id"/>
481
+ <xsl:param name="lang"/>
482
+
483
+ <svrl:text>
484
+ <xsl:apply-templates mode="text"/>
485
+ </svrl:text>
486
+ </xsl:template>
487
+
488
+ <xsl:template name="process-pattern">
489
+ <xsl:param name="name"/>
490
+ <xsl:param name="id"/>
491
+ <xsl:param name="is-a"/>
492
+
493
+ <!-- "Rich" parameters -->
494
+ <xsl:param name="fpi" />
495
+ <xsl:param name="icon" />
496
+ <xsl:param name="lang" />
497
+ <xsl:param name="see" />
498
+ <xsl:param name="space" />
499
+ <svrl:active-pattern >
500
+ <xsl:if test=" string( $id )">
501
+ <axsl:attribute name="id">
502
+ <xsl:value-of select=" $id " />
503
+ </axsl:attribute>
504
+ </xsl:if>
505
+ <xsl:if test=" string( $name )">
506
+ <axsl:attribute name="name">
507
+ <xsl:value-of select=" $name " />
508
+ </axsl:attribute>
509
+ </xsl:if>
510
+
511
+ <xsl:call-template name='richParms'>
512
+ <xsl:with-param name="fpi" select="$fpi"/>
513
+ <xsl:with-param name="icon" select="$icon"/>
514
+ <xsl:with-param name="lang" select="$lang"/>
515
+ <xsl:with-param name="see" select="$see" />
516
+ <xsl:with-param name="space" select="$space" />
517
+ </xsl:call-template>
518
+
519
+ <!-- ?? report that this screws up iso:title processing -->
520
+ <xsl:apply-templates mode="do-pattern-p"/>
521
+ <!-- ?? Seems that this apply-templates is never triggered DP -->
522
+ <axsl:apply-templates />
523
+ </svrl:active-pattern>
524
+ </xsl:template>
525
+
526
+ <!-- Overrides skeleton -->
527
+ <xsl:template name="process-message" >
528
+ <xsl:param name="pattern"/>
529
+ <xsl:param name="role"/>
530
+ </xsl:template>
531
+
532
+
533
+ <!-- Overrides skeleton -->
534
+ <xsl:template name="process-span" >
535
+ <xsl:param name="class" />
536
+ <xsl:choose>
537
+ <xsl:when test=" $allow-foreign = 'true'">
538
+ <xsl:copy-of select="."/>
539
+ </xsl:when>
540
+ <xsl:otherwise>
541
+ <!-- We generate too much whitespace rather than risking concatenation -->
542
+ <axsl:text> </axsl:text>
543
+ <xsl:apply-templates mode="inline-text"/>
544
+ <axsl:text> </axsl:text>
545
+ </xsl:otherwise>
546
+ </xsl:choose>
547
+ </xsl:template>
548
+
549
+ <!-- =========================================================================== -->
550
+ <!-- processing rich parameters. -->
551
+ <xsl:template name='richParms'>
552
+ <!-- "Rich" parameters -->
553
+ <xsl:param name="fpi" />
554
+ <xsl:param name="icon" />
555
+ <xsl:param name="lang" />
556
+ <xsl:param name="see" />
557
+ <xsl:param name="space" />
558
+ <!-- Process rich attributes. -->
559
+ <xsl:if test=" $allow-foreign = 'true'">
560
+ <xsl:if test="string($fpi)">
561
+ <axsl:attribute name="fpi">
562
+ <xsl:value-of select="$fpi"/>
563
+ </axsl:attribute>
564
+ </xsl:if>
565
+ <xsl:if test="string($icon)">
566
+ <axsl:attribute name="icon">
567
+ <xsl:value-of select="$icon"/>
568
+ </axsl:attribute>
569
+ </xsl:if>
570
+ <xsl:if test="string($see)">
571
+ <axsl:attribute name="see">
572
+ <xsl:value-of select="$see"/>
573
+ </axsl:attribute>
574
+ </xsl:if>
575
+ </xsl:if>
576
+ <xsl:if test="string($space)">
577
+ <axsl:attribute name="xml:space">
578
+ <xsl:value-of select="$space"/>
579
+ </axsl:attribute>
580
+ </xsl:if>
581
+ <xsl:if test="string($lang)">
582
+ <axsl:attribute name="xml:lang">
583
+ <xsl:value-of select="$lang"/>
584
+ </axsl:attribute>
585
+ </xsl:if>
586
+ </xsl:template>
587
+
588
+ <!-- processing linkable parameters. -->
589
+ <xsl:template name='linkableParms'>
590
+ <xsl:param name="role"/>
591
+ <xsl:param name="subject"/>
592
+
593
+ <!-- ISO SVRL has a role attribute to match the Schematron role attribute -->
594
+ <xsl:if test=" string($role )">
595
+ <axsl:attribute name="role">
596
+ <xsl:value-of select=" $role " />
597
+ </axsl:attribute>
598
+ </xsl:if>
599
+ <!-- ISO SVRL does not have a subject attribute to match the Schematron subject attribute.
600
+ Instead, the Schematron subject attribute is folded into the location attribute -->
601
+ </xsl:template>
602
+
603
+
604
+ </xsl:stylesheet>
605
+