Skip to content

Commit a689a7b

Browse files
authored
Add ingest_datetime to core.medical_claim and core.pharmacy_claim (#1263)
Pulls ingest_datetime through from normalized input to core staging and final models for medical_claim and pharmacy_claim. This field was already present in core.eligibility. Having both file_date and ingest_datetime in core strengthens traceability between raw data, input layer, and core, particularly when a payer sends the same claim across multiple files.
1 parent fa84ed4 commit a689a7b

5 files changed

Lines changed: 19 additions & 0 deletions

File tree

models/core/core_models.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,11 @@ models:
484484
config:
485485
meta:
486486
data_type: timestamp
487+
- name: ingest_datetime
488+
description: The date and time the source file was ingested into the data warehouse or landed in cloud storage.
489+
config:
490+
meta:
491+
data_type: timestamp
487492
- name: tuva_last_run
488493
description: The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.
489494
config:
@@ -1562,6 +1567,11 @@ models:
15621567
config:
15631568
meta:
15641569
data_type: timestamp
1570+
- name: ingest_datetime
1571+
description: The date and time the source file was ingested into the data warehouse or landed in cloud storage.
1572+
config:
1573+
meta:
1574+
data_type: timestamp
15651575
- name: tuva_last_run
15661576
description: The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.
15671577
config:
@@ -2303,6 +2313,11 @@ models:
23032313
config:
23042314
meta:
23052315
data_type: timestamp
2316+
- name: ingest_datetime
2317+
description: The date and time the source file was ingested into the data warehouse or landed in cloud storage.
2318+
config:
2319+
meta:
2320+
data_type: timestamp
23062321
- name: tuva_last_run
23072322
description: The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.
23082323
config:

models/core/final/core__medical_claim.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
{%- set tuva_metadata_columns -%}
7676
, data_source
7777
, file_date
78+
, ingest_datetime
7879
, file_name
7980
, tuva_last_run
8081
{%- endset %}

models/core/final/core__pharmacy_claim.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
{%- set tuva_metadata_columns -%}
4242
, data_source
4343
, file_date
44+
, ingest_datetime
4445
, file_name
4546
, tuva_last_run
4647
{%- endset %}

models/core/staging/core__stg_claims_medical_claim.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
{%- set tuva_metadata_columns -%}
9090
, cast(med.data_source as {{ dbt.type_string() }}) as data_source
9191
, cast(med.file_date as {{ dbt.type_timestamp() }}) as file_date
92+
, cast(med.ingest_datetime as {{ dbt.type_timestamp() }}) as ingest_datetime
9293
, cast(med.file_name as {{ dbt.type_string() }}) as file_name
9394
, cast('{{ var('tuva_last_run') }}' as {{ dbt.type_timestamp() }}) as tuva_last_run
9495
{%- endset %}

models/core/staging/core__stg_claims_pharmacy_claim.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
{%- set tuva_metadata_columns -%}
5252
, cast(pharm.data_source as {{ dbt.type_string() }}) as data_source
5353
, cast(pharm.file_date as {{ dbt.type_timestamp() }}) as file_date
54+
, cast(pharm.ingest_datetime as {{ dbt.type_timestamp() }}) as ingest_datetime
5455
, cast(pharm.file_name as {{ dbt.type_string() }}) as file_name
5556
, cast('{{ var('tuva_last_run') }}' as {{ dbt.type_timestamp() }}) as tuva_last_run
5657
{%- endset %}

0 commit comments

Comments
 (0)