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.74 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.73 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.72 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.71 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.70 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.69 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.68 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.67 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.64 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.63 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.62 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.61 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.60 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.58 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.57 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.56 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.55 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.54 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.53 app/presenters/renalware/clinical/header_presenter.rb
renalware-core-2.0.52 app/presenters/renalware/clinical/header_presenter.rb