<!-- BEGIN site/make_chart.tt -->
    [% BLOCK chart_url;
	    img_url = app_url _ '/chart/' _ chart_type _ '/' _ data.id;
		# need to pass session ID manually if called 'in memory' ie PDF gen:
		IF url_session_id_required; # replaced by setting cookies in Local::PDF::make_pdf()
            # img_url = img_url _ '?CGISESSID=' _ c.session.id;
		END;
		IF use_file_sessions; # eg called via cron
            img_url = img_url _ '?USE_FILE_SESSIONS=1';
		END %]
		<blockquote>
		  <p><img src="[% img_url %]" /></p>
		</blockquote>
	[% END %]

    [% # draw graphs/charts if required:
		IF format_info.has_glivec AND patient.nhs_number;
		  chart_type = 'imatinib'; 
		ELSIF format_info.has_hiv;
		  chart_type = 'hiv'; 
		ELSIF format_info.has_pnh;
		  chart_type = 'pnh'; 
		ELSIF format_info.has_chimerism;
		  chart_type = 'chimerism'; 
		END;
        
		INCLUDE chart_url IF chart_type;
	%]
<!-- END site/make_chart.tt -->
