Skip to content

Remove a flagged cross-reference id from the disease record - #151

Merged
KrishnaTO merged 1 commit into
mainfrom
claude/pr82-umls-flagged-id-removal-3b266d
Sep 3, 2026
Merged

Remove a flagged cross-reference id from the disease record#151
KrishnaTO merged 1 commit into
mainfrom
claude/pr82-umls-flagged-id-removal-3b266d

Conversation

@KrishnaTO

Copy link
Copy Markdown
Owner

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_xrefs had no counterpart, so a judgment that an id is not this disease changed nothing anyone could see: the ontology kept serving it, /api/v2/xrefs kept 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:C0156147 is flagged wrong for ARI:0001073 (Crohn's disease — C0156147 is Crohn's colitis, NCIT:C35211) and is still stored on the disease in that PR's ontologies/ari_t1d.owl.

What changed

  • remove_flagged_xrefs is the mirror of store_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 (umlsARI_UMLS, and so on through xref_registry.XREF_SUFFIXES), a Removed 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.
  • The one id already stranded that way on main is gone. ARI:0001012 (Ankylosing spondylitis) held ARI_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

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>
@KrishnaTO
KrishnaTO merged commit cb220dd into main Sep 3, 2026
2 checks passed
@KrishnaTO
KrishnaTO deleted the claude/pr82-umls-flagged-id-removal-3b266d branch September 8, 2026 00:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant