 ;
 
 /*****************************************************
-* 4. Compare new drug vocabulary q to existing one r *
+* 8. Compare new drug vocabulary q to existing one r *
 *****************************************************/
 -- Strategy: replace attributes with existing ones. Since there are multiple choices for quant, i_combo, d_combo, df_code, bn_code and mf_code, start with lowest (most defined) concept_classes and move up
 -- If there is a conflict (more than one equally good choices despite precs and div), split up

;
commit;

select distinct i_code from q_ing
minus
select qi_combo from x_ing;
select i_combo from q_combo
minus
select qi_combo from x_ing

;

-- Create table with all drug concept codes linked to the above unique components 
drop table q_ds purge;
create table q_ds nologging as
select dss.drug_concept_code as concept_code, dss.ingredient_concept_code as i_code, uds.ds_code
from ds_stage dss
