RSS Git Download  Clone
Raw Blame History
<!-- BEGIN hmrn/data/chronologies.tt -->

    [% IF user_can_enter_data %]
	<script type="text/javascript" src="/js/jquery-1.4.2.min.js"></script>
	<script type="text/javascript" src="/js/jquery-ui-1.8.4.custom.min.js"></script>	
    <script type="text/javascript">
        $(function() {
            $('.datepicker').datepicker({
                changeMonth: true,
                changeYear: true,
                dateFormat: 'dd/mm/yy',
            });
        });
	</script>
    [% END %]
	
    <h3 class="header">Chronological data:</h3>

    <form method="get" action="[% app_url %]/hmrn_data/edit_chronology/[% data.id %]/[% patient.id %]">
    [% dates = hmrn_data.chronology %]
    <table class="indent">
        <tr>
            <td class="label">Date of diagnosis:</td>
            <td class="content">
                <input type="text" name="diagnosed" class="datepicker" 
                    value="[% dates.diagnosed.strftime('%d.%b.%Y') %]" />
            </td>
        </tr>        
        <tr>
            <td class="label">Age at diagnosis:</td>
            <td class="content">
                [% age = dates.calculate_age(patient.dob,dates.diagnosed) %]
                <input type="text" value="[% age || '[ check null date(s) ]' %]"
					[% site.html.readonly %] />
            </td>
        </tr>
        <tr>
            <td class="label">First haem. appointment:</td>
            <td class="content">
                <input type="text" name="first_appointment" class="datepicker" 
                    value="[% dates.first_appointment.strftime('%d.%b.%Y') %]" />
            </td>
        </tr>
        <tr>
            <td class="label">Palliative referral date:</td>
            <td class="content">
                <input type="text" name="palliative_care" class="datepicker" 
                    value="[% dates.palliative_care.strftime('%d.%b.%Y') %]" />
            </td>
        </tr>
        <tr>
            <td class="label">Date of death:</td>
            <td class="content">
                <input type="text" name="deceased" class="datepicker" 
                    value="[% dates.deceased.strftime('%d.%b.%Y') %]" />
            </td>
        </tr>
        <tr>
            <td class="label" style="vertical-align: top">
                MDT meeting dates [[% dates.mdt_dates.size || 0 %]]:
            </td>
            <td class="content">
                [% FOREACH entry IN dates.mdt_dates %]
                <div>
                    [% loop.count %].
                    <span style="font-family: monospace">
                        [% entry.date.strftime('%d.%b.%Y') %]
                    </span>
                    [% IF user_can_enter_data %]
                    [<a href="[% app_url %]/hmrn/edit_mdt_date/[% entry.id %]">edit</a>]
                    [% END %]
                </div>                
                [% END %]
                [% IF user_can_enter_data %]
                <p>[% ( dates.mdt_dates.size || 0 ) + 1 %].
                    <input type="text" name="mdt_date" class="datepicker" size="10" />
                    &#171; new
                </p>
                [% END %]
            </td>
        </tr>
		[% INCLUDE hmrn_submit %]
    </table>
    </form>
<!-- END hmrn/data/chronologies.tt -->