Trunk 4446: Support deriving auto_expire_date from duration and duration units for Drug Orders

Changes for ticket https://issues.openmrs.org/browse/TRUNK-4446
I'll make that change. 

Earlier it used to work without this condition since addToDate was returning null for unknown codes or null code.