Modified query_json_template to include patient.uuid

Modified query_json_template to include patient.uuid to uniquely
identify patients
Separated logic from views.py into utils.py

Separated the processing logic from views.py and moved them into
views.py