ActiveRecord::RecordInvalid: Validation failed: Procedure cost must be greater than or equal to 0
sentry-io opened this issue · 3 comments
sentry-io commented
Sentry Issue: DARIA-SERVICES-PRODUCTION-W
ActiveRecord::RecordInvalid: Validation failed: Procedure cost must be greater than or equal to 0
[FILTERED]:111:in `block in convert_patient'
archived_patient.save!
[FILTERED]:110:in `convert_patient'
PaperTrail.request(whodunnit: patient.created_by_id) do
[FILTERED]:53:in `block (2 levels) in archive_eligible_patients!'
ArchivedPatient.convert_patient(patient)
[FILTERED]:52:in `block in archive_eligible_patients!'
ActiveRecord::Base.transaction do
[FILTERED]:50:in `archive_eligible_patients!'
Patient.all.each do |patient|
...
(50 additional frame(s) were not displayed)
[FILTERED]
colinxfleming commented
@elimbaum can you take a gander at this? I think the thrust of it is that we've got a patient eligible for archiving who has a negative patient.procedure_cost. For weird cases like this, let's please set to nil.
This shouldn't happen anymore because of some data integrity improvements we've made, so not super worried about it being a common case.
elimbaum commented
How specific do you want this to be?
- if
procedure_cost
is negative set it tonil
- if any numeric value is negative set it to
nil
- if any field fails validation on archiving set it to
nil
- something else?
colinxfleming commented
Just the first please! Should only affect procedure cost if possible
…On Mon, Mar 13, 2023 at 10:45 PM Eli Baum ***@***.***> wrote:
How specific do you want this to be?
- if procedure_cost is negative set it to nil
- if any numeric value is negative set it to nil
- if any field fails validation on archiving set it to nil
- something else?
—
Reply to this email directly, view it on GitHub
<#2855 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA5QB5GCKTZUEKDO2BETVB3W37LT7ANCNFSM6AAAAAAVEQZCLM>
.
You are receiving this because you commented.Message ID:
***@***.***>