Sha256: 64a6697cb7cd0f68949594b3c9f1a661187ea9b2708df727ee242a6e69786d9a

Contents?: true

Size: 539 Bytes

Versions: 114

Compression:

Stored size: 539 Bytes

Contents

# frozen_string_literal: true

module Renalware
  class BloodPressure < NestedAttribute
    attribute :systolic, Integer
    attribute :diastolic, Integer

    validates :systolic, numericality: { allow_blank: true }
    validates :diastolic, numericality: { allow_blank: true }
    validates_with Renalware::Patients::BloodPressureValidator

    def to_s
      return "" unless systolic.present? && diastolic.present?

      "#{systolic} / #{diastolic}"
    end

    def blank?
      systolic.blank? && diastolic.blank?
    end
  end
end

Version data entries

114 entries across 114 versions & 1 rubygems

Version Path
renalware-core-2.1.1 app/documents/renalware/blood_pressure.rb
renalware-core-2.1.0 app/documents/renalware/blood_pressure.rb
renalware-core-2.0.167 app/documents/renalware/blood_pressure.rb
renalware-core-2.0.166 app/documents/renalware/blood_pressure.rb
renalware-core-2.0.165 app/documents/renalware/blood_pressure.rb
renalware-core-2.0.164 app/documents/renalware/blood_pressure.rb
renalware-core-2.0.163 app/documents/renalware/blood_pressure.rb
renalware-core-2.0.162 app/documents/renalware/blood_pressure.rb
renalware-core-2.0.161 app/documents/renalware/blood_pressure.rb
renalware-core-2.0.160 app/documents/renalware/blood_pressure.rb
renalware-core-2.0.159 app/documents/renalware/blood_pressure.rb
renalware-core-2.0.158 app/documents/renalware/blood_pressure.rb
renalware-core-2.0.157 app/documents/renalware/blood_pressure.rb
renalware-core-2.0.156 app/documents/renalware/blood_pressure.rb
renalware-core-2.0.155 app/documents/renalware/blood_pressure.rb
renalware-core-2.0.153 app/documents/renalware/blood_pressure.rb
renalware-core-2.0.152 app/documents/renalware/blood_pressure.rb
renalware-core-2.0.151 app/documents/renalware/blood_pressure.rb
renalware-core-2.0.149 app/documents/renalware/blood_pressure.rb
renalware-core-2.0.148 app/documents/renalware/blood_pressure.rb