Inventory (Details) - USD ($) $ in Thousands |
Jun. 30, 2018 |
Dec. 31, 2017 |
|---|---|---|
| Inventory. | ||
| Raw materials and supplies | $ 34,689 | $ 42,851 |
| Work-in-process | 4,584 | 3,492 |
| Finished goods | 3,015 | 2,433 |
| Total inventory | 42,288 | 48,776 |
| Inventory held at service locations | $ 4,700 | $ 5,500 |