<?xml version="1.0" encoding="UTF-8"?>
<!-- 
	Transformata generująca warstwę prezentacyjną informacji o receptach w pakiecie na potrzeby powiadomień i wydruków, 
	przygotowana przez Centrum Systemów Informacyjnych Ochrony Zdrowia.
	
	Transformata nie jest zgodna ze standardem HL7 CDA, wykorzystuje elementy HL7 CDA do wyświetlenia wybranych informacji z dokumentów medycznych.
	
	Wersja pl_informacja_o_receptach_1.3.1:1.0 dla CDA_PL_IG_1.3.1.
	
	Historia wersji:
		- pl_informacja_o_receptach_1.0:1.0, 1904 linie kodu, autor Marcin Pusz, Pentacomp Systemy Informatyczne S.A., wersja inicjalna
		- pl_informacja_o_receptach_1.3.1:1.0, 3057 linii kodu, autor Marcin Pusz, Pentacomp Systemy Informatyczne S.A., dostosowanie do IHE PRE, kod kreskowy SVG (IE9+) jako domyślna alternatywa dla zakodowanych elementów graficznych (IE8-), usunięcie zastosowania tablic globalnych ze względu na trudności z dostępem w różnych środowiskach, przebudowa układu graficznego wg projektu CSIOZ
		- pl_informacja_o_receptach_1.3.2:1.0 20220209, 3304 linii kodu, autor NT6, rozbudowa transformaty dokumentu informacyjnego recepty o informację dot. 365		
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:hl7="urn:hl7-org:v3" xmlns:extPL="http://www.csioz.gov.pl/xsd/extPL/r2" version="1.0">

	<xsl:output method="html" version="4.01" encoding="UTF-8" indent="yes" doctype-public="-//W3C//DTD HTML 4.01//EN" media-type="text/html" doctype-system="about:legacy-compat"/>
	
	<xsl:variable name="LOWERCASE_LETTERS">aąbcćdeęfghijklłmnńoópqrsśtuvwxyzżź</xsl:variable>
	<xsl:variable name="UPPERCASE_LETTERS">AĄBCĆDEĘFGHIJKLŁMNŃOÓPQRSŚTUVWXYZŻŹ</xsl:variable>
	
	<!-- 44-cyfrowy klucz pakietu recept wystarczający do realizacji recept -->
	<xsl:param name="kluczPakietu"/>
	<!-- klucz pakietu to jedyny klucz w tej wersji transformaty -->
	<xsl:variable name="klucz" select="$kluczPakietu"/>
	
	<!-- 4-cyfrowy kod dostępowy do pakietu recept, wymagający podania id usługobiorcy przy realizacji recept -->
	<xsl:param name="kodPakietu"/>
	<!-- kod pakietu to jedyny kod dostępu w tej wersji transformaty -->
	<xsl:variable name="kod" select="$kodPakietu"/>
	
	<!-- parametr opcjonalny, ustawiając dowolną wartość inną niż domyślna (np. disabled) można wyłączyć generowanie kodów kreskowych SVG i wykorzystać obsługiwane przez IE8- img -->
	<xsl:param name="SVG">enabled</xsl:param>
	
	<!-- stała dot. wysokości kodu kreskowego w pikselach (w XSLT variable to stała), aktualnie nie ma potrzeby wystawiania tego jako parametr -->
	<xsl:variable name="barcodeHeight" select="30"/>
	
	<!-- ilość recept w pakiecie, jeśli nie podano, przyjmuje się ilość wynikającą z wypełnionych parametrów
		 parametr wraz z parametrami doc*Nr umożliwia wyświetlenie podzbioru dużego pakietu recept na jednej informacji
		 np. Recepta 4 z 11 ogółem, Recepta 5 z 11 ogółem, Recepta 6 z 11 ogółem -->
	<xsl:param name="receptWPakiecie"/>
	
	<!-- dane pierwszego dokumentu recepty do wyświetlenia, dokument źródłowy przyjęto jako pierwszy -->
	<xsl:variable name="doc1" select="/"/>
	<xsl:param name="doc1Nr" select="1"/>
	
	<!-- dane drugiego dokumentu recepty do wyświetlenia -->
	<!-- opcjonalna nazwa pliku z dokumentem przydatna przy uruchamianiu transformaty z linii poleceń lub skryptów -->
	<xsl:param name="doc2FN"/>
	<!-- alternatywnie dla nazwy pliku z dokumentem możliwe jest podanie zawartości dokumentu, przydatne przy uruchamianiu transformaty w kodzie systemu -->
	<xsl:param name="doc2" select="document($doc2FN)"/>
	<xsl:param name="doc2Nr" select="2"/>
	
	<!-- dane trzeciego dokumentu recepty do wyświetlenia -->
	<xsl:param name="doc3FN"/>
	<xsl:param name="doc3" select="document($doc3FN)"/>
	<xsl:param name="doc3Nr" select="3"/>
	
	<!-- dane czwartego dokumentu recepty do wyświetlenia -->
	<xsl:param name="doc4FN"/>
	<xsl:param name="doc4" select="document($doc4FN)"/>
	<xsl:param name="doc4Nr" select="4"/>
	
	<!-- dane piątego dokumentu recepty do wyświetlenia -->
	<xsl:param name="doc5FN"/>
	<xsl:param name="doc5" select="document($doc5FN)"/>
	<xsl:param name="doc5Nr" select="5"/>
	
	<!-- ilość recept w pakiecie wyliczana, jeśli nie podano z parametru -->
	<xsl:variable name="iloscRecept">
		<xsl:call-template name="iloscRecept"/>
	</xsl:variable>
	
	<!-- opcjonalny tekst dotyczący terminu kontroli -->
	<xsl:param name="termin"/>
	
	<xsl:template match="/">
		<xsl:apply-templates select="hl7:ClinicalDocument"/>
	</xsl:template>
	
	<!-- Wyznaczenie ilości recept w pakiecie -->
	<xsl:template name="iloscRecept">
		<xsl:choose>
			<xsl:when test="$receptWPakiecie">
				<xsl:value-of select="$receptWPakiecie"/>
			</xsl:when>
			<xsl:when test="not($doc2/hl7:ClinicalDocument)">
				<xsl:value-of select="1"/>
			</xsl:when>
			<xsl:when test="not($doc3/hl7:ClinicalDocument)">
				<xsl:value-of select="2"/>
			</xsl:when>
			<xsl:when test="not($doc4/hl7:ClinicalDocument)">
				<xsl:value-of select="3"/>
			</xsl:when>
			<xsl:when test="not($doc5/hl7:ClinicalDocument)">
				<xsl:value-of select="4"/>
			</xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="5"/>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	
	<!-- Wykorzystanie parametrów oraz dokumentów recept zgodnych z IG -->
	<xsl:template match="hl7:ClinicalDocument">
		<html>
			<head>
				<xsl:call-template name="styles"/>
			</head>
			<body>
				<div class="document">
					<xsl:call-template name="title"/>
					<div class="klucz_id">
						<xsl:call-template name="klucz"/>
						<xsl:call-template name="docRootId"/>
					</div>
					<div class="doc_header kod_time table">
						<xsl:call-template name="kod"/>
						<xsl:call-template name="effectiveTime"/>
					</div>
					<div class="doc_header border_top table">
						<xsl:call-template name="recordTarget"/>
						<xsl:call-template name="author"/>
						<xsl:call-template name="terminKontroli"/>
					</div>
					
					<xsl:call-template name="docBody">
						<xsl:with-param name="doc" select="$doc1/hl7:ClinicalDocument"/>
						<xsl:with-param name="docNr" select="$doc1Nr"/>
					</xsl:call-template>
					<xsl:call-template name="docBody">
						<xsl:with-param name="doc" select="$doc2/hl7:ClinicalDocument"/>
						<xsl:with-param name="docNr" select="$doc2Nr"/>
					</xsl:call-template>
					<xsl:call-template name="docBody">
						<xsl:with-param name="doc" select="$doc3/hl7:ClinicalDocument"/>
						<xsl:with-param name="docNr" select="$doc3Nr"/>
					</xsl:call-template>
					<xsl:call-template name="docBody">
						<xsl:with-param name="doc" select="$doc4/hl7:ClinicalDocument"/>
						<xsl:with-param name="docNr" select="$doc4Nr"/>
					</xsl:call-template>
					<xsl:call-template name="docBody">
						<xsl:with-param name="doc" select="$doc5/hl7:ClinicalDocument"/>
						<xsl:with-param name="docNr" select="$doc5Nr"/>
					</xsl:call-template>
					<xsl:call-template name="disclaimer"/>
				</div>
			</body>
		</html>
	</xsl:template>
	
	<!--
		Dane wyświetlane w ramach informacji o receptach:
		- klucz i kod dostępowy pakietu recept na podstawie zewnętrznych parametrów
		- dane wspólne o receptach w pakiecie na podstawie danych jednej z recept:
			- data wystawienia pakietu recept
			- imię i nazwisko pacjenta
			- imię i nazwisko osoby wystawiającej pakiet recept
			- numer prawa wykonywania zawodu osoby wystawiającej
			- numer telefonu do bezpośredniego kontaktu z osobą wystawiającą
			
		- dane poszczególnych dokumentów recept:
			- klucz dokumentu recepty na podstawie zewnętrznego parametru
			- id dokumentu recepty
			- narrative text sekcji zalecenia leku (Prescriptions), w tym:
				- nazwa leku
				- postać
				- dawka
				- ilość
				- sposób stosowania (do narrative block sekcji zalecenia leku włączono od 1.2.1 IG)
			- datę "realizacji od" konkretnej daty, jeżeli dotyczy
		
		- wskazany termin kontroli lekarskiej, jeżeli dotyczy, na podstawie zewnętrznego parametru o tekstowym typie
	-->

	<xsl:template name="docBody">
		<xsl:param name="doc"/>
		<xsl:param name="docNr"/>

		<xsl:if test="$doc">
			<div class="page_break_avoid">&#160;</div>
			<div class="doc_body">
				<div class="noScreen">
					<div id="footer">

					</div>
				</div>
				<xsl:call-template name="docTitle">
					<xsl:with-param name="docNr" select="$docNr"/>
					<xsl:with-param name="docId" select="$doc/hl7:id"/>
				</xsl:call-template>
				<div style="clear:both"/>
				<div class="section_text_1">
					<xsl:call-template name="prescriptions">
						<xsl:with-param name="doc" select="$doc"/>
					</xsl:call-template>
				</div>
			</div>
		</xsl:if>
	</xsl:template>
	
	<!-- tytuł informacji -->
	<xsl:template name="title">
		<span class="title">
			<img class="title_img" src="data:image/png;base64,[encoded data, 185684 characters]"/>
		</span>
		<xsl:choose>
			<xsl:when test="hl7:code/hl7:translation[@code='04.01']/hl7:qualifier/hl7:name[@code='RRECE']/../hl7:value[@code='PA']"> 
				<span class="title_suffix" style="font-style: italic">
					<xsl:text>pro auctore</xsl:text>
				</span>
			</xsl:when>
			<xsl:when test="hl7:code/hl7:translation[@code='04.01']/hl7:qualifier/hl7:name[@code='RRECE']/../hl7:value[@code='PF']"> 
				<span class="title_suffix" style="font-style: italic">
					<xsl:text>pro familiae</xsl:text>
				</span>
			</xsl:when>
			<xsl:when test="hl7:code/hl7:translation[@code='04.01']/hl7:qualifier/hl7:name[@code='RRECE']/../hl7:value[@code='TG']"> 
				<span class="title_suffix" style="font-style: italic">
					<xsl:text>transgraniczna</xsl:text>
				</span>
			</xsl:when>
		</xsl:choose>
	</xsl:template>
	
	<!-- nazwa dokumentu recepty -->
	<xsl:template name="docTitle">
		<xsl:param name="docNr"/>
		<xsl:param name="docId"/>
		
		<div class="section_title_left">
			<xsl:text>Recepta </xsl:text>
			<xsl:value-of select="$docNr"/>
			<xsl:text> z </xsl:text>
			<xsl:value-of select="$iloscRecept"/>
		</div>
		<div class="section_title_right">
			<xsl:value-of select="$docId/@extension"/>
		</div>
	</xsl:template>
	
	<!-- uwaga: uznano, że wszystkie recepty w pakiecie powinny mieć ten sam root identyfikatora! -->
	<xsl:template name="docRootId">
		<div class="header_element">
			<div class="doc_id">
				<xsl:text>Prefiks ID </xsl:text>
				<xsl:value-of select="$doc1/hl7:ClinicalDocument/hl7:id/@root"/>
			</div>
		</div>
	</xsl:template>
	
	<!-- klucz pakietu recept, wyeliminowano z użycia klucze poszczególnych recept -->
	<xsl:template name="klucz">
		<div class="klucz">
			<xsl:choose>
				<xsl:when test="$klucz and string-length($klucz) = 44">
					<xsl:variable name="barcodeWidth" select="277"/>
					
					<xsl:variable name="p1" select="number(substring($klucz, 1, 2))"/>
					<xsl:variable name="p2" select="number(substring($klucz, 3, 2))"/>
					<xsl:variable name="p3" select="number(substring($klucz, 5, 2))"/>
					<xsl:variable name="p4" select="number(substring($klucz, 7, 2))"/>
					<xsl:variable name="p5" select="number(substring($klucz, 9, 2))"/>
					<xsl:variable name="p6" select="number(substring($klucz, 11, 2))"/>
					<xsl:variable name="p7" select="number(substring($klucz, 13, 2))"/>
					<xsl:variable name="p8" select="number(substring($klucz, 15, 2))"/>
					<xsl:variable name="p9" select="number(substring($klucz, 17, 2))"/>
					<xsl:variable name="p10" select="number(substring($klucz, 19, 2))"/>
					<xsl:variable name="p11" select="number(substring($klucz, 21, 2))"/>
					<xsl:variable name="p12" select="number(substring($klucz, 23, 2))"/>
					<xsl:variable name="p13" select="number(substring($klucz, 25, 2))"/>
					<xsl:variable name="p14" select="number(substring($klucz, 27, 2))"/>
					<xsl:variable name="p15" select="number(substring($klucz, 29, 2))"/>
					<xsl:variable name="p16" select="number(substring($klucz, 31, 2))"/>
					<xsl:variable name="p17" select="number(substring($klucz, 33, 2))"/>
					<xsl:variable name="p18" select="number(substring($klucz, 35, 2))"/>
					<xsl:variable name="p19" select="number(substring($klucz, 37, 2))"/>
					<xsl:variable name="p20" select="number(substring($klucz, 39, 2))"/>
					<xsl:variable name="p21" select="number(substring($klucz, 41, 2))"/>
					<xsl:variable name="p22" select="number(substring($klucz, 43, 2))"/>
					
					<xsl:variable name="checksum" select="(105+$p1*1+$p2*2+$p3*3+$p4*4+$p5*5+$p6*6+$p7*7+$p8*8+$p9*9+$p10*10+$p11*11+$p12*12+$p13*13+$p14*14+$p15*15+$p16*16+$p17*17+$p18*18+$p19*19+$p20*20+$p21*21+$p22*22) mod 103"/>
					
					<div class="barcode">
						<xsl:choose>
							<xsl:when test="$SVG = 'enabled'">
								<!-- kod SVG niekompatybilny z IE8-, przy generowaniu wyniku należy podać parametr SVG=disabled by wykorzystać img zamiast SVG. Efekt może być mniej czytelny dla czytników kodów. -->
								<svg id="kluczSkierowania" xmlns="http://www.w3.org/2000/svg" width="{$barcodeWidth}" height="{$barcodeHeight}">
									<g transform="translate(0)">
										<xsl:call-template name="drawBarSVG">
											<xsl:with-param name="code" select="'startC'"/>
										</xsl:call-template>
									</g>
									<g transform="translate(11)">
										<xsl:call-template name="drawBarSVG">
											<xsl:with-param name="code" select="$p1"/>
										</xsl:call-template>
									</g>
									<g transform="translate(22)">
										<xsl:call-template name="drawBarSVG">
											<xsl:with-param name="code" select="$p2"/>
										</xsl:call-template>
									</g>
									<g transform="translate(33)">
										<xsl:call-template name="drawBarSVG">
											<xsl:with-param name="code" select="$p3"/>
										</xsl:call-template>
									</g>
									<g transform="translate(44)">
										<xsl:call-template name="drawBarSVG">
											<xsl:with-param name="code" select="$p4"/>
										</xsl:call-template>
									</g>
									<g transform="translate(55)">
										<xsl:call-template name="drawBarSVG">
											<xsl:with-param name="code" select="$p5"/>
										</xsl:call-template>
									</g>
									<g transform="translate(66)">
										<xsl:call-template name="drawBarSVG">
											<xsl:with-param name="code" select="$p6"/>
										</xsl:call-template>
									</g>
									<g transform="translate(77)">
										<xsl:call-template name="drawBarSVG">
											<xsl:with-param name="code" select="$p7"/>
										</xsl:call-template>
									</g>
									<g transform="translate(88)">
										<xsl:call-template name="drawBarSVG">
											<xsl:with-param name="code" select="$p8"/>
										</xsl:call-template>
									</g>
									<g transform="translate(99)">
										<xsl:call-template name="drawBarSVG">
											<xsl:with-param name="code" select="$p9"/>
										</xsl:call-template>
									</g>
									<g transform="translate(110)">
										<xsl:call-template name="drawBarSVG">
											<xsl:with-param name="code" select="$p10"/>
										</xsl:call-template>
									</g>
									<g transform="translate(121)">
										<xsl:call-template name="drawBarSVG">
											<xsl:with-param name="code" select="$p11"/>
										</xsl:call-template>
									</g>
									<g transform="translate(132)">
										<xsl:call-template name="drawBarSVG">
											<xsl:with-param name="code" select="$p12"/>
										</xsl:call-template>
									</g>
									<g transform="translate(143)">
										<xsl:call-template name="drawBarSVG">
											<xsl:with-param name="code" select="$p13"/>
										</xsl:call-template>
									</g>
									<g transform="translate(154)">
										<xsl:call-template name="drawBarSVG">
											<xsl:with-param name="code" select="$p14"/>
										</xsl:call-template>
									</g>
									<g transform="translate(165)">
										<xsl:call-template name="drawBarSVG">
											<xsl:with-param name="code" select="$p15"/>
										</xsl:call-template>
									</g>
									<g transform="translate(176)">
										<xsl:call-template name="drawBarSVG">
											<xsl:with-param name="code" select="$p16"/>
										</xsl:call-template>
									</g>
									<g transform="translate(187)">
										<xsl:call-template name="drawBarSVG">
											<xsl:with-param name="code" select="$p17"/>
										</xsl:call-template>
									</g>
									<g transform="translate(198)">
										<xsl:call-template name="drawBarSVG">
											<xsl:with-param name="code" select="$p18"/>
										</xsl:call-template>
									</g>
									<g transform="translate(209)">
										<xsl:call-template name="drawBarSVG">
											<xsl:with-param name="code" select="$p19"/>
										</xsl:call-template>
									</g>
									<g transform="translate(220)">
										<xsl:call-template name="drawBarSVG">
											<xsl:with-param name="code" select="$p20"/>
										</xsl:call-template>
									</g>
									<g transform="translate(231)">
										<xsl:call-template name="drawBarSVG">
											<xsl:with-param name="code" select="$p21"/>
										</xsl:call-template>
									</g>
									<g transform="translate(242)">
										<xsl:call-template name="drawBarSVG">
											<xsl:with-param name="code" select="$p22"/>
										</xsl:call-template>
									</g>
									<g transform="translate(253)">
										<xsl:call-template name="drawBarSVG">
											<xsl:with-param name="code" select="$checksum"/>
										</xsl:call-template>
									</g>
									<g transform="translate(264)">
										<xsl:call-template name="drawBarSVG">
											<xsl:with-param name="code" select="'stopAndTerminate'"/>
										</xsl:call-template>
									</g>
								</svg>
							</xsl:when>
							<xsl:otherwise>
								<xsl:call-template name="drawBarIMG">
									<xsl:with-param name="code" select="'startC'"/>
								</xsl:call-template>
								<xsl:call-template name="drawBarIMG">
									<xsl:with-param name="code" select="$p1"/>
								</xsl:call-template>
								<xsl:call-template name="drawBarIMG">
									<xsl:with-param name="code" select="$p2"/>
								</xsl:call-template>
								<xsl:call-template name="drawBarIMG">
									<xsl:with-param name="code" select="$p3"/>
								</xsl:call-template>
								<xsl:call-template name="drawBarIMG">
									<xsl:with-param name="code" select="$p4"/>
								</xsl:call-template>
								<xsl:call-template name="drawBarIMG">
									<xsl:with-param name="code" select="$p5"/>
								</xsl:call-template>
								<xsl:call-template name="drawBarIMG">
									<xsl:with-param name="code" select="$p6"/>
								</xsl:call-template>
								<xsl:call-template name="drawBarIMG">
									<xsl:with-param name="code" select="$p7"/>
								</xsl:call-template>
								<xsl:call-template name="drawBarIMG">
									<xsl:with-param name="code" select="$p8"/>
								</xsl:call-template>
								<xsl:call-template name="drawBarIMG">
									<xsl:with-param name="code" select="$p9"/>
								</xsl:call-template>
								<xsl:call-template name="drawBarIMG">
									<xsl:with-param name="code" select="$p10"/>
								</xsl:call-template>
								<xsl:call-template name="drawBarIMG">
									<xsl:with-param name="code" select="$p11"/>
								</xsl:call-template>
								<xsl:call-template name="drawBarIMG">
									<xsl:with-param name="code" select="$p12"/>
								</xsl:call-template>
								<xsl:call-template name="drawBarIMG">
									<xsl:with-param name="code" select="$p13"/>
								</xsl:call-template>
								<xsl:call-template name="drawBarIMG">
									<xsl:with-param name="code" select="$p14"/>
								</xsl:call-template>
								<xsl:call-template name="drawBarIMG">
									<xsl:with-param name="code" select="$p15"/>
								</xsl:call-template>
								<xsl:call-template name="drawBarIMG">
									<xsl:with-param name="code" select="$p16"/>
								</xsl:call-template>
								<xsl:call-template name="drawBarIMG">
									<xsl:with-param name="code" select="$p17"/>
								</xsl:call-template>
								<xsl:call-template name="drawBarIMG">
									<xsl:with-param name="code" select="$p18"/>
								</xsl:call-template>
								<xsl:call-template name="drawBarIMG">
									<xsl:with-param name="code" select="$p19"/>
								</xsl:call-template>
								<xsl:call-template name="drawBarIMG">
									<xsl:with-param name="code" select="$p20"/>
								</xsl:call-template>
								<xsl:call-template name="drawBarIMG">
									<xsl:with-param name="code" select="$p21"/>
								</xsl:call-template>
								<xsl:call-template name="drawBarIMG">
									<xsl:with-param name="code" select="$p22"/>
								</xsl:call-template>
								<xsl:call-template name="drawBarIMG">
									<xsl:with-param name="code" select="$checksum"/>
								</xsl:call-template>
								<xsl:call-template name="drawBarIMG">
									<xsl:with-param name="code" select="'stop'"/>
								</xsl:call-template>
								<xsl:call-template name="drawBarIMG">
									<xsl:with-param name="code" select="'term'"/>
								</xsl:call-template>
							</xsl:otherwise>
						</xsl:choose>
					</div>
					<div class="klucz_value">
						<xsl:value-of select="$klucz"/>
					</div>
				</xsl:when>
				<xsl:otherwise>
					<xsl:text>Brak poprawnego klucza dokumentu</xsl:text>
				</xsl:otherwise>
			</xsl:choose>
		</div>
	</xsl:template>
	
	<!-- kod dostępu do pakietu recept -->
	<xsl:template name="kod">
		<div class="kod cell">
			<span class="kod_label row_label_inline">
				<xsl:text>Kod dostępu</xsl:text>
				<span class="kod_value emphasized">
					<xsl:choose>
						<xsl:when test="$kod and string-length($kod) &gt;= 1">
							<!-- ograniczenie tymczasowe wynikające z obsługi kodu w P1, planuje się wprowadzenie informacji o błędnym kodzie przy długości != 4 -->
							<xsl:variable name="kodPakietu4cyfry" select="substring($kod, 1, 4)"/>
							<xsl:value-of select="$kodPakietu4cyfry"/>
						</xsl:when>
						<xsl:otherwise>
							<xsl:text>brak kodu dostępu</xsl:text>
						</xsl:otherwise>
					</xsl:choose>
				</span>
			</span>
		</div>
	</xsl:template>

	<!--	Przygotowuje komunikat dot. recepty 365-->
	<xsl:template name="komunikat-recepta-365">
		<xsl:param name="sa"/>

		<xsl:variable name="documentDate" select="substring(/hl7:ClinicalDocument/hl7:effectiveTime/@value, 1, 8)"/>
		<xsl:variable name="supplyDateLowValue" select="$sa//hl7:supply[hl7:templateId/@root = '2.16.840.1.113883.3.4424.13.10.4.55']/hl7:effectiveTime/@value"/>
		<xsl:variable name="supplyDateHighValue" select="$sa//hl7:supply[hl7:templateId/@root = '2.16.840.1.113883.3.4424.13.10.4.55']//hl7:supply[hl7:templateId/@root = '1.3.6.1.4.1.19376.1.9.1.3.15']/hl7:effectiveTime/hl7:high/@value"/>

		<xsl:variable name="dolnaData">
			<xsl:choose>
				<xsl:when test="$supplyDateLowValue">
					<xsl:value-of select="$supplyDateLowValue"/>
				</xsl:when>
				<xsl:when test="$documentDate">
					<xsl:value-of select="$documentDate"/>
				</xsl:when>
			</xsl:choose>
		</xsl:variable>

		<xsl:variable name="roznicaDat">
			<xsl:call-template name="oblicz-roznice-dat">
				<xsl:with-param name="data1" select="$dolnaData" />
				<xsl:with-param name="data2" select="$supplyDateHighValue" />
			</xsl:call-template>
		</xsl:variable>

		<xsl:if test="$roznicaDat = 365">
			<xsl:variable name="dataZPrzesunieciem">
				<xsl:call-template name="dodaj-dni-do-daty">
					<xsl:with-param name="data" select="$dolnaData"/>
					<xsl:with-param name="liczbaDni" select="30"/>
				</xsl:call-template>
			</xsl:variable>

			<div class="wykup-leku-info">
				<xsl:text>Do </xsl:text>
				<xsl:call-template name="formatDateTimeShortVariant">
					<xsl:with-param name="date" select="$dataZPrzesunieciem"/>
				</xsl:call-template>
				<xsl:text> wykup pierwsze opakowanie leku, żeby móc wykupić wszystkie przepisane opakowania. Jeśli zrobisz to później otrzymasz mniejszą ilość leku.</xsl:text>
			</div>
		</xsl:if>
	</xsl:template>

	<!--	Oblicz różnicę w dniach pomiędzy datami Gregorian Calendar-->
	<xsl:template name="oblicz-roznice-dat">
		<xsl:param name="data1"/>
		<xsl:param name="data2"/>
		<xsl:param name="julian-day1">
			<xsl:call-template name="gregorian-calendar-date-to-julian-day">
				<xsl:with-param name="date" select="$data1" />
			</xsl:call-template>
		</xsl:param>
		<xsl:param name="julian-day2">
			<xsl:call-template name="gregorian-calendar-date-to-julian-day">
				<xsl:with-param name="date" select="$data2" />
			</xsl:call-template>
		</xsl:param>
		<xsl:value-of select="$julian-day2 - $julian-day1"/>
	</xsl:template>

	<!--	Dodaje dni do daty Gregorian Calendar  -->
	<xsl:template name="dodaj-dni-do-daty">
		<xsl:param name="data"/>
		<xsl:param name="liczbaDni"/>

		<xsl:variable name="julianDay">
			<xsl:call-template name="gregorian-calendar-date-to-julian-day">
				<xsl:with-param name="date" select="$data" />
			</xsl:call-template>
		</xsl:variable>

		<xsl:variable name="dataGregorianCalendar">
			<xsl:call-template name="julian-day-to-gregorian-calendar-date">
				<xsl:with-param name="julian-day" select="$julianDay + $liczbaDni" />
			</xsl:call-template>
		</xsl:variable>

		<xsl:value-of select="$dataGregorianCalendar"/>
	</xsl:template>

	<!--	Konwertuje date Gregorian Calendar do julian day -->
	<xsl:template name="gregorian-calendar-date-to-julian-day">
		<xsl:param name="date"/>
		<xsl:param name="year" select="substring($date, 1, 4)"/>
		<xsl:param name="month" select="substring($date, 5, 2)"/>
		<xsl:param name="day" select="substring($date, 7, 2)"/>
		<xsl:param name="a" select="floor((14 - $month) div 12)"/>
		<xsl:param name="y" select="$year + 4800 - $a"/>
		<xsl:param name="m" select="$month + 12*$a - 3"/>
		<xsl:value-of select="$day + floor((153*$m + 2) div 5) + 365*$y + floor($y div 4) - floor($y div 100) + floor($y div 400) - 32045" />
	</xsl:template>

	<!--	Konwertuje julian day do daty Gregorian Calendar-->
	<xsl:template name="julian-day-to-gregorian-calendar-date">
		<xsl:param name="julian-day"/>

		<xsl:variable name="a" select="$julian-day + 32044"/>
		<xsl:variable name="b" select="floor((4 * $a + 3) div 146097)"/>
		<xsl:variable name="c" select="$a - 146097 * floor($b div 4)"/>

		<xsl:call-template name="gregorian-calendar-date-elem">
			<xsl:with-param name="b" select="$b"/>
			<xsl:with-param name="c" select="$c"/>
		</xsl:call-template>
	</xsl:template>

	<!-- Utils na potrzeby obliczenia Gregorian Calendar date -->
	<xsl:template name="gregorian-calendar-date-elem">
		<xsl:param name="b"/>
		<xsl:param name="c"/>

		<xsl:variable name="d" select="floor((4 * $c + 3) div 1461)"/>
		<xsl:variable name="e" select="$c - floor((1461 * $d) div 4)"/>
		<xsl:variable name="m" select="floor((5 * $e + 2) div 153)"/>

		<xsl:variable name="day"
					  select="$e - floor((153 * $m + 2) div 5) + 1"/>

		<xsl:variable name="month"
					  select="$m + 3 - (12 * floor($m div 10))"/>

		<xsl:variable name="year"
					  select="100 * $b + $d - 4800 + floor($m div 10)"/>

		<xsl:variable name="monthFormatted">
			<xsl:if test="string-length($month) = 2">
				<xsl:value-of select="$month"/>
			</xsl:if>
			<xsl:if test="string-length($month) = 1">
				<xsl:value-of select="concat('0',$month)"/>
			</xsl:if>
		</xsl:variable>

		<xsl:variable name="dayFormatted">
			<xsl:if test="string-length($day) = 2">
				<xsl:value-of select="$day"/>
			</xsl:if>
			<xsl:if test="string-length($day) = 1">
				<xsl:value-of select="concat('0',$day)"/>
			</xsl:if>
		</xsl:variable>

		<xsl:value-of select="concat($year, $monthFormatted, $dayFormatted)"/>
	</xsl:template>
	
	<!-- effectiveTime -->
	<xsl:template name="effectiveTime">
		<xsl:variable name="date" select="hl7:effectiveTime"/>
		
		<div class="effective_time header_element cell">
			<xsl:if test="$date">
				<span class="effective_time_label row_label_inline">
					<xsl:text>Wystawiono</xsl:text>
					<xsl:choose>
						<xsl:when test="$date/@nullFlavor">
							<xsl:call-template name="translateNullFlavor">
								<xsl:with-param name="nullableElement" select="$date"/>
							</xsl:call-template>
						</xsl:when>
						<xsl:when test="$date/@value">
							<span class="effective_time_value row_value_inline">
								<xsl:call-template name="formatDateTimeShortVariant">
									<xsl:with-param name="date" select="$date/@value"/>
								</xsl:call-template>
							</span>
						</xsl:when>
						<xsl:when test="$date/hl7:low/@value and $date/hl7:high/@value">
							<span class="effective_time_value row_value_inline">
								<xsl:call-template name="formatDateTimeShortVariant">
									<xsl:with-param name="date" select="$date/hl7:low/@value"/>
								</xsl:call-template>
								<xsl:text> - </xsl:text>
								<xsl:call-template name="formatDateTimeShortVariant">
									<xsl:with-param name="date" select="$date/hl7:high/@value"/>
								</xsl:call-template>
							</span>
						</xsl:when>
						<xsl:otherwise>
							<xsl:text>(nie podano)</xsl:text>
						</xsl:otherwise>
					</xsl:choose>
				</span>
			</xsl:if>
		</div>
	</xsl:template>
	
	<!-- zastrzeżenie dot. treści informacji o receptach elektronicznych -->
	<xsl:template name="disclaimer">
		<div class="header_element border_top">
			<div class="disclaimer">
				<div class="strona_ikp">
					Wejdź na <b>pacjent.gov.pl</b> i skorzystaj z Internetowego Konta Pacjenta (IKP).
				</div>
					<div class="oswiadczenie">
						Oświadczam, że nie realizowałem/am wcześniej recept o pozycjach: ...........<br/>
						Jestem świadomy odpowiedzialności karnej za złożenie fałszywego oświadczenia.
						<div class="podpis">
							...................................................................
						</div>
						<div class="dataIMiejscowosc">
							(data i podpis)
						</div>
					</div>
			</div>
		</div>
	</xsl:template>
	
	<!-- sekcja główna dokumentu recepty -->
	<xsl:template name="prescriptions">
		<xsl:param name="doc"/>
		
		<!-- sekcja Prescriptions o różnym OID w zależności od rodzaju recepty, ze stałym kodem LOINC 57828-6 wykorzystanym do odnalezienia jej -->
		<xsl:variable name="prescriptions" select="$doc/hl7:component/hl7:structuredBody/hl7:component/hl7:section[hl7:code/@code='57828-6' and hl7:code/@codeSystem='2.16.840.1.113883.6.1']"/>
		<xsl:variable name="sa" select="$prescriptions/hl7:entry/hl7:substanceAdministration"/>
		<xsl:variable name="paymentLevels" select ="$sa/hl7:entryRelationship/hl7:supply/hl7:entryRelationship/hl7:act[hl7:templateId/@root = '2.16.840.1.113883.3.4424.13.10.4.57']"/>
		<xsl:variable name="entitlements" select ="$doc/hl7:component/hl7:structuredBody/hl7:component/hl7:section[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.3.69']/hl7:entry[hl7:act[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.51']/hl7:entryRelationship/hl7:act[hl7:templateId/@root='2.16.840.1.113883.3.4424.13.10.4.61']]"/>

		<xsl:call-template name="komunikat-recepta-365">
			<xsl:with-param name="sa" select="$sa"/>
		</xsl:call-template>
		<xsl:choose>
			<xsl:when test="($paymentLevels and count($paymentLevels) &gt; 0) or ($entitlements and count($entitlements) &gt; 0)">
				<div class="section_block">
					<div class="section_text_block">
						<xsl:call-template name="sectionTitle">
							<xsl:with-param name="tytulRecepty" select="$prescriptions/hl7:title"/>
						</xsl:call-template>
						<xsl:call-template name="sectionText">
							<xsl:with-param name="text" select="$prescriptions/hl7:text"/>
						</xsl:call-template>
					</div>
					<div class="payment_block">
						<xsl:for-each select="$paymentLevels">
							<xsl:call-template name="paymentBlock">
							<!-- Wartość refundacji -->
								<xsl:with-param name="text" select="./hl7:entryRelationship/hl7:act/hl7:code/hl7:qualifier/hl7:value/@code"/>
							</xsl:call-template>
						</xsl:for-each>
						<xsl:for-each select="$entitlements">
							<xsl:call-template name="paymentBlock">
								<!-- Dodatkowe uprawnienia -->
								<xsl:with-param name="text" select="./hl7:act/hl7:entryRelationship/hl7:act/hl7:code/hl7:qualifier/hl7:value/@code"/>
							</xsl:call-template>
						</xsl:for-each>
					</div>
				</div>
			</xsl:when>
			<xsl:otherwise>
				<xsl:call-template name="sectionTitle">
					<xsl:with-param name="tytulRecepty" select="$prescriptions/hl7:title"/>
				</xsl:call-template>
				<xsl:call-template name="sectionText">
					<xsl:with-param name="text" select="$prescriptions/hl7:text"/>
				</xsl:call-template>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	
	<xsl:template name="paymentBlock">
		<xsl:param name="text"/>
		<div class="payment_text">
			<xsl:apply-templates select="$text"/>
		</div>
	</xsl:template>
	
	<xsl:template name="terminKontroli">
		<xsl:if test="$termin and string-length($termin) &gt;= 1">
			<div class="header_element row">
				<div class="row_label cell">
					<xsl:text>Termin kontroli</xsl:text>
				</div>
				<div class="row_value_bold cell">
					<xsl:value-of select="$termin"/>
				</div>
			</div>
		</xsl:if>
	</xsl:template>
	
	<!-- dane pacjenta -->
	<xsl:template name="recordTarget">
		<xsl:variable name="patientRole" select="hl7:recordTarget/hl7:patientRole"/>
		
		<div class="header_element row">
			<div class="row_label cell">
				<xsl:text>Pacjent</xsl:text>
			</div>
			<div class="row_value cell">
				<xsl:choose>
					<xsl:when test="hl7:recordTarget/@nullFlavor">
						<xsl:call-template name="translateNullFlavor">
							<xsl:with-param name="nullableElement" select="hl7:recordTarget"/>
						</xsl:call-template>
					</xsl:when>
					<xsl:when test="$patientRole/@nullFlavor">
						<xsl:call-template name="translateNullFlavor">
							<xsl:with-param name="nullableElement" select="$patientRole"/>
						</xsl:call-template>
					</xsl:when>
					<xsl:otherwise>
						<!-- imiona i nazwiska pacjenta -->
						<div class="emphasized">
							<xsl:call-template name="person">
								<xsl:with-param name="person" select="$patientRole/hl7:patient"/>
							</xsl:call-template>
						</div>
					</xsl:otherwise>
				</xsl:choose>
			</div>
		</div>
	</xsl:template>
	
	<!-- wystawca dokumentu, do wersji PIK 1.2 był to legalAuthenticator, od PIK 1.2.1 w związku z dostosowaniem do IHE PRE jest to author. PIK dopuszcza jednego autora recepty, alternatywnie asystenta i autora -->
	<xsl:template name="author">
		<xsl:variable name="assistant" select="/hl7:ClinicalDocument/hl7:dataEnterer/hl7:templateId/@root = '2.16.840.1.113883.3.4424.13.10.2.90' and 
										/hl7:ClinicalDocument/hl7:dataEnterer/hl7:assignedEntity/hl7:id/@extension = /hl7:ClinicalDocument/hl7:legalAuthenticator/hl7:assignedEntity/hl7:id/@extension and 
										/hl7:ClinicalDocument/hl7:dataEnterer/hl7:assignedEntity/hl7:id/@root = /hl7:ClinicalDocument/hl7:legalAuthenticator/hl7:assignedEntity/hl7:id/@root"/>
		
		<xsl:choose>
			<xsl:when test="not($assistant)">
				<xsl:call-template name="assignedEntity">
					<xsl:with-param name="entity" select="hl7:author/hl7:assignedAuthor"/>
					<xsl:with-param name="blockLabel">Wystawca</xsl:with-param>
					<xsl:with-param name="knownIdentifiersOnly" select="true()"/>
				</xsl:call-template>
			</xsl:when>
			<xsl:otherwise>
				<xsl:call-template name="assignedEntity">
					<xsl:with-param name="entity" select="hl7:dataEnterer/hl7:assignedEntity"/>
					<xsl:with-param name="blockLabel">Wystawca</xsl:with-param>
					<xsl:with-param name="knownIdentifiersOnly" select="true()"/>
				</xsl:call-template>
				<xsl:call-template name="assignedEntity">
					<xsl:with-param name="entity" select="hl7:author/hl7:assignedAuthor"/>
					<xsl:with-param name="blockLabel">W imieniu</xsl:with-param>
					<xsl:with-param name="knownIdentifiersOnly" select="true()"/>
				</xsl:call-template>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	
	
	<!-- ++++++++++++++++++++++++++++++++++++++ DRUGA LINIA +++++++++++++++++++++++++++++++++++++++++++-->
	
	<!-- osoba przypisana AssignedEntity templateId 2.16.840.1.113883.3.4424.13.10.2.49 -->
	<xsl:template name="assignedEntity">
		<xsl:param name="entity"/>
		<!-- kontekst domyślny -->
		<xsl:param name="context">assignedEntity</xsl:param>
		<xsl:param name="blockLabel">Blok danych</xsl:param>
		<xsl:param name="knownIdentifiersOnly" select="true()"/>
		
		<!-- maksymalna liczność assignedEntity to 1 -->
		<!-- id 1:*, code 0:1, addr 0:*, telecom 0:*, assignedPerson 0:1/1:1, representedOrganization 0:1 -->
		
		<div class="header_element row">
			<div class="row_label cell">
				<xsl:value-of select="$blockLabel"/>
			</div>
			<div class="row_value cell">
				<xsl:choose>
					<xsl:when test="not($entity)">
						<xsl:text>(nie podano informacji)</xsl:text>
					</xsl:when>
					<xsl:when test="$entity/@nullFlavor">
						<xsl:call-template name="translateNullFlavor">
							<xsl:with-param name="nullableElement" select="$entity"/>
						</xsl:call-template>
					</xsl:when>
					<xsl:when test="$context = 'assignedEntity'">
						<xsl:call-template name="person">
							<xsl:with-param name="person" select="$entity/hl7:assignedPerson"/>
						</xsl:call-template>
						
						<xsl:call-template name="identifiersInDiv">
							<xsl:with-param name="ids" select="$entity/hl7:id"/>
							<xsl:with-param name="functionCode" select="$entity/parent::hl7:author/hl7:functionCode"/>
							<xsl:with-param name="knownOnly" select="$knownIdentifiersOnly"/>
						</xsl:call-template>
						
						<xsl:choose>
							<xsl:when test="$entity/hl7:telecom">
								<!-- dane kontaktowe przypisanego bytu -->
								<xsl:call-template name="addressTelecomInDivs">
									<xsl:with-param name="telecom" select="$entity/hl7:telecom"/>
								</xsl:call-template>
							</xsl:when>
							<xsl:otherwise>
								<!-- jeśli nie podano danych przypisanego bytu, wyświetla się dane jego organizacji, o ile istnieją -->
								<xsl:call-template name="addressTelecomInDivs">
									<xsl:with-param name="telecom" select="$entity/hl7:representedOrganization/hl7:telecom"/>
								</xsl:call-template>
							</xsl:otherwise>
						</xsl:choose>
					</xsl:when>
					<xsl:otherwise>
						<xsl:text>(nie podano informacji)</xsl:text>
					</xsl:otherwise>
				</xsl:choose>
			</div>
		</div>
	</xsl:template>
	
	<!-- osoba templateId 2.16.840.1.113883.3.4424.13.10.2.1 -->
	<xsl:template name="person">
		<xsl:param name="person"/>
		
		<xsl:if test="$person">
			<xsl:choose>
				<xsl:when test="$person/@nullFlavor">
					<xsl:call-template name="translateNullFlavor">
						<xsl:with-param name="nullableElement" select="$person"/>
					</xsl:call-template>
				</xsl:when>
				<xsl:otherwise>
					<!-- imiona i nazwiska przypisanej osoby, brak innych istotnych danych w tym elemencie -->
					<xsl:call-template name="personName">
						<xsl:with-param name="name" select="$person/hl7:name"/>
					</xsl:call-template>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
	</xsl:template>
	
	<!-- imiona i nazwiska osoby z prefiksem i suffiksem, templateId 2.16.840.1.113883.3.4424.13.10.7.2 -->
	<xsl:template name="personName">
		<xsl:param name="name"/>
		
		<xsl:choose>
			<xsl:when test="not($name)">
				<xsl:call-template name="translateNullFlavor">
					<xsl:with-param name="nullableElement" select="$name"/>
				</xsl:call-template>
			</xsl:when>
			<xsl:otherwise>
				<!-- może istnieć wiele "nazw" osób, przy czym jedno imię i jedno nazwisko jest wymagane -->
				<xsl:for-each select="$name">
					<div class="row_value_element">
						<xsl:choose>
							<xsl:when test="./@nullFlavor">
								<xsl:call-template name="translateNullFlavor">
									<xsl:with-param name="nullableElement" select="."/>
								</xsl:call-template>
							</xsl:when>
							<xsl:otherwise>
								<xsl:if test="string-length(./hl7:prefix) &gt;= 1">
									<xsl:value-of select="./hl7:prefix"/>
									<xsl:text> </xsl:text>
								</xsl:if>
								<xsl:for-each select="./hl7:given">
									<xsl:choose>
										<xsl:when test="./@nullFlavor">
											<xsl:text>(imienia nie podano) </xsl:text>
										</xsl:when>
										<xsl:otherwise>
											<xsl:value-of select="."/>
											<xsl:text> </xsl:text>
										</xsl:otherwise>
									</xsl:choose>
								</xsl:for-each>
								<xsl:for-each select="./hl7:family">
									<xsl:choose>
										<xsl:when test="./@nullFlavor">
											<xsl:text>(nazwiska nie podano)</xsl:text>
										</xsl:when>
										<xsl:otherwise>
											<xsl:value-of select="."/>
										</xsl:otherwise>
									</xsl:choose>
									<xsl:if test="position()!=last()">
										<xsl:text> </xsl:text>
									</xsl:if>
								</xsl:for-each>
								<xsl:if test="string-length(./hl7:suffix) &gt;= 1">
									<xsl:text> </xsl:text>
									<xsl:value-of select="./hl7:suffix"/>
								</xsl:if>
							</xsl:otherwise>
						</xsl:choose>
					</div>
				</xsl:for-each>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	
	<!-- pełna, sformatowana lista identyfikatorów typu II -->
	<xsl:template name="identifiersInDiv">
		<xsl:param name="ids"/>
		<xsl:param name="functionCode"/>
		<xsl:param name="knownOnly" select="false()"/>
		
		<xsl:variable name="displayableIds" select="$ids[not(@displayable='false')]"/>
		<xsl:variable name="count" select="count($displayableIds)"/>
		
		<xsl:if test="$count &gt; 0">
			<xsl:call-template name="listIdentifiersOID">
				<xsl:with-param name="ids" select="$displayableIds"/>
				<xsl:with-param name="functionCode" select="$functionCode"/>
				<xsl:with-param name="knownOnly" select="$knownOnly"/>
			</xsl:call-template>
		</xsl:if>
	</xsl:template>
	
	<!--  lista identyfikatorów OID -->
	<xsl:template name="listIdentifiersOID">
		<xsl:param name="ids"/>
		<xsl:param name="functionCode"/>
		<xsl:param name="knownOnly" select="true()"/>
		
		<xsl:for-each select="$ids[not(@nullFlavor)]">
			<xsl:variable name="row">
				<xsl:call-template name="identifierOID">
					<xsl:with-param name="id" select="."/>
					<xsl:with-param name="functionCode" select="$functionCode"/>
					<xsl:with-param name="knownOnly" select="$knownOnly"/>
				</xsl:call-template>
			</xsl:variable>
			<xsl:if test="string-length($row) &gt;= 1">
				<div class="row_value_element small">
					<xsl:value-of select="$row"/>
				</div>
			</xsl:if>
		</xsl:for-each>
	</xsl:template>
	
	<!--  identyfikator OID -->
	<xsl:template name="identifierOID">
		<xsl:param name="id"/>
		<xsl:param name="functionCode"/>
		<xsl:param name="knownOnly"/>
		
		<xsl:choose>
			<xsl:when test="not($id) or $id/@nullFlavor">
				<span class="null_flavor_id">
					<xsl:text>ID </xsl:text>
				</span>
				<xsl:call-template name="translateNullFlavor">
					<xsl:with-param name="nullableElement" select="$id"/>
				</xsl:call-template>
			</xsl:when>
			<xsl:otherwise>
				<xsl:variable name="rootName">
					<xsl:call-template name="translateOID">
						<xsl:with-param name="oid" select="$id/@root"/>
						<xsl:with-param name="functionCode" select="$functionCode/@code"/>
					</xsl:call-template>
				</xsl:variable>
				
				<xsl:choose>
					<xsl:when test="$knownOnly">
						<!-- identyfikator nie jest wyświetlany gdy nie jest znany, a knownOnly = true -->
						<xsl:if test="string-length($rootName) &gt;= 1">
							<!-- bardzo robocze usunięcie numeru PESEL technika farm. gdyż ten szablon wykorzystuje się wyłącznie w przypadku id wystawcy -->
							<xsl:if test="$id/@root != '2.16.840.1.113883.3.4424.1.1.616'">
								<span>
									<xsl:value-of select="$rootName"/>
									<xsl:if test="string-length($id/@extension) &gt;= 1">
										<xsl:text> </xsl:text>
										<xsl:value-of select="$id/@extension"/>
									</xsl:if>
								</span>
							</xsl:if>
						</xsl:if>
					</xsl:when>
					<xsl:otherwise>
						<span>
							<xsl:choose>
								<xsl:when test="string-length($rootName) &gt;= 1">
									<xsl:value-of select="$rootName"/>
								</xsl:when>
								<xsl:otherwise>
									<span class="not_known_id_prefix">
										<xsl:text>ID </xsl:text>
									</span>
									<xsl:value-of select="$id/@root"/>
									<xsl:if test="string-length($id/@assigningAuthorityName) &gt;= 1">
										<xsl:text> (</xsl:text>
										<xsl:value-of select="$id/@assigningAuthorityName"/>
										<xsl:text>)</xsl:text>
									</xsl:if>
								</xsl:otherwise>
							</xsl:choose>
							<xsl:if test="string-length($id/@extension) &gt;= 1">
								<xsl:text> </xsl:text>
								<xsl:value-of select="$id/@extension"/>
							</xsl:if>
						</span>
					</xsl:otherwise>
				</xsl:choose>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	
	<!-- dane adresowe i kontaktowe -->
	<xsl:template name="addressTelecomInDivs">
		<xsl:param name="addr" select="false()"/>
		<xsl:param name="telecom" select="false()"/>
		
		<xsl:if test="$addr and count($addr) &gt; 0">
			<xsl:call-template name="addresses">
				<xsl:with-param name="addresses" select="$addr"/>
			</xsl:call-template>
		</xsl:if>
		
		<xsl:if test="$telecom and count($telecom) &gt; 0">
			<xsl:call-template name="telecoms">
				<xsl:with-param name="telecoms" select="$telecom"/>
			</xsl:call-template>
		</xsl:if>
	</xsl:template>
	
	<!-- adresy -->
	<xsl:template name="addresses">
		<xsl:param name="addresses"/>
		
		<xsl:for-each select="$addresses">
			<div class="row_value_element address_element">
				<span class="address_label">
					<xsl:call-template name="translateAddressUseCode">
						<xsl:with-param name="useCode" select="./@use"/>
					</xsl:call-template>
				</span>
				<div class="address_value">
					<xsl:call-template name="address">
						<xsl:with-param name="addr" select="."/>
					</xsl:call-template>
				</div>
			</div>
		</xsl:for-each>
	</xsl:template>
	
	<!-- adres templateId 2.16.840.1.113883.3.4424.13.10.7.1 -->
	<xsl:template name="address">
		<xsl:param name="addr"/>
		
		<xsl:choose>
			<!-- wyświetlenie informacji o braku wyłącznie gdy podano nullFlavor na poziomie całego adresu -->
			<xsl:when test="$addr/@nullFlavor">
				<xsl:call-template name="translateNullFlavor">
					<xsl:with-param name="nullableElement" select="$addr"/>
				</xsl:call-template>
			</xsl:when>
			<xsl:otherwise>
				<!-- obsługiwane są wyłącznie podstawowe pola zdefiniowane w PL IG (bez unitType,
					 w którym za granicą wyróżnia się typ lokalu, np. appartment)
					 oraz pole streetAddressLine wspierające zapis adresów zagranicznych,
					 nie są wyświetlanie adresy wprowadzane w postaci nieanalitycznej, tzw. plain-text -->
				<xsl:if test="$addr/hl7:streetAddressLine or $addr/hl7:streetName or $addr/hl7:city or $addr/hl7:country">
					
					<!-- linie dla adresu zagranicznego, przy czym dopuszczalne jest stosowanie także innych elementów -->
					<xsl:for-each select="$addr/hl7:streetAddressLine">
						<div>
							<xsl:value-of select="."/>
						</div>
					</xsl:for-each>
					
					<!-- układ adresu polskiego, stosowanego także dla adresów zagranicznych z podanym city -->
					<xsl:if test="string-length($addr/hl7:city) &gt;= 1">
						<xsl:choose>
							<xsl:when test="string-length($addr/hl7:streetName) &gt;= 1">
								<!-- ulica, numer domu, numer mieszkania -->
								<div>
									<xsl:value-of select="$addr/hl7:streetName"/>
									<xsl:if test="string-length($addr/hl7:houseNumber) &gt;= 1">
										<xsl:text> </xsl:text>
										<xsl:value-of select="$addr/hl7:houseNumber"/>
										<xsl:if test="string-length($addr/hl7:unitID) &gt;= 1">
											<xsl:text> lok. </xsl:text>
											<xsl:value-of select="$addr/hl7:unitID"/>
										</xsl:if>
									</xsl:if>
								</div>
								<xsl:choose>
									<xsl:when test="not($addr/hl7:postalCode/@postCity) or $addr/hl7:postalCode/@postCity = $addr/hl7:city">
										<!-- adres z ulicą i miejscowością posiadającą pocztę
											ul. Stroma 120
											41-400 Równe -->
										<div>
											<xsl:if test="string-length($addr/hl7:postalCode) &gt;= 1">
												<xsl:value-of select="$addr/hl7:postalCode"/>
												<xsl:text> </xsl:text>
											</xsl:if>
											<xsl:value-of select="$addr/hl7:city"/>
										</div>
									</xsl:when>
									<xsl:otherwise>
										<!-- adres z ulicą, miejscowością i inną pocztą
											ul. Stroma 120
											Wygoniska
											Poczta: 41-400 Równe -->
										<div>
											<xsl:value-of select="$addr/hl7:city"/>
										</div>
										<div>
											<xsl:text>Poczta: </xsl:text>
											<xsl:if test="string-length($addr/hl7:postalCode) &gt;= 1">
												<xsl:value-of select="$addr/hl7:postalCode"/>
												<xsl:text> </xsl:text>
											</xsl:if>
											<xsl:value-of select="$addr/hl7:postalCode/@postCity"/>
										</div>
									</xsl:otherwise>
								</xsl:choose>
							</xsl:when>
							<!-- ulica nie istnieje w adresie -->
							<xsl:otherwise>
								<xsl:choose>
									<xsl:when test="not($addr/hl7:postalCode/@postCity) or $addr/hl7:postalCode/@postCity = $addr/hl7:city">
										<!-- adres bez ulicy, z miejscowością posiadającą pocztę
											41-400 Równe 120 -->
										<div>
											<xsl:if test="string-length($addr/hl7:postalCode) &gt;= 1">
												<xsl:value-of select="$addr/hl7:postalCode"/>
												<xsl:text> </xsl:text>
											</xsl:if>
											<xsl:value-of select="$addr/hl7:city"/>
											<xsl:if test="string-length($addr/hl7:houseNumber) &gt;= 1">
												<xsl:text> </xsl:text>
												<xsl:value-of select="$addr/hl7:houseNumber"/>
												<xsl:if test="string-length($addr/hl7:unitID) &gt;= 1">
													<xsl:text> lok. </xsl:text>
													<xsl:value-of select="$addr/hl7:unitID"/>
												</xsl:if>
											</xsl:if>
										</div>
									</xsl:when>
									<xsl:otherwise>
										<!-- adres bez ulicy, z miejscowością i inną pocztą
											Wygoniska 120
											41-400 Równe -->
										<div>
											<xsl:value-of select="$addr/hl7:city"/>
											<xsl:if test="string-length($addr/hl7:houseNumber) &gt;= 1">
												<xsl:text> </xsl:text>
												<xsl:value-of select="$addr/hl7:houseNumber"/>
												<xsl:if test="string-length($addr/hl7:unitID) &gt;= 1">
													<xsl:text> lok. </xsl:text>
													<xsl:value-of select="$addr/hl7:unitID"/>
												</xsl:if>
											</xsl:if>
										</div>
										<div>
											<xsl:text>Poczta: </xsl:text>
											<xsl:if test="string-length($addr/hl7:postalCode) &gt;= 1">
												<xsl:value-of select="$addr/hl7:postalCode"/>
												<xsl:text> </xsl:text>
											</xsl:if>
											<xsl:value-of select="$addr/hl7:postalCode/@postCity"/>
										</div>
									</xsl:otherwise>
								</xsl:choose>
							</xsl:otherwise>
						</xsl:choose>
					</xsl:if>
					
					<!-- kod teryt hl7:censusTract nie jest wyświetlany, powinien być obsługiwany elektronicznie -->
					
					<!-- kraj, region/stan nie jest wyświetlany -->
					<xsl:if test="string-length($addr/hl7:country) &gt;= 1">
						<div>
							<xsl:value-of select="$addr/hl7:country"/>
						</div>
					</xsl:if>
				</xsl:if>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	
	<!-- dane kontaktowe -->
	<xsl:template name="telecoms">
		<xsl:param name="telecoms"/>
		
		<xsl:for-each select="$telecoms">
			<div class="row_value_element small">
				<xsl:call-template name="telecom">
					<xsl:with-param name="tele" select="."/>
				</xsl:call-template>
			</div>
		</xsl:for-each>
	</xsl:template>

	<!-- linia danych kontaktowych -->
	<xsl:template name="telecom">
		<xsl:param name="tele"/>
		
		<xsl:choose>
			<!-- wyświetlenie informacji o braku wyłącznie gdy podano nullFlavor -->
			<xsl:when test="$tele/@nullFlavor">
				<xsl:call-template name="translateNullFlavor">
					<xsl:with-param name="nullableElement" select="$tele"/>
				</xsl:call-template>
			</xsl:when>
			<xsl:otherwise>
				<!-- format <telecom use="PUB" value="tel: 22 2345 123"/> -->
				<xsl:variable name="address" select="substring-after($tele/@value, ':')"/>
				<xsl:variable name="protocol" select="substring-before($tele/@value, ':')"/>
				
				<xsl:choose>
					<xsl:when test="$address and $protocol">
						<xsl:call-template name="translateTelecomProtocolCode">
							<xsl:with-param name="protocolCode" select="$protocol"/>
						</xsl:call-template>
						
						<xsl:value-of select="$address"/>
						
						<xsl:if test="$tele/@use">
							<xsl:text> (</xsl:text>
							<xsl:call-template name="translateTelecomUseCode">
								<xsl:with-param name="useCode" select="$tele/@use"/>
							</xsl:call-template>
							<xsl:text>)</xsl:text>
						</xsl:if>
					</xsl:when>
					<xsl:otherwise>
						<!-- dane w niepoprawnym formacie, są jednak wyświetlane -->
						<xsl:value-of select="$tele"/>
					</xsl:otherwise>
				</xsl:choose>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	
	<!-- źródło - HL7 V3 Data Types 2.19.2 Telecommunication Use Code -->
	<xsl:template name="translateTelecomUseCode">
		<xsl:param name="useCode"/>
		<xsl:choose>
			<xsl:when test="$useCode='H' or $useCode='HP'">
				<xsl:text>domowy</xsl:text>
			</xsl:when>
			<xsl:when test="$useCode='HV'">
				<xsl:text>podczas urlopu</xsl:text>
			</xsl:when>
			
			<xsl:when test="$useCode='WP'">
				<xsl:text>służbowy</xsl:text>
			</xsl:when>
			<xsl:when test="$useCode='DIR'">
				<xsl:text>służbowy bezpośredni</xsl:text>
			</xsl:when>
			<xsl:when test="$useCode='PUB'">
				<xsl:text>rejestracja</xsl:text>
			</xsl:when>
			
			<xsl:when test="$useCode='TMP'">
				<xsl:text>tymczasowy</xsl:text>
			</xsl:when>
			<xsl:when test="$useCode='EC'">
				<xsl:text>w nagłych przypadkach</xsl:text>
			</xsl:when>
			<xsl:when test="$useCode='MC'">
				<xsl:text>komórkowy</xsl:text>
			</xsl:when>
			
			<xsl:otherwise>
				<xsl:text>inny: </xsl:text>
				<xsl:value-of select="$useCode"/>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	
	<!-- źródło - HL7 V3 Data Types 2.18.1 Protocol Code -->
	<xsl:template name="translateTelecomProtocolCode">
		<xsl:param name="protocolCode"/>
		<xsl:choose>
			<xsl:when test="$protocolCode='fax'">
				<xsl:text>faks: </xsl:text>
			</xsl:when>
			<xsl:when test="$protocolCode='http'">
				<xsl:text>Internet: </xsl:text>
			</xsl:when>
			<xsl:when test="$protocolCode='mailto'">
				<xsl:text>e-mail: </xsl:text>
			</xsl:when>
			<xsl:when test="$protocolCode='tel'">
				<xsl:text>tel: </xsl:text>
			</xsl:when>
			<!-- pozostałe przypadki są nieistotne, będą jednak wyświetlane -->
			<xsl:otherwise>
				<xsl:text>inny: </xsl:text>
				<xsl:value-of select="$protocolCode"/>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	
	<!-- źródło - HL7 V3 Data Types 2.21.1 Postal Address Use Code -->
	<xsl:template name="translateAddressUseCode">
		<xsl:param name="useCode"/>
		<xsl:choose>
			<!-- podstawowy adres instytucji, biura lub pracy -->
			<xsl:when test="not($useCode) or $useCode='WP' or $useCode='DIR' or $useCode='PUB' or $useCode='PHYS'">
				<xsl:text>Adres</xsl:text>
			</xsl:when>
			
			<xsl:when test="$useCode='H' or $useCode='HP'">
				<xsl:text>Adres zamieszkania</xsl:text>
			</xsl:when>
			<xsl:when test="$useCode='HV'">
				<xsl:text>Adres w trakcie urlopu</xsl:text>
			</xsl:when>
			<xsl:when test="$useCode='TMP'">
				<xsl:text>Adres tymczasowy</xsl:text>
			</xsl:when>
			<xsl:when test="$useCode='PST'">
				<xsl:text>Adres korespondencyjny</xsl:text>
			</xsl:when>
			
			<xsl:otherwise>
				<xsl:text>Inny adres (</xsl:text>
				<xsl:value-of select="$useCode"/>
				<xsl:text>)</xsl:text>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	
	
	<!-- ++++++++++++++ obsługa kodów kreskowych code 128 zestaw C w SVG (ograniczenie IE9+) ++++++++++++++++ -->
	<xsl:template name="drawBarSVG">
		<xsl:param name="code"/>
		<xsl:choose>
			<xsl:when test="$code = 'startC'"><!-- 211232 -->
				<rect x="0" height="30" width="2"/>
				<rect x="3" height="30" width="1"/>
				<rect x="6" height="30" width="3"/>
			</xsl:when>
			<xsl:when test="$code = 0"><!-- 212222 -->
				<rect x="0" height="30" width="2"/>
				<rect x="3" height="30" width="2"/>
				<rect x="7" height="30" width="2"/>
			</xsl:when>
			<xsl:when test="$code = 1"><!-- 222122 -->
				<rect x="0" height="30" width="2"/>
				<rect x="4" height="30" width="2"/>
				<rect x="7" height="30" width="2"/>
			</xsl:when>
			<xsl:when test="$code = 2"><!-- 222221 -->
				<rect x="0" height="30" width="2"/>
				<rect x="4" height="30" width="2"/>
				<rect x="8" height="30" width="2"/>
			</xsl:when>
			<xsl:when test="$code = 3"><!-- 121223 -->
				<rect x="0" height="30" width="1"/>
				<rect x="3" height="30" width="1"/>
				<rect x="6" height="30" width="2"/>
			</xsl:when>
			<xsl:when test="$code = 4"><!-- 121322 -->
				<rect x="0" height="30" width="1"/>
				<rect x="3" height="30" width="1"/>
				<rect x="7" height="30" width="2"/>
			</xsl:when>
			<xsl:when test="$code = 5"><!-- 131222 -->
				<rect x="0" height="30" width="1"/>
				<rect x="4" height="30" width="1"/>
				<rect x="7" height="30" width="2"/>
			</xsl:when>
			<xsl:when test="$code = 6"><!-- 122213 -->
				<rect x="0" height="30" width="1"/>
				<rect x="3" height="30" width="2"/>
				<rect x="7" height="30" width="1"/>
			</xsl:when>
			<xsl:when test="$code = 7"><!-- 122312 -->
				<rect x="0" height="30" width="1"/>
				<rect x="3" height="30" width="2"/>
				<rect x="8" height="30" width="1"/>
			</xsl:when>
			<xsl:when test="$code = 8"><!-- 132212 -->
				<rect x="0" height="30" width="1"/>
				<rect x="4" height="30" width="2"/>
				<rect x="8" height="30" width="1"/>
			</xsl:when>
			<xsl:when test="$code = 9"><!-- 221213 -->
				<rect x="0" height="30" width="2"/>
				<rect x="4" height="30" width="1"/>
				<rect x="7" height="30" width="1"/>
			</xsl:when>
			
			<xsl:when test="$code = 10"><!-- 221312 -->
				<rect x="0" height="30" width="2"/>
				<rect x="4" height="30" width="1"/>
				<rect x="8" height="30" width="1"/>
			</xsl:when>
			<xsl:when test="$code = 11"><!-- 231212 -->
				<rect x="0" height="30" width="2"/>
				<rect x="5" height="30" width="1"/>
				<rect x="8" height="30" width="1"/>
			</xsl:when>
			<xsl:when test="$code = 12"><!-- 112232 -->
				<rect x="0" height="30" width="1"/>
				<rect x="2" height="30" width="2"/>
				<rect x="6" height="30" width="3"/>
			</xsl:when>
			<xsl:when test="$code = 13"><!-- 122132 -->
				<rect x="0" height="30" width="1"/>
				<rect x="3" height="30" width="2"/>
				<rect x="6" height="30" width="3"/>
			</xsl:when>
			<xsl:when test="$code = 14"><!-- 122231 -->
				<rect x="0" height="30" width="1"/>
				<rect x="3" height="30" width="2"/>
				<rect x="7" height="30" width="3"/>
			</xsl:when>
			<xsl:when test="$code = 15"><!-- 113222 -->
				<rect x="0" height="30" width="1"/>
				<rect x="2" height="30" width="3"/>
				<rect x="7" height="30" width="2"/>
			</xsl:when>
			<xsl:when test="$code = 16"><!-- 123122 -->
				<rect x="0" height="30" width="1"/>
				<rect x="3" height="30" width="3"/>
				<rect x="7" height="30" width="2"/>
			</xsl:when>
			<xsl:when test="$code = 17"><!-- 123221 -->
				<rect x="0" height="30" width="1"/>
				<rect x="3" height="30" width="3"/>
				<rect x="8" height="30" width="2"/>
			</xsl:when>
			<xsl:when test="$code = 18"><!-- 223211 -->
				<rect x="0" height="30" width="2"/>
				<rect x="4" height="30" width="3"/>
				<rect x="9" height="30" width="1"/>
			</xsl:when>
			<xsl:when test="$code = 19"><!-- 221132 -->
				<rect x="0" height="30" width="2"/>
				<rect x="4" height="30" width="1"/>
				<rect x="6" height="30" width="3"/>
			</xsl:when>
			
			<xsl:when test="$code = 20"><!-- 221231 -->
				<rect x="0" height="30" width="2"/>
				<rect x="4" height="30" width="1"/>
				<rect x="7" height="30" width="3"/>
			</xsl:when>
			<xsl:when test="$code = 21"><!-- 213212 -->
				<rect x="0" height="30" width="2"/>
				<rect x="3" height="30" width="3"/>
				<rect x="8" height="30" width="1"/>
			</xsl:when>
			<xsl:when test="$code = 22"><!-- 223112 -->
				<rect x="0" height="30" width="2"/>
				<rect x="4" height="30" width="3"/>
				<rect x="8" height="30" width="1"/>
			</xsl:when>
			<xsl:when test="$code = 23"><!-- 312131 -->
				<rect x="0" height="30" width="3"/>
				<rect x="4" height="30" width="2"/>
				<rect x="7" height="30" width="3"/>
			</xsl:when>
			<xsl:when test="$code = 24"><!-- 311222 -->
				<rect x="0" height="30" width="3"/>
				<rect x="4" height="30" width="1"/>
				<rect x="7" height="30" width="2"/>
			</xsl:when>
			<xsl:when test="$code = 25"><!-- 321122 -->
				<rect x="0" height="30" width="3"/>
				<rect x="5" height="30" width="1"/>
				<rect x="7" height="30" width="2"/>
			</xsl:when>
			<xsl:when test="$code = 26"><!-- 321221 -->
				<rect x="0" height="30" width="3"/>
				<rect x="5" height="30" width="1"/>
				<rect x="8" height="30" width="2"/>
			</xsl:when>
			<xsl:when test="$code = 27"><!-- 312212 -->
				<rect x="0" height="30" width="3"/>
				<rect x="4" height="30" width="2"/>
				<rect x="8" height="30" width="1"/>
			</xsl:when>
			<xsl:when test="$code = 28"><!-- 322112 -->
				<rect x="0" height="30" width="3"/>
				<rect x="5" height="30" width="2"/>
				<rect x="8" height="30" width="1"/>
			</xsl:when>
			<xsl:when test="$code = 29"><!-- 322211 -->
				<rect x="0" height="30" width="3"/>
				<rect x="5" height="30" width="2"/>
				<rect x="9" height="30" width="1"/>
			</xsl:when>
			
			<xsl:when test="$code = 30"><!-- 212123 -->
				<rect x="0" height="30" width="2"/>
				<rect x="3" height="30" width="2"/>
				<rect x="6" height="30" width="2"/>
			</xsl:when>
			<xsl:when test="$code = 31"><!-- 212321 -->
				<rect x="0" height="30" width="2"/>
				<rect x="3" height="30" width="2"/>
				<rect x="8" height="30" width="2"/>
			</xsl:when>
			<xsl:when test="$code = 32"><!-- 232121 -->
				<rect x="0" height="30" width="2"/>
				<rect x="5" height="30" width="2"/>
				<rect x="8" height="30" width="2"/>
			</xsl:when>
			<xsl:when test="$code = 33"><!-- 111323 -->
				<rect x="0" height="30" width="1"/>
				<rect x="2" height="30" width="1"/>
				<rect x="6" height="30" width="2"/>
			</xsl:when>
			<xsl:when test="$code = 34"><!-- 131123 -->
				<rect x="0" height="30" width="1"/>
				<rect x="4" height="30" width="1"/>
				<rect x="6" height="30" width="2"/>
			</xsl:when>
			<xsl:when test="$code = 35"><!-- 131321 -->
				<rect x="0" height="30" width="1"/>
				<rect x="4" height="30" width="1"/>
				<rect x="8" height="30" width="2"/>
			</xsl:when>
			<xsl:when test="$code = 36"><!-- 112313 -->
				<rect x="0" height="30" width="1"/>
				<rect x="2" height="30" width="2"/>
				<rect x="7" height="30" width="1"/>
			</xsl:when>
			<xsl:when test="$code = 37"><!-- 132113 -->
				<rect x="0" height="30" width="1"/>
				<rect x="4" height="30" width="2"/>
				<rect x="7" height="30" width="1"/>
			</xsl:when>
			<xsl:when test="$code = 38"><!-- 132311 -->
				<rect x="0" height="30" width="1"/>
				<rect x="4" height="30" width="2"/>
				<rect x="9" height="30" width="1"/>
			</xsl:when>
			<xsl:when test="$code = 39"><!-- 211313 -->
				<rect x="0" height="30" width="2"/>
				<rect x="3" height="30" width="1"/>
				<rect x="7" height="30" width="1"/>
			</xsl:when>
			
			<xsl:when test="$code = 40"><!-- 231113 -->
				<rect x="0" height="30" width="2"/>
				<rect x="5" height="30" width="1"/>
				<rect x="7" height="30" width="1"/>
			</xsl:when>
			<xsl:when test="$code = 41"><!-- 231311 -->
				<rect x="0" height="30" width="2"/>
				<rect x="5" height="30" width="1"/>
				<rect x="9" height="30" width="1"/>
			</xsl:when>
			<xsl:when test="$code = 42"><!-- 112133 -->
				<rect x="0" height="30" width="1"/>
				<rect x="2" height="30" width="2"/>
				<rect x="5" height="30" width="3"/>
			</xsl:when>
			<xsl:when test="$code = 43"><!-- 112331 -->
				<rect x="0" height="30" width="1"/>
				<rect x="2" height="30" width="2"/>
				<rect x="7" height="30" width="3"/>
			</xsl:when>
			<xsl:when test="$code = 44"><!-- 132131 -->
				<rect x="0" height="30" width="1"/>
				<rect x="4" height="30" width="2"/>
				<rect x="7" height="30" width="3"/>
			</xsl:when>
			<xsl:when test="$code = 45"><!-- 113123 -->
				<rect x="0" height="30" width="1"/>
				<rect x="2" height="30" width="3"/>
				<rect x="6" height="30" width="2"/>
			</xsl:when>
			<xsl:when test="$code = 46"><!-- 113321 -->
				<rect x="0" height="30" width="1"/>
				<rect x="2" height="30" width="3"/>
				<rect x="8" height="30" width="2"/>
			</xsl:when>
			<xsl:when test="$code = 47"><!-- 133121 -->
				<rect x="0" height="30" width="1"/>
				<rect x="4" height="30" width="3"/>
				<rect x="8" height="30" width="2"/>
			</xsl:when>
			<xsl:when test="$code = 48"><!-- 313121 -->
				<rect x="0" height="30" width="3"/>
				<rect x="4" height="30" width="3"/>
				<rect x="8" height="30" width="2"/>
			</xsl:when>
			<xsl:when test="$code = 49"><!-- 211331 -->
				<rect x="0" height="30" width="2"/>
				<rect x="3" height="30" width="1"/>
				<rect x="7" height="30" width="3"/>
			</xsl:when>
			
			<xsl:when test="$code = 50"><!-- 231131 -->
				<rect x="0" height="30" width="2"/>
				<rect x="5" height="30" width="1"/>
				<rect x="7" height="30" width="3"/>
			</xsl:when>
			<xsl:when test="$code = 51"><!-- 213113 -->
				<rect x="0" height="30" width="2"/>
				<rect x="3" height="30" width="3"/>
				<rect x="7" height="30" width="1"/>
			</xsl:when>
			<xsl:when test="$code = 52"><!-- 213311 -->
				<rect x="0" height="30" width="2"/>
				<rect x="3" height="30" width="3"/>
				<rect x="9" height="30" width="1"/>
			</xsl:when>
			<xsl:when test="$code = 53"><!-- 213131 -->
				<rect x="0" height="30" width="2"/>
				<rect x="3" height="30" width="3"/>
				<rect x="7" height="30" width="3"/>
			</xsl:when>
			<xsl:when test="$code = 54"><!-- 311123 -->
				<rect x="0" height="30" width="3"/>
				<rect x="4" height="30" width="1"/>
				<rect x="6" height="30" width="2"/>
			</xsl:when>
			<xsl:when test="$code = 55"><!-- 311321 -->
				<rect x="0" height="30" width="3"/>
				<rect x="4" height="30" width="1"/>
				<rect x="8" height="30" width="2"/>
			</xsl:when>
			<xsl:when test="$code = 56"><!-- 331121 -->
				<rect x="0" height="30" width="3"/>
				<rect x="6" height="30" width="1"/>
				<rect x="8" height="30" width="2"/>
			</xsl:when>
			<xsl:when test="$code = 57"><!-- 312113 -->
				<rect x="0" height="30" width="3"/>
				<rect x="4" height="30" width="2"/>
				<rect x="7" height="30" width="1"/>
			</xsl:when>
			<xsl:when test="$code = 58"><!-- 312311 -->
				<rect x="0" height="30" width="3"/>
				<rect x="4" height="30" width="2"/>
				<rect x="9" height="30" width="1"/>
			</xsl:when>
			<xsl:when test="$code = 59"><!-- 332111 -->
				<rect x="0" height="30" width="3"/>
				<rect x="6" height="30" width="2"/>
				<rect x="9" height="30" width="1"/>
			</xsl:when>
			
			<xsl:when test="$code = 60"><!-- 314111 -->
				<rect x="0" height="30" width="3"/>
				<rect x="4" height="30" width="4"/>
				<rect x="9" height="30" width="1"/>
			</xsl:when>
			<xsl:when test="$code = 61"><!-- 221411 -->
				<rect x="0" height="30" width="2"/>
				<rect x="4" height="30" width="1"/>
				<rect x="9" height="30" width="1"/>
			</xsl:when>
			<xsl:when test="$code = 62"><!-- 431111 -->
				<rect x="0" height="30" width="4"/>
				<rect x="7" height="30" width="1"/>
				<rect x="9" height="30" width="1"/>
			</xsl:when>
			<xsl:when test="$code = 63"><!-- 111224 -->
				<rect x="0" height="30" width="1"/>
				<rect x="2" height="30" width="1"/>
				<rect x="5" height="30" width="2"/>
			</xsl:when>
			<xsl:when test="$code = 64"><!-- 111422 -->
				<rect x="0" height="30" width="1"/>
				<rect x="2" height="30" width="1"/>
				<rect x="7" height="30" width="2"/>
			</xsl:when>
			<xsl:when test="$code = 65"><!-- 121124 -->
				<rect x="0" height="30" width="1"/>
				<rect x="3" height="30" width="1"/>
				<rect x="5" height="30" width="2"/>
			</xsl:when>
			<xsl:when test="$code = 66"><!-- 121421 -->
				<rect x="0" height="30" width="1"/>
				<rect x="3" height="30" width="1"/>
				<rect x="8" height="30" width="2"/>
			</xsl:when>
			<xsl:when test="$code = 67"><!-- 141122 -->
				<rect x="0" height="30" width="1"/>
				<rect x="5" height="30" width="1"/>
				<rect x="7" height="30" width="2"/>
			</xsl:when>
			<xsl:when test="$code = 68"><!-- 141221 -->
				<rect x="0" height="30" width="1"/>
				<rect x="5" height="30" width="1"/>
				<rect x="8" height="30" width="2"/>
			</xsl:when>
			<xsl:when test="$code = 69"><!-- 112214 -->
				<rect x="0" height="30" width="1"/>
				<rect x="2" height="30" width="2"/>
				<rect x="6" height="30" width="1"/>
			</xsl:when>
			
			<xsl:when test="$code = 70"><!-- 112412 -->
				<rect x="0" height="30" width="1"/>
				<rect x="2" height="30" width="2"/>
				<rect x="8" height="30" width="1"/>
			</xsl:when>
			<xsl:when test="$code = 71"><!-- 122114 -->
				<rect x="0" height="30" width="1"/>
				<rect x="3" height="30" width="2"/>
				<rect x="6" height="30" width="1"/>
			</xsl:when>
			<xsl:when test="$code = 72"><!-- 122411 -->
				<rect x="0" height="30" width="1"/>
				<rect x="3" height="30" width="2"/>
				<rect x="9" height="30" width="1"/>
			</xsl:when>
			<xsl:when test="$code = 73"><!-- 142112 -->
				<rect x="0" height="30" width="1"/>
				<rect x="5" height="30" width="2"/>
				<rect x="8" height="30" width="1"/>
			</xsl:when>
			<xsl:when test="$code = 74"><!-- 142211 -->
				<rect x="0" height="30" width="1"/>
				<rect x="5" height="30" width="2"/>
				<rect x="9" height="30" width="1"/>
			</xsl:when>
			<xsl:when test="$code = 75"><!-- 241211 -->
				<rect x="0" height="30" width="2"/>
				<rect x="6" height="30" width="1"/>
				<rect x="9" height="30" width="1"/>
			</xsl:when>
			<xsl:when test="$code = 76"><!-- 221114 -->
				<rect x="0" height="30" width="2"/>
				<rect x="4" height="30" width="1"/>
				<rect x="6" height="30" width="1"/>
			</xsl:when>
			<xsl:when test="$code = 77"><!-- 413111 -->
				<rect x="0" height="30" width="4"/>
				<rect x="5" height="30" width="3"/>
				<rect x="9" height="30" width="1"/>
			</xsl:when>
			<xsl:when test="$code = 78"><!-- 241112 -->
				<rect x="0" height="30" width="2"/>
				<rect x="6" height="30" width="1"/>
				<rect x="8" height="30" width="1"/>
			</xsl:when>
			<xsl:when test="$code = 79"><!-- 134111 -->
				<rect x="0" height="30" width="1"/>
				<rect x="4" height="30" width="4"/>
				<rect x="9" height="30" width="1"/>
			</xsl:when>
			
			<xsl:when test="$code = 80"><!-- 111242 -->
				<rect x="0" height="30" width="1"/>
				<rect x="2" height="30" width="1"/>
				<rect x="5" height="30" width="4"/>
			</xsl:when>
			<xsl:when test="$code = 81"><!-- 121142 -->
				<rect x="0" height="30" width="1"/>
				<rect x="3" height="30" width="1"/>
				<rect x="5" height="30" width="4"/>
			</xsl:when>
			<xsl:when test="$code = 82"><!-- 121241 -->
				<rect x="0" height="30" width="1"/>
				<rect x="3" height="30" width="1"/>
				<rect x="6" height="30" width="4"/>
			</xsl:when>
			<xsl:when test="$code = 83"><!-- 114212 -->
				<rect x="0" height="30" width="1"/>
				<rect x="2" height="30" width="4"/>
				<rect x="8" height="30" width="1"/>
			</xsl:when>
			<xsl:when test="$code = 84"><!-- 124112 -->
				<rect x="0" height="30" width="1"/>
				<rect x="3" height="30" width="4"/>
				<rect x="8" height="30" width="1"/>
			</xsl:when>
			<xsl:when test="$code = 85"><!-- 124211 -->
				<rect x="0" height="30" width="1"/>
				<rect x="3" height="30" width="4"/>
				<rect x="9" height="30" width="1"/>
			</xsl:when>
			<xsl:when test="$code = 86"><!-- 411212 -->
				<rect x="0" height="30" width="4"/>
				<rect x="5" height="30" width="1"/>
				<rect x="8" height="30" width="1"/>
			</xsl:when>
			<xsl:when test="$code = 87"><!-- 421112 -->
				<rect x="0" height="30" width="4"/>
				<rect x="6" height="30" width="1"/>
				<rect x="8" height="30" width="1"/>
			</xsl:when>
			<xsl:when test="$code = 88"><!-- 421211 -->
				<rect x="0" height="30" width="4"/>
				<rect x="6" height="30" width="1"/>
				<rect x="9" height="30" width="1"/>
			</xsl:when>
			<xsl:when test="$code = 89"><!-- 212141 -->
				<rect x="0" height="30" width="2"/>
				<rect x="3" height="30" width="2"/>
				<rect x="6" height="30" width="4"/>
			</xsl:when>
			
			<xsl:when test="$code = 90"><!-- 214121 -->
				<rect x="0" height="30" width="2"/>
				<rect x="3" height="30" width="4"/>
				<rect x="8" height="30" width="2"/>
			</xsl:when>
			<xsl:when test="$code = 91"><!-- 412121 -->
				<rect x="0" height="30" width="4"/>
				<rect x="5" height="30" width="2"/>
				<rect x="8" height="30" width="2"/>
			</xsl:when>
			<xsl:when test="$code = 92"><!-- 111143 -->
				<rect x="0" height="30" width="1"/>
				<rect x="2" height="30" width="1"/>
				<rect x="4" height="30" width="4"/>
			</xsl:when>
			<xsl:when test="$code = 93"><!-- 111341 -->
				<rect x="0" height="30" width="1"/>
				<rect x="2" height="30" width="1"/>
				<rect x="6" height="30" width="4"/>
			</xsl:when>
			<xsl:when test="$code = 94"><!-- 131141 -->
				<rect x="0" height="30" width="1"/>
				<rect x="4" height="30" width="1"/>
				<rect x="6" height="30" width="4"/>
			</xsl:when>
			<xsl:when test="$code = 95"><!-- 114113 -->
				<rect x="0" height="30" width="1"/>
				<rect x="2" height="30" width="4"/>
				<rect x="7" height="30" width="1"/>
			</xsl:when>
			<xsl:when test="$code = 96"><!-- 114311 -->
				<rect x="0" height="30" width="1"/>
				<rect x="2" height="30" width="4"/>
				<rect x="9" height="30" width="1"/>
			</xsl:when>
			<xsl:when test="$code = 97"><!-- 411113 -->
				<rect x="0" height="30" width="4"/>
				<rect x="5" height="30" width="1"/>
				<rect x="7" height="30" width="1"/>
			</xsl:when>
			<xsl:when test="$code = 98"><!-- 411311 -->
				<rect x="0" height="30" width="4"/>
				<rect x="5" height="30" width="1"/>
				<rect x="9" height="30" width="1"/>
			</xsl:when>
			<xsl:when test="$code = 99"><!-- 113141 -->
				<rect x="0" height="30" width="1"/>
				<rect x="2" height="30" width="3"/>
				<rect x="6" height="30" width="4"/>
			</xsl:when>
			
			<!-- trzy kody do zastosowania wyłącznie na potrzeby sumy kontrolnej -->
			<xsl:when test="$code = 100"><!-- 114131 -->
				<rect x="0" height="30" width="1"/>
				<rect x="2" height="30" width="4"/>
				<rect x="7" height="30" width="3"/>
			</xsl:when>
			<xsl:when test="$code = 101"><!-- 311141 -->
				<rect x="0" height="30" width="3"/>
				<rect x="4" height="30" width="1"/>
				<rect x="6" height="30" width="4"/>
			</xsl:when>
			<xsl:when test="$code = 102"><!-- 411131 -->
				<rect x="0" height="30" width="4"/>
				<rect x="5" height="30" width="1"/>
				<rect x="7" height="30" width="3"/>
			</xsl:when>
			
			<xsl:when test="$code = 'stopAndTerminate'"><!-- 2331112 -->
				<rect x="0" height="30" width="2"/>
				<rect x="5" height="30" width="3"/>
				<rect x="9" height="30" width="1"/>
				<rect x="11" height="30" width="2"/>
			</xsl:when>
		</xsl:choose>
	</xsl:template>
	
	<!-- ++++++++++++++ wariant dla IE8- obsługi kodów kreskowych code 128 zestaw C przy zastosowaniu bloków graficznych ++++++++++++++++ -->
	<xsl:template name="drawBarIMG">
		<xsl:param name="code"/>
		<xsl:choose>
			<xsl:when test="$code = 'startC'"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAAvSURBVDhPY4CA////Q0gIAwJQuBAWitCoilEVoypGVUA4EBIhNKpiVAV9VPz/DwBnmvoibX9agwAAAABJRU5ErkJggg==" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 'stop'"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAA1SURBVDhP7cqxDQAgDMRA9l86KOGgp38XkfzxOtSFz/JuM9+GpwBPAZ4CPAV4CvAU4B9F1QbDhPoiW9BlugAAAABJRU5ErkJggg==" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 'term'"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAAzCAIAAAAy8k57AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAAOSURBVChTYxgFtAYMDAABZQABiqcCgwAAAABJRU5ErkJggg==" width="2" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 0"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAAtSURBVDhP7cqhEQAwDMPA7r+0CuILMguV0AO9CVhUe3gE1R4eQbWHR1B9OeAD1PT6ImuabuUAAAAASUVORK5CYII=" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 1"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAApSURBVDhPY4CA/2AAZ8MZcPaoilEVoypGVYyqQOMgM+DsURX0VPH/PwBnmvoisR60VwAAAABJRU5ErkJggg==" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 2"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAAvSURBVDhP7cohDgAwDIDA/f/TXTKCm6sFdYJD8/oadGjQoUGHBh0adGjQocHmmLn6MfoiEpWL0AAAAABJRU5ErkJggg==" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 3"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAACnSURBVDhPTcexEcBAEINA99/0mfkAQbR8dK9C06bQtCk0bQpNm0LTptC0KTRtCk2bQtOm0LQpNG0KTZtC06bQtCk0bQpNm0LTptC0KTRtCk2bQtOm0LQpNG0KTZtC06bQtCk0bQpNm0LTptC0KTRtCk2bQtOm0LQpNG0KTZtC06bQtCk0bQpNm0LTptC0KTRtCk2bQtOm0LQpNG0KTZtC06bQtCn03f23DysO9xFdygAAAABJRU5ErkJggg==" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 4"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAAxSURBVDhP7YqxDQAwDIP6/9OunUhpL8gEE0Ico2LEpH6do3g+1mJSOTg4QioHx84hXUm1Kw7GxRTxAAAAAElFTkSuQmCC" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 5"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAA2SURBVDhP7YqxDQAgDMP4/+kQ1BaRjQPsybK8jIbrp75eZqJycHC0hJeZqBwcHC3hZSbq7yFtEwgrDu6JfY8AAAAASUVORK5CYII=" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 6"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAC1SURBVDhPVcixEYAAEIRA+2/6RUk4oh0eur9PsaC5taC5taC5taC5taC5taC5taC5taC5taC5taC5taC5taC5taC5taC5taC5taC5taC5taC5taC5taC5taC5taC5taC5taC5taC5taC5taC5taC5taC5taC5taC5taC5taC5taC5taC5taC5taC5taC5taC5taC5taC5taC5taC5taC5taC5taC5taC5taC5taC5taC5tbi7FyR4Kw6yvVNQAAAAAElFTkSuQmCC" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 7"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAA1SURBVDhP7YpBCgAgEIT6/6enNQjp2nk8ibiGHLDrw9O1HlashxXrYcV6WLEeVqyHFfs5kg3tvCsOJj/7eAAAAABJRU5ErkJggg==" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 8"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAAqSURBVDhPYwCC/zAA4sC4yIxRFaMqQADEGVUxqmJUBQiAOKMqBoGK//8BgGIrDntzeXwAAAAASUVORK5CYII=" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 9"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAA1SURBVDhP7YqxDQAgAIP8/+lK6OjoWiYSOCXyCth3VMC+owL2HRWw76iAfUcF7DsqYP86kguR0isOkRI0QAAAAABJRU5ErkJggg==" width="11" height="{$barcodeHeight}"/></xsl:when>
			
			<xsl:when test="$code = 10"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAADhSURBVDhPTcjBEYAAEMJA+2/6BONk2FfgwX2M2LMcROxZDiL2LAcRe5aDiD3LQcSe5SBiz3IQsWc5iNizHETsWQ4i9iwHEXuWg4g9y0HEnuUgYs9yELFnOYjYsxxE7FkOIvYsBxF7loOIPctBxJ7lIGLPchCxZzmI2LMcROxZDiL2LAcRe5aDiD3LQcSe5SBiz3IQsWc5iNizHETsWQ4i9iwHEXuWg4g9y0HEnuUgYs9yELFnOYjYsxxE7FkOIvYsBxF7loOIPctBxJ7lIGLPchCxZzmI2LMcROxZDiL+vnsBWyUrDg3YTP8AAAAASUVORK5CYII=" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 11"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAADNSURBVDhPTcfBEYAAEINA+2/6TAZlwmt56P70ojFJLxqT9KIxSS8ak/SiMUkvGpP0ojFJLxqT9KIxSS8ak/SiMUkvGpP0ojFJLxqT9KIxSS8ak/SiMUkvGpP0ojFJLxqT9KIxSS8ak/SiMUkvGpP0ojFJLxqT9KIxSS8ak/SiMUkvGpP0ojFJLxqT9KIxSS8ak/SiMUkvGpP0ojFJLxqT9KIxSS8ak/SiMUkvGpP0ojFJLxqT9KIxSS8ak/SiMUkvGpP0ojFJLxqT9Ie7FyR4Kw4yehscAAAAAElFTkSuQmCC" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 12"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAACsSURBVDhPRcixAYAADMMw/n+6gIfISxs9X3f3n579X+YUlTlFZU5RmVNU5hSVOUVlTlGZU1TmFJU5RWVOUZlTVOYUlTlFZU5RmVNU5hSVOUVlTlGZU1TmFJU5RWVOUZlTVOYUlTlFZU5RmVNU5hSVOUVlTlGZU1TmFJU5RWVOUZlTVOYUlTlFZU5RmVNU5hSVOUVlTlGZU1TmFJU5RWVOUZlTVOYUlTlF9Y+7FzDt+iInAwR3AAAAAElFTkSuQmCC" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 13"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAAySURBVDhP7cohDgAwDMPA/f/TWdeByrTYQafIp5beU/ujNv/IgrKgLCgLyoKyoDZFcgHDhPoiqUmvwAAAAABJRU5ErkJggg==" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 14"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAACqSURBVDhPVcixDcMAEMSw7L/0RzauoFUR+tW9Pfq6Zq+u2atr9uqavbpmr67Zq2v26pq9umavrtmra/bqmr26Zq+u2atr9uqavbpmr67Zq2v26pq9umavrtmra/bqmr26Zq+u2atr9uqavbpmr67Zq2v26pq9umavrtmra/bqmr26Zq+u2atr9uqavbpmr67Zq2v26pq9umavrtmra/bqmr26Zq+u2avr7v4fffoiQpfoZQAAAABJRU5ErkJggg==" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 15"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAA3SURBVDhP7YqxDQAwDIP6/9Nu6BDWHmCWOIgzJOE8Zu/rXjVoW4C2BWhbgLYFaFuAtgVof4vkAp5H+iKF1IRWAAAAAElFTkSuQmCC" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 16"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAACdSURBVDhPRcixEcAwAISw7L+0Y1O8qHR8t1NPNftUs081+1SzTzX7VLNPNftUs081+1SzTzX7VLNPNftUs081+1SzTzX7VLNPNftUs081+1SzTzX7VLNPNftUs081+1SzTzX7VLNPNftUs081+1SzTzX7VLNPNftUs081+1SzTzX7VLNPNftUs081+1SzTzX7VLNPNftUs081v3vOD/ox+iKFu4oIAAAAAElFTkSuQmCC" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 17"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAC2SURBVDhPTcixEYAAEIRA+2/6ReeCJQKeuJ/PfsyJK8yJK8yJK8yJK8yJK8yJK8yJK8yJK8yJK8yJK8yJK8yJK8yJK8yJK8yJK8yJK8yJK8yJK8yJK8yJK8yJK8yJK8yJK8yJK8yJK8yJK8yJK8yJK8yJK8yJK8yJK8yJK8yJK8yJK8yJK8yJK8yJK8yJK8yJK8yJK8yJK8yJK8yJK8yJK8yJK8yJK8yJK8yJK8yJK8yJK8y7ewGM1/oiT0gpuAAAAABJRU5ErkJggg==" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 18"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAACkSURBVDhPTcixDcMAEMSw7L/0B7AMntWJv7qndz47RGWHqOwQlR2iskNUdojKDlHZISo7RGWHqOwQlR2iskNUdojKDlHZISo7RGWHqOwQlR2iskNUdojKDlHZISo7RGWHqOwQlR2iskNUdojKDlHZISo7RGWHqOwQlR2iskNUdojKDlHZISo7RGWHqOwQlR2iskNUdojKDlHZISo7RGWHqOzd/QFnmvoiskMAyAAAAABJRU5ErkJggg==" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 19"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAAtSURBVDhPY4CA/2AAYUBEgAAuiMJBCI2qGFUxqmJUBTIHITSqYlQFfVT8/w8AMO36Io4VCMgAAAAASUVORK5CYII=" width="11" height="{$barcodeHeight}"/></xsl:when>
			
			<xsl:when test="$code = 20"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAACcSURBVDhPTcnBCYAAEMRA+2/6BAOz5jWQp+7rj5oNqNmAmg2o2YCaDajZgJoNqNmAmg2o2YCaDajZgJoNqNmAmg2o2YCaDajZgJoNqNmAmg2o2YCaDajZgJoNqNmAmg2o2YCaDajZgJoNqNmAmg2o2YCaDajZgJoNqNmAmg2o2YCaDajZgJoNqNmAmg2o2YCaDajZgJoNqNmAursXjNf6Ij9gEssAAAAASUVORK5CYII=" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 21"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAA0SURBVDhP7cqxDQAgEMNA9l86yDzCNX1cXaSsKcnV8cwHUn2Q6oNUH6T6INUHqT5IfT+SDUJd+iJlNdLKAAAAAElFTkSuQmCC" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 22"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAAuSURBVDhPY4CA/2AA5YC5EBIhiMIZVTGqYlTFqIpRFSAAYaMIonBGVdBWxf//AJ5H+iIn18oCAAAAAElFTkSuQmCC" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 23"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAAtSURBVDhPY4CD////ozGAAJk9qmJUBQoDCEZVjKqAglEVoyqQGUBAJxX//wMAqrzJRXCBcAQAAAAASUVORK5CYII=" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 24"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAC+SURBVDhPXchBCoAAEMNA///plRKQwRxK0ufj7trk56Pw1Ufhq4/CVx+Frz4KX30UvvoofPVR+Oqj8NVH4auPwlcfha8+Cl99FL76KHz1Ufjqo/DVR+Grj8JXH4WvPgpffRS++ih89VH46qPw1Ufhq4/CVx+Frz4KX30UvvoofPVR+Oqj8NVH4auPwlcfha8+Cl99FL76KHz1Ufjqo/DVR+Grj8JXH4WvPgpffRS++ih89VH46qPw1UfhO7t7AQuw+iJ9IIe8AAAAAElFTkSuQmCC" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 25"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAACdSURBVDhPXcgxDgAgEMMw/v/pQ0DkgUytl+b2xiflU1I+JeVTUj4l5VNSPiXlU1I+JeVTUj4l5VNSPiXlU1I+JeVTUj4l5VNSPiXlU1I+JeVTUj4l5VNSPiXlU1I+JeVTUj4l5VNSPiXlU1I+JeVTUj4l5VNSPiXlU1I+JeVTUj4l5VNSPiXlU1I+JeVTUj4l5VNSPiXlU1I+PX9mA9T0+iIuo1TtAAAAAElFTkSuQmCC" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 26"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAC7SURBVDhPTcnBCYAAEMRA+2/6ZA0M5jWQR/f1Rw7LgByWATksA3JYBuSwDMhhGZDDMiCHZUAOy4AclgE5LANyWAbksAzIYRmQwzIgh2VADsuAHJYBOSwDclgG5LAMyGEZkMMyIIdlQA7LgByWATksA3JYBuSwDMhhGZDDMiCHZUAOy4AclgE5LANyWAbksAzIYRmQwzIgh2VADsuAHJYBOSwDclgG5LAMyGEZkMMyIIdlQA7LgByWAfPdC2ea+iKrwN/VAAAAAElFTkSuQmCC" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 27"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAChSURBVDhPPcnBCQAgAMNA91+6IobLpwk92Ea+kxAOEsJBQjhICAcJ4SAhHCSEg4RwkBAOEsJBQjhICAcJ4SAhHCSEg4RwkBAOEsJBQjhICAcJ4SAhHCSEg4RwkBAOEsJBQjhICAcJ4SAhHCSEg4RwkBAOEsJBQjhICAcJ4SAhHCSEg4RwkBAOEsJBQjhICAcJ4SAhHCSEg4RwkBAOEsLxZrt5CvoiVddVUQAAAABJRU5ErkJggg==" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 28"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAC2SURBVDhPXcjBCcBAAITA9N/0BbNwDPGlPpfzcf13wp54wp54wp54wp54wp54wp54wp54wp54wp54wp54wp54wp54wp54wp54wp54wp54wp54wp54wp54wp54wp54wp54wp54wp54wp54wp54wp54wp54wp54wp54wp54wp54wp54wp54wp54wp54wp54wp54wp54wp54wp54wp54wp54wp54wp54wp54wp54wp54wp54wp7U57wLsPoiIww3uwAAAABJRU5ErkJggg==" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 29"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAACoSURBVDhPXcixCcAAEMSw7L/0h0shTFwZPbqv35NF+2TRPlm0Txbtk0X7ZNE+WbRPFu2TRftk0T5ZtE8W7ZNF+2TRPlm0Txbtk0X7ZNE+WbRPFu2TRftk0T5ZtE8W7ZNF+2TRPlm0Txbtk0X7ZNE+WbRPFu2TRftk0T5ZtE8W7ZNF+2TRPlm0Txbtk0X7ZNE+WbRPFu2TRftk0T5ZtE8W7ZNF+2TR/t291PT6IiGD028AAAAASUVORK5CYII=" width="11" height="{$barcodeHeight}"/></xsl:when>
			
			<xsl:when test="$code = 30"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAAuSURBVDhP7YohDgAgAIT8/6fPwEhGKyTYOLDtFSA7hOwQskPIDiE7hOwQ8ufYLkJd+iK/9jbIAAAAAElFTkSuQmCC" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 31"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAAxSURBVDhP7YqxDQAgAIP8/+k6EHzAFSZIOLDtCbxEOkykw0Q6TKTDRDpMpMNEfo7tAmea+iLhoFOOAAAAAElFTkSuQmCC" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 32"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAAtSURBVDhPY4CA/zAA56IxRlWgMkZVoDJGVaAyRlWgMkZVoDJGVaAyKFHx/z8AjNf6IsKVWJkAAAAASUVORK5CYII=" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 33"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAA2SURBVDhP7YoxEgAwCML6/09TBSY2dzLohcsbAOiKnUL15MNOLVoQS04tWhBLTi1aEEtOhwL47bwrDn/PgokAAAAASUVORK5CYII=" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 34"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAAzSURBVDhP7YohDgAgEID8/6dPGTPYjZAYYx3mopPe2NEBOqkDdFIH6KQO0EkdoJO+HjMbgGIrDsiP800AAAAASUVORK5CYII=" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 35"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAACjSURBVDhPXcfBEYAwAIRA+2866uzlAx/g+TiXtJ2QthPSdkLaTkjbCWk7IW0npO2EtJ2QthPSdkLaTkjbCWk7IW0npO2EtJ2QthPSdkLaTkjbCWk7IW0npO2EtJ2QthPSdkLaTkjbCWk7IW0npO2EtJ2QthPSdkLaTkjbCWk7IW0npO2EtJ2QthPSdkLaTkjbCWk7IW0npO2EtJ2QthPS/57zAqWfKw4lR3rOAAAAAElFTkSuQmCC" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 36"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAAxSURBVDhP7cohAgAwDMLA/f/TbC0o7GwwnMh5kzS38MoUFIFXpqAIvDIFReCVPwvpApHSKw6odRI+AAAAAElFTkSuQmCC" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 37"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAAvSURBVDhPYwCC/zAA4oC56IJQ5qgKIIAKQQCIM6piVMWoChAAcUZVjKqgs4r//wG3DysONTksLgAAAABJRU5ErkJggg==" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 38"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAABCSURBVDhP7YrBDcAwEMKy/9KXBiuPeoNI+IEwYn3M5chfyT4C3ZOU7CPQPUnJPgLdk5TsI9A9Sck+At2TlHziMbMBSbUrDnki2W8AAAAASUVORK5CYII=" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 39"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAADPSURBVDhPXcjBCQBBEALByz/pOaUeC9ZDGj/uzjJdyhXTpVwxXcoV06VcMV3KFdOlXDFdyhXTpVwxXcoV06VcMV3KFdOlXDFdyhXTpVwxXcoV06VcMV3KFdOlXDFdyhXTpVwxXcoV06VcMV3KFdOlXDFdyhXTpVwxXcoV06VcMV3KFdOlXDFdyhXTpVwxXcoV06VcMV3KFdOlXDFdyhXTpVwxXcoV06VcMV3KFdOlXDFdyhXTpVwxXcoV06VcMV3KFdOlXDFdyhXTpVzx+u4HyH8rDlZPpH4AAAAASUVORK5CYII=" width="11" height="{$barcodeHeight}"/></xsl:when>
			
			<xsl:when test="$code = 40"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAA4SURBVDhP7YqxAQAgDML8/2lEUhdXVzKVJgt04X4+h1kt4lswTXwLpolvwTTxLZgmvgXTxH8V0gZbJSsOUa1MPgAAAABJRU5ErkJggg==" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 41"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAA2SURBVDhP7YqxDQAwDIP6/9OpBeqUsauZkODIPLbTewSd3iPo9B5Bp/cIOr1H0Ok9gk7/OmYu7bwrDruDQ/YAAAAASUVORK5CYII=" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 42"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAA6SURBVDhP7YqxAQAgDML8/2ksmKGzM1laIGeQ5LOeYf4HIWWNGpDVEFLWqAFZDSFljRqQ1RBS/hnSBdT0+iLiHA0HAAAAAElFTkSuQmCC" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 43"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAEnSURBVDhPPclBEgBADAHB/f+nsxilL0Ge3J1PAqjSvClfo0rzpnyNKs2b8jWqNG/K16jSvClfo0rzpnyNKs2b8jWqNG/K16jSvClfo0rzpnyNKs2b8jWqNG/K16jSvClfo0rzpnyNKs2b8jWqNG/K16jSvClfo0rzpnyNKs2b8jWqNG/K16jSvClfo0rzpnyNKs2b8jWqNG/K16jSvClfo0rzpnyNKs2b8jWqNG/K16jSvClfo0rzpnyNKs2b8jWqNG/K16jSvClfo0rzpnyNKs2b8jWqNG/K16jSvClfo0rzpnyNKs2b8jWqNG/K16jSvClfo0rzpnyNKs2b8jWqNG/K16jSvClfo0rzpnyNKs2b8jWqNG/K16jSvClfo0rzpnyNKnf3AYzX+iJcTrvgAAAAAElFTkSuQmCC" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 44"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAA7SURBVDhP7YqxAQAgDIP8/+lYUA9wD1MLWUMePL7nGO5tBWUXVlB2YQVlF1ZQdmEFZRdWUHZhBeXvItmyFPoi5EQnfQAAAABJRU5ErkJggg==" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 45"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAEOSURBVDhPPYlBEoAAEIL6/6e3IAcuoj4fd0dI/snPiiPkvrDiCLkvrDhC7gsrjpD7wooj5L6w4gi5L6w4Qu4LK46Q+8KKI+S+sOIIuS+sOELuCyuOkPvCiiPkvrDiCLkvrDhC7gsrjpD7wooj5L6w4gi5L6w4Qu4LK46Q+8KKI+S+sOIIuS+sOELuCyuOkPvCiiPkvrDiCLkvrDhC7gsrjpD7wooj5L6w4gi5L6w4Qu4LK46Q+8KKI+S+sOIIuS+sOELuCyuOkPvCiiPkvrDiCLkvrDhC7gsrjpD7wooj5L6w4gi5L6w4Qu4LK46Q+8KKI+S+sOIIuS+sOELuCyuOkPvCiiPkvrDiCLnv3d0LC7D6IkKWeSkAAAAASUVORK5CYII=" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 46"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAADYSURBVDhPTcnBDcQAEMLA67/pvdiJkOcDiN/j7gg9/bWZkC82E/LFZkK+2EzIF5sJ+WIzIV9sJuSLzYR8sZmQLzYT8sVmQr7YTMgXmwn5YjMhX2wm5IvNhHyxmZAvNhPyxWZCvthMyBebCfliMyFfbCbki82EfLGZkC82E/LFZkK+2EzIF5sJ+WIzIV9sJuSLzYR8sZmQLzYT8sVmQr7YTMgXmwn5YjMhX2wm5IvNhHyxmZAvNhPyxWZCvthMyBebCfliMyFfbCbki82EfLGZkC82E/LFN+/+MO36IsedAuUAAAAASUVORK5CYII=" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 47"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAEASURBVDhPPclBEoAADINA///pKkxkTzR9PvfjUL3wC0fUC79wRL3wC0fUC79wRL3wC0fUC79wRL3wC0fUC79wRL3wC0fUC79wRL3wC0fUC79wRL3wC0fUC79wRL3wC0fUC79wRL3wC0fUC79wRL3wC0fUC79wRL3wC0fUC79wRL3wC0fUC79wRL3wC0fUC79wRL3wC0fUC79wRL3wC0fUC79wRL3wC0fUC79wRL3wC0fUC79wRL3wC0fUC79wRL3wC0fUC79wRL3wC0fUC79wRL3wC0fUC79wRL3wC0fUC79wRL3wC0fUC79wRL3wC0fUC79wRL3wC0fUC79wRH13L+jB+iJ69fv4AAAAAElFTkSuQmCC" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 48"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAArSURBVDhPY4CD////Q1lIbGTBURWjKqBgVMWoCmQGCIyqGFUBAfRW8f8/AOFpyUWfTfHuAAAAAElFTkSuQmCC" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 49"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAEOSURBVDhPRcnBDQAwDMLA7r90avCDe0QWebo7rxyxtvoNR6ytfsMRa6vfcMTa6jccsbb6DUesrX7DEWur33DE2uo3HLG2+g1HrK1+wxFrq99wxNrqNxyxtvoNR6ytfsMRa6vfcMTa6jccsbb6DUesrX7DEWur33DE2uo3HLG2+g1HrK1+wxFrq99wxNrqNxyxtvoNR6ytfsMRa6vfcMTa6jccsbb6DUesrX7DEWur33DE2uo3HLG2+g1HrK1+wxFrq99wxNrqNxyxtvoNR6ytfsMRa6vfcMTa6jccsbb6DUesrX7DEWur33DE2uo3HLG2+g1HrK1+wxFrq99wxNrqNxyxtvoNR6ytfsMRd/cBw4T6IiYFQ/cAAAAASUVORK5CYII=" width="11" height="{$barcodeHeight}"/></xsl:when>
			
			<xsl:when test="$code = 50"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAEGSURBVDhPRcnBDcBAEMLA9N/0xmCdmJcFn+6xHbHuG7Yj1n3DdsS6b9iOWPcN2xHrvmE7Yt03bEes+4btiHXfsB2x7hu2I9Z9w3bEum/Yjlj3DdsR675hO2LdN2xHrPuG7Yh137Adse4btiPWfcN2xLpv2I5Y9w3bEeu+YTti3TdsR6z7hu2Idd+wHbHuG7Yj1n3DdsS6b9iOWPcN2xHrvmE7Yt03bEes+4btiHXfsB2x7hu2I9Z9w3bEum/Yjlj3DdsR675hO2LdN2xHrPuG7Yh137Adse4btiPWfcN2xLpv2I5Y9w3bEeu+YTti3TdsR6z7hu2Idd+wHbHuG7Yj1n3DdsTd/VYq+iJENo2YAAAAAElFTkSuQmCC" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 51"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAAzSURBVDhP7YrBCQAxAINu/6VzBesE/eojBPGDbff5zwKyQpAVgqwQZIUgKwRZIciXYvsBeQr6IgY/jHEAAAAASUVORK5CYII=" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 52"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAA1SURBVDhP7YrBDQAwEIK6/9I2ihvcV15EeSCpFgecccWKktfgjCtWlLwGZ1yxouQ1OOOlkD4LsPoisb71OgAAAABJRU5ErkJggg==" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 53"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAAsSURBVDhPY4CA////Q1m42KMqQGBUxagKVNaoClTWqApU1qgKVBYNVPz/DwB0D8lFJBaRNAAAAABJRU5ErkJggg==" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 54"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAD/SURBVDhPPYlBCgAwDIP2/093GEEPpZoXd9f1ERWU0lZQQSltBRWU0lZQQSltBRWU0lZQQSltBRWU0lZQQSltBRWU0lZQQSltBRWU0lZQQSltBRWU0lZQQSltBRWU0lZQQSltBRWU0lZQQSltBRWU0lZQQSltBRWU0lZQQSltBRWU0lZQQSltBRWU0lZQQSltBRWU0lZQQSltBRWU0lZQQSltBRWU0lZQQSltBRWU0lZQQSltBRWU0lZQQSltBRWU0lZQQSltBRWU0lZQQSltBRWU0lZQQSltBRWU0lZQQSltBRWU0lZQQSltBRWU0lZQQSltBRWU0lZQQSltvbv7eQr6IqDk8IwAAAAASUVORK5CYII=" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 55"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAADuSURBVDhPTcnBCQBBEALByz/pObSbxXoI6vfcHYkdRekbO4rSN3YUpW/sKErf2FGUvrGjKH1jR1H6xo6i9I0dRekbO4rSN3YUpW/sKErf2FGUvrGjKH1jR1H6xo6i9I0dRekbO4rSN3YUpW/sKErf2FGUvrGjKH1jR1H6xo6i9I0dRekbO4rSN3YUpW/sKErf2FGUvrGjKH1jR1H6xo6i9I0dRekbO4rSN3YUpW/sKErf2FGUvrGjKH1jR1H6xo6i9I0dRekbO4rSN3YUpW/sKErf2FGUvrGjKH1jR1H6xo6i9I0dRekbO4rSNxzvfp5H+iLDNuZhAAAAAElFTkSuQmCC" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 56"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAD5SURBVDhPPcnBEYAAEINA+2/6HIKyLyZ5cj+70cBe2I0G9sJuNLAXdqOBvbAbDeyF3WhgL+xGA3thNxrYC7vRwF7YjQb2wm40sBd2o4G9sBsN7IXdaGAv7EYDe2E3GtgLu9HAXtiNBvbCbjSwF3ajgb2wGw3shd1oYC/sRgN7YTca2Au70cBe2I0G9sJuNLAXdqOBvbAbDeyF3WhgL+xGA3thNxrYC7vRwF7YjQb2wm40sBd2o4G9sBsN7IXdaGAv7EYDe2E3GtgLu9HAXtiNBvbCbjSwF3ajgb2wGw3shd1oYC/sRgN7YTca2Au70cBe2I0G9sL+xrsXMO36Isaa3d4AAAAASUVORK5CYII=" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 57"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAEOSURBVDhPTYnBDcAAEIK6/9LXIgkpD4P6xN395UtxhIqyFxyhouwFR6goe8ERKspecISKshccoaLsBUeoKHvBESrKXnCEirIXHKGi7AVHqCh7wREqyl5whIqyFxyhouwFR6goe8ERKspecISKshccoaLsBUeoKHvBESrKXnCEirIXHKGi7AVHqCh7wREqyl5whIqyFxyhouwFR6goe8ERKspecISKshccoaLsBUeoKHvBESrKXnCEirIXHKGi7AVHqCh7wREqyl5whIqyFxyhouwFR6goe8ERKspecISKshccoaLsBUeoKHvBESrKXnCEirIXHKGi7AVHqCh7wREqyl5whIqyFxyhouy9u3sBr7f6Igm9BoEAAAAASUVORK5CYII=" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 58"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAADhSURBVDhPTcnJCQBBEMPAzT/pXuQBoXr5+HR3hqcjLHvREZa96AjLXnSEZS86wrIXHWHZi46w7EVHWPaiIyx70RGWvegIy150hGUvOsKyFx1h2YuOsOxFR1j2oiMse9ERlr3oCMtedIRlLzrCshcdYdmLjrDsRUdY9qIjLHvREZa96AjLXnSEZS86wrIXHWHZi46w7EVHWPaiIyx70RGWvegIy150hGUvOsKyFx1h2YuOsOxFR1j2oiMse9ERlr3oCMtedIRlLzrCshcdYdmLjrDsRUdY9qIjLHvREZa9IN/9Ql36ItvE898AAAAASUVORK5CYII=" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 59"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAADHSURBVDhPPclBCgBBEAKx/f+ne1Gc5FAgftxj6vQNU6dvmDp9w9TpG6ZO3zB1+oap0zdMnb5h6vQNU6dvmDp9w9TpG6ZO3zB1+oap0zdMnb5h6vQNU6dvmDp9w9TpG6ZO3zB1+oap0zdMnb5h6vQNU6dvmDp9w9TpG6ZO3zB1+oap0zdMnb5h6vQNU6dvmDp9w9TpG6ZO3zB1+oap0zdMnb5h6vQNU6dvmDp9w9TpG6ZO3zB1+oap0zdMnb5h6vQNU6dvmOndD2ea+iIunjDaAAAAAElFTkSuQmCC" width="11" height="{$barcodeHeight}"/></xsl:when>
			
			<xsl:when test="$code = 60"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAApSURBVDhPY4CD////Q1lgAOGiCI6qGFUBB6MqRlWMqoCBURUDqOL/fwAYJclFMxVUcAAAAABJRU5ErkJggg==" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 61"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAA3SURBVDhP7YqxDQAwAIL6/9PWQNIHusqkgSOBN8SLX1G8+BXFi19RvPgVxYtfUbz4FcWL/yqSCyR4Kw5tjw/JAAAAAElFTkSuQmCC" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 62"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAADVSURBVDhPTclBCsAAEMLA/v/TW2Kodg5B8Pm7j7udvHC3kxfudvLC3U5euNvJC3c7eeFuJy/c7eSFu528cLeTF+528sLdTl6428kLdzt54W4nL9zt5IW7nbxwt5MX7nbywt1OXrjbyQt3O3nhbicv3O3khbudvHC3kxfudvLC3U5euNvJC3c7eeFuJy/c7eSFu528cLeTF+528sLdTl6428kLdzt54W4nL9zt5IW7nbxwt5MX7nbywt1OXrjbyQt3O3nhbicv3O3khbudvHC3kxduevcCC7D6Iq+f8nQAAAAASUVORK5CYII=" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 63"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAA4SURBVDhP7Yq5DQAwEMKy/9IkiKdPj4vTGfk8AOjq6S/sXekrVgR7V/qKFcHelb5iRbB3pf8VwAVbJSsOtbNJZwAAAABJRU5ErkJggg==" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 64"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAA4SURBVDhP7YqxDQAwCMP6/9NpLShZOSAeELF8HpLqDthv+ptdYFMYbAqDTWGwKQw2hcGmMNhtIV2AYisOAo/1MAAAAABJRU5ErkJggg==" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 65"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAA2SURBVDhP7YoxEgAgDIP8/6ejtfSc3ckEOdZZ7hrK5+k9byi3gHALCLeAcAsIt4BwCwj/K5INJHgrDiZsdngAAAAASUVORK5CYII=" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 66"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAA5SURBVDhP7YrBEQAgDMLcf2k0xZOvA5BPuSbroOENg5jPPV4eBtEiIFoERIuAaBEQLQKiRUB8FdIG3EwrDuVieEkAAAAASUVORK5CYII=" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 67"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAA7SURBVDhP7YrBDQAgEIPcf+kqIeZ8OkB5FdJ1yINKvX2WqNQ+QKX2ASq1D1CpfYBK7QNUah+gUn8fyQbcTCsO+kWOsgAAAABJRU5ErkJggg==" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 68"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAA4SURBVDhP7YrBDQAgEMLcf2kUuTQ+HYB+gNB10APTx+0TwPRRo0YCmD5q1EgA00eNGglg+vgypA1u8isOlZM9jQAAAABJRU5ErkJggg==" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 69"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAA6SURBVDhP7YqxDQAgAML8/2mkwgXOdClJOUYSeiM7IzSgPUwD2sM0oD1MA9rDNKA9TAPawzSgz4d0Ach/Kw7eAWhOAAAAAElFTkSuQmCC" width="11" height="{$barcodeHeight}"/></xsl:when>
			
			<xsl:when test="$code = 70"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAA3SURBVDhP7YqxDQAwDML6/9M0NMgHdIYFI3wmklwPCDOHq8ZCjRoBwszhqrFQo0aAMHO4Pg3pAlslKw5OPIVrAAAAAElFTkSuQmCC" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 71"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAA1SURBVDhP7cqxDQAgDMRA9l86QDhlAOp3ZVleh2qutU95qCyHynKoLIfKcqgsh8pyqOznqNpbJSsOIoUfPgAAAABJRU5ErkJggg==" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 72"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAA2SURBVDhP7YoxDgAgEIP8/6ereDHszu1ECessd9Dj2Vwt1EILtdBCLbRQCy3UQgu10EI/RbIBtw8rDkudv70AAAAASUVORK5CYII=" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 73"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAA0SURBVDhP7YoxDgAgDIT8/6drMabn6g4bhNXUA37K9OsD7hFwj4B7BNwj4B4B9wj431G1ARMIKw44CUNtAAAAAElFTkSuQmCC" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 74"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAA0SURBVDhP7YoxDgAgEIP8/6er5GJwdS9TaViHPOD3maEPeAvBWwjeQvAWgrcQvIXgf0WyAdxMKw6YQ3CeAAAAAElFTkSuQmCC" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 75"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAAzSURBVDhP7YoxCgAwDIT6/0+nYEC6d/UmDz27eeZdwFcI+AoBXyHgKwR8hYCvEPBfxcwFtw8rDkqTE3AAAAAASUVORK5CYII=" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 76"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAAxSURBVDhP7YrBCQAwEIO6/9IpGHCB+8ZXgr4S6PAW/ArBrxD8CsGvEPwKwa8Q/KlIPsh/Kw76i5dZAAAAAElFTkSuQmCC" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 77"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAApSURBVDhPY0AG////h7JgbGQREBhVMaoCAkZVjKoYVQEDoyoGUMX//wBO0slFJYlhCgAAAABJRU5ErkJggg==" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 78"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAAzSURBVDhP7YoxCgAwDIT6/0+nYEC6d/W2U89unu0V4iuE+AohvkKIrxDiK4T4CiH+q5i57bwrDnNfueUAAAAASUVORK5CYII=" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 79"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAEFSURBVDhPNcnBAcBAEILA9N/05lCZH/o9J0LNjXlBqLkxLwg1N+YFoebGvCDU3JgXhJob84JQc2NeEGpuzAtCzY15Qai5MS8INTfmBaHmxrwg1NyYF4SaG/OCUHNjXhBqbswLQs2NeUGouTEvCDU35gWh5sa8INTcmBeEmhvzglBzY14Qam7MC0LNjXlBqLkxLwg1N+YFoebGvCDU3JgXhJob84JQc2NeEGpuzAtCzY15Qai5MS8INTfmBaHmxrwg1NyYF4SaG/OCUHNjXhBqbswLQs2NeUGouTEvCDU35gWh5sa8INTcmBeEmhvzglBzY14Qam7MC0LNjXlBqLkxLwg17+4HH336IvmzQQgAAAAASUVORK5CYII=" width="11" height="{$barcodeHeight}"/></xsl:when>
			
			<xsl:when test="$code = 80"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAACsSURBVDhPRcjBDcMADMPA7L+004JQjg/L5PPj7ro9H0rDh9LwoTR8KA0fSsOH0vChNHwoDR9Kw4fS8KE0fCgNH0rDh9LwoTR8KA0fSsOH0vChNHwoDR9Kw4fS8KE0fCgNH0rDh9LwoTR8KA0fSsOH0vChNHwoDR9Kw4fS8KE0fCgNH0rDh9LwoTR8KA0fSsOH0vChNHwoDR9Kw4fS8KE0fCgNH0rDh9Lw8fe7F8OE+iKL7HYOAAAAAElFTkSuQmCC" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 81"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAAySURBVDhP7YrBDQAgEIPcf+mqmGMBv+XVEtYh8Mb9g74F6FuAvgXoW4C+BehbgP6zSDaM1/oiztgPtwAAAABJRU5ErkJggg==" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 82"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAACcSURBVDhPTcnBCQAxAITA67/pTQgynC/F77LHX1AaBKVBUBoEpUFQGgSlQVAaBKVBUBoEpUFQGgSlQVAaBKVBUBoEpUFQGgSlQVAaBKVBUBoEpUFQGgSlQVAaBKVBUBoEpUFQGgSlQVAaBKVBUBoEpUFQGgSlQVAaBKVBUBoEpUFQGgSlQVAaBKVBUBoEpUFQGgSlQVAaBKVBsO0AshT6IiI8UfcAAAAASUVORK5CYII=" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 83"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAAzSURBVDhP7YrBEQAgDIPcf+lYz5MM4Bc+UsMakpznMef9QSwsCgNiYVEYEAuLwoB8FskGC7D6Im/GHaoAAAAASUVORK5CYII=" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 84"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAACqSURBVDhPRcjBEYAwAIRA+286Gm+Y5QU8H+fnWix9FkufxdJnsfRZLH0WS5/F0mex9FksfRZLn8XSZ7H0WSx9FkufxdJnsfRZLH0WS5/F0mex9FksfRZLn8XSZ7H0WSx9FkufxdJnsfRZLH0WS5/F0mex9FksfRZLn8XSZ7H0WSx9FkufxdJnsfRZLH0WS5/F0mex9FksfRZLn8XSZ7H0WSx9FkufxfLec14w7foiq87mBwAAAABJRU5ErkJggg==" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 85"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAACcSURBVDhPPcjJEQAgEMMw+m96OcbIr0TrNK+7fiT3RXJfJPdFcl8k90VyXyT3RXJfJPdFcl8k90VyXyT3RXJfJPdFcl8k90VyXyT3RXJfJPdFcl8k90VyXyT3RXJfJPdFcl8k90VyXyT3RXJfJPdFcl8k90VyXyT3RXJfJPdFcl8k90VyXyT3RXJfJPdFcl8k90VyXyT3RXJfZGY2+jH6ItE1OC4AAAAASUVORK5CYII=" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 86"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAACQSURBVDhPXYlBCsAwAIP6/0+njIEWPSSC52XbvxFJQCQBkQREEhBJQCQBkQREEhBJQCQBkQREEhBJQCQBkQREEhBJQCQBkQREEhBJQCQBkQREEhBJQCQBkQREEhBJQCQBkQREEhBJQCQBkQREEhBJQCQBkQREEhBJQCQBkQREEhBJQCQBkQREEhBJQCThu+0Cr7f6InijmDYAAAAASUVORK5CYII=" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 87"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAACpSURBVDhPTchBCoAAEMNA///pFQxMzSG0ef7cR+N/h8SNIXFjSNwYEjeGxI0hcWNI3BgSN4bEjSFxY0jcGBI3hsSNIXFjSNwYEjeGxI0hcWNI3BgSN4bEjSFxY0jcGBI3hsSNIXFjSNwYEjeGxI0hcWNI3BgSN4bEjSFxY0jcGBI3hsSNIXFjSNwYEjeGxI0hcWNI3BgSN4bEjSFxY0jcGBI3hsSNIfHdvXkK+iKhvETjAAAAAElFTkSuQmCC" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 88"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAC1SURBVDhPXcnBCcAAEITA9N/0BSQuEl/CPO3oN4gVNogVNogVNogVNogVNogVNogVNogVNogVNogVNogVNogVNogVNogVNogVNogVNogVNogVNogVNogVNogVNogVNogVNogVNogVNogVNogVNogVNogVNogVNogVNogVNogVNogVNogVNogVNogVNogVNogVNogVNogVNogVNogVNogVNogVNogVNogVNogVNogVNogVvrl7AUJd+iLf6HiFAAAAAElFTkSuQmCC" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 89"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAAtSURBVDhPY4CA////ozEgAMEdVQECoypGVaCwRlWgskZVoLJGVaCyaKHi/38APWLJRfVZTRQAAAAASUVORK5CYII=" width="11" height="{$barcodeHeight}"/></xsl:when>
			
			<xsl:when test="$code = 90"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAAwSURBVDhP7coxCgAgEMRA///pCCpKattslTtm7AGn1u75/glFwpFwJBwJR8LxI2ACqrzJRYC4FxAAAAAASUVORK5CYII=" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 91"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAAsSURBVDhP7cohAgAwDIPA/f/TzERUpKYaFOLeDNgmKRR1kkJRJykUddJJwAcYJclF+SmbiQAAAABJRU5ErkJggg==" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 92"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAADKSURBVDhPPcnBDYAAEAJB+2/6FCQzj00Iz+fulG/+NpS+saH0jQ2lb2wofWND6RsbSt/YUPrGhtI3NpS+saH0jQ2lb2wofWND6RsbSt/YUPrGhtI3NpS+saH0jQ2lb2wofWND6RsbSt/YUPrGhtI3NpS+saH0jQ2lb2wofWND6RsbSt/YUPrGhtI3NpS+saH0jQ2lb2wofWND6RsbSt/YUPrGhtI3NpS+saH0jQ2lb2wofWND6RsbSt/YUPrGhtI3NpS+saH0vbt7AZ5H+iIlkkAIAAAAAElFTkSuQmCC" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 93"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAEUSURBVDhPNcnBEcBADMLA9N+0c0KwDzPg77k7r5im1cgXTNNq5AumaTXyBdO0GvmCaVqNfME0rUa+YJpWI18wTauRL5im1cgXTNNq5AumaTXyBdO0GvmCaVqNfME0rUa+YJpWI18wTauRL5im1cgXTNNq5AumaTXyBdO0GvmCaVqNfME0rUa+YJpWI18wTauRL5im1cgXTNNq5AumaTXyBdO0GvmCaVqNfME0rUa+YJpWI18wTauRL5im1cgXTNNq5AumaTXyBdO0GvmCaVqNfME0rUa+YJpWI18wTauRL5im1cgXTNNq5AumaTXyBdO0GvmCaVqNfME0rUa+YJpWI18wTauRL5im1cgXTNNq5Aumubsf6MH6IurWr58AAAAASUVORK5CYII=" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 94"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAADnSURBVDhPRcnJEYAAEAJB8096dZAp+sXxfE5/ZlJrXmxSa15sUmtebFJrXmxSa15sUmtebFJrXmxSa15sUmtebFJrXmxSa15sUmtebFJrXmxSa15sUmtebFJrXmxSa15sUmtebFJrXmxSa15sUmtebFJrXmxSa15sUmtebFJrXmxSa15sUmtebFJrXmxSa15sUmtebFJrXmxSa15sUmtebFJrXmxSa15sUmtebFJrXmxSa15sUmtebFJrXmxSa15sUmtebFJrXmxSa15sUmtebFJrXmxSa15sUmtebFJrXmxSa15s0t29e2f6IuVHFBMAAAAASUVORK5CYII=" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 95"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAADrSURBVDhPRcnBDcAADMLA7r90WrBq7pEIeD53l/cjfherROwaq0TsGqtE7BqrROwaq0TsGqtE7BqrROwaq0TsGqtE7BqrROwaq0TsGqtE7BqrROwaq0TsGqtE7BqrROwaq0TsGqtE7BqrROwaq0TsGqtE7BqrROwaq0TsGqtE7BqrROwaq0TsGqtE7BqrROwaq0TsGqtE7BqrROwaq0TsGqtE7BqrROwaq0TsGqtE7BqrROwaq0TsGqtE7BqrROwaq0TsGqtE7BqrROwaq0TsGqtE7BqrROwaq0TsGqtE7BqrROwaq0Tsenf3AkJd+iKfRTCHAAAAAElFTkSuQmCC" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 96"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAEUSURBVDhPNcnBAcAwDMLA7r+0GyG4Dxh/z90R807ZOxGTL+ydiMkX9k7E5At7J2Lyhb0TMfnC3omYfGHvREy+sHciJl/YOxGTL+ydiMkX9k7E5At7J2Lyhb0TMfnC3omYfGHvREy+sHciJl/YOxGTL+ydiMkX9k7E5At7J2Lyhb0TMfnC3omYfGHvREy+sHciJl/YOxGTL+ydiMkX9k7E5At7J2Lyhb0TMfnC3omYfGHvREy+sHciJl/YOxGTL+ydiMkX9k7E5At7J2Lyhb0TMfnC3omYfGHvREy+sHciJl/YOxGTL+ydiMkX9k7E5At7J2Lyhb0TMfnC3omYfGHvREy+sHciJl/YOxGTL+ydiMkX9Lsf1PT6Ismta3gAAAAASUVORK5CYII=" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 97"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAADJSURBVDhPTclBCoAAEMNA///pFRsSnEOg9Pm7u3+xR+yKPWJX7BG7Yo/YFXvErtgjdsUesSv2iF2xR+yKPWJX7BG7Yo/YFXvErtgjdsUesSv2iF2xR+yKPWJX7BG7Yo/YFXvErtgjdsUesSv2iF2xR+yKPWJX7BG7Yo/YFXvErtgjdsUesSv2iF2xR+yKPWJX7BG7Yo/YFXvErtgjdsUesSv2iF2xR+yKPWJX7BG7Yo/YFXvErtgjdsUesSv2iF2xR+yKPWLXz90L5mT6It1UrTQAAAAASUVORK5CYII=" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 98"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAACXSURBVDhPTcjBCcAAEMOw7r/0lWJQqkcIfv7uro0yapRRo4waZdQoo0YZNcqoUUaNMmqUUaOMGmXUKKNGGTXKqFFGjTJqlFGjjBpl1CijRhk1yqhRRo0yapRRo4waZdQoo0YZNcqoUUaNMmqUUaOMGmXUKKNGGTXKqFFGjTJqlFGjjBpl1CijRhk1yqhRRo0yapRR8/27F3kK+iL1YAK1AAAAAElFTkSuQmCC" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 99"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAIAAADO52WxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAArSURBVDhPYwCC////gygwQGYDAZQ7qgIKRlWMqhhVAQOjKkZVDAIV//8DAAa1yUXFCdpnAAAAAElFTkSuQmCC" width="11" height="{$barcodeHeight}"/></xsl:when>
			<!-- trzy kody do zastosowania wyłącznie na potrzeby sumy kontrolnej -->
			<xsl:when test="$code = 100"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAYAAABBhfLmAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAA9SURBVEhL7coxCgAgDATBU1Lk/69NISiCxWKl/U2VHNuix6xRykjRve2/n/uJY3JMjskxOSbH5Jgc00csLTttClsiEU5TAAAAAElFTkSuQmCC" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 101"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAYAAABBhfLmAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAA7SURBVEhL7cpBCgAhDEPRxPvfOY4i8pfOPg9KS/mWlG+2JLJ9N63fOPeTxtSYGlNjakyNqTE1ph+xNAFsAApiqVFIuQAAAABJRU5ErkJggg==" width="11" height="{$barcodeHeight}"/></xsl:when>
			<xsl:when test="$code = 102"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAzCAYAAABBhfLmAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAA6SURBVEhL7cpBCgAgDAPB1P//OSpoyVHvO1DawpYkr2m2VVW9r/2Pcz8hTsSJOBEn4kSciBNx+oilCVQACmJAOOSrAAAAAElFTkSuQmCC" width="11" height="{$barcodeHeight}"/></xsl:when>
		</xsl:choose>
	</xsl:template>
	
	
	<!-- ++++++++++++++ obsługa dat ++++++++++++++++ -->
	
	<xsl:template name="translateMonthShortVariant">
		<xsl:param name="monthNo"/>
		
		<xsl:choose>
			<xsl:when test="$monthNo = 1">
				<xsl:text>01</xsl:text>
			</xsl:when>
			<xsl:when test="$monthNo = 2">
				<xsl:text>02</xsl:text>
			</xsl:when>
			<xsl:when test="$monthNo = 3">
				<xsl:text>03</xsl:text>
			</xsl:when>
			<xsl:when test="$monthNo = 4">
				<xsl:text>04</xsl:text>
			</xsl:when>
			<xsl:when test="$monthNo = 5">
				<xsl:text>05</xsl:text>
			</xsl:when>
			<xsl:when test="$monthNo = 6">
				<xsl:text>06</xsl:text>
			</xsl:when>
			<xsl:when test="$monthNo = 7">
				<xsl:text>07</xsl:text>
			</xsl:when>
			<xsl:when test="$monthNo = 8">
				<xsl:text>08</xsl:text>
			</xsl:when>
			<xsl:when test="$monthNo = 9">
				<xsl:text>09</xsl:text>
			</xsl:when>
			<xsl:when test="$monthNo = 10">
				<xsl:text>10</xsl:text>
			</xsl:when>
			<xsl:when test="$monthNo = 11">
				<xsl:text>11</xsl:text>
			</xsl:when>
			<xsl:when test="$monthNo = 12">
				<xsl:text>12</xsl:text>
			</xsl:when>
			<xsl:otherwise>
				<xsl:text>(miesiąc nieznany)</xsl:text>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	
	<xsl:template name="translateMonthVariant">
		<xsl:param name="monthNo"/>
		
		<xsl:choose>
			<xsl:when test="$monthNo = 1">
				<xsl:text>stycznia</xsl:text>
			</xsl:when>
			<xsl:when test="$monthNo = 2">
				<xsl:text>lutego</xsl:text>
			</xsl:when>
			<xsl:when test="$monthNo = 3">
				<xsl:text>marca</xsl:text>
			</xsl:when>
			<xsl:when test="$monthNo = 4">
				<xsl:text>kwietnia</xsl:text>
			</xsl:when>
			<xsl:when test="$monthNo = 5">
				<xsl:text>maja</xsl:text>
			</xsl:when>
			<xsl:when test="$monthNo = 6">
				<xsl:text>czerwca</xsl:text>
			</xsl:when>
			<xsl:when test="$monthNo = 7">
				<xsl:text>lipca</xsl:text>
			</xsl:when>
			<xsl:when test="$monthNo = 8">
				<xsl:text>sierpnia</xsl:text>
			</xsl:when>
			<xsl:when test="$monthNo = 9">
				<xsl:text>września</xsl:text>
			</xsl:when>
			<xsl:when test="$monthNo = 10">
				<xsl:text>października</xsl:text>
			</xsl:when>
			<xsl:when test="$monthNo = 11">
				<xsl:text>listopada</xsl:text>
			</xsl:when>
			<xsl:when test="$monthNo = 12">
				<xsl:text>grudnia</xsl:text>
			</xsl:when>
			<xsl:otherwise>
				<xsl:text>(miesiąc nieznany)</xsl:text>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	
	<xsl:template name="translateMonth">
		<xsl:param name="monthNo"/>
		
		<xsl:choose>
			<xsl:when test="$monthNo = 1">
				<xsl:text>styczeń</xsl:text>
			</xsl:when>
			<xsl:when test="$monthNo = 2">
				<xsl:text>luty</xsl:text>
			</xsl:when>
			<xsl:when test="$monthNo = 3">
				<xsl:text>marzec</xsl:text>
			</xsl:when>
			<xsl:when test="$monthNo = 4">
				<xsl:text>kwiecień</xsl:text>
			</xsl:when>
			<xsl:when test="$monthNo = 5">
				<xsl:text>maj</xsl:text>
			</xsl:when>
			<xsl:when test="$monthNo = 6">
				<xsl:text>czerwiec</xsl:text>
			</xsl:when>
			<xsl:when test="$monthNo = 7">
				<xsl:text>lipiec</xsl:text>
			</xsl:when>
			<xsl:when test="$monthNo = 8">
				<xsl:text>sierpień</xsl:text>
			</xsl:when>
			<xsl:when test="$monthNo = 9">
				<xsl:text>wrzesień</xsl:text>
			</xsl:when>
			<xsl:when test="$monthNo = 10">
				<xsl:text>październik</xsl:text>
			</xsl:when>
			<xsl:when test="$monthNo = 11">
				<xsl:text>listopad</xsl:text>
			</xsl:when>
			<xsl:when test="$monthNo = 12">
				<xsl:text>grudzień</xsl:text>
			</xsl:when>
			<xsl:otherwise>
				<xsl:text>(miesiąc nieznany)</xsl:text>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	
	<!-- formatowanie daty i czasu -->
	<xsl:template name="formatDateTimeShortVariant">
		<xsl:param name="date"/>
		
		<xsl:variable name="year" select="number(substring($date, 1, 4))"/>
		<xsl:variable name="monthIndex" select="number(substring($date, 5, 2))"/>
		<xsl:variable name="day" select="number(substring($date, 7, 2))"/>
		
		<xsl:choose>
			<xsl:when test="$day">
				<xsl:value-of select="$day"/>
				<xsl:text>.</xsl:text>
				<xsl:call-template name="translateMonthShortVariant">
					<xsl:with-param name="monthNo" select="$monthIndex"/>
				</xsl:call-template>
				<xsl:text>.</xsl:text>
				<xsl:value-of select="$year"/>
			</xsl:when>
			<xsl:otherwise>
				<xsl:if test="$monthIndex">
					<xsl:call-template name="translateMonth">
						<xsl:with-param name="monthNo" select="$monthIndex"/>
					</xsl:call-template>
					<xsl:text> </xsl:text>
				</xsl:if>
				<xsl:value-of select="$year"/>
				<!-- <xsl:text> r.</xsl:text> -->
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	
	<!-- data i czas jako @value lub hl7:high/@value i hl7:low/@value -->
	<!-- obsługa ograniczona do danych przeznaczonych do wizualizacji, brak wyświetlania szeregu atrybutów TS i IVL TS -->
	<xsl:template name="dateTimeInDiv">
		<xsl:param name="date"/>
		<xsl:param name="label"/>
		<xsl:param name="prefix" select="false()"/>
		
		<xsl:if test="$date">
			<xsl:if test="$label">
				<div class="row_label cell">
					<xsl:value-of select="$label"/>
				</div>
			</xsl:if>
			<xsl:choose>
				<xsl:when test="$date/@nullFlavor">
					<xsl:call-template name="translateNullFlavor">
						<xsl:with-param name="nullableElement" select="$date"/>
					</xsl:call-template>
				</xsl:when>
				<xsl:when test="$date/@value">
					<div class="row_value cell">
						<xsl:if test="$prefix and string-length($prefix) &gt;= 1">
							<xsl:value-of select="$prefix"/>
							<xsl:text> </xsl:text>
						</xsl:if>
						<xsl:call-template name="formatDateTime">
							<xsl:with-param name="date" select="$date/@value"/>
						</xsl:call-template>
					</div>
				</xsl:when>
				<xsl:when test="$date/hl7:low/@value and $date/hl7:high/@value">
					<div class="row_value cell">
						<xsl:call-template name="formatDateTime">
							<xsl:with-param name="date" select="$date/hl7:low/@value"/>
						</xsl:call-template>
						<xsl:text> - </xsl:text>
						<xsl:call-template name="formatDateTime">
							<xsl:with-param name="date" select="$date/hl7:high/@value"/>
						</xsl:call-template>
					</div>
				</xsl:when>
				<xsl:otherwise>
					<xsl:text> (nie podano)</xsl:text>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
	</xsl:template>
	
	<!-- formatowanie daty i czasu -->
	<xsl:template name="formatDateTime">
		<xsl:param name="date"/>
		<xsl:param name="shift" select="false()"/>
		<xsl:param name="side" select="false()"/>
		
		<xsl:variable name="year" select="number(substring($date, 1, 4))"/>
		<xsl:variable name="monthIndex" select="number(substring($date, 5, 2))"/>
		<xsl:variable name="day" select="number(substring($date, 7, 2))"/>
		<xsl:variable name="hour" select="substring($date, 9, 2)"/>
		<xsl:variable name="minute" select="substring($date, 11, 2)"/>
		<xsl:variable name="second" select="substring($date, 13, 2)"/>
		
		<xsl:choose>
			<xsl:when test="$day">
				<xsl:value-of select="$day"/>
				<xsl:text> </xsl:text>
				<xsl:call-template name="translateMonthVariant">
					<xsl:with-param name="monthNo" select="$monthIndex"/>
				</xsl:call-template>
				<xsl:text> </xsl:text>
				<xsl:value-of select="$year"/>
				<!-- <xsl:text> r.</xsl:text> -->
				
				<xsl:if test="$hour">
					<xsl:text> </xsl:text>
					<xsl:choose>
						<xsl:when test="$minute">
							<xsl:text> godz. </xsl:text>
							<xsl:choose>
								<xsl:when test="$hour = 00">
									<xsl:value-of select="$hour"/>
								</xsl:when>
								<xsl:otherwise>
									<xsl:value-of select="number($hour)"/>
								</xsl:otherwise>
							</xsl:choose>
							<xsl:text>:</xsl:text>
							<xsl:value-of select="$minute"/>
							<xsl:if test="$second">
								<xsl:text>:</xsl:text>
								<xsl:value-of select="$second"/>
							</xsl:if>
						</xsl:when>
						<xsl:otherwise>
							<xsl:text> godz. ok. </xsl:text>
							<xsl:value-of select="$hour"/>
							<xsl:text>.</xsl:text>
						</xsl:otherwise>
					</xsl:choose>
				</xsl:if>
			</xsl:when>
			<xsl:otherwise>
				<xsl:if test="$monthIndex">
					<xsl:call-template name="translateMonth">
						<xsl:with-param name="monthNo" select="$monthIndex"/>
					</xsl:call-template>
					<xsl:text> </xsl:text>
				</xsl:if>
				<xsl:value-of select="$year"/>
				<!-- <xsl:text> r.</xsl:text> -->
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	
	<!-- porównanie dat przez porównanie liczby typu 20150314 -->
	<xsl:template name="isFirstDateLaterThanSecond">
		<xsl:param name="firstDate"/>
		<xsl:param name="secondDate"/>
		
		<xsl:variable name="first" select="number(substring($firstDate, 1, 8))"/>
		<xsl:variable name="second" select="number(substring($secondDate, 1, 8))"/>

		<xsl:value-of select="$first &gt; $second"/>
	</xsl:template>
	
	<!-- znane węzły OID -->
	<xsl:template name="translateOID">
		<xsl:param name="oid"/>
		<xsl:param name="functionCode"/>		
		<xsl:choose>
			<!--<xsl:when test="$oid='2.16.840.1.113883.3.4424.1.1.616'">
			<xsl:text>PESEL</xsl:text>
			</xsl:when>-->
			<xsl:when test="$oid='2.16.840.1.113883.3.4424.1.6.1'">
				<xsl:text>PWZ farmaceuty</xsl:text>
			</xsl:when>
			<xsl:when test="$oid='2.16.840.1.113883.3.4424.1.6.2'">
				<xsl:text>PWZ lekarza</xsl:text>
			</xsl:when>
			<xsl:when test="$oid='2.16.840.1.113883.3.4424.1.6.3' and $functionCode='PIEL'">
				<xsl:text>PWZ pielęgniarki</xsl:text>
			</xsl:when>
			<xsl:when test="$oid='2.16.840.1.113883.3.4424.1.6.3' and $functionCode='POL'">
				<xsl:text>PWZ położnej</xsl:text>
			</xsl:when>
			<xsl:when test="$oid='2.16.840.1.113883.3.4424.1.6.4'">
				<xsl:text>PWZ diagnosty lab.</xsl:text>
			</xsl:when>
			<xsl:when test="$oid='2.16.840.1.113883.3.4424.2.2.1'">
				<xsl:text>REGON</xsl:text>
			</xsl:when>
			<xsl:when test="$oid='2.16.840.1.113883.3.4424.2.2.2'">
				<xsl:text>REGON</xsl:text>
			</xsl:when>
			<xsl:when test="$oid='2.16.840.1.113883.3.4424.2.1'">
				<xsl:text>NIP</xsl:text>
			</xsl:when>
			<xsl:when test="$oid='2.16.840.1.113883.3.4424.2.3.1'">
				<xsl:text>I cz. kodu resort.</xsl:text>
			</xsl:when>
			<xsl:when test="$oid='2.16.840.1.113883.3.4424.2.3.2'">
				<xsl:text>I-V cz. kodu resort.</xsl:text>
			</xsl:when>
			<xsl:when test="$oid='2.16.840.1.113883.3.4424.2.3.3'">
				<xsl:text>I-VII cz. kodu resort.</xsl:text>
			</xsl:when>
			<xsl:when test="$oid='2.16.840.1.113883.3.4424.2.6'">
				<xsl:text>Apteka</xsl:text>
			</xsl:when>
			<xsl:when test="$oid='2.16.840.1.113883.3.4424.3.1'">
				<xsl:text>Oddział NFZ</xsl:text>
			</xsl:when>
			<xsl:when test="$oid='2.16.840.1.113883.3.4424.11.1.49'">
				<xsl:text>Kod kraju</xsl:text>
			</xsl:when>
			<xsl:when test="starts-with($oid, '2.16.840.1.113883.3.4424.2.4.')">
				<xsl:text>Praktyka lekarska</xsl:text>
			</xsl:when>
			<xsl:when test="starts-with($oid, '2.16.840.1.113883.3.4424.2.5.')">
				<xsl:text>Praktyka pielęgniarska</xsl:text>
			</xsl:when>
		</xsl:choose>
	</xsl:template>
	
	<!-- nullFlavor-->
	<xsl:template name="translateNullFlavor">
		<xsl:param name="nullableElement"/>
		<!-- HL7 CDA dopuszcza podanie nullFlavor dla każdego kwantu dancyh i każdego elementu
			 obsłużono wyłącznie najważniejsze przypadki i najpopularniejsze kody:
			 NI = No Information. This is the most general and default null flavor.
			 NA = Not Applicable. Known to have no proper value (e.g., last menstrual period for a male).
			 UNK = Unknown. A proper value is applicable, but is not known.
			 ASKU = asked, but not known. Information was sought, but not found (e.g., the patient was asked but did not know).
			 NAV = temporarily unavailable. The information is not available, but is expected to be available later.
			 NASK = Not Asked. The patient was not asked. -->
		<xsl:if test="not($nullableElement) or $nullableElement/@nullFlavor">
			<span class="null_flavor">
				<xsl:choose>
					<xsl:when test="not($nullableElement)">
						<xsl:text>(nie podano)</xsl:text>
					</xsl:when>
					<xsl:when test="$nullableElement/@nullFlavor='NI'">
						<xsl:text>(brak informacji)</xsl:text>
					</xsl:when>
					<xsl:when test="$nullableElement/@nullFlavor='NA'">
						<xsl:text>(nie dotyczy)</xsl:text>
					</xsl:when>
					<xsl:when test="$nullableElement/@nullFlavor='UNK'">
						<xsl:text>(nieznane)</xsl:text>
					</xsl:when>
					<xsl:when test="$nullableElement/@nullFlavor='ASKU'">
						<xsl:text>(nie uzyskano informacji)</xsl:text>
					</xsl:when>
					<xsl:when test="$nullableElement/@nullFlavor='NAV'">
						<xsl:text>(czasowo niedostępne)</xsl:text>
					</xsl:when>
					<xsl:when test="$nullableElement/@nullFlavor='NASK'">
						<xsl:text>(nie pytano)</xsl:text>
					</xsl:when>
					<xsl:otherwise>
						<xsl:text>(nie podano)</xsl:text>
					</xsl:otherwise>
				</xsl:choose>
			</span>
		</xsl:if>
	</xsl:template>
	
	<xsl:template name="styles">
		<style type="text/css">
			<xsl:text>

@media screen {
	body {
		margin: 0px;
		display: block;
		background-color: #f1f1f1;
	}

    .noPrint{}

    .noScreen{display:none;}

	.page_break_avoid {display:none;}

	.document {
		margin: 15px auto;
		width: 300px;
		overflow: hidden;
		font-family: "Noto sans", sans-serif;
		font-size: 9pt;
		-webkit-box-shadow: 0px 0px 2px 2px #dcdcdc;
		box-shadow: 0px 0px 2px 2px #dcdcdc;
		background-color: white;
	}
	
	.patient_statement {
		display:none;
	}
	.oswiadczenie
	{
		margin:10px;
		text-align: center;
		font-family: "Noto sans", sans-serif;
		font-size: 7pt;
		border: 0.1em black solid;
	}							
}

@media print {
	body {
		margin: 0px;
		display: block;
		background-color: white;
	}

	.document {
		width: 80mm;
		overflow: hidden;
		font-family: "Noto sans", sans-serif;
		font-size: 9pt;
		background-color: white;
		background-repeat: no-repeat;
		background-image: none;
	}
	
	/* tymczasowe wyłączenie
	.page_break_avoid {
		page-break-after: avoid;
	}*/
	.page_break_avoid {display:none;}
	
	.patient_statement {
		margin:10px;
		text-align: center;
		font-family: "Noto sans", sans-serif;
		font-size: 7pt;
		padding: 5px;
		border: 0.1em black solid;
	}

	.patient_signature {
		padding: 20px 0 0 0;
	}
	
	.patient_signature_label {
		font-size: 5pt;
		font-family: "Noto sans", sans-serif;
	}
	.oswiadczenie
	{
		margin:10px;
		text-align: center;
		font-family: "Noto sans", sans-serif;
		font-size: 7pt;
		border: 0.1em black solid;
		page-break-before: always;
	}
}

.title {
	height: 44px;
	margin-top: 2px;
}

.title_img {
	max-width: 45%;
}

.title_suffix {
	font-size: 0.7em;
	font-weight: bold;
	position: absolute;
	top: 35px;
}

.doc_header {
	width: 100%;
}

.doc_body {
	width: 100%;
	border-top: 1px black solid;
}

.doc_title {
	font-size: 1.2em;
	text-align: center;
	font-weight: bold;
	border-bottom: 3px black solid;
	margin-top: 3px;
}

.section_title {
	font-weight: bold;
	padding: 3px 0 0 0;
}

.section_title_left {
	float: left;
	font-size: 8pt;
	font-weight: bold;
	padding: 3px 11px 0 11px;
}
.section_title_right {
	float: right;
    font-size: 7pt;
	padding: 3px 11px 0 11px;
}

.section_text_1 {
	padding: 5px 11px;
	font-size: 10pt;
}

.klucz_id {
	width: 277px;
	padding: 0 11px 0 12px;
}

.klucz {
	text-align: right;
}
.klucz_value {
	font-size: 8pt;
}

.doc_id {
	font-size: 7pt;
	text-align: right;
	padding-top: 1px;
}
.doc_id_label {
	float: left;
	vertical-align:top;
}
.doc_id_value {
	float: right;
	vertical-align: bottom;
	font-size: 7pt;
}

	.kod_time {
		padding: 4px 0 3px 0;
	}
	
	.kod {
	}
	
	.kod_label {
		margin-left: 11px;
	}
	
	.kod_value {
		padding-left: 5px; 
	}
	
	.effective_time {
		text-align: right;
	}
	
	.effective_time_label {
		margin-right: 11px;
	}
	
	.effective_time_value {
		font-weight: normal;
		padding-left: 3px;
	}

	.border_top {
		border-top: 1px black solid;
	}

.disclaimer {
	font-size: 0.9em;
	text-align: center;
	padding: 0 7px;
}

.strona_ikp {
	text-align: center;
	font-size: 6pt;
	padding-top: 5px;
	padding-bottom:5px;
}

.header_label {
	font-weight: bold;
	padding: 3px 0 0 7px;
}

.header_value {
	padding: 3px 7px 0 7px;
}

.header_element {
	/*oznaczenie elementu nagłówka dokumentu*/
}

.bold {
	font-weight: bold;
}

.header_inline_value {
	display: inline;
}

.body_element {
	width: 100%;
}

.section_block {
	display: table;
	width: 100%;
}
.section_text_block {
	display: table-cell;
	width: 100%;
}
.payment_block {
	display: table-cell;
}

.payment_text {
	font-size: 9pt;
	padding-left: 3px;
	top: 50%;
	border-left: 1px solid black;
	white-space:nowrap;
	width: 30px;
}

.table {
	display: table;
}
.table > div:nth-last-child(1) > div {
	padding-bottom: 3px;
}
.row {
	display: table-row;
}
.cell {
	display: table-cell;
}

.row_value {
	padding-top: 3px;
	padding-right: 11px;
	overflow-wrap: break-word;
	word-wrap: break-word;
	-ms-word-break: break-all;
	word-break: break-word;
}

.row_value_bold {
	padding-top: 3px;
	padding-right: 7px;
	overflow-wrap: break-word;
	word-wrap: break-word;
	-ms-word-break: break-all;
	word-break: break-word;
	font-weight: bold;
	hyphens: auto;
}

.small {
	font-size: 8pt;
}

.emphasized {
	font-weight: bold;
	font-size: 11pt !important;
}

.emphasized_id_label {
	font-size: 8pt !important;
}

.row_value > div:first-child {
	padding-top: 0;
}

.row_value_element {
	padding-top: 1px;
}

.row_value_element_patient {
	padding-top: 3px;
	font-size: 11pt;
	font-weight: bold;
}

.row_label {
	width: 90px;
	font-weight: bold;
	font-size: 8pt;
	padding-top: 3px;
	padding-left: 11px;
}

.row_label_inline {
	font-weight: bold;
	font-size: 8pt;
}

.row_value_inline {
	font-size: 8pt;
}

.not_known_id_prefix {
	font-weight: bold;
}

.address_value {
	padding-left: 7px;
}

.caption {
	font-weight: bold;
}
.paragraph:not(:last-child) {
	margin-bottom: 5px;
}
.paragraph_caption {
	padding-right: 3px;
}
.paragraph_text {
}

.footnote_div {
	border-top: 1px solid #dcdcdc;
	padding: 7px;
}
.footnote_label {
	font-size: 1.0em;
	font-weight: bold;
}
.footnote_values {
	font-size: 0.9em;
}
.footnote_value {
	margin: 2px 0 0 15px;
}

ol, ul {
	margin: 0;
}

.table_caption {
	font-weight: bold;
}
table {
	border-collapse: collapse;
}
th, td {
	padding: 5px;
}

#footer {
    position: running(footer);
    text-align: right;
    padding-right: 2px;
}

@page {
    size: 105mm 297mm;
    margin: 5mm;

    @bottom-right {
        content: element(footer);
    }
}

#pagenumber:before {
    content: counter(page);
}

#pagecount:before {
    content: counter(pages);
}
	.wykup-leku-info {
	text-align: justify;
	border: 0.1em black solid;
	padding: 5px;
}								
			</xsl:text>
			
			<!-- jeśli nie użyto żadnych stylów typu Rrule Lrule Toprule Botrule,
				 dodawany jest styl delikatnej szarej linii -->
			<xsl:if test="//hl7:table and not(//*[contains(@styleCode, 'Botrule')] or //*[contains(@styleCode, 'Lrule')] or //*[contains(@styleCode, 'Rrule')] or //*[contains(@styleCode, 'Toprule')])">
				<xsl:text>
table, th, td {
	border: 1px solid #dcdcdc;
}
				</xsl:text>
			</xsl:if>
		</style>
	</xsl:template>
	
	<!-- ++++++++++++++++++++++++++++++++++++++ OBSŁUGA NARRATIVE BLOCK (kod polskiej transformaty HL7 CDA, brak obsługi multimediów) +++++++++++++++++++++++++++++++++++++++++++-->
	<xsl:template name="sectionText">
		<xsl:param name="text"/>
		<xsl:apply-templates select="$text"/>
	</xsl:template>

	<xsl:template name="sectionTitle">
		<xsl:param name="tytulRecepty"/>
		<xsl:apply-templates select="$tytulRecepty"/>
	</xsl:template>
	
	<!-- Transformata przekodowuje tagi MIME type "text/x-hl7-text+xml" na html:
        <content> - odpowiednik <span> w HTML, posiada opcjonalny identyfikator wykorzystywany do wskazywania tego tekstu w bloku entry.
        <sub> oraz <sup> - identyczne jak w HTML
        <br> - identyczne jak w HTML
        <footnote> oraz <footnoteRef> - bez odpowiedników w HTML, należy oprogramować
        <caption> - nagłówek elementów paragraph, list, list item, table, table cell, renderMultimedia. Może zawierać linki, przypisy, sub, sup.
        <paragraph> - odpowiednik <p> w HTML
        <linkHtml> - odpowiednik <a> w HTML, nie identyczny
        <list> z atrybutem @listType oraz elementem <item> - odpowiednik list <ol> i <ul> z elementem <li> w HTML
        <table> z elementami <thead>, <tbody>, <tfoot>, <th>, <td>, <tr>, <colgroup>, <col>, <caption> - identyczne jak w HTML
        atrybut styleCode z listą prymitywnych wartości.
        -->

	<!-- content -->
	<xsl:template match="hl7:content">
		<xsl:choose>
			<xsl:when test="@revised='delete'">
				<!-- content wyróżniający fragmenty tekstu jako usunięte z poprzedniej wersji dokumentu -->
				<!-- tekst nie jest wyświetlany, pomijana jest cała usunięta zawartość, 
					 można rozważyć czy dodać specjalną obsługę revised (insert/delete), aktualnie uznano, że są to informacje nadmiarowe -->
			</xsl:when>
			<xsl:otherwise>
				<xsl:element name="span">
					<xsl:apply-templates select="@styleCode"/>
					<xsl:apply-templates/>
				</xsl:element>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	
	<!-- sup -->
	<xsl:template match="hl7:sup">
		<xsl:element name="sup">
			<xsl:apply-templates/>
		</xsl:element>
	</xsl:template>
	
	<!-- sub -->
	<xsl:template match="hl7:sub">
		<xsl:element name="sub">
			<xsl:apply-templates/>
		</xsl:element>
	</xsl:template>
	
	<!-- br -->
	<xsl:template match="hl7:br">
		<xsl:element name='br'>
			<xsl:apply-templates/>
		</xsl:element>
	</xsl:template>
	
	<!-- przypis w sekcji -->
	<xsl:template match="hl7:footnote">
		<xsl:variable name="referenceId" select="@ID"/>
		<sup>
			<xsl:text>[</xsl:text>
			<xsl:choose>
				<xsl:when test="$referenceId">
					<a href="#przypis-{$referenceId}">
						<xsl:value-of select="$referenceId"/>
					</a>
				</xsl:when>
				<xsl:otherwise>
					<!-- pojedyncze wystąpienie bez ID, brak odnośnika -->
					<span class="footnote_text_inline">
						<xsl:apply-templates/>
					</span>
				</xsl:otherwise>
			</xsl:choose>
			<xsl:text>]</xsl:text>
		</sup>
	</xsl:template>
	
	<!-- odnośnik do przypisu -->
	<xsl:template match="hl7:footnoteRef">
		<xsl:variable name="referencedId" select="@IDREF"/>
		<sup>
			<xsl:text>[</xsl:text>
			<a href="#przypis-{$referencedId}">
				<xsl:value-of select="$referencedId"/>
			</a>
			<xsl:text>]</xsl:text>
		</sup>
	</xsl:template>
	
	<!-- przypis - wyświetlenie -->
	<xsl:template name="footnotesOnTheBottom">
		<xsl:variable name="footnotes" select=".//hl7:footnote[@ID]"/>
		
		<xsl:if test="$footnotes">
			<div class="footnote_div">
				<span class="footnote_label">
					<xsl:text>Przypisy</xsl:text>
				</span>
				<div class="footnote_values">
					<xsl:for-each select="$footnotes">
						<xsl:if test="./@ID">
							<div class="footnote_value">
								<a id="przypis-{./@ID}">
									<xsl:value-of select="./@ID"/>
									<xsl:text>. </xsl:text>
									<xsl:apply-templates/>
								</a>
							</div>
						</xsl:if>
					</xsl:for-each>
				</div>
			</div>
		</xsl:if>
	</xsl:template>
	
	<!-- nagłówek w przypadkach innych niż dla elementu paragraph i table -->
	<xsl:template match="hl7:caption">
		<xsl:element name="span">
			<xsl:attribute name="class">list_caption caption</xsl:attribute>
			<xsl:apply-templates select="@styleCode"/>
			<xsl:apply-templates/>
		</xsl:element>
		<xsl:text> </xsl:text>
	</xsl:template>
	
	<!-- nagłówek akapitu
		parametr intentionally wyokrzystywany jest do wyjęcia <caption> z elementu <paragraph> 
		w sytuacji gdy caption nie jest pierwszym węzłem paragraph,
		umieszczenie tekstu w <paragraph> przed elementem <caption> jest zgodne z XSD 
		o ile tekst nie zawiera innych elementów, nie jest jednak zalecane -->
	<xsl:template match="hl7:paragraph/hl7:caption">
		<xsl:param name="intentionally" select="false()"/>
		<xsl:if test="$intentionally">
			<xsl:element name="span">
				<xsl:attribute name="class">paragraph_caption caption</xsl:attribute>
				<xsl:apply-templates select="@styleCode"/>
				<xsl:apply-templates/>
			</xsl:element>
		</xsl:if>
	</xsl:template>
	
	<!-- paragraph -->
	<xsl:template match="hl7:paragraph">
		<div class="paragraph">
			<xsl:element name="div">
				<xsl:attribute name="class">paragraph_text</xsl:attribute>
				<xsl:apply-templates select="@styleCode"/>
				<xsl:apply-templates select="hl7:caption">
					<xsl:with-param name="intentionally" select="true()"/>
				</xsl:apply-templates>
				<!-- spowoduje wywołanie template'ów dla wszystkich węzłów i dla caption, 
					jednak template caption nie wykona się bez parametru "intentionally" -->
				<xsl:apply-templates/>
			</xsl:element>
		</div>
	</xsl:template>
	
	<!-- list -->
	<xsl:template match="hl7:list">
		
		<xsl:apply-templates select="hl7:caption">
			<xsl:with-param name="intentionally" select="true()"/>
		</xsl:apply-templates>
		
		<xsl:choose>
			<xsl:when test="@listType='ordered'">
				<xsl:element name="ol">
					<xsl:choose>
						<!-- HTML5 nie wspiera tych typów -->
						<xsl:when test="contains(@styleCode, 'Arabic')">
							<xsl:attribute name="type">1</xsl:attribute>
						</xsl:when>
						<xsl:when test="contains(@styleCode, 'BigAlpha')">
							<xsl:attribute name="type">A</xsl:attribute>
						</xsl:when>
						<xsl:when test="contains(@styleCode, 'BigRoman')">
							<xsl:attribute name="type">I</xsl:attribute>
						</xsl:when>
						<xsl:when test="contains(@styleCode, 'LittleAlpha')">
							<xsl:attribute name="type">a</xsl:attribute>
						</xsl:when>
						<xsl:when test="contains(@styleCode, 'LittleRoman')">
							<xsl:attribute name="type">i</xsl:attribute>
						</xsl:when>
					</xsl:choose>
					<xsl:apply-templates select="@styleCode"/>
					<xsl:apply-templates/>
				</xsl:element>
			</xsl:when>
			<xsl:otherwise>
				<xsl:element name="ul">
					<xsl:choose>
						<!-- HTML5 nie wspiera tych typów -->
						<xsl:when test="contains(@styleCode, 'Circle')">
							<xsl:attribute name="type">circle</xsl:attribute>
						</xsl:when>
						<xsl:when test="contains(@styleCode, 'Disc')">
							<xsl:attribute name="type">disc</xsl:attribute>
						</xsl:when>
						<xsl:when test="contains(@styleCode, 'Square')">
							<xsl:attribute name="type">square</xsl:attribute>
						</xsl:when>
					</xsl:choose>
					<xsl:apply-templates select="@styleCode"/>
					<xsl:apply-templates/>
				</xsl:element>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	
	<!-- nagłówek listy przed głównym elementem listy
		 kolejny zabieg z intentionally pozwala uniknąć operatora exerpt z XPATH 2.0 -->
	<xsl:template match="hl7:list/hl7:caption">
		<xsl:param name="intentionally" select="false()"/>
		
		<xsl:if test="$intentionally">
			<xsl:element name="span">
				<xsl:attribute name="class">list_caption caption</xsl:attribute>
				<xsl:apply-templates select="@styleCode"/>
				<xsl:apply-templates/>
			</xsl:element>
		</xsl:if>
	</xsl:template>
	
	<xsl:template match="hl7:list/hl7:item">
		<xsl:element name="li">
			<xsl:apply-templates select="@styleCode"/>
			<xsl:apply-templates/>
		</xsl:element>
	</xsl:template>
	
	<!-- nagłówek elementu listy -->
	<xsl:template match="hl7:list/hl7:item/hl7:caption">
		<xsl:element name="span">
			<xsl:attribute name="class">list_caption caption</xsl:attribute>
			<xsl:apply-templates select="@styleCode"/>
			<xsl:apply-templates/>
		</xsl:element>
		<xsl:text> </xsl:text>
	</xsl:template>
	
	<!-- zmiana nazwy bez przepisywania ze względów bezpieczeństwa, wyłącznie dla znanych wartości, 
		w tym poza stylami HL7 CDA dodano dopuszczalne przez ten standard polskie rozszerzenia dot. kolorów czcionek
		(zastosowano style, gdyż jest silniejsze niż przypisany class) -->
	<xsl:template match="@styleCode">
		<xsl:if test="string-length(.) &gt;= 1">
			<xsl:attribute name="style">
				<xsl:if test="contains(., 'Italics')"> font-style: italic;</xsl:if>
				<xsl:if test="contains(., 'Bold')"> font-weight: bold;</xsl:if>
				<xsl:if test="contains(., 'Underline')"> text-decoration: underline;</xsl:if>
				<xsl:if test="contains(., 'Emphasis')"> font-style: bold;</xsl:if>
				<xsl:if test="contains(., 'xPLred')"> color: red;</xsl:if>
				<xsl:if test="contains(., 'xPLgreen')"> color: green;</xsl:if>
				<xsl:if test="contains(., 'xPLblue')"> color: blue;</xsl:if>
				<xsl:if test="contains(., 'xPLlime')"> color: lime;</xsl:if>
				<xsl:if test="contains(., 'xPLolive')"> color: olive;</xsl:if>
				<xsl:if test="contains(., 'xPLorange')"> color: orange;</xsl:if>
				<xsl:if test="contains(., 'xPLnavy')"> color: navy;</xsl:if>
				<xsl:if test="contains(., 'xPLviolet')"> color: violet;</xsl:if>
				<xsl:if test="contains(., 'xPLpurple')"> color: purple;</xsl:if>
				<xsl:if test="contains(., 'xPLsilver')"> color: silver;</xsl:if>
				<xsl:if test="contains(., 'xPLgray')"> color: gray;</xsl:if>
				<xsl:if test="contains(., 'xPLbig')"> font-size: 11pt;</xsl:if>
				<xsl:if test="contains(., 'xPLsmall')"> font-size: 9pt;</xsl:if>
				<xsl:if test="contains(., 'xPLxsmall')"> font-size: 8pt;</xsl:if>
			</xsl:attribute>
		</xsl:if>
	</xsl:template>
	
	<!--  Tabele  -->
	<!-- Znaki dopuszczalne w atrybutach, obsługa w XPATH 1.0, tj. bez wyrażeń regularnych -->
	<xsl:variable name="CHARACTERS_ALLOWED_IN_TABLE_ATTRIBUTES">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 ,.-_!</xsl:variable>
	
	<!-- tabele są identyczne jak w HTML (poza atrybutem styleCode), są więc kopiowane bez zmian
		 XSD dopuszcza wiele atrybutów nieobsługiwanych w HTML5, ale dopuszczalnych tutaj. -->
	<xsl:template match="hl7:table | hl7:col | hl7:colgroup | hl7:tbody | hl7:td | hl7:tfoot | hl7:th | hl7:thead | hl7:tr">
		<xsl:element name="{local-name()}">

			<xsl:call-template name="copyTableAttributes">
				<xsl:with-param name="tagName" select="local-name()"/>
				<xsl:with-param name="attributes" select="./@*"/>
			</xsl:call-template>
			<xsl:apply-templates/>
		</xsl:element>
	</xsl:template>

	<!-- atrybuty pochodzące z HTML dopuszczalne w XSD Narrative Block dla elementów tabeli
		 wszystkie wartości tych atrybutów będą przepisywane bez zmian niniejszą transformatą z postaci "text/x-hl7-text+xml" do "text/html" -->
	<xsl:variable name="TABLE_ALLOWED_ATTRIBUTES">
		<item name="COL">;ID;language;span;width;align;char;charoff;valign;</item>
		<item name="COLGROUP">;ID;language;span;width;align;char;charoff;valign;</item>
		<item name="TABLE">;ID;language;summary;width;border;frame;rules;cellspacing;cellpadding;</item>
		<item name="TBODY">;ID;language;align;char;charoff;valign;</item>
		<item name="TD">;ID;language;abbr;axis;headers;scope;rowspan;colspan;align;char;charoff;valign;</item>
		<item name="TFOOT">;ID;language;align;char;charoff;valign;</item>
		<item name="TH">;ID;language;abbr;axis;headers;scope;rowspan;colspan;align;char;charoff;valign;</item>
		<item name="THEAD">;ID;language;align;char;charoff;valign;</item>
		<item name="TR">;ID;language;align;char;charoff;valign;</item>
	</xsl:variable>
	
	<!-- pełna kontrola nad tym co jest kopiowane -->
	<xsl:template name="copyTableAttributes">
		<xsl:param name="tagName"/>
		<xsl:param name="attributes"/>
		
		<xsl:param name="allowedAttributes" select="document('')/*/xsl:variable[@name='TABLE_ALLOWED_ATTRIBUTES']/*"/>
		<!--<xsl:param name="allowedAttributes" select="$TABLE_ALLOWED_ATTRIBUTES/*"/>-->
		
		<xsl:for-each select="$attributes">
			<xsl:if test="string-length(translate(., $CHARACTERS_ALLOWED_IN_TABLE_ATTRIBUTES, '')) = 0">
				<xsl:choose>
					<xsl:when test="local-name(.) = 'styleCode'">
						<xsl:if test="string-length(.) &gt;= 1">
							<xsl:attribute name="style">
								<xsl:if test="contains(., 'Italics')"> font-style: italic;</xsl:if>
								<xsl:if test="contains(., 'Bold')"> font-weight: bold;</xsl:if>
								<xsl:if test="contains(., 'Underline')"> text-decoration: underline;</xsl:if>
								<xsl:if test="contains(., 'Emphasis')"> font-style: bold;</xsl:if>
								<xsl:if test="contains(., 'Botrule')"> border-bottom: 1pt solid #dcdcdc;</xsl:if>
								<xsl:if test="contains(., 'Lrule')"> border-left: 1pt solid #dcdcdc;</xsl:if>
								<xsl:if test="contains(., 'Rrule')"> border-right: 1pt solid #dcdcdc;</xsl:if>
								<xsl:if test="contains(., 'Toprule')"> border-top: 1pt solid #dcdcdc;</xsl:if>
							</xsl:attribute>
						</xsl:if>
					</xsl:when>
					<xsl:otherwise>
						<xsl:if test="contains($allowedAttributes[@name=translate($tagName, $LOWERCASE_LETTERS, $UPPERCASE_LETTERS)], concat(';',local-name(.),';'))">
							<xsl:copy-of select="."/>
						</xsl:if>
					</xsl:otherwise>
				</xsl:choose>
			</xsl:if>
		</xsl:for-each>
	</xsl:template>
	
	<!-- nagłówek tabeli to standardowo i wyjątkowo element html caption -->
	<xsl:template match="hl7:table/hl7:caption">
		<xsl:element name="caption">
			<xsl:attribute name="class">table_caption caption</xsl:attribute>
			<xsl:apply-templates select="@styleCode"/>
			<xsl:apply-templates/>
		</xsl:element>
	</xsl:template>
	
	
	<!-- odnośnik -->
	<xsl:template match="hl7:linkHtml">
		<xsl:element name="a">
			<xsl:attribute name="href"><xsl:value-of select="./@href"/></xsl:attribute>
			<xsl:apply-templates/>
		</xsl:element>
	</xsl:template>
</xsl:stylesheet>