 set AMOUNT_UNIT_CONCEPT_ID=8510 -- 'U'
 where AMOUNT_UNIT_CONCEPT_ID=8718 -- 'iU'
 and vocabulary_id_1='RxNorm Extension';
+
+--deprecate transdermal patches with cm and mm as unit in order to rebuild them
+update concept_stage set invalid_reason='D',
+valid_end_date=(SELECT latest_update-1 FROM vocabulary WHERE vocabulary_id = 'RxNorm Extension') 
+WHERE concept_code in (
+	select drug_concept_code from drug_strength_stage
+	where  denominator_unit_concept_id in (8582,8588)
+	and vocabulary_id_1='RxNorm Extension'
+);
 commit;
 
 --9

    and ds.drug_concept_code=cs.concept_code
    and ds.vocabulary_id_1=cs.vocabulary_id
    and cs.vocabulary_id='RxNorm Extension'
) l on (cs.concept_code=l.concept_code and cs.vocabulary_id='RxNorm Extension')
when matched then 
    update set cs.concept_name=l.new_name where cs.concept_name<>l.new_name;

);
*/


update drug_strength_stage
set NUMERATOR_UNIT_CONCEPT_ID=8510
where NUMERATOR_UNIT_CONCEPT_ID=8718 -- 'iU'
