  [% META title = 'Admin &raquo; Edit Outreach Practice' -%]
<!-- BEGIN [% template.name %] -->

  [% # PROCESS dumper.tt dump = data %]

  [% # PROCESS admin/misc_nav.tt page = 'specimens' %]

  <h2 align="center">Edit Outreach Practice Details</h2>

    [% IF dfv_errors # not handling errors here %]
    <dl>
        <dt class="error">[% c.cfg('msg').dfv_errors %]</dt>
        [% IF error_sample_code %]
            <dd>Sample code [% error_sample_code %]</dd>[% END %]
        [% IF error_description %]
            <dd>Description [% error_description %]</dd>[% END %]
        [% IF error_active %]
            <dd>Active [% error_active %]</dd>[% END %]
    </dl>
    [% END %]

    <p class="warning">
        WARNING: change is global and will apply to all patients registered at this
        practice
    </p>
    
    <form method="post" action="[% app_url %]/config/outreach-practices/update/[% data.id %]"
        name="practice" id="practice">

    <table>
        <tr>
            <td class="label">Address:</td>
            <td>[% data.display_name | html %]</td>
        </tr>
        <tr>
			<td class="label">Org. code</td>
            <td>[% data.organisation_code | html %]</td>
        </tr>
        [% default_blood_tube = tube_type(data.post_code) %]
        <tr>
			<td class="label">Default tube:</td>
            <td>[% default_blood_tube | ucfirst %] [[% data.post_code %]]</td>
        </tr>
        <tr>
			<td class="label">Override</th>
            <td>
                [% tube_type = default_blood_tube == 'monovette'
                    ? 'vacutainer' : 'monovette' # opposite %]
                [% tube_type | upper %]:
                <input type="checkbox" value="[% tube_type %]" name="tube_type"
                    [% 'checked' IF data.outreach_practice_blood_tube.size %] />
                [% IF data.outreach_practice_blood_tube.size %]
                    <input type="hidden" name="clear" value="1" />
                    <input type='submit' value='Clear' name='.submit' class='button' />  
                [% ELSE %]
                    [% site.html.submit %]
                [% END %]
            </td>
        </tr>
    </table>

    </form>

    <p>[% site.html.back_button %]</p>
<!-- END [% template.name %] -->


