Include vocabulary and domain ID in NearestConceptMatch#49
Open
nicoloesch wants to merge 2 commits into
Open
Conversation
gkennos
requested changes
Jul 23, 2026
gkennos
left a comment
Member
There was a problem hiding this comment.
add at least one test that asserts end to end that new fields are populated on returned matches
gkennos
approved these changes
Jul 23, 2026
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.
Summary
NearestConceptMatchnow carriesdomain_id,vocabulary_id, andis_activealongside the existingis_standard, and all three embedding backends (pgvector,sqlite-vec, and theFAISSsidecar) populate them consistently. Previously onlyis_standardwas returned by KNN queries, whereasdomain_id/vocabulary_idweren't exposed at all.is_activewas documented as CDM-enriched but actually already got populated during ingestion.These four fields all come from the embedding table's own filter columns (written from the CDM at ingestion time), so they're now always populated regardless of whether an
omop_cdm_engineis configured for the read interface.concept_nameremains the only field that requires a CDM engine at query time to "save" some storage.As part of this,
ConceptEmbeddingRecord.is_validno longer defaults to True. It's now required, matchingis_standard, so every call site has to state a concept's validity explicitly instead of silently inheriting a default. This was already done in production code and only had to be adapted in test sites.Checklist