RSS Git Download  Clone
Raw Blame History
<!-- BEGIN report/report.tt -->
    [% IF spelling_checked AND NOT has_unrecognised.size %]
      <p class="info">
        <span class="indent">Spellchecker reports no unrecognised words</span>
      </p>
    [% END %]

    <form action="[% app_url %]/report/[% this_form_action %]/[% request_data.id %]"
      method="post" [% this_onsubmit # set above %] name="reportForm" id="reportForm">
    
    [% IF report_data.diagnosis # include diagnosis_id in case amendment: %]
      <input type="hidden" name="_diagnosis_id" value="[% report_data.diagnosis.id %]" />
    [% END %]
    
    <table class="indent">
	   <tr>
        <td class="label">General notes:</td>
        <td class="content">
          <textarea name="general_notes" rows="1" cols="70" class="expand20-200"
            [% site.html.onfocus %] [% site.html.disabled IF authorisation_request %]
              >[% request_data.request_general_note.detail %]</textarea>
        </td>
      </tr>

      <tr>
        <td class="label" style="vertical-align: top">Clinical details:</td>
        <td class="content">				 
       		<textarea name="clinical_details" rows="1" cols="70" [% site.html.onfocus %]
            class="expand20-200" [% site.html.disabled IF authorisation_request %]
            id="clinical_details">[% report_data.clinical_details %]</textarea>
          [% error_clinical_details %]
          
          [% IF unrecognised_clinical_details_words.size %]
            [% PROCESS report/highlight.tt
              this_text  = highlighted_clinical_details
              this_field = 'clinical_details' %]
              
            [% PROCESS report/speller.tt list = unrecognised_clinical_details_words %]
          [% END %]
		</td>
      </tr>
      
      [% IF want_gross_description OR request_data.request_gross_description %]
      <tr>
        <td class="label" style="vertical-align: top">Gross description:</td>
        <td class="content">
          <input type="hidden" name="_want_gross_description" value="1" />
       		<textarea name="gross_description" rows="1" cols="70" [% site.html.onfocus %]
             class="expand20-200" [% site.html.disabled IF authorisation_request %]
            >[% request_data.request_gross_description.detail %]</textarea>
          [% error_gross_description %]
		</td>
      </tr>
      [% END %]
      
      <tr>
        <td class="label">Specimen quality:</td>
        <td class="content">
          [% FOREACH option IN ['good', 'adequate', 'poor'];
            quality_match = report_data.specimen_quality.match(option) ? 1 : 0 %]
					<label>						
            <span class="[% quality_match ? 'title' : 'normal' %]">
              [% option | ucfirst %]</span><input type="radio"
                  name="specimen_quality" value="[% option %]"
                  [% site.html.disabled IF authorisation_request %]
                  [% 'checked' IF quality_match %] />
					</label>
          <span style="margin-left: 0.5em" class="spacer">&nbsp;</span>
          [% END %]
          [% error_specimen_quality %]
		</td>
      </tr>
      
    [% UNLESS authorisation_request %]
      <tr>
        <td class="label" style="vertical-align: top">Morphology/Comment:</td>
        <td class="content">		
        	<textarea name="comment" rows="3" cols="70" class="expand20-500"
            id="comment">[% report_data.comment | html %]</textarea>
          [% error_comment %]
          
          [% IF unrecognised_comment_words.size %]          
            [% PROCESS report/highlight.tt
              this_text  = highlighted_comment
              this_field = 'comment' %]
              
            [% PROCESS report/speller.tt list = unrecognised_comment_words %]
          [% END %]
		</td>
      </tr>      
    [% END %]
      
      <tr>
        <td class="label" style="vertical-align: top">
          Diagnosis:
        </td>
        <td class="content">
          <select name="diagnosis_id">
            <option value="">-- select one --</option>
            [% FOREACH category IN diagnoses.keys.sort %]
            <optgroup label="[% category %]">
              [% FOREACH diagnosis IN diagnoses.item(category) %]
              <option value="[% diagnosis.id %]" [% 'selected' IF
                  diagnosis.id == report_data.diagnosis.id
                  AND NOT authorisation_request %]>                
                [% diagnosis.name %]
              </option>
              [% END %]
            </optgroup>              
            [% END %]
          </select>
          [% error_diagnosis_id %]
          
          [% IF report_data.diagnosis AND NOT authorisation_request %]
            <span class="title">Revision:</span>
            <select name="revision">
              <option value="">--</option>
              [% FOREACH option IN diagnosis_change_options.keys.sort %]
              <option value="[% option %]">[% option %]</option>
              [% END %]
            </select>
            [% error_revision; error__diagnosis_id # could be either %]
          [% END %]

          [% IF previous_diagnoses AND c.user_can('report')
            AND NOT authorisation_request %]
          <p><i>Revisions [[% previous_diagnoses %]]:</i>
            [% div_name = 'diagnoses'; INCLUDE site/snippets/toggleview.tt %]
          </p>

          <div id="[% div_name %]" class="itemhidden">
              <ol>
              [% FOREACH d IN previous_diagnoses_data %]
                <li class="results">
                  [% d.diagnosis.name | html %]
                  [[% d.user.username | upper %]: [% d.reason %]]
                  [% d.time.strftime('%a %d.%b.%Y @ %T') %]
                </li>
              [% END %]        
            </ol>
          [% END %]
		</td>
      </tr>
      
      [% INCLUDE outreach/followup.tt IF is_outreach %]
      
      <tr>
        <td class="label">Report by:</td>        
        <td>
          [% IF history.reported.user %]
          <span class="title">
              [%  history.reported.user.first_name | ucfirst; ' ';
                  history.reported.user.last_name  | ucfirst %]
            </span> on <span class="title">       
            [% history.reported.time.strftime('%a %d.%b.%Y @ %H:%M') %]
          </span>
         [% ELSE %]
            <span class="grey">
            [% this_user.first_name | ucfirst %]
            [% this_user.last_name  | ucfirst %]              
            </span>
          [% END %]
        </td>
      </tr>
      
      [% IF history.authorised %]
        <tr>
          <td class="label">Authorised by:</td>
          <td>
            <span class="title">
              [%  history.authorised.user.first_name | ucfirst; ' ';
                history.authorised.user.last_name  | ucfirst; %]
            </span> on <span class="title"> 
              [% history.authorised.time.strftime('%a %d.%b.%Y @ %H:%M') %]
            </span>
          </td>				
        </tr>
      [% ELSIF status_options.authorised.is_active.match('yes')
		AND ( c.query.param('pre-authorisation-check') OR self_authorisable ) %]
      <tr>
        <td class="label">Authorise report:</td>
        <td>
        [% IF this_user.username == history.reported.user.username %]
          [% disable_submit = 1 %]
          <span class="error">*** self-authorisation not permitted ***</span>
        [% ELSE %]
          <input type="checkbox" name="authorise" value="1" />
          <input type="hidden" name="pre-authorisation-check" value="1" />
        [% END %]
        </td>				
      </tr>
      [% END %]

      
      [% IF is_outreach %]
        <input type="hidden" name="status" value="default" />
        [% disable_submit = 1 UNLESS # disable report submit button unless:
            c.user_can('report')
            AND NOT is_locked;
        %]
        
      [% ELSE %]
      <tr>
        <td class="label">Request status:</td>
        <td class="content">
          [% FOREACH option IN [ 'new', 'relapse', 'default' ];
              status_match = report_data.status.match(option) ? 1 : 0 %]
					<label>						
            <span class="[% status_match ? 'title' : 'normal' %]">
              [% option | ucfirst %]</span><input type="radio" name="status"
                value="[% option %]" [% 'checked' IF status_match %]
                [% site.html.disabled IF authorisation_request %] />
					</label>
          <span style="margin-left: 0.5em">&nbsp;</span>
          [% END %]
          [% error_status %]
				[% UNLESS previous_cases.this_id.size %]
          <span class="red">** unknown patient details **</span>
				[% END %]
		</td>
      </tr>
      [% END %]
      
      [% UNLESS authorisation_request OR is_outreach %]
      <tr>
        <td class="label">Others:</td>
        <td class="content">
          [% IF request_options.teaching.is_active.match('yes') %]
            Teaching case:
            <input type="checkbox" name="teaching" value="1"
              [% 'checked' IF request_options.teaching.is_selected %] />
          [% END %]                
        </td>
      </tr>
      [% END %]

      [% IF have_outstanding_tests %]
        <tr>
          <td colspan="2" class="borderless">
          <input type="hidden" name="_have_outstanding_tests" value="1" />
          <span class="indent">
            <span class="normal">ACKNOWLEDGE OUTSTANDING TESTS:</span>
            <input type="checkbox" name="confirm_outstanding" value="1" />
            [% IF error_confirm_outstanding %]
              [% error_confirm_outstanding %]
            [% ELSE %]
              <span class="warning">&#171; required</span>
            [% END %]
          </span>          
          </td>
        </tr>
      [% END %]
    
      [% IF history.authorised AND
          NOT data.status_option.description.match('complete') AND
          NOT have_outstanding_tests %]
        <tr>
          <td colspan="2" class="borderless">
            <span class="indent"><!--  style="float: right" -->
              <span class="normal">CONFIRM FINAL DIAGNOSIS:</span>          
              <input type="checkbox" name="final_diagnosis" value="1" />
            </span>
			[% error__diagnosis_id %]
          </td>
        </tr>
      [% END %]

      [% UNLESS disable_submit # set above %]
      <tr>
        <td colspan="2" align="center" class="borderless">
          <input type="button" value="Check Spelling" onClick="openSpellChecker();" />
          [% IF spelling_checked # set flag for target rm update_report():
            || c.cfg('settings').require_spell_check.match('no') # not needed
            || authorisation_request # not needed %]
            <input type="hidden" name="_spelling_checked" value="1" />
            [% site.html.submit %]
          [% ELSE %]
            <input type="submit" value="Preview" style="color: #008000" />
          [% END %]
          [% site.html.reset %]
        </td>
      </tr>
      [% END %]
      
    </table>
  </form>
<!-- END report/report.tt -->