Pass AttrSwapFields to nested translators #1126
Merged
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.
Issue
When changing the slider to 17 - 100 it also produces another incorrect query for top 10 conditions, procedures, labs and drugs. The query is matching domain occurrence id to person_id which gives incorrect results:
root cause - the attribute swap function is initialized on one filter translator, but not applied when it is actually translated to sql since it is done by a different filter translator. Possible fix - pass on attribute swap object
before change
debug:
added swapAttributeField (id / person_id) to GroupHasItemsFilterTranslator in BQRelationshipFilterTranslator.foreignKeyOnSelectEntity (object @387bd4ac)
checking attributeSwapFields (id) in BQRelationshipFilterTranslator.foreignKeyOnFilterEntity (object @5fc6cc6b)
after changes
also fixes bug in the top 10 charts for conditions, procedures, labs and drugs queries.
When selecting a Physical Measurement criteria first time in the query produced is incorrect and referencing columns that don’t exist in the entity table. Example query (T_RCNT_heartRatePerson_NOHIER doesn’t exist in T_ENT_measurementOccurrence table
after change