<?xml version="1.0" encoding="UTF-8"?>
<!--wp2319 - changed how maltreatment(maltrtmt) and  response decision(respdesc) sections handled the 3rd and 4th columns of Tools used.-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
	<xsl:output method="xml" encoding="ISO-8859-1"/>
	<xsl:param name="request" select="'print'"/>
	<xsl:variable name="document-properties">
		<doc name="IW" desc="Intake Worksheet">
			<orientation>portrait</orientation>
			<duplex-setting>simplex</duplex-setting>
			<effective from="19950101"/>
			<updated-by>Salyer</updated-by>
			<updated-on>July, 2005</updated-on>
			<n-focus-work-pkg>2319</n-focus-work-pkg>
		</doc>
	</xsl:variable>
	<xsl:variable name="upperCase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
	<xsl:variable name="lowerCase" select="'abcdefghijklmnopqrstuvwxyz'"/>
	<xsl:template match="COR">
		<xsl:variable name="lang" select="translate(LNG,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>
		<fo:root>
			<fo:layout-master-set>
				<fo:simple-page-master master-name="main" page-height="279mm" page-width="216mm" margin-left="10mm" margin-right="10mm" margin-top="10mm" margin-bottom="5mm">
					<fo:region-body region-name="xsl-region-body" margin-bottom="15mm"/>
					<fo:region-after extent="10mm"/>
				</fo:simple-page-master>
			</fo:layout-master-set>
			<fo:page-sequence master-reference="main">
				<fo:static-content font-family="Helvetica" font-weight="normal" font-size="8pt" flow-name="xsl-region-after">
					<fo:block>
						<fo:table table-layout="fixed" width="196mm">
							<fo:table-column column-width="85mm"/>
							<fo:table-column column-width="65mm"/>
							<fo:table-column column-width="46mm"/>
							<fo:table-body>
								<fo:table-row>
									<fo:table-cell>
										<fo:block color="#000000" font-size="9pt" padding-top="1mm" padding-bottom="1mm" padding-start="1mm" border-top-width="1px" border-top-style="solid" border-top-color="#000000">
											<fo:block>Intake Worksheet</fo:block>
											<fo:block font-size="7pt">
												<xsl:value-of select="HDR/INTK_NME"/>
											</fo:block>
										</fo:block>
									</fo:table-cell>
									<fo:table-cell>
										<fo:block color="#000000" font-size="9pt" padding-top="1mm" padding-bottom="1mm" padding-start="1mm" border-top-width="1px" border-top-style="solid" border-top-color="#000000">Page 
											<fo:page-number/> of 
											<fo:page-number-citation ref-id="last-page"/>
										</fo:block>
									</fo:table-cell>
									<fo:table-cell>
										<fo:block color="#000000" font-size="9pt" padding-top="1mm" padding-bottom="1mm" padding-start="1mm" border-top-width="1px" border-top-style="solid" border-top-color="#000000" text-align="end">
											<xsl:value-of select="@ID"/>
										</fo:block>
									</fo:table-cell>
								</fo:table-row>
							</fo:table-body>
						</fo:table>
					</fo:block>
				</fo:static-content>
				<fo:flow flow-name="xsl-region-body">
					<fo:block font-family="Helvetica" font-size="10pt">
						<fo:table table-layout="fixed" space-before="2pt" width="196mm">
							<fo:table-column column-number="1" column-width="135mm"/>
							<fo:table-column column-number="2" column-width="61mm"/>
							<fo:table-body>
								<fo:table-row>
									<fo:table-cell margin-right="2.5pt" width="100%">
										<xsl:apply-templates select="HDR"/>
										<xsl:apply-templates select="BDY"/>
									</fo:table-cell>
									<fo:table-cell width="100%">
										<xsl:call-template name="record_checks"/>
									</fo:table-cell>
								</fo:table-row>
							</fo:table-body>
						</fo:table>
					</fo:block>
					<fo:block id="last-page"/>
				</fo:flow>
			</fo:page-sequence>
		</fo:root>
	</xsl:template>
	<xsl:template match="HDR">
		<fo:table table-layout="fixed" font-size="10pt" font-family="Helvetica">
			<fo:table-column column-number="1" column-width="50mm"/>
			<fo:table-column column-number="2" column-width="85mm"/>
			<fo:table-body margin="5pt">
				<fo:table-row>
					<fo:table-cell number-columns-spanned="2">
						<fo:block text-align="center" space-after="5pt">
							<fo:block font-weight="bold" font-size="14pt">
								<xsl:value-of select="INTK_TYP"/>
							</fo:block>
						</fo:block>
					</fo:table-cell>
				</fo:table-row>
				<fo:table-row>
					<fo:table-cell number-columns-spanned="2">
						<fo:block text-align="center" space-after="5pt">
							<fo:block font-weight="bold" font-size="14pt">Intake Worksheet</fo:block>
						</fo:block>
					</fo:table-cell>
				</fo:table-row>
				<fo:table-row>
					<fo:table-cell number-columns-spanned="2">
						<fo:block text-align="center" space-after="12pt">
							<fo:block font-weight="bold" font-size="12pt">
								<xsl:value-of select="DRAFT"/>
							</fo:block>
						</fo:block>
					</fo:table-cell>
				</fo:table-row>
			</fo:table-body>
		</fo:table>
	</xsl:template>
	<xsl:template match="BDY">
		<fo:table table-layout="fixed">
			<fo:table-column column-number="1" column-width="48mm"/>
			<fo:table-column column-number="2" column-width="90mm"/>
			<fo:table-body>
				<fo:table-row space-before="6pt">
					<fo:table-cell>
						<fo:block>
Intake Number:	<xsl:value-of select="../HDR/INTK_NBR"/>
						</fo:block>
					</fo:table-cell>
					<fo:table-cell>
						<fo:block wrap-option="wrap">
Intake Name:<xsl:value-of select="../HDR/INTK_NME"/>
						</fo:block>
					</fo:table-cell>
				</fo:table-row>
			</fo:table-body>
		</fo:table>
		<fo:block text-align="left" space-before="6pt">
			<xsl:if test="PRIRTY or STAT_RSN_CD">
				<fo:block space-after="6pt">
					Priority:&#160;
					<xsl:value-of select="PRIRTY"/>
					<xsl:value-of select="STAT_RSN_CD"/>
				</fo:block>
			</xsl:if>
			<xsl:if test="STAT_RSN_CD_X">
				<fo:block space-after="6pt">Status Reason: 
					<xsl:value-of select="STAT_RSN_CD_X"/>
				</fo:block>
			</xsl:if>
		</fo:block>
		<fo:block text-align="left">
			<fo:block>Date Received:
				<xsl:value-of select="DT_RCVD"/> &#160;&#160;&#160;&#160;Time Received:
				<xsl:value-of select="TME_RCVD"/>
			</fo:block>
			<fo:block text-indent="48mm">Source:
				<xsl:value-of select="SRC"/>
				<xsl:value-of select="HOT_LNE"/>
			</fo:block>
		</fo:block>
		<xsl:call-template name="received_by"/>
		<xsl:if test="ALL_TYP">
			<fo:block space-after="12pt" space-before="6pt">
				<xsl:apply-templates select="ALL_TYP"/>
			</fo:block>
		</xsl:if>
		<xsl:if test="ALL_TYP_A">
			<fo:block space-after="12pt">
				<xsl:apply-templates select="ALL_TYP_A"/>
			</fo:block>
		</xsl:if>
		<fo:block space-before="6pt"/>
		<xsl:call-template name="worker_info"/>
		<xsl:call-template name="asgn_date"/>
		<xsl:call-template name="county_info"/>
		<xsl:apply-templates select="HH_INFO"/>
		
		<xsl:if test="contains(translate(../HDR/INTK_TYP, $upperCase, $lowerCase),'adult protective services')">
			<fo:block space-before="9pt" font-size="11pt">
				<xsl:text>Person Information:</xsl:text>
			</fo:block>
		</xsl:if>
		<xsl:apply-templates select="ADLT_INFO"/>
		<xsl:apply-templates select="CHLD_INFO"/>
		<xsl:apply-templates select="REL_SUMM"/>
		<xsl:apply-templates select="REF_INFO"/>
		<xsl:apply-templates select="RPTR_INFO"/>
		<xsl:apply-templates select="CURR_ALL_SUMM"/>
		<xsl:apply-templates select="PERP_HIST"/>
		<xsl:apply-templates select="DEPT_DCSN"/>
		<xsl:apply-templates select="ORG_INVLVD"/>
		<xsl:choose>
			<xsl:when test="contains(translate(../HDR/INTK_TYP, $upperCase, $lowerCase),'adult protective services')">
				<fo:block>
					<xsl:text/>
				</fo:block>
			</xsl:when>
			<xsl:otherwise>
				<xsl:apply-templates select="TL_USED"/>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template match="INTK_NME">
		<xsl:choose>
			<xsl:when test="position()=1">
				<fo:block>Intake Name: 
					<fo:inline>
						<xsl:value-of select="."/>
					</fo:inline>
				</fo:block>
			</xsl:when>
			<xsl:otherwise>
				<fo:block text-indent="20mm">
					<xsl:value-of select="."/>
				</fo:block>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template name="record_checks">
		<fo:table table-layout="fixed" font-family="Helvetica" font-size="8pt">
			<fo:table-column column-number="1" column-width="10mm"/>
			<fo:table-column column-number="2" column-width="31mm"/>
			<fo:table-column column-number="3" column-width="20mm"/>
			<fo:table-body>
				<fo:table-row>
					<fo:table-cell number-columns-spanned="3">
						<fo:block text-align="center" space-after="5pt">
							<xsl:if test="contains(HDR/INTK_TYP,'Child Abuse/Neglect') or contains(HDR/INTK_TYP,'Adult Protective Services') ">
								<fo:block font-weight="bold">RECORDS CHECK</fo:block>
							</xsl:if>
						</fo:block>
					</fo:table-cell>
				</fo:table-row>
				<xsl:if test="HDR/REC_CHK/TIED">
					<fo:table-row>
						<fo:table-cell number-columns-spanned="3">
							<fo:block text-indent="2mm">
								<xsl:value-of select="HDR/REC_CHK/TIED"/>
							</fo:block>
						</fo:table-cell>
					</fo:table-row>
				</xsl:if>
				<xsl:if test="HDR/DESC">
					<fo:table-row>
						<fo:table-cell>
							<fo:block>
								<fo:block text-align="right">[ X ]</fo:block>
							</fo:block>
						</fo:table-cell>
						<fo:table-cell number-columns-spanned="2">
							<fo:block>
								<fo:block>All Program Cases</fo:block>
							</fo:block>
						</fo:table-cell>
					</fo:table-row>
				</xsl:if>
			</fo:table-body>
		</fo:table>
		<fo:block>
			<fo:table table-layout="fixed" width="100%">
				<fo:table-column column-width="proportional-column-width(1)"/>
				<fo:table-column column-width="58mm"/>
				<fo:table-column column-width="proportional-column-width(1)"/>
				<fo:table-body>
					<fo:table-row>
						<fo:table-cell/>
						<fo:table-cell>
							<xsl:call-template name="repeat_records"/>
						</fo:table-cell>
						<fo:table-cell/>
					</fo:table-row>
				</fo:table-body>
			</fo:table>
		</fo:block>
		<fo:block space-before="6pt"/>
		<fo:table table-layout="fixed" font-family="Helvetica" font-size="8pt">
			<fo:table-column column-number="1" column-width="10mm"/>
			<fo:table-column column-number="2" column-width="31mm"/>
			<fo:table-column column-number="3" column-width="20mm"/>
			<fo:table-body margin="5pt">
				<xsl:for-each select="HDR/REC_CHK/DESC">
					<xsl:variable name="flag-text">
						<xsl:choose>
							<xsl:when test="@FLAG">
								<xsl:value-of select="@FLAG"/>
							</xsl:when>
							<xsl:otherwise>&#160;&#160;</xsl:otherwise>
						</xsl:choose>
					</xsl:variable>
					<fo:table-row>
						<fo:table-cell>
							<fo:block>
								<fo:block text-align="right">
									<xsl:value-of select="concat('[ ',$flag-text,' ]')"/>
								</fo:block>
							</fo:block>
						</fo:table-cell>
						<fo:table-cell number-columns-spanned="2">
							<xsl:choose>
								<xsl:when test="contains(.,'(')">
									<fo:block>
										<xsl:value-of select="substring-before(.,'(')"/>
										<fo:inline font-size="7pt">(
											<xsl:value-of select="substring-after(.,'(')"/>
										</fo:inline>
									</fo:block>
								</xsl:when>
								<xsl:otherwise>
									<fo:block>
										<xsl:value-of select="."/>
									</fo:block>
								</xsl:otherwise>
							</xsl:choose>
						</fo:table-cell>
					</fo:table-row>
				</xsl:for-each>
				<fo:table-row>
					<fo:table-cell>
						<fo:block>
							<fo:block>&#160;</fo:block>
						</fo:block>
					</fo:table-cell>
					<fo:table-cell number-columns-spanned="2">
						<xsl:apply-templates select="HDR/REC_CHK/DESC_TXT"/>
					</fo:table-cell>
				</fo:table-row>
			</fo:table-body>
		</fo:table>
	</xsl:template>
	<xsl:template name="received_by">
		<fo:block space-before="3mm">
			<fo:table table-layout="fixed">
				<fo:table-column column-number="1" column-width="48mm"/>
				<fo:table-column column-number="2" column-width="90mm"/>
				<fo:table-body>
					<fo:table-row>
						<fo:table-cell>
							<fo:block>
								<fo:block>
								Received By:
							</fo:block>
							</fo:block>
						</fo:table-cell>
						<fo:table-cell>
							<xsl:apply-templates select="RCVD_BY_INFO"/>
						</fo:table-cell>
					</fo:table-row>
				</fo:table-body>
			</fo:table>
		</fo:block>
	</xsl:template>
	<xsl:template match="RCVD_BY_INFO">
		<fo:block>
			<fo:block>
				<xsl:value-of select="NME"/>
			</fo:block>
			<fo:block>
				<xsl:value-of select="OFC"/>
			</fo:block>
		</fo:block>
	</xsl:template>
	<xsl:template name="worker_info">
		<fo:table table-layout="fixed">
			<fo:table-column column-number="1" column-width="48mm"/>
			<fo:table-column column-number="2" column-width="90mm"/>
			<fo:table-body>
				<fo:table-row>
					<fo:table-cell>
						<fo:block>
							<fo:block>
								Worker Assigned:
							</fo:block>
						</fo:block>
					</fo:table-cell>
					<fo:table-cell>
						<xsl:apply-templates select="WRKR_ASGN_INFO"/>
					</fo:table-cell>
				</fo:table-row>
			</fo:table-body>
		</fo:table>
	</xsl:template>
	<xsl:template match="WRKR_ASGN_INFO">
		<fo:block>
			<fo:block>
				<xsl:value-of select="NME"/>
			</fo:block>
			<xsl:apply-templates select="ADDR" mode="rpt_info"/>
			<fo:block>
				<xsl:value-of select="PHN_NBR"/>
			</fo:block>
		</fo:block>
	</xsl:template>
	<xsl:template name="asgn_date">
		<xsl:if test="string-length(normalize-space(DT_WRKR_ASGN)) &gt; 0">
			<fo:block space-before="6pt">
				<fo:table table-layout="fixed">
					<fo:table-column column-number="1" column-width="48mm"/>
					<fo:table-column column-number="2" column-width="90mm"/>
					<fo:table-body>
						<fo:table-row>
							<fo:table-cell>
								<fo:block>
									<fo:block>
							Date Assigned:
									</fo:block>
								</fo:block>
							</fo:table-cell>
							<fo:table-cell>
								<fo:block>
									<xsl:value-of select="DT_WRKR_ASGN"/>
								</fo:block>
							</fo:table-cell>
						</fo:table-row>
					</fo:table-body>
				</fo:table>
			</fo:block>
		</xsl:if>
	</xsl:template>
	<xsl:template name="county_info">
		<fo:block space-before="6pt">
			<fo:table table-layout="fixed">
				<fo:table-column column-number="1" column-width="48mm"/>
				<fo:table-column column-number="2" column-width="90mm"/>
				<fo:table-body>
					<xsl:if test="string-length(normalize-space(CNTY_OF_INCD)) &gt; 0">
						<fo:table-row>
							<fo:table-cell>
								<fo:block>County of Incident:</fo:block>
							</fo:table-cell>
							<fo:table-cell>
								<xsl:apply-templates select="CNTY_OF_INCD" mode="rpt_info"/>
							</fo:table-cell>
						</fo:table-row>
					</xsl:if>
				</fo:table-body>
			</fo:table>
		</fo:block>
	</xsl:template>
	<xsl:template match="HH_INFO">
		<fo:block space-before="9pt" space-after="9pt" font-size="11pt">Household Information:</fo:block>
		<xsl:apply-templates select="NONE"/>
		<fo:table table-layout="fixed">
			<fo:table-column column-number="1" column-width="10mm"/>
			<fo:table-column column-number="2" column-width="38mm"/>
			<fo:table-column column-number="3" column-width="38mm"/>
			<fo:table-column column-number="4" column-width="55mm"/>
			<fo:table-body>
				<xsl:if test="string-length(normalize-space(NME)) &gt; 0">
					<fo:table-row>
						<fo:table-cell>
							<fo:block/>
						</fo:table-cell>
						<fo:table-cell>
							<fo:block>
								<fo:block>
							Name:
								</fo:block>
							</fo:block>
						</fo:table-cell>
						<fo:table-cell number-columns-spanned="2">
							<fo:block>
								<xsl:value-of select="NME"/>
							</fo:block>
						</fo:table-cell>
					</fo:table-row>
				</xsl:if>
				<xsl:if test="string-length(normalize-space(ADDR)) &gt; 0">
					<fo:table-row>
						<fo:table-cell>
							<fo:block/>
						</fo:table-cell>
						<fo:table-cell>
							<fo:block>
								<xsl:if test="position()=1">
									<fo:block>
								Address:
									</fo:block>
								</xsl:if>
							</fo:block>
						</fo:table-cell>
						<fo:table-cell number-columns-spanned="2">
							<fo:block>
								<xsl:apply-templates select="ADDR" mode="rpt_info"/>
							</fo:block>
						</fo:table-cell>
					</fo:table-row>
				</xsl:if>
				<xsl:if test="string-length(normalize-space(CNTY)) &gt; 0">
					<fo:table-row>
						<fo:table-cell>
							<fo:block/>
						</fo:table-cell>
						<fo:table-cell>
							<fo:block>
								<fo:block>
							County:
								</fo:block>
							</fo:block>
						</fo:table-cell>
						<fo:table-cell number-columns-spanned="2">
							<fo:block>
								<xsl:value-of select="CNTY"/>
							</fo:block>
						</fo:table-cell>
					</fo:table-row>
				</xsl:if>
				<xsl:if test="string-length(normalize-space(DIR)) &gt; 0">
					<fo:table-row>
						<fo:table-cell>
							<fo:block/>
						</fo:table-cell>
						<fo:table-cell>
							<fo:block>
								<fo:block>
							Directions:
								</fo:block>
							</fo:block>
						</fo:table-cell>
						<fo:table-cell number-columns-spanned="2">
							<fo:block>
								<xsl:value-of select="DIR"/>
							</fo:block>
						</fo:table-cell>
					</fo:table-row>
				</xsl:if>
				<xsl:if test="string-length(normalize-space(PHN_NBR)) &gt; 0">
					<fo:table-row>
						<fo:table-cell>
							<fo:block/>
						</fo:table-cell>
						<fo:table-cell>
							<fo:block>
								<xsl:if test="position()=1">
									<fo:block>
								Phone:
									</fo:block>
								</xsl:if>
							</fo:block>
						</fo:table-cell>
						<fo:table-cell number-columns-spanned="2">
							<fo:block>
								<xsl:apply-templates select="PHN_NBR" mode="rpt_info"/>
							</fo:block>
						</fo:table-cell>
					</fo:table-row>
				</xsl:if>
			</fo:table-body>
		</fo:table>
	</xsl:template>
	<xsl:template match="ADLT_INFO|CHLD_INFO">
		<fo:table table-layout="fixed">
			<fo:table-column column-number="1" column-width="10mm"/>
			<fo:table-column column-number="2" column-width="38mm"/>
			<fo:table-column column-number="3" column-width="35mm"/>
			<fo:table-column column-number="4" column-width="55mm"/>
			<fo:table-body>
				<fo:table-row keep-with-next="always">
					<fo:table-cell number-columns-spanned="4">
						<xsl:choose>
							<xsl:when test="contains(translate(//HDR/INTK_TYP, $upperCase, $lowerCase),'adult protective services')">
								<fo:block>
									<xsl:text/>
								</fo:block>
							</xsl:when>
							<xsl:otherwise>
								<xsl:choose>
									<xsl:when test="name()='ADLT_INFO'">
										<fo:block space-before="9pt" font-size="11pt">
											<xsl:text>Adult Information (Greater than 18 years of age)</xsl:text>
										</fo:block>
									</xsl:when>
									<xsl:when test="name()='CHLD_INFO'">
										<fo:block space-before="9pt" font-size="11pt">
											<xsl:text>Child Information (18 years of age or less)</xsl:text>
										</fo:block>
									</xsl:when>
								</xsl:choose>
							</xsl:otherwise>
						</xsl:choose>
					</fo:table-cell>
				</fo:table-row>
				<fo:table-row keep-with-next="always">
					<fo:table-cell number-columns-spanned="2">
						<fo:block space-after="9pt"/>
						<xsl:apply-templates select="NONE"/>
						<fo:block text-indent="10mm">
							<xsl:value-of select="RLE"/>
						</fo:block>
					</fo:table-cell>
				</fo:table-row>
				<xsl:if test="string-length(normalize-space(NME)) &gt; 0">
					<fo:table-row keep-with-previous="always">
						<fo:table-cell>
							<fo:block/>
						</fo:table-cell>
						<fo:table-cell>
							<fo:block>
								<fo:block>
							Name:
								</fo:block>
							</fo:block>
						</fo:table-cell>
						<fo:table-cell number-columns-spanned="2">
							<fo:block>
								<xsl:value-of select="NME"/>
							</fo:block>
						</fo:table-cell>
					</fo:table-row>
				</xsl:if>
				<xsl:if test="string-length(normalize-space(ADDR)) &gt; 0">
					<fo:table-row keep-with-previous="always">
						<fo:table-cell>
							<fo:block/>
						</fo:table-cell>
						<fo:table-cell>
							<fo:block>
								Address:							
							</fo:block>
						</fo:table-cell>
						<fo:table-cell number-columns-spanned="2">
							<fo:block>
								<xsl:apply-templates select="ADDR" mode="rpt_info"/>
							</fo:block>
						</fo:table-cell>
					</fo:table-row>
				</xsl:if>
				<xsl:if test="string-length(normalize-space(DIR)) &gt; 0">
					<fo:table-row keep-with-previous="always">
						<fo:table-cell>
							<fo:block/>
						</fo:table-cell>
						<fo:table-cell>
							<fo:block>
								<fo:block>
							Directions:
								</fo:block>
							</fo:block>
						</fo:table-cell>
						<fo:table-cell number-columns-spanned="2">
							<fo:block>
								<xsl:value-of select="DIR"/>
							</fo:block>
						</fo:table-cell>
					</fo:table-row>
				</xsl:if>
				<xsl:if test="string-length(normalize-space(PHN_NBR)) &gt; 0">
					<fo:table-row keep-with-previous="always">
						<fo:table-cell>
							<fo:block/>
						</fo:table-cell>
						<fo:table-cell>
							<fo:block>									
								Phone:
							
							</fo:block>
						</fo:table-cell>
						<fo:table-cell number-columns-spanned="2">
							<fo:block>
								<xsl:apply-templates select="PHN_NBR" mode="rpt_info"/>
							</fo:block>
						</fo:table-cell>
					</fo:table-row>
				</xsl:if>
				<fo:table-row keep-with-previous="always">
					<fo:table-cell>
						<fo:block/>
					</fo:table-cell>
					<fo:table-cell>
						<fo:block>
							<xsl:if test="string-length(normalize-space(DOB)) &gt; 0 or string-length(normalize-space(AGE)) &gt; 0 ">
								<fo:block>
								DOB/Age:
								</fo:block>
							</xsl:if>
						</fo:block>
					</fo:table-cell>
					<fo:table-cell>
						<fo:block>
							<xsl:if test="string-length(normalize-space(DOB)) &gt; 0 or string-length(normalize-space(AGE)) &gt; 0 ">
								<xsl:choose>
									<xsl:when test="contains(DOB,'Unknown')">
								  Unknown
									</xsl:when>
									<xsl:otherwise>
										<xsl:value-of select="concat(DOB,'/',AGE)"/>
									</xsl:otherwise>
								</xsl:choose>
							</xsl:if>
						</fo:block>
					</fo:table-cell>
					<fo:table-cell>
						<fo:block>
							<xsl:if test="string-length(normalize-space(SEX)) &gt; 0">
								<xsl:value-of select="concat('Sex: ',SEX)"/>
							</xsl:if>
						</fo:block>
					</fo:table-cell>
				</fo:table-row>
				<xsl:if test="string-length(normalize-space(RACE)) &gt; 0">
					<fo:table-row keep-with-previous="always">
						<fo:table-cell>
							<fo:block/>
						</fo:table-cell>
						<fo:table-cell>
							<fo:block>	
								Race:							
							</fo:block>
						</fo:table-cell>
						<fo:table-cell number-columns-spanned="2">
							<fo:block>
								<xsl:apply-templates select="RACE" mode="rpt_info"/>
							</fo:block>
						</fo:table-cell>
					</fo:table-row>
				</xsl:if>
				<xsl:if test="string-length(normalize-space(ENTCY)) &gt; 0">
					<fo:table-row keep-with-previous="always">
						<fo:table-cell>
							<fo:block/>
						</fo:table-cell>
						<fo:table-cell>
							<fo:block>
								<fo:block>
							Ethnicity:
								</fo:block>
							</fo:block>
						</fo:table-cell>
						<fo:table-cell number-columns-spanned="2">
							<fo:block>
								<xsl:value-of select="ENTCY"/>
							</fo:block>
						</fo:table-cell>
					</fo:table-row>
				</xsl:if>
				<xsl:if test="string-length(normalize-space(TRIB)) &gt; 0">
					<fo:table-row keep-with-previous="always">
						<fo:table-cell>
							<fo:block/>
						</fo:table-cell>
						<fo:table-cell>
							<fo:block>Tribal Affiliation:
							</fo:block>
						</fo:table-cell>
						<fo:table-cell number-columns-spanned="2">
							<fo:block>
								<xsl:apply-templates select="TRIB" mode="rpt_info"/>
							</fo:block>
						</fo:table-cell>
					</fo:table-row>
				</xsl:if>
				<xsl:if test="string-length(normalize-space(SCHL)) &gt; 0">
					<fo:table-row keep-with-previous="always">
						<fo:table-cell>
							<fo:block/>
						</fo:table-cell>
						<fo:table-cell>
							<fo:block>
								<fo:block>
							School:
								</fo:block>
							</fo:block>
						</fo:table-cell>
						<fo:table-cell number-columns-spanned="2">
							<fo:block>
								<xsl:value-of select="SCHL"/>
							</fo:block>
						</fo:table-cell>
					</fo:table-row>
				</xsl:if>
				<xsl:if test="string-length(normalize-space(GRADE)) &gt; 0">
					<fo:table-row keep-with-previous="always">
						<fo:table-cell>
							<fo:block/>
						</fo:table-cell>
						<fo:table-cell>
							<fo:block>
								<fo:block>
							Grade:
								</fo:block>
							</fo:block>
						</fo:table-cell>
						<fo:table-cell number-columns-spanned="2">
							<fo:block>
								<xsl:value-of select="GRADE"/>
							</fo:block>
						</fo:table-cell>
					</fo:table-row>
				</xsl:if>
			</fo:table-body>
		</fo:table>
	</xsl:template>
	<xsl:template match="RPTR_INFO">
		<fo:table table-layout="fixed">
			<fo:table-column column-number="1" column-width="10mm"/>
			<fo:table-column column-number="2" column-width="38mm"/>
			<fo:table-column column-number="3" column-width="35mm"/>
			<fo:table-column column-number="4" column-width="55mm"/>
			<fo:table-body>
				<fo:table-row keep-with-next="always">
					<fo:table-cell>
						<fo:block space-before="9pt" space-after="9pt" font-size="11pt">
							<xsl:text>Reporter</xsl:text>
						</fo:block>
					</fo:table-cell>
				</fo:table-row>
				<fo:table-row keep-with-previous="always">
					<fo:table-cell>
						<xsl:apply-templates select="NONE"/>
					</fo:table-cell>
				</fo:table-row>
				<fo:table-row keep-with-previous="always">
					<fo:table-cell number-columns-spanned="4">
						<xsl:if test="string-length(normalize-space(SRC)) &gt; 0">
							<fo:block text-indent="10mm"> Source:
			<fo:inline>
									<fo:leader leader-pattern="space" leader-length="25mm"/>
								</fo:inline>
								<xsl:value-of select="SRC"/>
							</fo:block>
						</xsl:if>
					</fo:table-cell>
				</fo:table-row>
				<xsl:if test="string-length(normalize-space(NME)) &gt; 0">
					<fo:table-row keep-with-previous="always">
						<fo:table-cell>
							<fo:block/>
						</fo:table-cell>
						<fo:table-cell>
							<fo:block>
								<fo:block>
							Name:
								</fo:block>
							</fo:block>
						</fo:table-cell>
						<fo:table-cell number-columns-spanned="2">
							<fo:block>
								<xsl:value-of select="NME"/>
							</fo:block>
						</fo:table-cell>
					</fo:table-row>
				</xsl:if>
				<xsl:if test="string-length(normalize-space(ADDR)) &gt; 0">
					<fo:table-row keep-with-previous="always">
						<fo:table-cell>
							<fo:block/>
						</fo:table-cell>
						<fo:table-cell>
							<fo:block>
								<fo:block>
								Address:
								</fo:block>
							</fo:block>
						</fo:table-cell>
						<fo:table-cell number-columns-spanned="2">
							<fo:block>
								<xsl:apply-templates select="ADDR" mode="rpt_info"/>
							</fo:block>
						</fo:table-cell>
					</fo:table-row>
				</xsl:if>
				<xsl:if test="string-length(normalize-space(DIR)) &gt; 0">
					<fo:table-row keep-with-previous="always">
						<fo:table-cell>
							<fo:block/>
						</fo:table-cell>
						<fo:table-cell>
							<fo:block>
								<fo:block>
							Directions:
								</fo:block>
							</fo:block>
						</fo:table-cell>
						<fo:table-cell number-columns-spanned="2">
							<fo:block>
								<xsl:value-of select="DIR"/>
							</fo:block>
						</fo:table-cell>
					</fo:table-row>
				</xsl:if>
				<xsl:if test="string-length(normalize-space(PHN_NBR)) &gt; 0">
					<fo:table-row keep-with-previous="always">
						<fo:table-cell>
							<fo:block/>
						</fo:table-cell>
						<fo:table-cell>
							<fo:block>
								<fo:block>
								Phone:
								</fo:block>
							</fo:block>
						</fo:table-cell>
						<fo:table-cell number-columns-spanned="2">
							<fo:block>
								<xsl:apply-templates select="PHN_NBR" mode="rpt_info"/>
							</fo:block>
						</fo:table-cell>
					</fo:table-row>
				</xsl:if>
				<fo:table-row keep-with-previous="always">
					<fo:table-cell>
						<fo:block/>
					</fo:table-cell>
					<fo:table-cell>
						<fo:block>
							<xsl:if test="string-length(normalize-space(DOB)) &gt; 0 or string-length(normalize-space(AGE)) &gt; 0 ">
								<fo:block>
								DOB/Age:
								</fo:block>
							</xsl:if>
						</fo:block>
					</fo:table-cell>
					<fo:table-cell>
						<fo:block>
							<xsl:if test="string-length(normalize-space(DOB)) &gt; 0 or string-length(normalize-space(AGE)) &gt; 0 ">
								<xsl:choose>
									<xsl:when test="contains(DOB,'Unknown')">
								  Unknown
									</xsl:when>
									<xsl:otherwise>
										<xsl:value-of select="concat(DOB,'/',AGE)"/>
									</xsl:otherwise>
								</xsl:choose>
							</xsl:if>
						</fo:block>
					</fo:table-cell>
					<fo:table-cell>
						<fo:block>
							<xsl:if test="string-length(normalize-space(SEX)) &gt; 0">
								<xsl:value-of select="concat('Sex: ',SEX)"/>
							</xsl:if>
						</fo:block>
					</fo:table-cell>
				</fo:table-row>
				<xsl:if test="string-length(normalize-space(RACE)) &gt; 0">
					<fo:table-row keep-with-previous="always">
						<fo:table-cell>
							<fo:block/>
						</fo:table-cell>
						<fo:table-cell>
							<fo:block>
								<fo:block>
								Race:
								</fo:block>
							</fo:block>
						</fo:table-cell>
						<fo:table-cell number-columns-spanned="2">
							<fo:block>
								<xsl:apply-templates select="RACE" mode="rpt_info"/>
							</fo:block>
						</fo:table-cell>
					</fo:table-row>
				</xsl:if>
				<xsl:if test="string-length(normalize-space(ENTCY)) &gt; 0">
					<fo:table-row keep-with-previous="always">
						<fo:table-cell>
							<fo:block/>
						</fo:table-cell>
						<fo:table-cell>
							<fo:block>
								<fo:block>
							Ethnicity:
								</fo:block>
							</fo:block>
						</fo:table-cell>
						<fo:table-cell number-columns-spanned="2">
							<fo:block>
								<xsl:value-of select="ENTCY"/>
							</fo:block>
						</fo:table-cell>
					</fo:table-row>
				</xsl:if>
				<xsl:if test="string-length(normalize-space(TRIB)) &gt; 0">
					<fo:table-row keep-with-previous="always">
						<fo:table-cell>
							<fo:block/>
						</fo:table-cell>
						<fo:table-cell>
							<fo:block>Tribal Affiliation:
							</fo:block>
						</fo:table-cell>
						<fo:table-cell number-columns-spanned="2">
							<fo:block>
								<xsl:apply-templates select="TRIB" mode="rpt_info"/>
							</fo:block>
						</fo:table-cell>
					</fo:table-row>
				</xsl:if>
				<xsl:if test="string-length(normalize-space(ADD_DTL)) &gt; 0">
					<fo:table-row keep-with-previous="always">
						<fo:table-cell>
							<fo:block/>
						</fo:table-cell>
						<fo:table-cell>
							<xsl:if test="string-length(normalize-space(ADD_DTL)) &gt; 0">
								<fo:block> Additional Details:
			<fo:inline>
										
									</fo:inline>
								</fo:block>
							</xsl:if>
						</fo:table-cell>
						<fo:table-cell number-columns-spanned="2">
							<fo:block wrap-option="wrap">
								<xsl:value-of select="ADD_DTL"/>
							</fo:block>
						</fo:table-cell>
					</fo:table-row>
				</xsl:if>
			</fo:table-body>
		</fo:table>
	</xsl:template>
	<xsl:template name="repeat_records">
		<fo:table table-layout="fixed" width="58mm" font-family="Times Roman" font-size="8pt">
			<fo:table-column column-number="1" column-width="14mm"/>
			<fo:table-column column-number="2" column-width="20mm"/>
			<fo:table-column column-number="3" column-width="8mm"/>
			<fo:table-column column-number="4" column-width="16mm"/>
			<fo:table-body>
				<xsl:if test=".//MC">
					<fo:table-row>
						<fo:table-cell>
							<fo:block text-align="center">
								<fo:block text-decoration="underline">
								MC
								</fo:block>
							</fo:block>
						</fo:table-cell>
						<fo:table-cell>
							<fo:block text-align="center">
								<fo:block text-decoration="underline">
								Program
								</fo:block>
							</fo:block>
						</fo:table-cell>
						<fo:table-cell>
							<fo:block text-align="center">
								<fo:block text-decoration="underline">
								St
								</fo:block>
							</fo:block>
						</fo:table-cell>
						<fo:table-cell>
							<fo:block text-align="center">
								<fo:block text-decoration="underline">
								Begin Dt
								</fo:block>
							</fo:block>
						</fo:table-cell>
					</fo:table-row>
				</xsl:if>
				<xsl:for-each select="HDR/REC_CHK/MC_PC">
					<fo:table-row>
						<fo:table-cell>
							<fo:block>
								<fo:block>
									<xsl:value-of select="MC"/>
								</fo:block>
							</fo:block>
						</fo:table-cell>
						<fo:table-cell>
							<fo:block>
								<fo:block>
									<xsl:value-of select="PC"/>
								</fo:block>
							</fo:block>
						</fo:table-cell>
						<fo:table-cell>
							<fo:block>
								<fo:block text-align="center">
									<xsl:value-of select="STAT"/>
								</fo:block>
							</fo:block>
						</fo:table-cell>
						<fo:table-cell>
							<fo:block>
								<fo:block>
									<xsl:value-of select="BEG_DT"/>
								</fo:block>
							</fo:block>
						</fo:table-cell>
					</fo:table-row>
				</xsl:for-each>
			</fo:table-body>
		</fo:table>
	</xsl:template>
	<xsl:template match="DESC_TXT">
		<fo:block space-before="6pt">
			<fo:block text-align="justify">
				<xsl:value-of select="."/>
			</fo:block>
		</fo:block>
	</xsl:template>
	<xsl:template match="REL_SUMM">
		<fo:table table-layout="fixed">
			<fo:table-column column-number="1" column-width="196mm"/>
			<fo:table-body>
				<fo:table-row keep-with-next="always">
					<fo:table-cell>
						<fo:block space-before="9pt" space-after="9pt" font-size="11pt">
							<xsl:text>Relationship Summary</xsl:text>
						</fo:block>
					</fo:table-cell>
				</fo:table-row>
				<fo:table-row keep-with-previous="always">
					<fo:table-cell>
						<xsl:apply-templates select="NONE"/>
					</fo:table-cell>
				</fo:table-row>
				<fo:table-row keep-with-previous="always">
					<fo:table-cell>
						<fo:block start-indent="10mm">
							<xsl:apply-templates select="RS_ARP"/>
							<xsl:apply-templates select="RS_FUNCTNL"/>
						</fo:block>
					</fo:table-cell>
				</fo:table-row>
			</fo:table-body>
		</fo:table>
	</xsl:template>
	<xsl:template match="RS_ARP">
		<fo:block line-height="12pt">
			<xsl:value-of select="concat(RS_ARP1,'&#160;',RS_ARP2)"/>
		</fo:block>
	</xsl:template>
	<xsl:template match="RS_FUNCTNL">
		<fo:block line-height="12pt">
			<xsl:value-of select="concat(RS_FUNCTNL1,'&#160;',RS_FUNCTNL2)"/>
		</fo:block>
	</xsl:template>
	<xsl:template match="REF_INFO">
		<xsl:if test="position() =1">
			<fo:block space-before="9pt" space-after="9pt" font-size="11pt">
				<xsl:text>Referral Information</xsl:text>
			</fo:block>
		</xsl:if>
		<xsl:apply-templates select="NONE"/>
		<xsl:for-each select="DTL">
			<xsl:apply-templates mode="ref_info"/>
			<fo:block space-before="6pt"/>
		</xsl:for-each>
	</xsl:template>
	<xsl:template match="CURR_ALL_SUMM">
		<xsl:for-each select="DTL">
			<fo:table table-layout="fixed">
				<fo:table-column column-number="1" column-width="10mm"/>
				<fo:table-column column-number="2" column-width="38mm"/>
				<fo:table-column column-number="3" column-width="35mm"/>
				<fo:table-column column-number="4" column-width="65mm"/>
				<fo:table-body>
					<fo:table-row keep-with-next="always">
						<fo:table-cell number-columns-spanned="3">
							<fo:block space-before="9pt" space-after="9pt" font-size="11pt">
				Current Allegation(s) Summary
		</fo:block>
						</fo:table-cell>
					</fo:table-row>
					<fo:table-row keep-with-previous="always">
						<fo:table-cell>
							<xsl:apply-templates select="NONE"/>
						</fo:table-cell>
					</fo:table-row>
					<xsl:if test="string-length(normalize-space(INCD_DT)) &gt; 0">
						<fo:table-row keep-with-previous="always">
							<fo:table-cell>
								<fo:block/>
							</fo:table-cell>
							<fo:table-cell>
								<fo:block>
									<fo:block>
							Incident Date:
									</fo:block>
								</fo:block>
							</fo:table-cell>
							<fo:table-cell number-columns-spanned="2">
								<fo:block>
									<xsl:value-of select="INCD_DT"/>
								</fo:block>
							</fo:table-cell>
						</fo:table-row>
					</xsl:if>
					<xsl:if test="string-length(normalize-space(FNDNG_DT)) &gt; 0">
						<fo:table-row keep-with-previous="always">
							<fo:table-cell>
								<fo:block/>
							</fo:table-cell>
							<fo:table-cell>
								<fo:block>
									<fo:block>
								Finding Date:
									</fo:block>
								</fo:block>
							</fo:table-cell>
							<fo:table-cell>
								<fo:block>
									<fo:inline>
										<xsl:value-of select="FNDNG_DT"/>
									</fo:inline>
								</fo:block>
							</fo:table-cell>
							<fo:table-cell>
								<fo:block>
									<xsl:if test="FNDNG">
								  Finding:&#160;
										<xsl:value-of select="FNDNG"/>
									</xsl:if>
								</fo:block>
							</fo:table-cell>
						</fo:table-row>
					</xsl:if>
					<xsl:if test="string-length(normalize-space(VCTM)) &gt; 0">
						<fo:table-row keep-with-previous="always">
							<fo:table-cell>
								<fo:block/>
							</fo:table-cell>
							<fo:table-cell>
								<fo:block>
									<fo:block>
							Victim:
									</fo:block>
								</fo:block>
							</fo:table-cell>
							<fo:table-cell number-columns-spanned="2">
								<fo:block>
									<xsl:value-of select="VCTM"/>
								</fo:block>
							</fo:table-cell>
						</fo:table-row>
					</xsl:if>
					<xsl:if test="string-length(normalize-space(PERP)) &gt; 0">
						<fo:table-row keep-with-previous="always">
							<fo:table-cell>
								<fo:block/>
							</fo:table-cell>
							<fo:table-cell>
								<fo:block>
									<fo:block>
							Perpetrator:
									</fo:block>
								</fo:block>
							</fo:table-cell>
							<fo:table-cell number-columns-spanned="2">
								<fo:block>
									<xsl:value-of select="PERP"/>
								</fo:block>
							</fo:table-cell>
						</fo:table-row>
					</xsl:if>
					<xsl:if test="string-length(normalize-space(ALL)) &gt; 0">
						<fo:table-row keep-with-previous="always">
							<fo:table-cell>
								<fo:block/>
							</fo:table-cell>
							<fo:table-cell>
								<fo:block>
									<fo:block>
							Allegation:
									</fo:block>
								</fo:block>
							</fo:table-cell>
							<fo:table-cell number-columns-spanned="2">
								<fo:block>
									<xsl:value-of select="ALL"/>
								</fo:block>
							</fo:table-cell>
						</fo:table-row>
					</xsl:if>
					<xsl:if test="string-length(normalize-space(EXPUNG_DT)) &gt; 0">
						<fo:table-row keep-with-previous="always">
							<fo:table-cell>
								<fo:block/>
							</fo:table-cell>
							<fo:table-cell>
								<fo:block>
									<fo:block>
								Expungement&#160;Date:
									</fo:block>
								</fo:block>
							</fo:table-cell>
							<fo:table-cell>
								<fo:block space-after="6pt">
									<fo:inline>
										<xsl:value-of select="EXPUNG_DT"/>
									</fo:inline>
								</fo:block>
							</fo:table-cell>
							<fo:table-cell>
								<fo:block>
									<xsl:if test="string-length(normalize-space(EXPUNG_RSN)) &gt; 0">
								 Reason:&#160;
										<xsl:value-of select="EXPUNG_RSN"/>
									</xsl:if>
								</fo:block>
							</fo:table-cell>
						</fo:table-row>
					</xsl:if>
				</fo:table-body>
			</fo:table>
			<fo:block space-after="6pt"/>
		</xsl:for-each>
	</xsl:template>
	<xsl:template match="PERP_HIST">
		<xsl:if test="position() =1">
			<fo:block space-before="9pt" space-after="9pt" font-size="11pt">
				Perpetrator History
			</fo:block>
		</xsl:if>
		<xsl:apply-templates select="NONE"/>
		<xsl:for-each select="PERP">
			<fo:block font-weight="bold" text-indent="10mm">
				<xsl:value-of select="NME"/>
			</fo:block>
			<xsl:for-each select="INTK">
				<xsl:for-each select="DTL">
					<fo:table table-layout="fixed">
						<fo:table-column column-number="1" column-width="13mm"/>
						<fo:table-column column-number="2" column-width="35mm"/>
						<fo:table-column column-number="3" column-width="35mm"/>
						<fo:table-column column-number="4" column-width="62mm"/>
						<fo:table-body>
							<fo:table-row keep-with-next="always">
								<fo:table-cell number-columns-spanned="4">
									<xsl:if test="string-length(normalize-space(../NBR)) &gt; 0">
										<fo:block text-indent="10mm">
								Intake #: 
						<xsl:value-of select="../NBR"/>
											<fo:leader leader-length="40mm" leader-pattern="space"/>
											<xsl:if test="../RCVD_DT">
							Received&#160;Date:&#160;
							<xsl:value-of select="../RCVD_DT"/>
											</xsl:if>
										</fo:block>
									</xsl:if>
								</fo:table-cell>
							</fo:table-row>
							<xsl:if test="string-length(normalize-space(INCD_DT)) &gt; 0">
								<fo:table-row keep-with-previous="always">
									<fo:table-cell>
										<fo:block/>
									</fo:table-cell>
									<fo:table-cell>
										<fo:block>
											<fo:block>
							Incident Date:
											</fo:block>
										</fo:block>
									</fo:table-cell>
									<fo:table-cell number-columns-spanned="2">
										<fo:block>
											<xsl:value-of select="INCD_DT"/>
										</fo:block>
									</fo:table-cell>
								</fo:table-row>
							</xsl:if>
							<xsl:if test="string-length(normalize-space(FNDNG_DT)) &gt; 0">
								<fo:table-row keep-with-previous="always">
									<fo:table-cell>
										<fo:block/>
									</fo:table-cell>
									<fo:table-cell>
										<fo:block>
											<fo:block>
								Finding Date:
											</fo:block>
										</fo:block>
									</fo:table-cell>
									<fo:table-cell>
										<fo:block>
											<fo:inline>
												<xsl:value-of select="FNDNG_DT"/>
											</fo:inline>
										</fo:block>
									</fo:table-cell>
									<fo:table-cell>
										<fo:block>
											<xsl:if test="FNDNG">
								  Finding:&#160;
												<xsl:value-of select="FNDNG"/>
											</xsl:if>
										</fo:block>
									</fo:table-cell>
								</fo:table-row>
							</xsl:if>
							<xsl:if test="string-length(normalize-space(VCTM)) &gt; 0">
								<fo:table-row keep-with-previous="always">
									<fo:table-cell>
										<fo:block/>
									</fo:table-cell>
									<fo:table-cell>
										<fo:block>
											<fo:block>
							Victim:
											</fo:block>
										</fo:block>
									</fo:table-cell>
									<fo:table-cell number-columns-spanned="2">
										<fo:block>
											<xsl:value-of select="VCTM"/>
										</fo:block>
									</fo:table-cell>
								</fo:table-row>
							</xsl:if>
							<xsl:if test="string-length(normalize-space(PERP)) &gt; 0">
								<fo:table-row keep-with-previous="always">
									<fo:table-cell>
										<fo:block/>
									</fo:table-cell>
									<fo:table-cell>
										<fo:block>
											<fo:block>
							Perpetrator:
											</fo:block>
										</fo:block>
									</fo:table-cell>
									<fo:table-cell number-columns-spanned="2">
										<fo:block>
											<xsl:value-of select="PERP"/>
										</fo:block>
									</fo:table-cell>
								</fo:table-row>
							</xsl:if>
							<xsl:if test="string-length(normalize-space(ALL)) &gt; 0">
								<fo:table-row keep-with-previous="always">
									<fo:table-cell>
										<fo:block/>
									</fo:table-cell>
									<fo:table-cell>
										<fo:block>
											<fo:block>
							Allegation:
											</fo:block>
										</fo:block>
									</fo:table-cell>
									<fo:table-cell number-columns-spanned="2">
										<fo:block>
											<xsl:value-of select="ALL"/>
										</fo:block>
									</fo:table-cell>
								</fo:table-row>
							</xsl:if>
							<xsl:if test="string-length(normalize-space(EXPUNG_DT)) &gt; 0">
								<fo:table-row keep-with-previous="always">
									<fo:table-cell>
										<fo:block/>
									</fo:table-cell>
									<fo:table-cell>
										<fo:block>
											<fo:block>
								Expungement&#160;Date:
											</fo:block>
										</fo:block>
									</fo:table-cell>
									<fo:table-cell>
										<fo:block space-after="6pt">
											<fo:inline>
												<xsl:value-of select="EXPUNG_DT"/>
											</fo:inline>
										</fo:block>
									</fo:table-cell>
									<fo:table-cell>
										<fo:block>
											<xsl:if test="string-length(normalize-space(EXPUNG_RSN)) &gt; 0">
								 Reason:&#160;
												<xsl:value-of select="EXPUNG_RSN"/>
											</xsl:if>
										</fo:block>
									</fo:table-cell>
								</fo:table-row>
							</xsl:if>
						</fo:table-body>
					</fo:table>
					<fo:block space-after="6pt"/>
				</xsl:for-each>
				<fo:block space-after="9pt"/>
			</xsl:for-each>
		</xsl:for-each>
	</xsl:template>
	<xsl:template match="DEPT_DCSN">
		<fo:table table-layout="fixed">
			<fo:table-column column-number="1" column-width="196mm"/>
			<fo:table-body>
				<fo:table-row keep-with-next="always">
					<fo:table-cell>
						<xsl:if test="position() =1">
							<fo:block space-before="9pt" space-after="9pt" font-size="11pt">
			Department Decision
			</fo:block>
						</xsl:if>
					</fo:table-cell>
				</fo:table-row>
				<fo:table-row keep-with-previous="always">
					<fo:table-cell>
						<xsl:apply-templates select="NONE"/>
					</fo:table-cell>
				</fo:table-row>
				<fo:table-row keep-with-previous="always">
					<fo:table-cell>
						<xsl:for-each select="DTL">
							<fo:block text-indent="10mm">
								<xsl:value-of select="concat(BEG_DT,' ',STAT,' ',WRKR_NME)"/>
							</fo:block>
							<fo:block text-indent="10mm" space-after="6pt">
								<xsl:value-of select="concat(TYP,' ',STAT_RSN_CD,' ')"/>
								<xsl:if test="string-length(normalize-space(PRIRTY)) &gt; 0">
				- Priority:
					<xsl:value-of select="PRIRTY"/>
								</xsl:if>
							</fo:block>
						</xsl:for-each>
					</fo:table-cell>
				</fo:table-row>
			</fo:table-body>
		</fo:table>
	</xsl:template>
	<xsl:template match="ORG_INVLVD">
		<fo:table table-layout="fixed">
			<fo:table-column column-number="1" column-width="196mm"/>
			<fo:table-body>
				<fo:table-row keep-with-next="always">
					<fo:table-cell>
						<xsl:if test="position() =1">
							<fo:block space-before="9pt" space-after="9pt" font-size="11pt">
			Organization Involved
			</fo:block>
						</xsl:if>
					</fo:table-cell>
				</fo:table-row>
				<fo:table-row keep-with-previous="always">
					<fo:table-cell>
						<xsl:apply-templates select="NONE"/>
					</fo:table-cell>
				</fo:table-row>
				<fo:table-row keep-with-previous="always">
					<fo:table-cell>
						<xsl:for-each select="ORG">
							<fo:block text-indent="10mm">
								<xsl:value-of select="NME"/>
							</fo:block>
							<fo:block text-indent="10mm">
								<xsl:value-of select="RLE"/>
							</fo:block>
							<fo:block start-indent="10mm">
								<xsl:apply-templates select="ADDR" mode="rpt_info"/>
								<xsl:apply-templates select="PHN_NBR" mode="rpt_info"/>
							</fo:block>
						</xsl:for-each>
					</fo:table-cell>
				</fo:table-row>
			</fo:table-body>
		</fo:table>
	</xsl:template>
	<xsl:template match="TL_USED">
		<fo:table table-layout="fixed">
			<fo:table-column column-number="1" column-width="196mm"/>
			<fo:table-body>
				<fo:table-row keep-with-next="always">
					<fo:table-cell>
						<xsl:if test="position() =1">
							<fo:block space-before="12pt" font-size="11pt">
			Tools Used
			</fo:block>
						</xsl:if>
					</fo:table-cell>
				</fo:table-row>
				<fo:table-row keep-with-previous="always">
					<fo:table-cell>
						<xsl:call-template name="maltreatment"/>
					</fo:table-cell>
				</fo:table-row>
				<fo:table-row>
					<fo:table-cell>
						<xsl:call-template name="respdesc"/>
					</fo:table-cell>
				</fo:table-row>
			</fo:table-body>
		</fo:table>
		<fo:block space-before="6pt"/>
		<!--/xsl:if-->
	</xsl:template>
	<xsl:template name="maltreatment">
		<!--fo:block space-before="9pt" space-after="9pt" font-size="11pt">
			Maltreatment Screening Tools
		</fo:block-->
		<xsl:variable name="totalitems">
			<xsl:value-of select="count(MALTRTMT)"/>
		</xsl:variable>
		<xsl:variable name="half" select="ceiling($totalitems div 2)"/>
		<fo:table table-layout="fixed">
			<fo:table-column column-number="1" column-width="16mm"/>
			<fo:table-column column-number="2" column-width="51mm"/>
			<fo:table-column column-number="3" column-width="16mm"/>
			<fo:table-column column-number="4" column-width="51mm"/>
			<fo:table-body>
				<fo:table-row keep-with-next="always">
					<fo:table-cell number-columns-spanned="4">
						<fo:block space-before="9pt" space-after="9pt" font-size="11pt">
			Maltreatment Screening Tools
		</fo:block>
					</fo:table-cell>
				</fo:table-row>
				<xsl:for-each select="MALTRTMT[position() &lt;= $half]">
					<xsl:variable name="this-position" select="position()"/>
					<xsl:variable name="flag-text">
						<xsl:choose>
							<xsl:when test="@FLAG">
								<xsl:value-of select="@FLAG"/>
							</xsl:when>
							<xsl:otherwise>&#160;&#160;</xsl:otherwise>
						</xsl:choose>
					</xsl:variable>
					<fo:table-row>
						<fo:table-cell text-align="right" column-number="1">
							<fo:block padding-top="1mm" padding-bottom="1mm">
								<xsl:value-of select="concat('[',$flag-text,']')"/>
							</fo:block>
						</fo:table-cell>
						<fo:table-cell column-number="2">
							<fo:block padding-top="1mm" padding-bottom="1mm">
								<xsl:value-of select="."/>
							</fo:block>
						</fo:table-cell>
						<xsl:choose>
							<xsl:when test="../MALTRTMT[$this-position+$half]">
								<xsl:variable name="next-flag">
									<xsl:choose>
										<xsl:when test="../MALTRTMT[$this-position+$half]/@FLAG">
											<xsl:value-of select="../MALTRTMT[$this-position+$half]/@FLAG"/>
										</xsl:when>
										<xsl:otherwise>&#160;&#160;</xsl:otherwise>
									</xsl:choose>
								</xsl:variable>
								<fo:table-cell text-align="right" column-number="3">
									<fo:block padding-top="1mm" padding-bottom="1mm">
										<xsl:value-of select="concat('[',$next-flag,']')"/>
									</fo:block>
								</fo:table-cell>
								<fo:table-cell column-number="4">
									<fo:block padding-top="1mm" padding-bottom="1mm">
										<xsl:value-of select="../MALTRTMT[$this-position+$half]"/>
									</fo:block>
								</fo:table-cell>
							</xsl:when>
							<xsl:otherwise>
								<fo:table-cell column-number="3">
									<fo:block/>
								</fo:table-cell>
								<fo:table-cell column-number="4">
									<fo:block/>
								</fo:table-cell>
							</xsl:otherwise>
						</xsl:choose>
					</fo:table-row>
				</xsl:for-each>
			</fo:table-body>
		</fo:table>
	</xsl:template>
	<xsl:template name="respdesc">
		<!--fo:block space-before="9pt" space-after="9pt" font-size="11pt">
			Priority Response Decision Tools
		</fo:block-->
		<xsl:variable name="totalitems">
			<xsl:value-of select="count(RESP_DESC)"/>
		</xsl:variable>
		<xsl:variable name="half" select="ceiling($totalitems div 2)"/>
		<fo:table table-layout="fixed">
			<fo:table-column column-number="1" column-width="16mm"/>
			<fo:table-column column-number="2" column-width="51mm"/>
			<fo:table-column column-number="3" column-width="16mm"/>
			<fo:table-column column-number="4" column-width="51mm"/>
			<fo:table-body>
				<fo:table-row keep-with-next="always">
					<fo:table-cell number-columns-spanned="4">
						<fo:block space-before="9pt" space-after="9pt" font-size="11pt">
			Priority Response Decision Tools
		</fo:block>
					</fo:table-cell>
				</fo:table-row>
				<xsl:for-each select="RESP_DESC[position() &lt;= $half]">
					<xsl:variable name="this-position" select="position()"/>
					<xsl:variable name="flag-text">
						<xsl:choose>
							<xsl:when test="@FLAG">
								<xsl:value-of select="@FLAG"/>
							</xsl:when>
							<xsl:otherwise>&#160;&#160;</xsl:otherwise>
						</xsl:choose>
					</xsl:variable>
					<fo:table-row keep-with-previous="always">
						<fo:table-cell text-align="right" column-number="1">
							<fo:block padding-top="1mm" padding-bottom="1mm">
								<xsl:value-of select="concat('[',$flag-text,']')"/>
							</fo:block>
						</fo:table-cell>
						<fo:table-cell column-number="2">
							<fo:block padding-top="1mm" padding-bottom="1mm">
								<xsl:value-of select="."/>
							</fo:block>
						</fo:table-cell>
						<xsl:choose>
							<xsl:when test="../RESP_DESC[$this-position+$half]">
								<xsl:variable name="next-flag">
									<xsl:choose>
										<xsl:when test="../RESP_DESC[$this-position+$half]/@FLAG">
											<xsl:value-of select="../RESP_DESC[$this-position+$half]/@FLAG"/>
										</xsl:when>
										<xsl:otherwise>&#160;&#160;</xsl:otherwise>
									</xsl:choose>
								</xsl:variable>
								<fo:table-cell text-align="right" column-number="3">
									<fo:block padding-top="1mm" padding-bottom="1mm">
										<xsl:value-of select="concat('[',$next-flag,']')"/>
									</fo:block>
								</fo:table-cell>
								<fo:table-cell column-number="4">
									<fo:block padding-top="1mm" padding-bottom="1mm">
										<xsl:value-of select="../RESP_DESC[$this-position+$half]"/>
									</fo:block>
								</fo:table-cell>
							</xsl:when>
							<xsl:otherwise>
								<fo:table-cell column-number="3">
									<fo:block/>
								</fo:table-cell>
								<fo:table-cell column-number="4">
									<fo:block/>
								</fo:table-cell>
							</xsl:otherwise>
						</xsl:choose>
					</fo:table-row>
				</xsl:for-each>
			</fo:table-body>
		</fo:table>
	</xsl:template>
	<xsl:template match="OCC_DT|DESC" mode="ref_info">
		<fo:block text-indent="10mm">
			<xsl:value-of select="."/>
		</fo:block>
	</xsl:template>
	<xsl:template match="NARR_TXT" mode="ref_info">
		<fo:block start-indent="10mm" white-space-collapse="false">
			<xsl:value-of select="."/>
		</fo:block>
	</xsl:template>
	<xsl:template match="*" mode="line_info">
		<xsl:param name="sttext" select="' '"/>
		<xsl:param name="startin" select="'0'"/>
		<xsl:if test="string-length(normalize-space(.)) &gt; 0">
			<fo:table-row>
				<fo:table-cell>
					<fo:block/>
				</fo:table-cell>
				<fo:table-cell>
					<fo:block text-indent="{$startin}mm">
						<fo:block>
							<xsl:value-of select="$sttext"/>
						</fo:block>
					</fo:block>
				</fo:table-cell>
				<fo:table-cell>
					<fo:block>
						<xsl:value-of select="."/>
					</fo:block>
				</fo:table-cell>
			</fo:table-row>
		</xsl:if>
	</xsl:template>
	<xsl:template match="ADDR|PHN_NBR|CNTY_OF_INCD|RACE|TRIB" mode="rpt_info">
		<fo:block>
			<xsl:value-of select="."/>
		</fo:block>
	</xsl:template>
	<xsl:template match="ALL_TYP_A">
		<fo:table table-layout="fixed">
			<fo:table-column column-number="1" column-width="48mm"/>
			<fo:table-column column-number="2" column-width="100mm"/>
			<fo:table-body>
				<fo:table-row keep-with-next="always">
					<fo:table-cell>
						<fo:block space-before="12pt">
			Allegation Type:
			</fo:block>
					</fo:table-cell>
					<fo:table-cell>
						<fo:block space-before="12pt">
							<xsl:value-of select="TYP_A"/>
						</fo:block>
					</fo:table-cell>
				</fo:table-row>
				<xsl:if test="ALL_INCD_LOCT">
					<fo:table-row keep-with-previous="always" column-number="1">
						<fo:table-cell>
							<fo:block start-indent="3mm">Incident Location:</fo:block>
						</fo:table-cell>
						<fo:table-cell>
							<fo:block>
								<xsl:value-of select="ALL_INCD_LOCT"/>
							</fo:block>
						</fo:table-cell>
					</fo:table-row>
				</xsl:if>
				<xsl:if test="ALL_LIV_STAT_CD">
					<fo:table-row keep-with-previous="always" column-number="1">
						<fo:table-cell>
							<fo:block start-indent="3mm">Victim Living Status:</fo:block>
						</fo:table-cell>
						<fo:table-cell>
							<fo:block>
								<xsl:value-of select="ALL_LIV_STAT_CD"/>
							</fo:block>
						</fo:table-cell>
					</fo:table-row>
				</xsl:if>
				<xsl:if test="ALL_LA_CD">
					<fo:table-row keep-with-previous="always" column-number="1">
						<fo:table-cell>
							<fo:block start-indent="3mm">Victim Living Arrangement:</fo:block>
						</fo:table-cell>
						<fo:table-cell>
							<fo:block>
								<xsl:value-of select="ALL_LA_CD"/>
							</fo:block>
						</fo:table-cell>
					</fo:table-row>
				</xsl:if>
				<xsl:if test="ALL_SLF_NEG">
					<fo:table-row keep-with-previous="always" column-number="1">
						<fo:table-cell>
							<fo:block start-indent="3mm">Self Neglect:</fo:block>
						</fo:table-cell>
						<xsl:if test="ALL_SLF_NEG='N'">
							<fo:table-cell>
								<fo:block>
								No
							</fo:block>
							</fo:table-cell>
						</xsl:if>
						<xsl:if test="ALL_SLF_NEG='Y'">
							<fo:table-cell>
								<fo:block>
								Yes
							</fo:block>
							</fo:table-cell>
						</xsl:if>
					</fo:table-row>
				</xsl:if>
			</fo:table-body>
		</fo:table>
	</xsl:template>
	<xsl:template match="ALL_TYP">
		<xsl:choose>
			<xsl:when test="position()=1">
				<fo:block>Allegation Type:
					<fo:leader leader-pattern="space" leader-length="22mm"/>
					<xsl:value-of select="."/>
				</fo:block>
			</xsl:when>
			<xsl:otherwise>
				<fo:block>
					<fo:leader leader-pattern="space" leader-length="48mm"/>
					<xsl:value-of select="."/>
				</fo:block>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template match="NONE">
		<fo:block text-indent="10mm">
			None
		</fo:block>
	</xsl:template>
</xsl:stylesheet>
