Added formcode mapping support and minor drug frequency tweak