-
Notifications
You must be signed in to change notification settings - Fork 97
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
Rewrite temporalPlausibleAfter
for checking events before birth
#445
Comments
Another note: the logic uses June 1st is used as a proxy together with the year of birth. This is tricky, as half of the persons will be born before that. We could combine all four date of birth fields into one query, using the information that is available and defaulting to the first day of the month/year when unavailable. COALESCE(
plausibleTable.birth_datetime,
CAST(CONCAT(
plausibleTable.year_of_birth, '-',
COALESCE(plausibleTable.month_of_birth, 1), '-',
COALESCE(plausibleTable.day_of_birth, 1)
) AS DATE)
) To replace the coalesce in: DataQualityDashboard/inst/sql/sql_server/field_plausible_temporal_after.sql Lines 43 to 48 in 1197d5d
This might warrant a whole new check specifically checking for events before birth (akin to |
temporalPlausibleAfter
to check events before birthtemporalPlausibleAfter
for checking events before birth
I agree with the proposal here! Also agree that comparisons to DOB may be better off in their own check to reduce complexity of |
Thanks Katy. I will indeed add this to the PR you mentioned, refactoring the |
The check
temporalPlausibleAfter
is used to check for dates before birth based onPERSON.BIRTH_DATETIME
.However, this is a non-required field and therefore will be empty in many databases.
I would propose to use
PERSON.YEAR_OF_BIRTH
by default, for which there is already logic in field_plausible_temporal_after.sql. To make this work, theplausibleTemporalAfterTableName
is set to PERSON andplausibleTemporalAfterFieldName
has to be left empty in the field-level thresholds file.The text was updated successfully, but these errors were encountered: