Sha256: 91ba178f69660b06b52f163075f318336b3269f1e38adad1bf30ba275c6b128f

Contents?: true

Size: 891 Bytes

Versions: 35

Compression:

Stored size: 891 Bytes

Contents

# 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

35 entries across 35 versions & 1 rubygems

Version Path
renalware-core-2.0.16 app/drops/renalware/patients/patient_drop.rb
renalware-core-2.0.15 app/drops/renalware/patients/patient_drop.rb
renalware-core-2.0.14 app/drops/renalware/patients/patient_drop.rb
renalware-core-2.0.13 app/drops/renalware/patients/patient_drop.rb
renalware-core-2.0.12 app/drops/renalware/patients/patient_drop.rb
renalware-core-2.0.11 app/drops/renalware/patients/patient_drop.rb
renalware-core-2.0.9 app/drops/renalware/patients/patient_drop.rb
renalware-core-2.0.8 app/drops/renalware/patients/patient_drop.rb
renalware-core-2.0.7 app/drops/renalware/patients/patient_drop.rb
renalware-core-2.0.5 app/drops/renalware/patients/patient_drop.rb
renalware-core-2.0.4 app/drops/renalware/patients/patient_drop.rb
renalware-core-2.0.3 app/drops/renalware/patients/patient_drop.rb
renalware-core-2.0.2 app/drops/renalware/patients/patient_drop.rb
renalware-core-2.0.1 app/drops/renalware/patients/patient_drop.rb
renalware-core-2.0.0 app/drops/renalware/patients/patient_drop.rb
renalware-core-2.0.0.pre.rc13 app/drops/renalware/patients/patient_drop.rb
renalware-core-2.0.0.pre.rc11 app/drops/renalware/patients/patient_drop.rb
renalware-core-2.0.0.pre.rc10 app/drops/renalware/patients/patient_drop.rb
renalware-core-2.0.0.pre.rc9 app/drops/renalware/patients/patient_drop.rb
renalware-core-2.0.0.pre.rc8 app/drops/renalware/patients/patient_drop.rb