forked from AntoniusWang/icd10data-scraper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
30 lines (26 loc) · 832 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from flask import Flask, abort
from flask_mongoalchemy import MongoAlchemy
app = Flask(__name__)
#app.config['DEBUG'] = True
app.config['MONGOALCHEMY_DATABASE'] = 'icdcodes'
db = MongoAlchemy(app)
class ICDCode(db.Document):
'''
Represents an ICD Code
code: [A-Z][0-9]{2}.[0-9] code
synonyms: list of appropriate synonyms
body_content: raw html content
'''
code = db.StringField(max_length=10)
synonyms = db.ListField(db.StringField(max_length=256))
body_content = db.StringField()
class RangedSite(db.Document):
'''
Represents a range where an ICD code may be
site: the url of the site
start: starting ICDCode
end: ending ICDcode
'''
site = db.StringField(max_length=64)
start = db.StringField(max_length=3)
end = db.StringField(max_length=3)