Sha256: 9fcc69902a29d7b0729b94b19638768cdbc1a74d49cb987776b2fd3de46b3b1c
Contents?: true
Size: 594 Bytes
Versions: 35
Compression:
Stored size: 594 Bytes
Contents
# frozen_string_literal: true module Renalware module Clinical class AllergyStatusForm include ActiveModel::Model include Virtus::Model attribute :no_known_allergies, Integer def save(patient, user) return unless patient.allergies.count == 0 patient.allergy_status = no_known_allergies? ? :no_known_allergies : :unrecorded patient.by = user patient.allergy_status_updated_at = Time.zone.now patient.save! end private def no_known_allergies? no_known_allergies == 1 end end end end
Version data entries
35 entries across 35 versions & 1 rubygems