Adjusting for COPD severity in database research: developing and validating an algorithm