Most patients will need to undergo a polysomnography (sleep study), conducted in a sleep lab or at home. Other tests, such as an electroencephalogram and genetic blood testing, can be useful in a diagnosis.