[% META title = 'Request &raquo; Email Diagnosis Status' %]
<!-- BEGIN request/email_alert.tt -->
    [% # PROCESS dumper.tt dump = data.as_tree %]
    [% # PROCESS dumper.tt dump = centres %]
    
  <h2>E-mail New Diagnosis Report:</h2>

  <form method="post" action="[% app_url %]/request/email_alert/[% data.id %]">
    
  <div class="indent">
    <h3>[% PROCESS site/lab_number.tt %]
      :: [% data.patient_case.patient.last_name | upper %],
      [% data.patient_case.patient.first_name   | ucfirst %]
      [% data.patient_case.patient.middle_name  | ucfirst %]
      :: 
      [% data.request_report.diagnosis.name %]
    </h3>
    
    <h4>Referral infomation:
      [% data.referrer_department.referrer.name %] @
      [% data.patient_case.referral_source.display_name | html %]
    </h4>
    
    <p class="red">Check this before sending &#187;
      <select name="mdt_centre">
        <option value=""></option>
        [% FOREACH entry IN centres;
          match = ''; # reset
          IF entry.scope == 'organisation'; # do this 1st as hospital also matches
            match = 'selected' IF entry.referral_source.parent_organisation_id
              == data.patient_case.referral_source.parent_organisation_id;
          ELSIF entry.scope == 'hospital';
            match = 'selected' IF entry.referral_source_id ==
              data.patient_case.referral_source_id;
          END;
        %]
        <option value="[% entry.display_name %]" [% match %]>
          [% entry.display_name %]
        </option>
        [% END %]            
      </select>
      [% site.html.submit %] [% site.html.reset %]
    </p>
  </div>
    
  <p class="classname">[% site.html.back_button %]</p>
  
  </form>
<!-- END request/email_alert.tt -->

