OHDSI / dbt-synthea

[Under development] A dbt ETL project to convert a Synthea synthetic data set into the OMOP CDM
https://ohdsi.github.io/dbt-synthea/
Apache License 2.0
16 stars 6 forks source link

Move date typecasts into stg models #40

Closed katy-sadowski closed 1 month ago

katy-sadowski commented 5 months ago

There are repeated typecasts of timestamp-->date in the OMOP models. To DRY up the code we can move these into the original stg models by creating a _date column in those models and carrying it through to the final models.

For example: https://github.com/OHDSI/dbt-synthea/blob/236f52ab1f651e418eab6978d6a9bb92754ad682/models/omop/drug_exposure.sql#L11

katy-sadowski commented 1 month ago

@lawrenceadams , I have addressed this Issue in commit https://github.com/OHDSI/dbt-synthea/commit/ae791145d50c9e0693880ff9ed37d60f7cc0195d

I accidentally pushed to main 🙈 I had branch protections relaxed for myself in the early days and forgot I was working on main. I have added these back now so I won't be able to do that in the future...oopsie! It runs and passes all tests on duckdb and Postgres. If you'd like to take a look / test the changes please do! What I did:

lawrenceadams commented 1 month ago

Oops! easily done (have done it myself before)!!

Excellent commit! 💪