def get_search_results(request): report = request.POST["report"] print report search_results = healthSearchUtils.get_search_results(report) #search_results = healthSearchUtils.makeJSONSerializable(search_results) return HttpResponse(json.dumps(search_results, sort_keys=True, indent=4, default=json_util.default), mimetype="application/json")
def get_search_results(request): report = request.POST["report"] print report search_results = healthSearchUtils.get_search_results(report) #search_results = healthSearchUtils.makeJSONSerializable(search_results) return HttpResponse(json.dumps(search_results, sort_keys=True, indent=4, default=json_util.default),mimetype="application/json")
-------------- Add a "credentials.py" file in this same directory and the database connection string in this format DB_CONNECTION_STRING = "mongodb://*****:*****@HOST:PORT/DATABASE" Example, DB_CONNECTION_STRING = "mongodb://*****:*****@staff.mongohq.com:10068/BOSE" Also, make sure the following files are present in the same directory: sample-case-reports.xml word_list.txt ''' import healthSearchUtils # Add all the sample case reports to the MongoDB database healthSearchUtils.generate_case_report_repository() # Add all the medical keywords to the MongoDB database healthSearchUtils.create_index() # Test with a sample search-key result = healthSearchUtils.get_search_results( "A young man was brought for mental retardation, frequent non-bloody diarrhoea" ) healthSearchUtils.format_search_results(result)
pre-requisite -------------- Add a "credentials.py" file in this same directory and the database connection string in this format DB_CONNECTION_STRING = "mongodb://*****:*****@HOST:PORT/DATABASE" Example, DB_CONNECTION_STRING = "mongodb://*****:*****@staff.mongohq.com:10068/BOSE" Also, make sure the following files are present in the same directory: sample-case-reports.xml word_list.txt ''' import healthSearchUtils # Add all the sample case reports to the MongoDB database healthSearchUtils.generate_case_report_repository() # Add all the medical keywords to the MongoDB database healthSearchUtils.create_index() # Test with a sample search-key result = healthSearchUtils.get_search_results("A young man was brought for mental retardation, frequent non-bloody diarrhoea") healthSearchUtils.format_search_results(result)