- if medications.any?
  table[class="auto-layout" id="#{id}"]
    thead
      tr
        th
        th= sort_link_if(treatable.sortable?, search, :drug_name, "Medication")
        th Drug Type
        th Dose
        th Frequency
        th Route
        th Provider
        th Notes
        th= sort_link_if(treatable.sortable?, search, :prescribed_on, "Prescribed on")
        th Prescribed By
        - if include_terminated_column
          th Terminated On
    tbody
      - medications.each do |medication|
        tr
          td
            - if medication.current?
                = link_to "Edit", edit_patient_medication_path(patient, medication), remote: true
                = pipe_separator
                = link_to "Terminate", patient_medication_path(patient, medication), method: :delete,
                    remote: true, data: { confirm: "Are you sure?" }
          td= medication.drug.name
          td= medication.drug_types
          td= medication.dose
          td= medication.frequency
          td= medication.route_name
          td= medication.provider
          td= medication.notes
          td= I18n.l medication.prescribed_on
          td= medication.created_by.full_name
          - if include_terminated_column
            td= I18n.l medication.terminated_on
- else
  p There are no medications in this list.

- if medications.any?
  table[class="auto-layout" id="#{id}"]
    thead
      tr
        th
        th= sort_link_if(treatable.sortable?, search, :drug_name, "Medication")
        th Drug Type
        th Dose
        th Frequency
        th Route
        th Provider
        th Notes
        th= sort_link_if(treatable.sortable?, search, :prescribed_on, "Prescribed on")
        th Prescribed By
        - if include_terminated_column
          th Terminated On
    tbody
      - medications.each do |medication|
        tr
          td
            - if medication.current?
                = link_to "Edit", edit_patient_medication_path(patient, medication), remote: true
            - unless medication.terminated?
                = pipe_separator
                = link_to "Terminate", patient_medication_path(patient, medication), method: :delete,
                    remote: true, data: { confirm: "Are you sure?" }
          td= medication.drug.name
          td= medication.drug_types
          td= medication.dose
          td= medication.frequency
          td= medication.route_name
          td= medication.provider
          td= medication.notes
          td= I18n.l medication.prescribed_on
          td= medication.created_by.full_name
          - if include_terminated_column
            td= I18n.l medication.terminated_on
- else
  p There are no medications in this list.

Allow allow to terminate if medication is not previously terminated
Allow allow to terminate if medication is not previously terminated

airslie/renalware-core,airslie/renalware-core,airslie/renalware-core,airslie/renalware-core