Sha256: fe661a69abe6661e46b82540203844cb774e1f4f8e1fdaaa28caa390c56e8f07
Contents?: true
Size: 596 Bytes
Versions: 54
Compression:
Stored size: 596 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.zero? 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
54 entries across 54 versions & 1 rubygems