Skip to content

Commit

Permalink
Revert "rxnorm update and intermediate tables"
Browse files Browse the repository at this point in the history
This reverts commit 56f786e.
  • Loading branch information
lprzychodzien committed May 17, 2024
1 parent eb96bfc commit 0480383
Show file tree
Hide file tree
Showing 34 changed files with 299 additions and 385 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
-- int_mthspl_products_to_active_ingredients.sql

with substance as (
SELECT * FROM {{ ref('stg_rxnorm__mthspl_substances') }}
)
with

, product as (
SELECT * FROM {{ ref('stg_rxnorm__mthspl_products') }}
)
substance as (

select * from {{ ref('stg_rxnorm__mthspl_substances') }}

),

product as (

select * from {{ ref('stg_rxnorm__mthspl_products') }}

, rxnrel AS (
SELECT * FROM {{ source('rxnorm', 'rxnorm_rxnrel') }}
)

select distinct
Expand All @@ -24,7 +26,7 @@ select distinct
, substance.tty as active_ingredient_tty
, product.active as active
, product.prescribable as prescribable
from rxnrel
from sagerx_lake.rxnorm_rxnrel rxnrel
inner join substance
on rxnrel.rxaui1 = substance.rxaui
inner join product
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
-- int_mthspl_products_to_active_moieties.sql

with substance as (
SELECT * FROM {{ ref('stg_rxnorm__mthspl_substances') }}
)
with

, product as (
SELECT * FROM {{ ref('stg_rxnorm__mthspl_products') }}
)
substance as (

select * from {{ ref('stg_rxnorm__mthspl_substances') }}

),

product as (

select * from {{ ref('stg_rxnorm__mthspl_products') }}

, rxnrel AS (
SELECT * FROM {{ source('rxnorm', 'rxnorm_rxnrel') }}
)

select distinct
Expand All @@ -24,7 +26,7 @@ select distinct
, substance.tty as active_moiety_tty
, product.active as active
, product.prescribable as prescribable
from rxnrel
from sagerx_lake.rxnorm_rxnrel rxnrel
inner join substance
on rxnrel.rxaui1 = substance.rxaui
inner join product
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
-- int_mthspl_products_to_inactive_ingredients.sql

with substance as (
SELECT * FROM {{ ref('stg_rxnorm__mthspl_substances') }}
)
with

, product as (
SELECT * FROM {{ ref('stg_rxnorm__mthspl_products') }}
)
substance as (

select * from {{ ref('stg_rxnorm__mthspl_substances') }}

),

product as (

select * from {{ ref('stg_rxnorm__mthspl_products') }}

, rxnrel AS (
SELECT * FROM {{ source('rxnorm', 'rxnorm_rxnrel') }}
)

select distinct
Expand All @@ -24,7 +26,7 @@ select distinct
, substance.tty as inactive_ingredient_tty
, product.active as active
, product.prescribable as prescribable
from rxnrel
from sagerx_lake.rxnorm_rxnrel rxnrel
inner join substance
on rxnrel.rxaui1 = substance.rxaui
inner join product
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
with all_ndcs as
(
select * from {{ ref('stg_rxnorm__all_ndcs') }}
)
),

, product_rxcuis as
product_rxcuis as
(
select * from {{ source('rxnorm', 'rxnorm_rxnconso') }}
select * from sagerx_lake.rxnorm_rxnconso
where sab = 'RXNORM'
and tty in ('SCD', 'SBD', 'GPCK', 'BPCK')
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@
-- int_rxnorm_clinical_products_to_clinical_product_components.sql

with ndc as (
with

ndc as (

select * from {{ ref('stg_rxnorm__ndcs') }}
)

, rcp as (
),

rcp as (

select * from {{ ref('stg_rxnorm__clinical_products') }}
)

, rcpcl as (
),

rcpcl as (

select * from {{ ref('stg_rxnorm__clinical_product_component_links') }}
)

, rcpc as (
),

rcpc as (

select * from {{ ref('stg_rxnorm__clinical_product_components') }}

)

select
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,29 @@
-- int_rxnorm_clinical_products_to_dose_forms.sql
with rcp as (

with

rcp as (

select * from {{ ref('stg_rxnorm__clinical_products') }}
)

, rcpcl as (
),

rcpcl as (

select * from {{ ref('stg_rxnorm__clinical_product_component_links') }}
)

, rcpc as (
),

rcpc as (

select * from {{ ref('stg_rxnorm__clinical_product_components') }}
)

, rdf as (
),

rdf as (

select * from {{ ref('stg_rxnorm__dose_forms') }}

)

select
Expand Down
Original file line number Diff line number Diff line change
@@ -1,31 +1,47 @@
-- int_rxnorm_clinical_products_to_ingredient_components.sql

with rcp as (
with

rcp as (

select * from {{ ref('stg_rxnorm__clinical_products') }}
)

, rcpcl as (
),

rcpcl as (

select * from {{ ref('stg_rxnorm__clinical_product_component_links') }}
)

, rcpc as (
),

rcpc as (

select * from {{ ref('stg_rxnorm__clinical_product_components') }}
)

, rdf as (
),

rdf as (

select * from {{ ref('stg_rxnorm__dose_forms') }}
)

, ri as (
),

ri as (

select * from {{ ref('stg_rxnorm__ingredients') }}
)

, ricl as (
),

ricl as (

select * from {{ ref('stg_rxnorm__ingredient_component_links') }}
)

, ric as (
),

ric as (

select * from {{ ref('stg_rxnorm__ingredient_components') }}

)

select
Expand Down
Original file line number Diff line number Diff line change
@@ -1,47 +1,77 @@
-- int_rxnorm_clinical_products_to_ingredient_strengths.sql

with rcp as (
with

rcp as (

select * from {{ ref('stg_rxnorm__clinical_products') }}
)

, rcpcl as (
),

rcpcl as (

select * from {{ ref('stg_rxnorm__clinical_product_component_links') }}
)

, rcpc as (
),

rcpc as (

select * from {{ ref('stg_rxnorm__clinical_product_components') }}
)

, rdf as (
),

rdf as (

select * from {{ ref('stg_rxnorm__dose_forms') }}
)

, ri as (
),

ri as (

select * from {{ ref('stg_rxnorm__ingredients') }}
)

, ricl as (
),

ricl as (

select * from {{ ref('stg_rxnorm__ingredient_component_links') }}
)

, ric as (
),

ric as (

select * from {{ ref('stg_rxnorm__ingredient_components') }}
)

, risl as (
),

risl as (

select * from {{ ref('stg_rxnorm__ingredient_strength_links') }}
)

<<<<<<< HEAD
, ris as (
select * from {{ ref('stg_rxnorm__ingredient_strengths') }}
)
=======
),

ris as (

select * from {{ ref('stg_rxnorm__ingredient_strengths') }}

),

pinl as (
>>>>>>> parent of 56f786e (rxnorm update and intermediate tables)

, pinl as (
select * from {{ ref('stg_rxnorm__precise_ingredient_links') }}
)

, pin as (
),

pin as (

select * from {{ ref('stg_rxnorm__precise_ingredients') }}

)

select
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,35 @@
-- int_rxnorm_clinical_products_to_ingredients.sql

with rcp as (
with

rcp as (

select * from {{ ref('stg_rxnorm__clinical_products') }}
)

, rcpcl as (
),

rcpcl as (

select * from {{ ref('stg_rxnorm__clinical_product_component_links') }}
)

, rcpc as (
),

rcpc as (

select * from {{ ref('stg_rxnorm__clinical_product_components') }}
)

, rdf as (
),

rdf as (

select * from {{ ref('stg_rxnorm__dose_forms') }}
)

, ri as (
),

ri as (

select * from {{ ref('stg_rxnorm__ingredients') }}

)

select
Expand Down
Loading

0 comments on commit 0480383

Please sign in to comment.