Expert system for pharmaceutical analysis