| Business segments - Schedule of Segment Reporting Results By Segment (Details) $ in Thousands | 3 Months Ended | 12 Months Ended | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Sep. 30, 2017  USD ($) | Jun. 30, 2017  USD ($) | Mar. 31, 2017  USD ($) | Dec. 31, 2016  USD ($) | Sep. 30, 2016  USD ($) | Jun. 30, 2016  USD ($) | Mar. 31, 2016  USD ($) | Dec. 31, 2015  USD ($) | Sep. 30, 2017  USD ($)  segment | Sep. 30, 2016  USD ($) | Sep. 30, 2015  USD ($) | |
| Segment Reporting [Abstract] | |||||||||||
| Number of business segments | segment | 3 | ||||||||||
| Financial information for each of the Company's business segments | |||||||||||
| Revenue | $ 620,903 | $ 600,447 | $ 622,047 | $ 607,564 | $ 623,091 | $ 617,094 | $ 606,453 | $ 556,722 | $ 2,450,961 | $ 2,403,360 | $ 2,099,821 | 
| Gross profit | 162,581 | 152,189 | 152,317 | 144,818 | 152,930 | 151,379 | 147,667 | 110,215 | 611,905 | 562,191 | 512,717 | 
| Selling, general and administrative expense | 284,510 | 268,259 | 238,792 | ||||||||
| Operating income | 77,590 | 81,811 | 80,335 | 73,776 | 81,308 | 84,609 | 77,900 | 42,786 | 313,512 | 286,603 | 259,832 | 
| Amortization of intangible assets | (12,208) | (13,377) | (9,348) | ||||||||
| Acquisition-related expenses | (83) | (832) | (4,745) | ||||||||
| Gain on sale of a business | $ 650 | $ 6,880 | $ 0 | ||||||||
| Percentage of total revenue | 12.80% | 11.90% | 12.40% | ||||||||
| Depreciation and amortization | $ 55,769 | $ 58,404 | $ 46,849 | ||||||||
| Corporate/Other | |||||||||||
| Financial information for each of the Company's business segments | |||||||||||
| Selling, general and administrative expense | 1,050 | (90) | 92 | 357 | (622) | 2,127 | 0 | 650 | 1,409 | 2,155 | 6 | 
| Other | (1,409) | (2,155) | (6) | ||||||||
| Segment Reconciling Items | |||||||||||
| Financial information for each of the Company's business segments | |||||||||||
| Amortization of intangible assets | (2,700) | (2,720) | (3,386) | (3,402) | (3,449) | (3,517) | (3,262) | (3,149) | (12,208) | (13,377) | (9,348) | 
| Restructuring Costs | (2,242) | 0 | 0 | ||||||||
| Acquisition-related expenses | (83) | 0 | 0 | 0 | (257) | 0 | (529) | (46) | (83) | (832) | (4,745) | 
| Gain on sale of a business | $ 0 | $ 650 | $ 0 | $ 0 | $ 427 | $ 6,453 | $ 0 | $ 0 | 650 | 6,880 | 0 | 
| Health Services | |||||||||||
| Financial information for each of the Company's business segments | |||||||||||
| Revenue | 1,380,151 | 1,298,304 | 1,109,238 | ||||||||
| Gross profit | 347,325 | 292,181 | 254,108 | ||||||||
| Selling, general and administrative expense | 132,081 | 107,155 | 99,815 | ||||||||
| Operating income | $ 215,244 | $ 185,026 | $ 154,293 | ||||||||
| Percentage of total revenue | 15.60% | 14.30% | 13.90% | ||||||||
| Depreciation and amortization | $ 29,114 | $ 31,916 | $ 27,694 | ||||||||
| U.S. Federal Services | |||||||||||
| Financial information for each of the Company's business segments | |||||||||||
| Revenue | 545,573 | 591,728 | 502,484 | ||||||||
| Gross profit | 139,321 | 138,168 | 118,646 | ||||||||
| Selling, general and administrative expense | 74,345 | 74,792 | 59,252 | ||||||||
| Operating income | $ 64,976 | $ 63,376 | $ 59,394 | ||||||||
| Percentage of total revenue | 11.90% | 10.70% | 11.80% | ||||||||
| Depreciation and amortization | $ 11,175 | $ 9,953 | $ 10,363 | ||||||||
| Human Services | |||||||||||
| Financial information for each of the Company's business segments | |||||||||||
| Revenue | 525,237 | 513,328 | 488,099 | ||||||||
| Gross profit | 125,259 | 131,842 | 139,963 | ||||||||
| Selling, general and administrative expense | 76,675 | 84,157 | 79,719 | ||||||||
| Operating income | $ 48,584 | $ 47,685 | $ 60,244 | ||||||||
| Percentage of total revenue | 9.20% | 9.30% | 12.30% | ||||||||
| Depreciation and amortization | $ 15,480 | $ 16,535 | $ 8,792 | ||||||||