Sha256: 851e7e85a5eea4ded2ff12beeeac4c4333dade1c2d342859ff63560ea1c96fc0
Contents?: true
Size: 595 Bytes
Versions: 60
Compression:
Stored size: 595 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
60 entries across 60 versions & 1 rubygems