kashenfelter / RadiologyIRServer

Server side component to marshall data for client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RadiologyIRServer

Server side component to perform search and marshall data for RadiologyIR client. Built using Flask and supporting Solr and Yottalook WS API. As this application was designed with an Ember Data client, the REST services provided follow the JSON API specification.

Search Analytics in the form of query tracking, search back end response tracking, and client side click tracking made possible via MongoDB

This application was developed and tested with Python 3 (specifically 3.4). It likely could work with Python 2 but would require some changes.

Installation & Usage

Update ir_server.py to point to your Solr instance and collection/core by changing this line to match your environment:

solr = pysolr.Solr('http://localhost:8983/solr/mypacs')

Also, update code to point to your MongoDB instance by changing this line as appropriate:

client = MongoClient("mongodb://localhost:27017")

I recommend creating a virtual python environment. I've used Anaconda There are numerous methods for creating a virtual environment - feel free to choose the one you like best. The following commands will create a virtual environment, install required dependencies, and launch the application:

conda env create -f flask_conda_env.yml
source activate flask
python ir_server.py

A pip requirements.txt file is also provided if you prefer to use pip and a different python virtual environment.

Open http://localhost:5000 in your browser to verify.

Utilities

As part of this project, I created a few additional python scripts to help with various items:

  • mongo_test_queries.py - This file contains a few sample queries used to get statistics about what searches have been performed and what links have been clicked. It also includes a few basic items on how to use MongoDB as this was my first time using MongoDB.
  • stopword_generator.py - This script will read in URLs, parse the returned HTML and identify words that occur in all documents. If a word occurs in all or most documents, it isn't a good word for a search query and should be ignored.

License

For code written by magic-lantern, see the LICENSE file for license rights and limitations (Apache License, Version 2.0). Code from other parties may have different licensing terms.

About

Server side component to marshall data for client

License:Apache License 2.0


Languages

Language:Python 100.0%