[% content_only = 1 # no html wrappers %]

  [% # PROCESS dumper.tt dump = data %]
  [% # PROCESS dumper.tt dump = notifications %]
  
[% USE date(format = '%d/%m/%Y', locale = 'en_GB') %]
[% BLOCK format_letter %]
    <div style="page-break-after: always">
      <div align="center">
          <img src='/images/outreach_header.png' alt="" />
      </div>
      
      [% INCLUDE worklist/local/outreach/address.tt %]

      <div class="indent">
      [%
        IF entry.delta_days >= 90; # return to GP:
          INCLUDE worklist/local/outreach/return_to_gp.tt;
        ELSIF entry.delta_days >= 30; # patient 30 & 60 day letter:
          INCLUDE worklist/local/outreach/patient_letter.tt;
        END;
      %]
    
      <p>Yours,</p>
      <img src="/images/acr.png" />
      <div>Dr. Andy C. Rawstron</div>
      <div>Consultant Clinical Scientist</div>
        </div>
      </div>
[% END %]

<!-- BEGIN [% template.name %] -->
<html>
<head>
  <title>Outreach Pack Overdue Notifications</title>
  <link type="text/css" rel="stylesheet" href="/css/outreach.css" />
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>

<body>
  [% FOREACH entry IN requests; # PROCESS dumper.tt dump = entry.delta_days;
    IF entry.delta_days >= 60 AND entry.delta_days < 90;
      gp_copy = 1; INCLUDE format_letter; # GP gets copy of 60-day letter
      gp_copy = 0; INCLUDE format_letter; # copy to patient
    ELSE; INCLUDE format_letter; END;
  END %]
</body>
</html>
<!-- END [% template.name %] -->
