-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Related to: #2362 (comment)
User story
As a curator, I want OpenMRS validation on CIEL/HEAD to correctly reject duplicate Fully Specified Names so duplicates cannot be saved into the source.
Use case
Create or update a concept name in CIEL/HEAD with OpenMRS validation enabled and ensure identical FSNs are rejected.
Requirements
- Fix OpenMRS validation logic so duplicate FSNs are reliably detected and rejected.
- Ensure name comparison does not drop entire concepts from the comparison set due to unrelated names (e.g., synonyms/NULL types).
- Add a regression test reproducing the staging case where “Cerebral malaria” exists as FSN in two different concepts and confirm validation blocks it.
Acceptance criteria
- Given OpenMRS validation is enabled, when attempting to save a concept with an FSN that already exists (same locale + same text) in another active concept, then validation fails and the save is rejected.
- Validation behavior is consistent even when compared concepts have other names with excluded/NULL types.
- A regression test covers the “Cerebral malaria” duplicate scenario and passes after the fix.
More details
Check: https://github.com/OpenConceptLab/oclapi2/blob/master/core/concepts/custom_validators.py#L99
Staging evidence and context
- CIEL/HEAD on staging has custom_validation_schema = OpenMRS
- Duplicate FSN exists: “Cerebral malaria” appears on concepts 145851 and 17307337
- Suspected root cause: OpenMRS validator uses chained exclude() clauses on the reverse names relation, which can remove entire concepts from the queryset based on any related name record, preventing proper FSN comparison
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Projects
Status
Todo