Code generation for department status