If we need the variable ```prism_swap_id``` only in the case of ```MeshElemType::PRISM``` we can declare/define it within the ```case MeshElemType::PRISM```. Maybe you need some brackets:
```case MeshElemType::PRISM: { 
unsigned prism_swap_id; 
  ... 
}```