1 | <?xml version="1.0" encoding="ISO-8859-1"?> |
---|
2 | |
---|
3 | <xsl:stylesheet version="3.0" |
---|
4 | xmlns:xsl ="http://www.w3.org/1999/XSL/Transform" |
---|
5 | xmlns:ibis="http://www.ibisph.org" |
---|
6 | |
---|
7 | exclude-result-prefixes="ibis" |
---|
8 | > |
---|
9 | <!-- garth todo: |
---|
10 | <xsl:import href="../../../json/Dataset.xslt"/> |
---|
11 | <xsl:import href="../../../json/Kendo.xslt"/> |
---|
12 | --> |
---|
13 | <xsl:import href="../../HTMLContentPage.xslt"/> |
---|
14 | <xsl:import href="../Page.xslt"/> |
---|
15 | <xsl:import href="SiteSpecific.xslt"/> |
---|
16 | |
---|
17 | |
---|
18 | <ibis:doc> |
---|
19 | <name>html/community/facts/Page</name> |
---|
20 | <summary> |
---|
21 | Provides the Special Introduction Overrides to be able to process |
---|
22 | both the community dimension file and the 'HTML_CONTENT' file to |
---|
23 | produce the intro/quick facts page. |
---|
24 | </summary> |
---|
25 | <description> |
---|
26 | </description> |
---|
27 | </ibis:doc> |
---|
28 | |
---|
29 | |
---|
30 | <xsl:param name="ShowMap" select="false"/> |
---|
31 | |
---|
32 | |
---|
33 | <xsl:param name="Page.pageTitle" ibis:doc="Page's browser title text." |
---|
34 | select="concat(Page.communityTitle, ' Quick Facts')" |
---|
35 | /> |
---|
36 | <xsl:param name="Page.contentTitle" ibis:doc="Page's content title text." |
---|
37 | select="concat('Quick Facts for ', $Page.communityTitle)" |
---|
38 | /> |
---|
39 | |
---|
40 | <xsl:param name="Page.communityTitle" ibis:doc="Page's community title text." |
---|
41 | select="concat( |
---|
42 | $Page.communityDimensionValue/TITLE, |
---|
43 | ' ', |
---|
44 | ibis:getDimensionTitle($Page.communityDimension) |
---|
45 | )" |
---|
46 | /> |
---|
47 | |
---|
48 | |
---|
49 | <xsl:variable name="Page.demographicPublishedIndicators" select="document( ibis:getContentPath('xml/indicator/published_indicators.xml'), /)//PUBLISHED_INDICATOR[DEMOGRAPHIC_FLAG = 'x']"/> |
---|
50 | <xsl:variable name="Page.communityDemographicPublishedIndicators" select="$Page.demographicPublishedIndicators//DIMENSION_COMBINATION[(DIMENSION_1/NAME = $Page.dimensionName) and not(DIMENSION_2)]"/> |
---|
51 | |
---|
52 | |
---|
53 | |
---|
54 | <xsl:template name="Page.contentBody" ibis:doc="HTML API template implementation |
---|
55 | that provides main HTML body content for the page. Defaults to copying |
---|
56 | all elements and attributes of the the 'HTML_CONTENT/CONTENT' element." |
---|
57 | > |
---|
58 | <style> |
---|
59 | .Overview |
---|
60 | { |
---|
61 | margin-top: 2em; |
---|
62 | vertical-align: top; |
---|
63 | max-width: 60%; |
---|
64 | min-width: 300px; |
---|
65 | } |
---|
66 | .Overview img |
---|
67 | { |
---|
68 | display: inline-block; |
---|
69 | float: left; |
---|
70 | padding-right: 1rem; |
---|
71 | } |
---|
72 | |
---|
73 | .Overview, .GoogleMap {display: inline-block;} |
---|
74 | .GoogleMap |
---|
75 | { |
---|
76 | max-width: 30%; |
---|
77 | min-width: 300px; |
---|
78 | padding: 1em 2rem 0 2rem; |
---|
79 | } |
---|
80 | |
---|
81 | table.Info, .Note |
---|
82 | { |
---|
83 | margin-top: 1.5rem; |
---|
84 | } |
---|
85 | .Note ul |
---|
86 | { |
---|
87 | list-style: none; |
---|
88 | } |
---|
89 | </style> |
---|
90 | |
---|
91 | <div class="ContentOptions"> |
---|
92 | <h3>Quick Facts Report Options</h3> |
---|
93 | |
---|
94 | <table class="ListTable"> |
---|
95 | <tr> |
---|
96 | <td><label for="dimensionValue"><xsl:value-of select="$Page.communityDimensionTitle"/>:</label></td> |
---|
97 | <td> |
---|
98 | <!-- |
---|
99 | <xsl:if test="0 != string-length($Page.previousDimensionValue/TITLE)"> |
---|
100 | <a href="javascript:requestSamePageDifferentDimensionValue('{normalize-space($Page.previousDimensionValue/text()[1])}')" |
---|
101 | title="show previous community value" |
---|
102 | ><< Show <xsl:value-of select="$Page.previousDimensionValue/TITLE"/></a> |
---|
103 | </xsl:if> |
---|
104 | --> |
---|
105 | <select name="dimensionValue" id="dimensionValue" onchange="location=this.value; this.value='';" style="width: 200px;"> |
---|
106 | <xsl:for-each select="$Page.communityDimension/VALUES/VALUE[not(NOT_SELECTABLE_FLAG)]"> |
---|
107 | <xsl:sort select="SORT_ORDER" data-type="number" order="ascending"/> |
---|
108 | <xsl:sort select="TITLE" order="ascending"/> |
---|
109 | <xsl:variable name="value" select="normalize-space(text()[1])"/> |
---|
110 | <option value="{concat($ibis.baseRequestPath, 'community/facts/', $Page.dimensionName, '/', $value, '.html')}"> |
---|
111 | <xsl:if test="$value = $Page.dimensionValue"> |
---|
112 | <xsl:attribute name="selected">selected</xsl:attribute> |
---|
113 | </xsl:if> |
---|
114 | <xsl:value-of select="TITLE"/> |
---|
115 | </option> |
---|
116 | </xsl:for-each> |
---|
117 | </select> |
---|
118 | <!-- |
---|
119 | <xsl:if test="0 != string-length($Page.nextDimensionValue/TITLE)"> |
---|
120 | <a href="javascript:requestSamePageDifferentDimensionValue('{normalize-space($Page.nextDimensionValue/text()[1])}')" |
---|
121 | title="show next community value" |
---|
122 | >Show <xsl:value-of select="$Page.nextDimensionValue/TITLE"/> >></a> |
---|
123 | </xsl:if> |
---|
124 | --> |
---|
125 | </td> |
---|
126 | </tr> |
---|
127 | </table> |
---|
128 | </div> |
---|
129 | |
---|
130 | <!-- The content file contains elements that control demographic and |
---|
131 | IP set bar charts etc. |
---|
132 | --> |
---|
133 | <xsl:apply-templates select="HTML_CONTENT/CONTENT/(text() | *)" mode="ibis.copy"/> |
---|
134 | |
---|
135 | <!-- standard end of page content that doesn't need to be repeated in |
---|
136 | the content file. |
---|
137 | --> |
---|
138 | <div class="Note"> |
---|
139 | <h3>Data Sources and Limitations</h3> |
---|
140 | <ul> |
---|
141 | <li><sup class="Bold">¥</sup> IHS Final User Population Estimate-FY2013 memo 12/20/2013</li> |
---|
142 | <li><sup class="Bold">±</sup> Based on information extracted from the Tribe's |
---|
143 | electronic health record management system may not be a true |
---|
144 | reflection of all the Tribal members that reside in the Tribe's |
---|
145 | CHSDA. |
---|
146 | </li> |
---|
147 | <li><sup class="Bold">*</sup> US Census Bureau data used to generate the data. |
---|
148 | Compares AI/AN alone, AI/AN alone or in combination with other |
---|
149 | races, and White non-Hispanic groups at the CHSDA county level. |
---|
150 | US Census Bureau Data are self-reported and not collected based |
---|
151 | on Tribal membership. |
---|
152 | </li> |
---|
153 | <li><sup class="Bold">^</sup> Represents the All Races Population within counties |
---|
154 | that make up the Tribe's CHSDA. Centers for Disease Control and |
---|
155 | Prevention, National Center for Health Statistics. Compressed |
---|
156 | Death File 1999-2009. CDC WONDER Online Database, compiled from |
---|
157 | Compressed Death File 1999-2009 Series 20 No. 2O, 2012. Accessed |
---|
158 | at <a href="http:/ABM/wonder.cdc.gov/cmf-icd10.html">http:/ABM/wonder.cdc.gov/cmf-icd10.html</a> |
---|
159 | on Jan 4, 2013 10:09:58 AM |
---|
160 | </li> |
---|
161 | </ul> |
---|
162 | </div> |
---|
163 | |
---|
164 | </xsl:template> |
---|
165 | |
---|
166 | |
---|
167 | |
---|
168 | <xsl:template match="ibis:Page.demographicIndicators" mode="ibis.copy"> |
---|
169 | |
---|
170 | <table class="Info" title="table of demographics for this community"> |
---|
171 | <thead><tr> |
---|
172 | <th>Demographics</th> |
---|
173 | <th class="Value"><xsl:value-of select="$Page.communityTitle"/></th> |
---|
174 | <th class="Value"><xsl:value-of select="$Page.stateTitle"/></th> |
---|
175 | <th class="Value">U.S.</th> |
---|
176 | </tr></thead> |
---|
177 | |
---|
178 | <xsl:for-each select="$Page.demographicPublishedIndicators"> |
---|
179 | <xsl:sort select="SORT_ORDER" data-type="number" order="ascending"/> |
---|
180 | <xsl:sort select="NAME" data-type="text" order="ascending"/> |
---|
181 | |
---|
182 | <xsl:variable name="indicator" select="document(concat($Page.indicatorProfileXMLFilePath, '/', NAME, '.xml'), /)/INDICATOR"/> |
---|
183 | <xsl:variable name="indicatorComparisonValues"> |
---|
184 | <xsl:call-template name="ComparisonValues.getIndicatorStateUSComparisonValues"> |
---|
185 | <xsl:with-param name="indicator" select="$indicator"/> |
---|
186 | <xsl:with-param name="dimensions" select="$Page.dimensions"/> |
---|
187 | <xsl:with-param name="measures" select="$Page.measures"/> |
---|
188 | <xsl:with-param name="valueTypes" select="$Page.valueTypes"/> |
---|
189 | <xsl:with-param name="communityDimensionName" select="$Page.dimensionName"/> |
---|
190 | <xsl:with-param name="communityDimensionValue" select="$Page.dimensionValue"/> |
---|
191 | </xsl:call-template> |
---|
192 | </xsl:variable> |
---|
193 | <!-- GARTH TODO: |
---|
194 | <xsl:message select="concat('============indicatorComparisonValues:', NAME, ', indicatorComparisonValues below:')"/> |
---|
195 | <xsl:message select="$indicatorComparisonValues"/> |
---|
196 | --> |
---|
197 | <tr class="Value"> |
---|
198 | <th><a href="{ibis:getRequestURL(concat('community/indicator/', $indicator/NAME, '/', $Page.communityDimension/NAME, '/', normalize-space($Page.communityDimensionValue/text()[1]),'.html'))}"> |
---|
199 | <xsl:value-of select="ibis:getIndicatorTitle($indicator)"/> (<xsl:value-of select="$indicatorComparisonValues/PERIOD_DIMENSION/VALUE/TITLE"/>) |
---|
200 | </a> </th> |
---|
201 | <td><xsl:value-of select="$indicatorComparisonValues/COMMUNITY/VALUE/TITLE"/></td> |
---|
202 | <td><xsl:value-of select="$indicatorComparisonValues/STATE/VALUE/TITLE"/></td> |
---|
203 | <td><xsl:value-of select="$indicatorComparisonValues/US/VALUE/TITLE"/> |
---|
204 | <!-- xsl:copy-of select="$indicatorComparisonValues"/ --> |
---|
205 | |
---|
206 | </td> |
---|
207 | </tr> |
---|
208 | </xsl:for-each> |
---|
209 | </table> |
---|
210 | </xsl:template> |
---|
211 | |
---|
212 | |
---|
213 | |
---|
214 | |
---|
215 | <xsl:template match="ibis:Page.indicatorsChart" mode="ibis.copy"> |
---|
216 | <xsl:param name="chartName" select="CHART_NAME"/> |
---|
217 | <xsl:param name="measureName" select="MEASURE_NAME"/> |
---|
218 | <xsl:param name="indicatorSetName" select="INDICATOR_SET_NAME"/> |
---|
219 | |
---|
220 | <xsl:apply-templates select="HEADER_CONTENT/*" mode="ibis.copy"/> |
---|
221 | <div class="DataViz"> |
---|
222 | <h3><xsl:value-of select="TITLE"/></h3> |
---|
223 | <div id="{DATAVIZ_ID}" class="{DATAVIZ_CLASSES}"> |
---|
224 | </div> |
---|
225 | </div> |
---|
226 | <xsl:apply-templates select="FOOTER_CONTENT/*" mode="ibis.copy"/> |
---|
227 | |
---|
228 | |
---|
229 | <xsl:variable name="indicatorSet" select="document( ibis:getContentPath('xml/indicator/indicator_sets.xml'), /)//INDICATOR_SET[NAME = $Page.indicatorSetName]"/> |
---|
230 | <xsl:variable name="values"> |
---|
231 | <xsl:for-each select="$indicatorSet/INDICATOR_TO_INDICATOR_SETS/INDICATOR_TO_INDICATOR_SET/INDICATOR_NAME"> |
---|
232 | <xsl:sort select="SORT_ORDER" data-type="number" order="ascending"/> |
---|
233 | <xsl:sort select="INDICATOR_NAME" data-type="text" order="ascending"/> |
---|
234 | |
---|
235 | <xsl:call-template name="indicatorProfileRow"> |
---|
236 | <xsl:with-param name="indicatorName" select="current()"/> |
---|
237 | <xsl:with-param name="measureName" select="/HTML_CONTENT/PARAMETERS/PARAMETER[NAME='MeasureName']/VALUE"/> |
---|
238 | </xsl:call-template> |
---|
239 | </xsl:for-each> |
---|
240 | </xsl:variable> |
---|
241 | |
---|
242 | <xsl:variable name="communityCSV"> |
---|
243 | <xsl:for-each select="$values/INDICATOR_RECORD/COMMUNITY/VALUE/text()"> |
---|
244 | <xsl:if test="position() != 1">, </xsl:if> |
---|
245 | <xsl:value-of select="."/> |
---|
246 | </xsl:for-each> |
---|
247 | </xsl:variable> |
---|
248 | <xsl:variable name="stateCSV"> |
---|
249 | <xsl:for-each select="$values/INDICATOR_RECORD/STATE/VALUE/text()"> |
---|
250 | <xsl:if test="position() != 1">, </xsl:if> |
---|
251 | <xsl:value-of select="."/> |
---|
252 | </xsl:for-each> |
---|
253 | </xsl:variable> |
---|
254 | <xsl:variable name="usCSV"> |
---|
255 | <xsl:for-each select="$values/INDICATOR_RECORD/US/VALUE/text()"> |
---|
256 | <xsl:if test="position() != 1">, </xsl:if> |
---|
257 | <xsl:value-of select="."/> |
---|
258 | </xsl:for-each> |
---|
259 | </xsl:variable> |
---|
260 | |
---|
261 | <xsl:variable name="indicatorTitleCSV"> |
---|
262 | <xsl:for-each select="$values/INDICATOR_RECORD/TITLE"> |
---|
263 | <xsl:if test="position() != 1">, </xsl:if> |
---|
264 | "<xsl:value-of select="."/>" |
---|
265 | </xsl:for-each> |
---|
266 | </xsl:variable> |
---|
267 | |
---|
268 | <script> |
---|
269 | var kendoChartConstructorJSON = $.extend(true |
---|
270 | ,{} |
---|
271 | ,<xsl:call-template name="Kendo.namedConfigurationJSON"> |
---|
272 | <xsl:with-param name="configurationName" select="/HTML_CONTENT/PARAMETERS/PARAMETER[NAME='ChartName']/VALUE"/> |
---|
273 | </xsl:call-template> |
---|
274 | ,{ |
---|
275 | "title": |
---|
276 | { |
---|
277 | "text": "<xsl:value-of select="$indicatorSet/TITLE"/>" |
---|
278 | } |
---|
279 | ,"series": |
---|
280 | [ |
---|
281 | { |
---|
282 | "name": "<xsl:value-of select="distinct-values($values/INDICATOR_RECORD/COMMUNITY/TITLE)"/>" |
---|
283 | ,"data": [<xsl:value-of select="$communityCSV"/>] |
---|
284 | } |
---|
285 | ,{ |
---|
286 | "name": "<xsl:value-of select="distinct-values($values/INDICATOR_RECORD/STATE/TITLE)"/>" |
---|
287 | ,"data": [<xsl:value-of select="$stateCSV"/>] |
---|
288 | } |
---|
289 | ,{ |
---|
290 | "name": "<xsl:value-of select="distinct-values($values/INDICATOR_RECORD/US/TITLE)"/>" |
---|
291 | ,"data": [<xsl:value-of select="$usCSV"/>] |
---|
292 | } |
---|
293 | ] |
---|
294 | ,"valueAxis": |
---|
295 | { |
---|
296 | "title": {"text": "<xsl:value-of select="$values/INDICATOR_RECORD[1]/MEASURE/TITLE"/>"} |
---|
297 | } |
---|
298 | ,"categoryAxis": |
---|
299 | { |
---|
300 | "categories": [<xsl:value-of select="$indicatorTitleCSV"/>] |
---|
301 | } |
---|
302 | } |
---|
303 | ); |
---|
304 | |
---|
305 | $(document).ready( |
---|
306 | function() |
---|
307 | { |
---|
308 | console.log(kendoChartConstructorJSON); |
---|
309 | $("#chart").kendoChart(kendoChartConstructorJSON); |
---|
310 | } |
---|
311 | ); |
---|
312 | </script> |
---|
313 | |
---|
314 | </xsl:template> |
---|
315 | |
---|
316 | |
---|
317 | |
---|
318 | <xsl:template name="indicatorProfileRow" |
---|
319 | ibis:doc="Handles the xml/community/DIMENSION.xml type file. Which is of |
---|
320 | the struct: COMMUNITY_PROFILE, OVERVIEWS, DIMENSION, INDICATOR_PROFILES |
---|
321 | /INDICATOR_PROFILE/COMPARATIVE_VALUES/COMPARATIVE_VALUE/ TYPE, SERIES, |
---|
322 | CAT. |
---|
323 | " |
---|
324 | > |
---|
325 | <xsl:param name="indicatorName"/> |
---|
326 | <xsl:param name="indicator" select="document(concat($Page.indicatorProfileXMLFilePath, '/', $indicatorName, '.xml'), /)/INDICATOR"/> |
---|
327 | <xsl:param name="measureName"/> |
---|
328 | |
---|
329 | <xsl:if test="not($indicator/*)"><xsl:message select="concat('IP NOT FOUND: ', $indicatorName)"/></xsl:if> |
---|
330 | <xsl:if test="$indicator/*"> |
---|
331 | <xsl:variable name="indicatorComparisonValues"> |
---|
332 | <xsl:call-template name="ComparisonValues.getIndicatorStateUSComparisonValues"> |
---|
333 | <xsl:with-param name="indicator" select="$indicator"/> |
---|
334 | <xsl:with-param name="communityDimensionName" select="$Page.dimensionName"/> |
---|
335 | <xsl:with-param name="communityDimensionValue" select="$Page.dimensionValue"/> |
---|
336 | <xsl:with-param name="measureName"/> |
---|
337 | <xsl:with-param name="dimensions" select="$Page.dimensions"/> |
---|
338 | <xsl:with-param name="measures" select="$Page.measures"/> |
---|
339 | <xsl:with-param name="valueTypes" select="$Page.valueTypes"/> |
---|
340 | </xsl:call-template> |
---|
341 | </xsl:variable> |
---|
342 | |
---|
343 | <xsl:if test="$indicatorComparisonValues/*"> |
---|
344 | <INDICATOR_RECORD> |
---|
345 | <xsl:copy-of select="$indicator/TITLE"/> |
---|
346 | <xsl:copy-of select="$indicatorComparisonValues"/> |
---|
347 | </INDICATOR_RECORD> |
---|
348 | </xsl:if> |
---|
349 | </xsl:if> |
---|
350 | </xsl:template> |
---|
351 | |
---|
352 | |
---|
353 | <xsl:template match="ibis:Page.indicatorSetsSelection" mode="ibis.copy"> |
---|
354 | GARTH: <xsl:value-of select="$Page.indicatorSetName"/> |
---|
355 | <select name="indicatorSetName" id="indicatorSetName" |
---|
356 | onchange="requestDifferentIndicatorSet()" |
---|
357 | > |
---|
358 | <xsl:for-each select="$Page.communityIndicatorSet"> |
---|
359 | <xsl:sort select="SORT_ORDER" data-type="number" order="ascending"/> |
---|
360 | <xsl:sort select="TITLE" order="ascending"/> |
---|
361 | <option value="{NAME}"> |
---|
362 | <xsl:if test="NAME = $Page.indicatorSetName"> |
---|
363 | <xsl:attribute name="selected" select="'selected'"/> |
---|
364 | </xsl:if> |
---|
365 | <xsl:value-of select="TITLE"/> |
---|
366 | </option> |
---|
367 | </xsl:for-each> |
---|
368 | </select> |
---|
369 | </xsl:template> |
---|
370 | |
---|
371 | </xsl:stylesheet> |
---|
372 | <!-- ============================= End of File ============================= --> |
---|