Sha256: 11138a9252cd0e81f74918de8401ab183b20db3156373242cc87eaf80fca48c3

Contents?: true

Size: 922 Bytes

Versions: 142

Compression:

Stored size: 922 Bytes

Contents

# frozen_string_literal: true

# A Liquid 'Drop' - a safe, read-only presenter compatible with Liquid templates.
# We use Liquid templates for one-off hospital-specific views or print-outs.
require_dependency "renalware/patients"

module Renalware
  module Patients
    class PatientDrop < Liquid::Drop
      delegate :given_name,
               :family_name,
               :telephone1,
               :telephone2,
               to: :patient

      def initialize(patient)
        @patient = patient
      end

      def born_on
        I18n.l(patient.born_on)
      end

      def hospital_identifier
        patient.hospital_identifier&.to_s
      end

      def name
        patient.to_s(:default)
      end

      def current_modality
        patient.current_modality&.to_s
      end

      def diabetic
        patient.diabetic? ? "Yes" : "No"
      end

      private

      attr_reader :patient
    end
  end
end

Version data entries

142 entries across 142 versions & 1 rubygems

Version Path
renalware-core-2.0.147 app/drops/renalware/patients/patient_drop.rb
renalware-core-2.0.146 app/drops/renalware/patients/patient_drop.rb
renalware-core-2.0.145 app/drops/renalware/patients/patient_drop.rb
renalware-core-2.0.144 app/drops/renalware/patients/patient_drop.rb
renalware-core-2.0.143 app/drops/renalware/patients/patient_drop.rb
renalware-core-2.0.142 app/drops/renalware/patients/patient_drop.rb
renalware-core-2.0.141 app/drops/renalware/patients/patient_drop.rb
renalware-core-2.0.140 app/drops/renalware/patients/patient_drop.rb
renalware-core-2.0.139 app/drops/renalware/patients/patient_drop.rb
renalware-core-2.0.138 app/drops/renalware/patients/patient_drop.rb
renalware-core-2.0.137 app/drops/renalware/patients/patient_drop.rb
renalware-core-2.0.136 app/drops/renalware/patients/patient_drop.rb
renalware-core-2.0.135 app/drops/renalware/patients/patient_drop.rb
renalware-core-2.0.134 app/drops/renalware/patients/patient_drop.rb
renalware-core-2.0.133 app/drops/renalware/patients/patient_drop.rb
renalware-core-2.0.132 app/drops/renalware/patients/patient_drop.rb
renalware-core-2.0.131 app/drops/renalware/patients/patient_drop.rb
renalware-core-2.0.130 app/drops/renalware/patients/patient_drop.rb
renalware-core-2.0.129 app/drops/renalware/patients/patient_drop.rb
renalware-core-2.0.128 app/drops/renalware/patients/patient_drop.rb