Sha256: 683e28a1c77ba2847ddcebc930a7b85d9ced9a619c50d5b67b18fb492464d7af

Contents?: true

Size: 1023 Bytes

Versions: 104

Compression:

Stored size: 1023 Bytes

Contents

# frozen_string_literal: true

require_dependency "renalware"
require "attr_extras"

module Renalware
  module Clinical
    class HeaderPresenter
      pattr_initialize :patient
      delegate :weight, :height, :blood_pressure, :bmi, to: :clinical_current_observations
      delegate :measurement, :date, to: :weight, prefix: true
      delegate :measurement, :date, to: :height, prefix: true
      delegate :measurement, :date, to: :blood_pressure, prefix: true
      delegate :measurement, :date, to: :bmi, prefix: true

      def current_pathology
        @current_pathology ||= pathology_current_observation_set.values
      end

      private

      def pathology_current_observation_set
        pathology_patient.current_observation_set || Pathology::NullObservationSet.new
      end

      def pathology_patient
        Pathology.cast_patient(patient)
      end

      def clinical_current_observations
        @clinical_current_observations ||= Clinics::CurrentObservations.new(patient)
      end
    end
  end
end

Version data entries

104 entries across 104 versions & 1 rubygems

Version Path
renalware-core-2.0.159 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.158 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.157 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.156 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.155 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.153 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.152 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.151 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.149 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.148 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.147 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.146 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.145 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.144 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.143 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.142 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.141 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.140 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.139 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.138 app/presenters/renalware/clinical/header_presenter.rb