<commit_before>.admissions-consults-table
  table
    thead
      tr
        th.col-width-medium.noprint
        th.col-width-large
          = sort_link(query, :patient, ["patient_family_name", "patient_given_name asc"], "Patient")
        th.col-width-nhs-no.noprint NHS No.
        th.col-width-reference-no Hosp Nos.
        th.col-width-medium= sort_link(query,
                                      :location,
                                      [:consult_site_name, :hospital_ward_name],
                                      "Location")
        th.col-width-date.noprint= sort_link(query, :started_on, "Started")
        th.col-width-date.noprint= sort_link(query, :ended_on, "Ended")
        th.col-width-small.show-for-large-up Modality
        th.col-width-tiny.show-for-large-up Sex
        th.col-width-date.show-for-large-up= sort_link(query, :patient_born_on, "DOB")
        th.col-width-tiny.show-for-large-up.noprint Age
        th.col-width-tiny RRT?
        th.col-width-tiny.noprint= sort_link(query, :aki_risk, "AKI Risk")
        th.col-width-tiny.noprint= sort_link(query, :requires_aki_nurse, " AKI Nurse?")
        /th.show-for-large-up Author
        /th.col-width-medium.show-for-xlarge-up Description

    tbody
      - consults.each do |consult|
        - uid = "consult-#{consult.id}"
        tr
          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"
            | &nbsp;&nbsp;
            = link_to("Toggle",
                      "#consult-quick-preview-#{consult.id}",
                      data: { behaviour: "toggler" })
          td= default_patient_link(consult.patient)
          td.noprint= consult.patient_nhs_number
          td= consult.patient_hospital_identifiers&.to_s_multiline
          td= consult.location
          td.noprint= l(consult.started_on)
          td.noprint= l(consult.ended_on)
          td.show-for-large-up= consult.patient_current_modality
          td.show-for-large-up= consult.patient_sex
          td.show-for-large-up= l(consult.patient.born_on)
          td.show-for-large-up.noprint= consult.patient_age
          td= yes_no(consult.rrt)
          td.noprint= consult.aki_risk&.text
          td.noprint= yes_no(consult.requires_aki_nurse)
          /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")
          td(colspan=12)<commit_msg>Make modality fit better in the consults table<commit_after>.admissions-consults-table
  table
    thead
      tr
        th.col-width-medium.noprint
        th.col-width-large
          = sort_link(query, :patient, ["patient_family_name", "patient_given_name asc"], "Patient")
        th.col-width-nhs-no.noprint NHS No.
        th.col-width-reference-no Hosp Nos.
        th.col-width-medium= sort_link(query,
                                      :location,
                                      [:consult_site_name, :hospital_ward_name],
                                      "Location")
        th.col-width-date.noprint= sort_link(query, :started_on, "Started")
        th.col-width-date.noprint= sort_link(query, :ended_on, "Ended")
        th.col-width-small.show-for-large-up Modality
        th.col-width-tiny.show-for-large-up Sex
        th.col-width-date.show-for-large-up= sort_link(query, :patient_born_on, "DOB")
        th.col-width-tiny.show-for-large-up.noprint Age
        th.col-width-tiny RRT?
        th.col-width-tiny.noprint= sort_link(query, :aki_risk, "AKI Risk")
        th.col-width-tiny.noprint= sort_link(query, :requires_aki_nurse, " AKI Nurse?")
        /th.show-for-large-up Author
        /th.col-width-medium.show-for-xlarge-up Description

    tbody
      - consults.each do |consult|
        - uid = "consult-#{consult.id}"
        tr
          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"
            | &nbsp;&nbsp;
            = link_to("Toggle",
                      "#consult-quick-preview-#{consult.id}",
                      data: { behaviour: "toggler" })
          td= default_patient_link(consult.patient)
          td.noprint= consult.patient_nhs_number
          td= consult.patient_hospital_identifiers&.to_s_multiline
          td= consult.location
          td.noprint= l(consult.started_on)
          td.noprint= l(consult.ended_on)
          td.show-for-large-up.col-width-medium-with-ellipsis= consult.patient_current_modality
          td.show-for-large-up= consult.patient_sex
          td.show-for-large-up= l(consult.patient.born_on)
          td.show-for-large-up.noprint= consult.patient_age
          td= yes_no(consult.rrt)
          td.noprint= consult.aki_risk&.text
          td.noprint= yes_no(consult.requires_aki_nurse)
          /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")
          td(colspan=12)
{'fraction_non_alphanumeric': 0.10787629862285576, 'fraction_numerical': 0.00048320850446967865, 'mean_word_length': 1.6026406790317511, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 38, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6610821', 'n_tokens_mistral': 2486, 'n_tokens_neox': 2349, 'n_words': 386}