- compact = local_assigns.fetch(:compact, false) - allow_sorting = local_assigns[:query].present? .admissions-consults-table table thead tr th.col-width-medium.noprint - unless compact th.col-width-large - if allow_sorting = sort_link(query, :patient, ["patient_family_name", "patient_given_name asc"], "Patient") - else | Patient th.col-width-nhs-no.noprint NHS No. th.col-width-reference-no Hosp Nos. th.col-width-medium - if allow_sorting = sort_link(query, :hospital_ward_name, "Ward") - else | Ward th.col-width-tiny RRT th.col-width-date.noprint - if allow_sorting = sort_link(query, :started_on, "Started") - else | Started th.col-width-date.noprint - if allow_sorting = sort_link(query, :ended_on, "Ended") - else | Ended - unless compact th.col-width-small.show-for-large-up - if allow_sorting = sort_link([:renalware, query], :modality_desc, "Modality") - else | Modality - unless compact th.col-width-tiny.show-for-large-up Sex - unless compact th.col-width-date.show-for-large-up - if allow_sorting = sort_link(query, :patient_born_on, "DOB") - else | DOB - unless compact th.col-width-tiny.show-for-large-up Age th.col-width-tiny.noprint - if allow_sorting = sort_link(query, :aki_risk, "AKI Risk") - else | AKI Risk tbody - consults.each do |consult| - uid = "consult-#{consult.id}" tr.keep-with-next td.actions-dropdown.going-right.noprint / As we have lots of possible actions, group them in a button group. / A wrapping div is required for now in order for the button group display correctly / (though we could style the td like a div I guess). div button.button.secondary.dropdown(href="#" data-dropdown=uid aria-controls=uid aria-expanded="false") | Actions ul.f-dropdown(id="#{uid}" data-dropdown-content aria-hidden="true") = dropdown_btn_item(icon: "fa-edit", url: edit_admissions_consult_path(consult), title: "View/Edit", enabled: policy(consult).edit?) = dropdown_btn_item(icon: "fa-trash", url: admissions_consult_path(consult), title: "Mark as Done", method: :delete, data: { confirm: t(".delete_consult_warning_msg") }, enabled: policy(consult).destroy?) - if policy(Renalware::Admissions::Request).create? li= render "renalware/admissions/requests/create_request_link", patient: consult.patient, link_text: "Request Admission" |    = link_to("Toggle", "#consult-quick-preview-#{consult.id}", data: { behaviour: "toggler" }) - unless compact td= default_patient_link(consult.patient) td.noprint= consult.patient_nhs_number td= consult.patient_hospital_identifiers&.to_s_multiline td= consult.hospital_ward td= yes_no(consult.rrt?) td.noprint= l(consult.started_on) td.noprint= l(consult.ended_on) - unless compact td.show-for-large-up.col-width-medium-with-ellipsis= consult.patient_current_modality - unless compact td.show-for-large-up= consult.patient_sex - unless compact td.show-for-large-up= l(consult.patient.born_on) - unless compact td.show-for-large-up= consult.patient_age td.noprint= consult.aki_risk&.text /td.show-for-xlarge-up.consult-author.col-width-medium-with-ellipsis(title=consult.created_by)= consult.created_by /td.col-width-medium-with-ellipsis(title=consult.description)= consult.description = content_tag(:tr, id: "consult-quick-preview-#{consult.id}", style: "display: none") - colspan = compact ? 8 : 11 td(colspan=colspan) .quick-preview dl.dl-horizontal dt Author dd=consult.created_by dt Modality dd= consult.patient_current_modality dt Description dd= simple_format consult.description / When printing we just show the notes on the second row tr.print-only.child-row td(colspan=12)= simple_format consult.description