Even though cadmium and its compounds are toxic in certain forms and concentrations , the British Pharmaceutical Codex from 1907 states that cadmium iodide was used as a medication to treat " enlarged joints , scrofulous glands , and chilblains " .