core function to plot the timeline for individual patients
adding script tags to render the data from json file