    SET DOSAGE = '500unit/g'
 WHERE DOSAGE = '500unit';
 
-drop table ds_all_tmp; select count (1) from ds_all_tmp;
+drop table ds_all_tmp; 
 create table ds_all_tmp as 
 select DOSAGE,DRUG_COMP,CONCEPT_NAME,CONCEPT_CODE,INGREDIENT_CONCEPT_CODE,INGREDIENT_CONCEPT_NAME , cast ('' as varchar (200)) as volume  from clin_dr_to_ingr_one where concept_code not in (select concept_code from ds_by_lena_1)
 union 

case when regexp_substr (dosage, 
'[[:digit:]\,\.]+(mg|%|ml|mcg|hr|hours|unit(s)*|iu|g|microgram(s*)|u|mmol|c|gm|litre|million unit|nanogram(s)*|x|ppm| Kallikrein inactivator units|kBq|MBq|molar|micromol|microlitres|million units)/[[:digit:]\,\.]*(g|dose|ml|mg|ampoule|litre|hour(s)*|h|square cm|microlitres|unit dose|drop)') = dosage
or regexp_like (dosage, '%') 
then regexp_substr (dosage, 'mg|%|mcg|hr|hours|unit(s)*|iu|g|microgram(s*)|u|mmol|c|gm|litre|million unit|nanogram(s)*|x|ppm| Kallikrein inactivator units|kBq|microlitres', 1,1) 
else  null end
as numerator_unit,


;
--Ingred to Ingred, for now Ingred to Ingred relationship is considered only as Maps to 
insert into INTERNAL_RELATIONSHIP_STAGE (concept_code_1, concept_code_2)
select distinct concept_code_1, concept_code_2 from ingr_to_ingr  -- deprecated to active relationship already included here
where CONCEPT_CODE_2 is not null
;
insert into INTERNAL_RELATIONSHIP_STAGE (concept_code_1, concept_code_2)
