<commit_before>require_dependency "renalware/medications"

module Renalware
  module Medications
    class PrescriptionPresenter < DumbDelegator
      def route_name
        medication_route.other? ? route_description : medication_route.name
      end

      def drug_types
        drug.drug_types.map(&:name).join(", ")
      end

      def provider
        ::I18n.t(super, scope: "enums.provider")
      end

      def terminated_by
        if terminated?
          updated_by.full_name
        else
          ""
        end

      def dose
        "#{dose_amount} #{translated_dose_unit}"<commit_msg>simplify terminated_by method as per PR feedback<commit_after>require_dependency "renalware/medications"

module Renalware
  module Medications
    class PrescriptionPresenter < DumbDelegator
      def route_name
        medication_route.other? ? route_description : medication_route.name
      end

      def drug_types
        drug.drug_types.map(&:name).join(", ")
      end

      def provider
        ::I18n.t(super, scope: "enums.provider")
      end

      def terminated_by
        updated_by.full_name if terminated?
      end

      def dose
        "#{dose_amount} #{translated_dose_unit}"
{'fraction_non_alphanumeric': 0.07481296758104738, 'fraction_numerical': 0.0033250207813798837, 'mean_word_length': 2.510204081632653, 'pattern_counts': {'":': 0, '<': 5, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5711208', 'n_tokens_mistral': 366, 'n_tokens_neox': 345, 'n_words': 76}