Write a Python script to clean a highly nested JSON dataset containing patient medical histories and convert it into a flat Pandas DataFrame.