[% META
title = 'Haematological Malignancy Research Network » Clinical Data'
%]
[% # PROCESS dumper.tt dump = request_data.request_report.diagnosis.diagnostic_category_id %]
[% # PROCESS dumper.tt dump = hmrn_data.maps.diagnostic_categories %]
[% # PROCESS dumper.tt dump = request_data.as_tree %]
[% # PROCESS dumper.tt dump = request_history %]
[% # PROCESS dumper.tt dump = hmrn_data %]
[% # PROCESS dumper.tt dump = validation_profile.constraints %]
[% # PROCESS dumper.tt dump = demographic_data.practice %]
[% # PROCESS dumper.tt dump = c.stash.errs %]
[% # PROCESS dumper.tt dump = hmrn_data.maps.parameters %]
[% # PROCESS dumper.tt dump = hmrn_data.maps %]
[% # PROCESS dumper.tt dump = hmrn_data %]
[% # PROCESS dumper.tt dump = hmrn_data.params %]
[% # PROCESS dumper.tt dump = hmrn_data.maps.parameter_menu_items %]
[% addcss = [
'validationEngine.jquery.css' # for validationEngine
'smoothness/jquery-ui-1.8.4.custom.css' # for DatePicker
]
%]
[%
data = request_data;
report_data = data.request_report;
patient = data.patient_case.patient;
parameters = hmrn_data.maps.parameters;
diagnostic_category_id = request_data.request_report.diagnosis.diagnostic_category_id;
diagnostic_category_desc = hmrn_data.maps.diagnostic_categories.$diagnostic_category_id;
%]
[% user_can_enter_data = c.user_can('edit_clinical_data')
AND patient.nhs_number ? 1 : 0 # MUST have primary identifier (NHS No) %]
[% # PROCESS site/js/jquery.tt # already loaded in html_wrapper %]
[% BLOCK hmrn_submit;
IF user_can_enter_data %]
[% site.html.submit %]
[% site.html.reset %]
[% IF delete_section %]
[ delete ... ]
[% END %]
[% END; END %]
[% BLOCK define_shared_with; # is param shared with any other section ?
# may not be possible - class is redefined
shared_with = 0;
class = [];
validation_profile.required_fields.item(type).item(name)
? class.push('validate[required]') : class.push('normal');
IF hmrn_data.maps.parameters.$name.in_categories.size > 1;
shared_with = hmrn_data.maps.parameters.$name.in_categories;
class.push('hmrn-shared-param');
END;
END %]
[% BLOCK build_select_field;
# INCLUDE dumper.tt dump = hmrn_data.maps.parameters.$name.in_categories.join(', ');
# PROCESS define_shared_with;
shared_with = 0;
class = [];
validation_profile.required_fields.item(type).item(name)
? class.push('validate[required]') : class.push('normal');
IF hmrn_data.maps.parameters.$name.in_categories.size > 1;
shared_with = hmrn_data.maps.parameters.$name.in_categories;
class.push('hmrn-shared-param');
END;
%]
[% FOREACH opt IN hmrn_data.maps.parameter_menu_items %]
[% IF opt.param_name == name %]
[% opt.item_value %]
[% END %]
[% END %]
[% END %]
[% BLOCK build_text_field;
# INCLUDE dumper.tt dump = hmrn_data.maps.parameters.$name.in_categories;
constraint = validation_profile.constraints.item(name); # name;
class = []; # set after validation
IF user_can_enter_data;
validate = [];
IF validation_profile.required_fields.item(type).item(name);
validate.push('required');
ELSE;
validate.push('optional'); # or empty textboxes fail validation
END;
IF constraint;
validate.push("ajax[ajaxRange]");
IF constraint.field_type == 'decimal';
validate.push('custom[onlyDecimal]');
ELSIF constraint.field_type == 'int';
validate.push('custom[onlyNumber]');
END;
END;
END;
IF validate.size;
str = validate.join(',');
class.push("validate[$str]");
ELSE; class.push('normal'); END;
# PROCESS define_shared_with;
shared_with = 0;
# class = [];
# validation_profile.required_fields.item(type).item(name)
# ? class.push('validate[required]') : class.push('normal');
IF hmrn_data.maps.parameters.$name.in_categories.size > 1;
shared_with = hmrn_data.maps.parameters.$name.in_categories;
class.push('hmrn-shared-param');
END;
%]
[% IF error; error; %]
[% ELSIF user_can_enter_data;
constraint = validation_profile.constraints.item(name);
NS = constraint.field_type == 'int' ? # get rid of trailing .0
10 * constraint.not_stated / 10 : constraint.not_stated;
ND = constraint.field_type == 'int' ? # get rid of trailing .0
10 * constraint.not_done / 10 : constraint.not_done;
%]
«
(
NS
|
ND
)
[% IF units; '[' _ units _ ']'; END %]
[% END %]
[% END %]
[% IF user_can_enter_data %]
[% IF not_using_validationEngine_jquery # then use 'basic' jquery val %]
[% ELSE; INCLUDE site/js/validationEngine.tt; END %]
[% END %]
[% IF dfv_errors; # PROCESS dumper.tt dump = c.stash.errs %]
******** FORM FAILED VALIDATION ********
jump to error(s) »
[% END %]
[% IF c.user_can('edit_clinical_data');
IF patient.nhs_number; user_can_enter_data = 1;
ELSE %]
Cannot enter/edit data without NHS number
[% END %]
[% END %]
[%
INCLUDE hmrn/data/patient_summary.tt;
INCLUDE hmrn/data/chronologies.tt;
INCLUDE hmrn/data/referral.tt;
INCLUDE hmrn/data/antecedent.tt;
INCLUDE hmrn/data/treatment.tt;
INCLUDE hmrn/data/clinical_data.tt;
INCLUDE hmrn/data/comments.tt;
%]