query database - get test results by state for monitor