Skip to content

Commit

Permalink
Background jobs that flag entities should use the activity, not the a…
Browse files Browse the repository at this point in the history
…ction
  • Loading branch information
susannasiebert committed Apr 19, 2024
1 parent 03006e1 commit 17ad705
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions server/app/jobs/flag_duplicate_allele_registry_ids.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ def perform
duplicates.each do |caid, ids|
variants = Variant.where(id: ids)
variants.each do |variant|
if variant.flags.select{|f| f.state == 'open' && f.comments.select{|c| c.text =~ /This Variant may be a duplicate and may need to be deprecated/ && c.user_id == 385}.count > 0}.count == 0
Actions::FlagEntity.new(
if variant.flags.select{|f| f.state == 'open' && f.open_activity.note =~ /This Variant may be a duplicate and may need to be deprecated/ && f.open_activity.user_id == 385}.count == 0
Activity::FlagEntity.new(
flagging_user: civicbot_user,
flaggable: variant,
organization_id: nil,
comment: "The Allele Registry ID of this Variant is used more than once. This Variant may be a duplicate and may need to be deprecated. The following Variants all resolved to Allele Registry ID \"#{caid}\": #{ids.join(', ')}"
note: "The Allele Registry ID of this Variant is used more than once. This Variant may be a duplicate and may need to be deprecated. The following Variants all resolved to Allele Registry ID \"#{caid}\": #{ids.join(', ')}"
).perform
end
end
Expand Down
6 changes: 3 additions & 3 deletions server/app/lib/importer/disease_ontology_mirror.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,12 @@ def url_from_doid(doid)
def add_flags(disease, text)
civicbot_user = User.find(385)
(disease.evidence_items + disease.assertions).each do |obj|
if obj.flags.select{|f| f.state == 'open' && f.comments.select{|c| c.comment == text && c.user_id == 385}.count > 0}.count == 0
Actions::FlagEntity.new(
if obj.flags.select{|f| f.state == 'open' && f.open_activity.note == text && c.open_activity.user_id == 385}.count == 0
Activity::FlagEntity.new(
flagging_user: civicbot_user,
flaggable: obj,
organization_id: nil,
comment: text
note: text
).perform
end
end
Expand Down
6 changes: 3 additions & 3 deletions server/app/lib/scrapers/human_phenotype_ontology.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ def self.update
else
civicbot_user = User.find(385)
(p.evidence_items + p.assertions).each do |obj|
if obj.flags.select{|f| f.state == 'open' && f.comments.select{|c| c.text =~ /deprecated HPO term/ && c.user_id == 385}.count > 0}.count == 0
Actions::FlagEntity.new(
if obj.flags.select{|f| f.state == 'open' && f.open_activity.note =~ /deprecated HPO term/ && f.open_activity.user_id == 385}.count == 0
Activity::FlagEntity.new(
flagging_user: civicbot_user,
flaggable: obj,
organization_id: nil,
comment: "This entity uses a deprecated HPO term \"#{name}\" (#{hpo_id})"
note: "This entity uses a deprecated HPO term \"#{name}\" (#{hpo_id})"
).perform
end
end
Expand Down

0 comments on commit 17ad705

Please sign in to comment.