[% META title="Sample storage" %] [% # PROCESS dumper.tt dump = request.as_tree %] [% # PROCESS dumper.tt dump = specimen_map %] [% # PROCESS dumper.tt dump = storage %] [% # PROCESS dumper.tt dump = c.stash.errs %] [% # PROCESS dumper.tt dump = menu_options %] [% # PROCESS dumper.tt dump = lab_tests %] [% # PROCESS dumper.tt dump = lab_sections %] [% # PROCESS dumper.tt dump = request_lab_tests %] [% # PROCESS dumper.tt dump = menu_options %] [% # define some data structures: # c.debug('##############'); # to reveal any db calls from templates patient = request.patient_case.patient; # not as_tree - preserve datetime objects; sample_codes = specimen_map.item(request.id).sample_code; %] [% INCLUDE record/patient_summary.tt %]

Sample storage

[% IF lab_tests.size; INCLUDE storage/request_lab_tests.tt; END %]

Current stock

Number of vials in store: [% available.size %]

[% IF storage.size %] [% FOREACH item IN storage; # PROCESS dumper.tt dump = item.as_tree class = item.signed_out ? 'grey' : 'normal'; %] [% END %]
Specimen Vial ID Sample Part Num Source Volume Concn Method Location In Out
[% loop.count %] [% item.specimen.sample_code %] [% item.vialId %] [% item.sample %] [% item.part_number %] [% item.source || site.html.grey_null %] [% IF item.volume; item.volume; 'µL'; ELSE; site.html.grey_null; END %] [% IF item.concentration; item.concentration; 'ng/µL'; ELSE; site.html.grey_null; END %] [% item.method || site.html.grey_null %] [% IF item.vial_location; IF item.rack.storage_location; item.rack.storage_location; '/'; END; item.rack.plateId _ '/' _ item.vial_location; END %] [% item.created_at.strftime('%d.%b.%Y') %] [% item.signed_out.strftime('%d.%b.%Y') %] [edit] [ [%# IF item.rack_id; 'x'; ELSE # allow delete vial if already allocated with a reason %] x [%# END %] ]
[% END %]

Input new vial [% div_name = 'input'; INCLUDE site/snippets/toggleview.tt %]

[% IF dfv_errors %]

[% c.cfg('msg').dfv_errors %]

[% END %]
[% display = c.query.param('sample').match('plasma|(?i)[rd]na') ? 'visible' : 'none' %]
Vial ID(s): [% IF error_vialId; error_vialId; ELSIF NOT c.query.param('vialId') %] « place cursor here to scan barcode [% END %]
Specimen: [% FOREACH s IN sample_codes; # PROCESS dumper.tt dump = s %]
[% END %]
[% error_specimen %]
Sample: [% error_sample %]
Part number: [% error_part_number %]
Source: [% error_source %]
Volume: [% error_volume %]
Concentration: [% error_concentration %]
Extraction
method:
[% error_method %]
[% site.html.submit %] [%# site.html.reset # don't need it %]
[% IF available.size %]

Output vial

[% IF error; # PROCESS dumper.tt dump = error %]

ERROR: [% error %]

[% END %]

Available vials to sign out: [% available.join(', ') %]

VialId: [% IF error_vialId; error_vialId; ELSE %] « place cursor here to scan barcode [% END %]

[% site.html.submit %]

[% END %]