Script added to patient show page with function calling d3 code