 COMMIT;
 
 --8
+--normalizing
+update drug_strength_stage
+set NUMERATOR_UNIT_CONCEPT_ID=8576,NUMERATOR_VALUE=NUMERATOR_VALUE/1000 -- 'mg'
+where NUMERATOR_UNIT_CONCEPT_ID=9655 -- 'ug'
+and vocabulary_id_1='RxNorm Extension';
+
+update drug_strength_stage
+set AMOUNT_UNIT_CONCEPT_ID=8576,AMOUNT_VALUE=AMOUNT_VALUE/1000 -- 'mg'
+where AMOUNT_UNIT_CONCEPT_ID=9655 -- 'ug'
+and vocabulary_id_1='RxNorm Extension';
+
+update drug_strength_stage
+set AMOUNT_UNIT_CONCEPT_ID=8510,AMOUNT_VALUE=AMOUNT_VALUE*1000000 -- 'U'
+where AMOUNT_UNIT_CONCEPT_ID=44777647 -- 'ukat'
+and vocabulary_id_1='RxNorm Extension';
+
+update drug_strength_stage
+set NUMERATOR_UNIT_CONCEPT_ID=8510
+where NUMERATOR_UNIT_CONCEPT_ID=8718 -- 'iU'
+and vocabulary_id_1='RxNorm Extension';
+
+update drug_strength_stage
+set DENOMINATOR_UNIT_CONCEPT_ID=8510
+where DENOMINATOR_UNIT_CONCEPT_ID=8718 -- 'iU'
+and vocabulary_id_1='RxNorm Extension';
+
+update drug_strength_stage
+set AMOUNT_UNIT_CONCEPT_ID=8510 -- 'U'
+where AMOUNT_UNIT_CONCEPT_ID=8718 -- 'iU'
+and vocabulary_id_1='RxNorm Extension';
+commit;
+
+--9
 --do a rounding amount_value, numerator_value and denominator_value
 update drug_strength_stage set 
     amount_value=round(amount_value, 3-floor(log(10, amount_value))-1),

and invalid_reason is null;
commit;

--16
--deprecate all mappings (except 'Maps to' and 'Drug has drug class') if RxE-concept was deprecated 
update concept_relationship_stage crs set crs.invalid_reason='D', 
crs.valid_end_date=(SELECT latest_update-1 FROM vocabulary WHERE vocabulary_id = 'RxNorm Extension') 

and invalid_reason is null;
commit;

--11 
--impossible dosages
update concept_stage set invalid_reason='D',
valid_end_date=(SELECT latest_update-1 FROM vocabulary WHERE vocabulary_id = 'RxNorm Extension')
