<!-- BEGIN [% component.name %] -->
    [% # PROCESS dumper.tt dump = outreach %]

	[% user_can_enter_data = # 1;
        c.user_can('edit_outreach_data') # can edit outreach data
        AND patient.nhs_number # MUST have primary identifier (NHS No)
        AND NOT is_locked ? 1 : 0; # not already locked
    %]

    [% BLOCK outreach_submit;
			IF user_can_enter_data %]
			<input type="submit" value="Update" class="[% button_class || 'button' %]" />
            [% IF require_reset; site.html.reset; END %]
        [% END %]
	  [% END %]

    [% BLOCK th_default_val;
        IF lab_data.item(param).default;
            default_value = 100 * lab_data.item(param).default / 100;
            class = default_value ? 'acronym' : 'normal'; # redefine class OK here
            title = default_value ? "default value: ${default_value}" : '';
        %]
          <a href="#" onclick="javascript:set_proposed('#[% param %]',
             '[% default_value %]'); return false">
            <span class="[% class %]" title="[% title %]">
              [% lab_data.item(param).field_label %]
            </span>
          </a>
        [% ELSE; lab_data.item(param).field_label; END %]
    [% END %]

	<script language="javascript" type="text/javascript">
		<!--
		function set_proposed(id, proposed) { $(id).val(proposed) }
		-->
	</script>

    <p class="title">
        [% required_fields =
            ['address' 'post_code' 'contact_number' 'gp_id' 'practice_id'];

            img_name = missing_fields(required_fields, outreach.demographics)
                ? 'question' : 'tick'
        %]
        <img src="/images/[% img_name %].gif" alt="" />
        Demographics [% div_name = 'demographics'; INCLUDE site/snippets/toggleview.tt %]
    </p>

    <div id="[% div_name %]" class="itemhidden">
        [% INCLUDE outreach/demographics.tt %]
    </div>

    <p class="title">
        [% img_name = incomplete_dataset() ? 'question' : 'tick' %]
        <img src="/images/[% img_name %].gif" alt="" />
        Questionnaire [% div_name = 'questionnaire'; INCLUDE site/snippets/toggleview.tt %]
    </p>

    <div id="[% div_name %]" class="itemhidden">
        [% INCLUDE outreach/questionnaire.tt %]
    </div>

    <p class="title">
        [% img_name = incomplete_dataset(outreach.haematology) ? 'question' : 'tick' %]
        <img src="/images/[% img_name %].gif" alt="" />
        Haematology [% div_name = 'haematology'; INCLUDE site/snippets/toggleview.tt %]
    </p>

    <div id="[% div_name %]" class="itemhidden">
        [% INCLUDE outreach/haematology.tt %]
    </div>

    <p class="title">
        [% img_name = incomplete_dataset(outreach.flow_cytometry) ? 'question' : 'tick' %]
        <img src="/images/[% img_name %].gif" alt="" />
        Flow cytometry [% div_name = 'flow'; INCLUDE site/snippets/toggleview.tt %]
    </p>

    <div id="[% div_name %]" class="itemhidden">
        [% INCLUDE outreach/flow_cytometry.tt %]
    </div>

    <p class="title">
        [% img_name = incomplete_dataset(outreach.biochemistry) ? 'question' : 'tick' %]
        <img src="/images/[% img_name %].gif" alt="" />
        Biochemistry [% div_name = 'biochemistry'; INCLUDE site/snippets/toggleview.tt %]
    </p>

    <div id="[% div_name %]" class="itemhidden">
        [% INCLUDE outreach/biochemistry.tt %]
    </div>

    <p class="title">
        [% img_name = incomplete_dataset(outreach.immunology) ? 'question' : 'tick' %]
        <img src="/images/[% img_name %].gif" alt="" />
        Immunology [% div_name = 'immunology'; INCLUDE site/snippets/toggleview.tt %]
    </p>

    <div id="[% div_name %]" class="itemhidden">
        [% INCLUDE outreach/immunology.tt %]
    </div>

<!-- END [% component.name %] -->
