It is definitely adapted from the book but otherwise, I don't know. The writer was working closely with CK up until he was murdered and with his wife and friends since. The story of writing/researching the script is almost as interesting as the story itself.