Skip to content

OpenConceptLab/ocl_issues#2494 | locale retired#865

Open
snyaggarwal wants to merge 2 commits intomasterfrom
issues#2494
Open

OpenConceptLab/ocl_issues#2494 | locale retired#865
snyaggarwal wants to merge 2 commits intomasterfrom
issues#2494

Conversation

@snyaggarwal
Copy link
Copy Markdown
Contributor

Linked Issue

Ref OpenConceptLab/ocl_issues#2494

  • retired flag on concept.names and concept.descriptions
  • only not retired locales are searchable

Comment thread core/concepts/views.py Fixed
Copy link
Copy Markdown
Member

@paynejd paynejd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Notes

Overall: Solid approach — soft-delete via retired flag, consistent filtering with active_names/active_descriptions, good partial indexes, and nice test coverage.

A few things worth checking:

  1. CodeQL flag on views.py:728 — the or e fallback in the except ValidationError block passes the raw exception to the Response. Should be or str(e) or or e.messages to avoid leaking stack trace info.

  2. GraphQL inconsistencyserialize_names (queries.py:172) returns all names including retired, but resolve_description (queries.py:543) filters to active_descriptions only. Is that intentional?

  3. all_names property removed — was anything else referencing it (exports, OCL Module)?

  4. Migration 0081 drops and recreates the preferred_locale index on ConceptName. With 20M+ rows that index rebuild will take a lock — worth scheduling during a maintenance window.

@snyaggarwal
Copy link
Copy Markdown
Contributor Author

  1. Fixed
  2. serialize_names returns all names, while resolve_description resolves to preferred one so retired needs to be excluded from here.
  3. all_names was dead code
  4. tried on local with staging dump and took around 60seconds for indexes migrations. In any case will run this with migration service.

Comment thread core/concepts/views.py Dismissed
@filiperochalopes
Copy link
Copy Markdown
Contributor

I noticed that concept_name.retired_reason (string) was not implemented. Was this an intentional architectural decision to keep the scope concise @paynejd ?

Some terminologies use a controlled set of coded reasons, while CIEL uses an open string field. These values exist in the CIEL/OpenMRS data model and could be lost if not implemented. That said, I’m not sure yet what the actual impact of that loss would be. @askanter

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.

Add retired fields to Concept Name model for OpenMRS compatibility (retired + retiredReason)

4 participants