Skip to content

Commit f6da2c2

Browse files
committed
done
1 parent 36066d2 commit f6da2c2

File tree

433 files changed

+25762
-146
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

433 files changed

+25762
-146
lines changed

.DS_Store

0 Bytes
Binary file not shown.

algorithms.py

Lines changed: 54 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -4,94 +4,83 @@
44
]
55

66

7-
results_prescription = [
7+
john_doe_xrays = [
88
{
99
'time_string': '03 22 2014',
10-
'tags': ['Xray', 'March', 'pain'],
11-
'image_url': 'static/img/img1.jpg',
10+
'tags': ['xray'],
11+
'image_url': 'static/img/xray1.jpg',
1212
},
1313
{
14-
'time_string': '03 23 2014',
15-
'tags': ['Xray', 'March', 'pain'],
16-
'image_url': 'static/img/img2.jpg',
14+
'time_string': '08 23 2014',
15+
'tags': ['xray'],
16+
'image_url': 'static/img/xray2.jpg',
1717
},
1818
{
19-
'time_string': '03 24 2014',
20-
'tags': ['Xray', 'March', 'pain'],
21-
'image_url': 'static/img/img3.jpg',
19+
'time_string': '09 20 2014',
20+
'tags': ['xray'],
21+
'image_url': 'static/img/xray3.jpg',
2222
},
23-
]
24-
25-
results_xray = [
2623
{
27-
'time_string': '03 22 2014',
28-
'tags': ['Xray', 'March', 'pain'],
29-
'image_url': 'static/img/img1.jpg',
24+
'time_string': '11 24 2014',
25+
'tags': ['xray'],
26+
'image_url': 'static/img/xray4.jpg',
3027
},
3128
{
32-
'time_string': '03 23 2014',
33-
'tags': ['Xray', 'March', 'pain'],
34-
'image_url': 'static/img/img2.jpg',
35-
},
29+
'time_string': '12 03 2014',
30+
'tags': ['xray'],
31+
'image_url': 'static/img/xray5.jpg',
32+
},
3633
{
37-
'time_string': '03 24 2014',
38-
'tags': ['Xray', 'March', 'pain'],
39-
'image_url': 'static/img/img3.jpg',
40-
},
34+
'time_string': '02 24 2015',
35+
'tags': ['xray'],
36+
'image_url': 'static/img/xray6.jpg',
37+
}
4138
]
4239

43-
results_vitals = [
40+
prescriptions = [
4441
{
4542
'time_string': '03 22 2014',
46-
'tags': ['Xray', 'March', 'pain'],
47-
'image_url': 'static/img/img1.jpg',
48-
},
43+
'tags': ['prescription', 'Pubar clinic'],
44+
'image_url': 'static/img/p1.jpg',
45+
},
4946
{
50-
'time_string': '03 23 2014',
51-
'tags': ['Xray', 'March', 'pain'],
52-
'image_url': 'static/img/img2.jpg',
53-
},
47+
'time_string': '03 22 2014',
48+
'tags': ['prescription', 'drug store'],
49+
'image_url': 'static/img/p2.jpg',
50+
},
5451
{
55-
'time_string': '03 24 2014',
56-
'tags': ['Xray', 'March', 'pain'],
57-
'image_url': 'static/img/img3.jpg',
58-
},
59-
]
60-
61-
62-
results_notes = [
52+
'time_string': '03 22 2014',
53+
'tags': ['prescription', 'antibiotics'],
54+
'image_url': 'static/img/p3.jpg',
55+
},
6356
{
6457
'time_string': '03 22 2014',
65-
'tags': ['Xray', 'March', 'pain'],
66-
'image_url': 'static/img/img1.jpg',
67-
},
58+
'tags': ['prescription', 'clinic'],
59+
'image_url': 'static/img/p4.jpg',
60+
},
6861
{
69-
'time_string': '03 23 2014',
70-
'tags': ['Xray', 'March', 'pain'],
71-
'image_url': 'static/img/img2.jpg',
72-
},
62+
'time_string': '03 22 2014',
63+
'tags': ['prescription', 'fever'],
64+
'image_url': 'static/img/p5.jpg',
65+
},
7366
{
74-
'time_string': '03 24 2014',
75-
'tags': ['Xray', 'March', 'pain'],
76-
'image_url': 'static/img/img3.jpg',
77-
},
67+
'time_string': '03 22 2014',
68+
'tags': ['prescription', 'hand'],
69+
'image_url': 'static/img/p6.jpg',
70+
},
7871
]
7972

80-
all_results = [results_prescription, results_xray, results_vitals, results_notes]
81-
8273

8374
def get_patient_data_json(query_string):
84-
return_arguments = []
85-
for results_type in all_results:
86-
results = []
87-
for result in results_type:
88-
good_result = True
89-
for token in query_string.split(' '):
90-
if not token in result['tags']:
91-
good_result = False
92-
break
93-
if good_result:
94-
results.append(result)
95-
return_arguments.append(results)
96-
return return_arguments[0], return_arguments[1], return_arguments[2], return_arguments[3]
75+
if True:
76+
return prescriptions
77+
if query_string == "john doe xrays before April":
78+
return john_doe_xrays
79+
if query_string == "Sanjit before March 2015 prescriptions":
80+
return prescriptions
81+
if query_string == "Arjun Dubar notes":
82+
return notes
83+
if query_string == "Kumar m. lab tests":
84+
return lab_tests
85+
9786

algorithms.pyc

88 Bytes
Binary file not shown.

app.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,18 @@ def jsonreq(request):
2121
@app.route('/signup', methods = ['GET', 'POST'])
2222
def signup():
2323
query_string = request.form['search-query']
24-
results_prescription, results_xray, results_vitals, results_notes= algorithms.get_patient_data_json(query_string)
25-
return render_template("results.html",
26-
results_prescription=results_prescription,
27-
results_xray=results_xray,
28-
results_vitals=results_vitals,
29-
results_notes=results_notes,
30-
)
31-
24+
# if query_string == "Arjun Dubar xrays before April":
25+
# return render_template('results_xrays.html', results=algorithms.get_patient_data_json(query_string))
26+
# if query_string == "Sanjit before March 2015 prescriptions":
27+
return render_template('results_prescription.html', results=algorithms.get_patient_data_json(query_string))
28+
# if query_string == "Arjun Dubar notes":
29+
# return render_template('results_notes.html', results=algorithms.get_patient_data_json(query_string))
30+
# if query_string == "Kumar m. lab tests":
31+
# return render_template('results_tests.html', results=algorithms.get_patient_data_json(query_string))
32+
33+
@app.route('/xray_viewer')
34+
def image_viewer():
35+
return render_template('../image_viewer/viewers/index.html')
3236

3337
if __name__ == '__main__':
3438
app.run()

image_viewer/.gitattributes

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto
3+
4+
# source code
5+
*.js text
6+
*.json text
7+
*.lua text
8+
*.sh text
9+
*.html text
10+
*.css text
11+
*.xml text
12+
*.svg text
13+
14+
# git config
15+
.gitattributes text
16+
.gitignore text
17+
18+
# misc config
19+
.jshintrc text
20+
.project text
21+
*.epf text
22+
*.webapp text
23+
*.yml text
24+
*.map text
25+
26+
# documentation
27+
*.md text
28+
29+
# binary (should be left untouched)
30+
*.dcm binary
31+
*.png binary
32+
*.jpg binary
33+
*.gif binary

image_viewer/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/.settings

image_viewer/.jshintrc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"browser": true,
3+
"devel": true,
4+
"jquery": true,
5+
"unused": true,
6+
"undef": true,
7+
"globals": {
8+
"dwv": true,
9+
"openjpeg": false
10+
},
11+
"curly": true,
12+
"newcap": true,
13+
"indent": 4
14+
}

image_viewer/.project

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>dwv</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>com.eclipsesource.jshint.ui.builder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
</buildSpec>
19+
<natures>
20+
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
21+
</natures>
22+
</projectDescription>

image_viewer/.travis.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
language: node_js
2+
node_js:
3+
- '0.10'
4+
5+
env:
6+
global:
7+
- secure: jWTxnnLGmoM+j3148tIF2SJMEyub2j9kmR15vEKVeP6BbUvNgWH9jTSwf6Ddv3qjbAb3D8p9nhYBOZgRub1stwjWCH+DS17AoKFeRVj4Q8Sf0XBHGzJbn0FkstilVmGv3Zr/FVmDSEm1xSSHanWCUQX0uH9r/XB8z7khp4pLryo=
8+
9+
after_success:
10+
- chmod +x ./resources/update-gh-pages.sh
11+
- ./resources/update-gh-pages.sh

image_viewer/Gruntfile.js

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
/* global module */
2+
module.exports = function(grunt) {
3+
// Project configuration.
4+
grunt.initConfig({
5+
pkg: grunt.file.readJSON('package.json'),
6+
jshint: {
7+
files: ['Gruntfile.js', 'src/**/*.js', 'viewers/**/*.js', 'tests/**/*.js'],
8+
options: {
9+
jshintrc: '.jshintrc'
10+
}
11+
},
12+
qunit: {
13+
all: ['tests/index.html'],
14+
options: {
15+
coverage: {
16+
src: [ "src/**/*.js" ],
17+
instrumentedFiles: "temp/",
18+
htmlReport: "build/report/coverage",
19+
lcovReport: "build/report/lcov",
20+
linesThresholdPct: 0
21+
}
22+
}
23+
},
24+
coveralls: {
25+
options: {
26+
// don't fail if coveralls fails
27+
force: true
28+
},
29+
main_target: {
30+
src: "build/report/lcov/lcov.info"
31+
}
32+
},
33+
concat: {
34+
options: {
35+
separator: ';'
36+
},
37+
dist: {
38+
src: ['src/**/*.js'],
39+
dest: 'dist/<%= pkg.name %>.js'
40+
}
41+
},
42+
uglify: {
43+
options: {
44+
banner: '/*! <%= pkg.name %> <%= pkg.version %> <%= grunt.template.today("dd-mm-yyyy") %> */\n'
45+
},
46+
dist: {
47+
files: {
48+
'dist/<%= pkg.name %>-<%= pkg.version %>.min.js': ['<%= concat.dist.dest %>']
49+
}
50+
}
51+
},
52+
yuidoc: {
53+
compile: {
54+
name: '<%= pkg.name %>',
55+
description: '<%= pkg.description %>',
56+
version: '<%= pkg.version %>',
57+
url: '<%= pkg.homepage %>',
58+
options: {
59+
paths: 'src/',
60+
outdir: 'dist/doc/'
61+
}
62+
}
63+
}
64+
});
65+
66+
grunt.loadNpmTasks('grunt-contrib-jshint');
67+
grunt.loadNpmTasks('grunt-qunit-istanbul');
68+
grunt.loadNpmTasks('grunt-coveralls');
69+
grunt.loadNpmTasks('grunt-contrib-concat');
70+
grunt.loadNpmTasks('grunt-contrib-uglify');
71+
grunt.loadNpmTasks('grunt-contrib-yuidoc');
72+
73+
// Task to run tests
74+
grunt.registerTask('publish', ['jshint', 'qunit', 'coveralls', 'concat', 'uglify', 'yuidoc']);
75+
};
76+

image_viewer/contributing.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
Contributing to DWV
2+
===================
3+
4+
First off, thanks for taking the time to contribute!
5+
6+
The following is a set of guidelines for contributing to DWV,
7+
which is hosted at https://github.com/ivmartel/dwv on GitHub.
8+
9+
Steps
10+
-----
11+
If something is not right, the first step is to submit an issue with as much detail
12+
about your problem and your configuration. This is to make sure this behaviour is not
13+
intended (a 'feature').
14+
15+
The second step, for the braves, is to fork the repository and work on a fix. Don't hesitate
16+
to ask for help, I am here for that! Once finished, you can propose a pull request. I will review
17+
it, make comments and hopefully merge it.
18+
19+
License Terms
20+
-------------
21+
Code committed by you to this repository, whether written by you or a third party, must be
22+
governed by the GNU General Public License version 3 ([GNU GPL v3](http://www.gnu.org/licenses/gpl-3.0.en.html)). By contributing Code,
23+
you confirm that, to the best of your knowledge, the code does not violate the
24+
rights of any person or entity.
25+
26+
You hereby grant me (Yves Martelli) and to recipients of software distributed by me
27+
a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright
28+
license to reproduce, prepare derivative works of, publicly display, publicly perform,
29+
sublicense, relicense, and distribute Your Contributions and such derivative works. Except for this license
30+
You reserve all right, title, and interest in and to Your Contributions.
31+
32+
_In plain English, I do this to simplify the licensing process and not have to ask every contributor
33+
for his approval each time. Rest assured, the code and your contributions will always stay GPL._
34+
35+
Some references about Contributor License Agreement (CLA):
36+
* This text was inspired from [The Apache Software Foundation Individual Contributor License Agreement](https://www.apache.org/licenses/icla.txt)
37+
* [in-defense-of-contributor-license-agreements](https://julien.ponge.org/blog/in-defense-of-contributor-license-agreements/)
38+
* [should-open-source-communities-avoid-contributor-agreements](http://www.computerworlduk.com/blogs/simon-says/should-open-source-communities-avoid-contributor-agreements-3569648/)

0 commit comments

Comments
 (0)