   -- drug strength for each r ingredient 
   left join r on r.drug_concept_id=m.r_did and r.ingredient_concept_id=m.r_iid
 )
-where div>0.9 and u_match=1
+where div>0.9 
+--added correct definition of div
+and div<1.12
+
+and u_match=1
 ;
 commit;
 


commit;

begin
   devv5.vocabulary_pack.DeleteAmbiguousMAPSTO;
end;

commit;

--6 Working with replacement mappings

BEGIN
   DEVV5.VOCABULARY_PACK.CheckReplacementMappings;
END;
COMMIT;

--7 Deprecate 'Maps to' mappings to deprecated and upgraded concepts
BEGIN
   DEVV5.VOCABULARY_PACK.DeprecateWrongMAPSTO;
END;
COMMIT;

--8 Add mapping from deprecated to fresh concepts
BEGIN
   DEVV5.VOCABULARY_PACK.AddFreshMAPSTO;
END;
COMMIT;

--9 Delete ambiguous 'Maps to' mappings
BEGIN
   DEVV5.VOCABULARY_PACK.DeleteAmbiguousMAPSTO;
END;
COMMIT;

      when others then null;
  end;
end;
/
-- generate OMOP codes for new concepts
insert into xxx_replace
select concept_code as xxx_code, 'OMOP'||omop_seq.nextval as omop_code
