Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

q_ref_target_valid: change denominator from fields to rows #37

Merged
merged 1 commit into from
May 29, 2024

Conversation

mikix
Copy link
Contributor

@mikix mikix commented May 29, 2024

Before, we would count all potential matching Reference fields as the denominator. This commit aligns us back with the qualifier metric documentation to just use all rows as the denominator.

In cases like DocumentReference.context.encounter that can have multiple references, we include the row once in the numerator and concatenate the target values for debugging.

Noticed this discrepancy during a recent qualifier doc read-through.

Before, we would count all potential matching Reference fields as the
denominator. This commit aligns us back with the qualifier metric
documentation to just use all rows as the denominator.

In cases like DocumentReference.context.encounter that can have
multiple references, we include the row once in the numerator and
concatenate the target values for debugging.
LEFT JOIN {{ dest }} AS dest
ON SUBSTRING(src.{{ field }}.reference, LENGTH('{{ dest }}/') + 1) = dest.id
WHERE
src.{{ field }}.reference LIKE '{{ dest }}/%'

Choose a reason for hiding this comment

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

reminder that we're supposed to use regexp() instead of LIKE for performance reasons.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah yes thank you - filed #38 and I'll do that as a separate thing.

@mikix mikix merged commit 1c3f353 into main May 29, 2024
2 checks passed
@mikix mikix deleted the mikix/target-valid-denom branch May 29, 2024 14:30
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.

2 participants