Low sleep quality

It's been 4 months since my mom had a very difficult stroke In the nights she has to force and push her self to breath like spitting very agressevly Her sleep quality become so low and as a result get tired during the day and this affect her physical therapy a little Anyone had something similar? And is it okay to give her melatonin to cause deep sleep or it might be dangerous