Sha256: 2326fcef15c6b5c41a269d3352e2b1df1fceed1b2c91a7332bf5830094c5c966
Contents?: true
Size: 863 Bytes
Versions: 10
Compression:
Stored size: 863 Bytes
Contents
# frozen_string_literal: true require_dependency "renalware/patients" module Renalware module Patients class ClearPatientUKRDCData pattr_initialize [:patient!, :by!] def self.call(**args) new(**args).call end # Note that we want to avoid any patient validation errors (email is invalid etc) # at this important stage, so we use validate: false. While we validate patient data # entered thorugh the UI, its possible that some migrated data might be invalid # and would cause an error to be raised during a callback in save! def call patient.send_to_rpv = false patient.rpv_decision_on = Time.zone.today patient.rpv_recorded_by = by.to_s patient.skip_death_validations = true patient.by = by patient.save!(validate: false) end end end end
Version data entries
10 entries across 10 versions & 1 rubygems