Remove a flagged cross-reference id from the disease record - #151
Merged
Conversation
Flagging a cross-reference as wrong wrote a negative SSSOM row and a changelog line but left the id on the disease, so the ontology kept serving an id a curator had judged wrong and the review grid kept offering it as unreviewed. store_confirmed_xrefs had no counterpart. remove_flagged_xrefs drops the flagged ids from the property their database maps to, records who removed them in the disease's changelog, and reports the count in the publish PR body. Ids the record does not hold are ignored, and the other ids in the same field are untouched. Also removes the one id already stranded that way: ARI:0001012 (Ankylosing spondylitis) held ARI_ICD10 720.0, flagged 2026-07-10. A sweep of all 124 stored negative judgments found no others. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Flagging a cross-reference as wrong wrote the negative SSSOM row (
predicate_modifier = Not) and the disease's changelog line, and left the id itself on the record.store_confirmed_xrefshad no counterpart, so a judgment that an id is not this disease changed nothing anyone could see: the ontology kept serving it,/api/v2/xrefskept returning it, and the review grid kept offering it as an unreviewed value the next curator could confirm.Found on KrishnaTO/ARI#82, a live mappings-review PR:
umls:C0156147is flagged wrong forARI:0001073(Crohn's disease — C0156147 is Crohn's colitis, NCIT:C35211) and is still stored on the disease in that PR'sontologies/ari_t1d.owl.What changed
remove_flagged_xrefsis the mirror ofstore_confirmed_xrefs. Publish runs it over the session's flagged cells right after the confirm pass: the id leaves the property its database maps to (umls→ARI_UMLS, and so on throughxref_registry.XREF_SUFFIXES), aRemoved flagged cross-reference: …changelog entry records who dropped it, and the PR body reports how many ids were removed next to how many were stored. Ids the record does not hold are ignored, so re-flagging is idempotent, and the other ids in the same field are untouched.mainis gone.ARI:0001012(Ankylosing spondylitis) heldARI_ICD10 720.0, flagged on 2026-07-10 and still served. Removed here. A sweep of all 124 stored negative judgments against the ontology found no others — the backlog was that single row.Verification
Two tests added: flagging removes the id and leaves the field's other ids alone, and flagging an id the disease does not hold is a no-op that writes no changelog entry. 308 pytest pass, ruff clean. Backend and data only — no endpoint, schema or auth boundary changes.
🤖 Generated with Claude Code