Sha256: cc206b9b323ec89122a3197e93911a1d697e7ff2b31b2e4b07221465780a5432

Contents?: true

Size: 1015 Bytes

Versions: 44

Compression:

Stored size: 1015 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
        @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

44 entries across 44 versions & 1 rubygems

Version Path
renalware-core-2.0.46 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.45 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.44 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.43 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.42 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.41 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.40 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.39 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.38 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.37 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.36 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.35 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.34 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.33 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.32 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.31 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.30 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.28 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.27 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.26 app/presenters/renalware/clinical/header_presenter.rb