-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhealth_icd11.py
46 lines (39 loc) · 1.22 KB
/
health_icd11.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
from trytond.pool import Pool
from trytond.model import ModelView, ModelSQL, fields
from trytond.modules.health import health as baseHealth
class Pathology(baseHealth.Pathology):
__name__ = 'gnuhealth.pathology'
classifier = fields.Char('classifier')
active = fields.Boolean('active')
@classmethod
def __setup__(cls):
super(Pathology, cls).__setup__()
@classmethod
def search_domain(cls, domain, active_test=True):
has_classifier = False
for d in domain:
if d[0].lower() == 'classifier' and d[1] == '=':
has_classifier = True
if not has_classifier:
#TODO: Use the tryond.conf file to store the default ICD classifier
domain.append([
'OR',
('classifier', '=', 'ICD10'),
('classifier', '=', None)
])
(table, expression) = \
super(baseHealth.Pathology, cls).search_domain(
domain, active_test)
return table, expression
@classmethod
def default_classifier():
return 'ICD10'
class PathologyCategory(baseHealth.PathologyCategory):
__name__ = 'gnuhealth.pathology.category'
classifier = fields.Char('classifier')
@classmethod
def __setup__(cls):
super(PathologyCategory, cls).__setup__()
#TODO: Remove Deprecations
HealthIcd11 = Pathology
Category = PathologyCategory