diagnosing pain