Sha256: 7150ab22dab3cb883b4e2a2f6e2a6ac3652e4b46e36c46923dc20ba46c361bf5

Contents?: true

Size: 507 Bytes

Versions: 4

Compression:

Stored size: 507 Bytes

Contents

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

4 entries across 4 versions & 1 rubygems

Version Path
renalware-core-2.0.16 app/documents/renalware/blood_pressure.rb
renalware-core-2.0.15 app/documents/renalware/blood_pressure.rb
renalware-core-2.0.14 app/documents/renalware/blood_pressure.rb
renalware-core-2.0.13 app/documents/renalware/blood_pressure.rb