~openbias/bias-trunk/bias-public-trunk

« back to all changes in this revision

Viewing changes to medical_lifestyle/medical_lifestyle.py

  • Committer: Jose Patricio
  • Date: 2011-10-19 03:16:40 UTC
  • Revision ID: josepato@bias.com.mx-20111019031640-05zd7r5lxwx084qu
el push inicial

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# coding=utf-8
 
2
 
 
3
#    Copyright (C) 2008-2010  Luis Falcon
 
4
 
 
5
#    This program is free software: you can redistribute it and/or modify
 
6
#    it under the terms of the GNU General Public License as published by
 
7
#    the Free Software Foundation, either version 3 of the License, or
 
8
#    (at your option) any later version.
 
9
 
 
10
#    This program is distributed in the hope that it will be useful,
 
11
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
#    GNU General Public License for more details.
 
14
 
 
15
#    You should have received a copy of the GNU General Public License
 
16
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
17
 
 
18
 
 
19
from osv import fields, osv
 
20
 
 
21
 
 
22
class drugs_recreational (osv.osv):
 
23
        _name="medical.drugs_recreational"
 
24
        _columns = {
 
25
                'name': fields.char ('Name', size=128, help="Name of the drug"),
 
26
                'street_name': fields.char ('Street names', size=256, help="Common name of the drug in street jargon"),
 
27
                'toxicity' : fields.selection([
 
28
                                ('0','None'),
 
29
                                ('1','Low'),
 
30
                                ('2','High'),
 
31
                                ('3','Extreme'),
 
32
                                ], 'Toxicity', select=True),            
 
33
                'addiction_level' : fields.selection([
 
34
                                ('0','None'),
 
35
                                ('1','Low'),
 
36
                                ('2','High'),
 
37
                                ('3','Extreme'),
 
38
                                ], 'Dependence', select=True),          
 
39
                'legal_status' : fields.selection([
 
40
                                ('0','Legal'),
 
41
                                ('1','Illegal'),
 
42
                                ], 'Legal Status', select=True),
 
43
 
 
44
                'category' : fields.selection([
 
45
                                ('cannabinoid','Cannabinoids'),
 
46
                                ('depressant','Depressants'),
 
47
                                ('dissociative','Dissociative Anesthetics'),
 
48
                                ('hallucinogen','Hallucinogens'),
 
49
                                ('opioid','Opioids'),
 
50
                                ('stimulant','Stimulants'),
 
51
                                ('other','Others'),
 
52
                                ], 'Category', select=True),
 
53
                'withdrawal_level' : fields.integer ("Withdrawal",help="Presence and severity ofcharacteristic withdrawal symptoms.\nUsing Henningfield rating. 1=highest and 6=lowest"),
 
54
                'reinforcement_level' : fields.integer ("Reinforcement",help="A measure of the substance's ability to get users to take it again and again, and in preference to other substances.\nUsing Henningfield rating. 1=highest and 6=lowest"),
 
55
                'tolerance_level' : fields.integer ("Tolerance",help="How much of the substance is needed to satisfy increasing cravings for it, and the level of stable need that is eventually reached.\nUsing Henningfield rating. 1=highest and 6=lowest"),
 
56
                'dependence_level' : fields.integer ("Dependence",help="How difficult it is for the user to quit, the relapse rate, the percentage of people who eventually become dependent, the rating users give their own need for the substance and the degree to which the substance will be used in the face of evidence that it causes harm.\nUsing Henningfield rating. 1=highest and 6=lowest"),
 
57
                'intoxication_level' : fields.integer ("Intoxication",help="the level of intoxication is associated with addiction and increases the personal and social damage a substance may do. \nUsing Henningfield rating. 1=highest and 6=lowest"),
 
58
 
 
59
                'route_oral' : fields.boolean ('Oral', help=""),
 
60
                'route_popping' : fields.boolean ('Skin Popping', help="Subcutaneous or Intradermical administration"),
 
61
                'route_inhaling' : fields.boolean ('Smoke / Inhale', help="Insufflation, exluding nasal"),
 
62
                'route_sniffing' : fields.boolean ('Sniffing',help="Also called snorting - inhaling through the nares  "),
 
63
                'route_injection' : fields.boolean ('Injection', help="Injection - Intravenous, Intramuscular..."),
 
64
 
 
65
                'dea_schedule_i' : fields.boolean ('DEA schedule I',help="Schedule I and II drugs have a high potential for abuse. They require greater storage security and have a quota on manufacturing, among other restrictions. Schedule I drugs are available for research only and have no approved medical use; Schedule II drugs are available only by prescription (unrefillable) and require a form for ordering. Schedule III and IV drugs are available by prescription, may have five refills in 6 months, and may be ordered orally. Some Schedule V drugs are available over the counter"),
 
66
                'dea_schedule_ii' : fields.boolean ('II',help="Schedule I and II drugs have a high potential for abuse. They require greater storage security and have a quota on manufacturing, among other restrictions. Schedule I drugs are available for research only and have no approved medical use; Schedule II drugs are available only by prescription (unrefillable) and require a form for ordering. Schedule III and IV drugs are available by prescription, may have five refills in 6 months, and may be ordered orally. Some Schedule V drugs are available over the counter"),
 
67
                'dea_schedule_iii' : fields.boolean ('III',help="Schedule I and II drugs have a high potential for abuse. They require greater storage security and have a quota on manufacturing, among other restrictions. Schedule I drugs are available for research only and have no approved medical use; Schedule II drugs are available only by prescription (unrefillable) and require a form for ordering. Schedule III and IV drugs are available by prescription, may have five refills in 6 months, and may be ordered orally. Some Schedule V drugs are available over the counter"),
 
68
                'dea_schedule_iv' : fields.boolean ('IV',help="Schedule I and II drugs have a high potential for abuse. They require greater storage security and have a quota on manufacturing, among other restrictions. Schedule I drugs are available for research only and have no approved medical use; Schedule II drugs are available only by prescription (unrefillable) and require a form for ordering. Schedule III and IV drugs are available by prescription, may have five refills in 6 months, and may be ordered orally. Some Schedule V drugs are available over the counter"),
 
69
                'dea_schedule_v' : fields.boolean ('V',help="Schedule I and II drugs have a high potential for abuse. They require greater storage security and have a quota on manufacturing, among other restrictions. Schedule I drugs are available for research only and have no approved medical use; Schedule II drugs are available only by prescription (unrefillable) and require a form for ordering. Schedule III and IV drugs are available by prescription, may have five refills in 6 months, and may be ordered orally. Some Schedule V drugs are available over the counter"),
 
70
 
 
71
                'info' : fields.text ('Extra Info'),
 
72
                }
 
73
 
 
74
drugs_recreational ()
 
75
 
 
76
 
 
77
 
 
78
# lifestyle section
 
79
 
 
80
class medical_patient (osv.osv):
 
81
        _name = "medical.patient"
 
82
        _inherit = "medical.patient"
 
83
        _columns = {
 
84
                'excercise' : fields.boolean ('Excersise'),
 
85
                'excercise_minutes_day' : fields.integer ('Minutes / day',help="How many minutes a day the patient excersises"),
 
86
                'sleep_hours' : fields.integer ('Hours of sleep',help="Average hours of sleep per day"),
 
87
                'sleep_during_daytime' : fields.boolean ('Sleeps at daytime',help="Check if the patient sleep hours are during daylight rather than at night"),         
 
88
                'number_of_meals' : fields.integer ('Meals per day'),
 
89
                'eats_alone' : fields.boolean ('Eats alone',help="Check this box if the patient eats by him / herself."),
 
90
                'salt' : fields.boolean ('Salt',help="Check if patient consumes salt with the food"),
 
91
                'coffee' : fields.boolean ('Coffee'),
 
92
                'coffee_cups' : fields.integer ('Cups per day',help="Number of cup of coffee a day"),
 
93
                'soft_drinks' : fields.boolean ('Soft drinks (sugar)',help="Check if the patient consumes soft drinks with sugar"),
 
94
                'diet' : fields.boolean ('Currently on a diet',help="Check if the patient is currently on a diet"),
 
95
                'diet_info' : fields.char ('Diet info',size=256,help="Short description on the diet"),
 
96
                'smoking' : fields.boolean ('Smokes'),
 
97
                'smoking_number' : fields.integer ('Cigarretes a day'),
 
98
                'ex_smoker' : fields.boolean ('Ex-smoker'),
 
99
                'second_hand_smoker' : fields.boolean ('Passive smoker', help="Check it the patient is a passive / second-hand smoker"),
 
100
                'age_start_smoking' : fields.integer ('Age started to smoke'),
 
101
                'age_quit_smoking' : fields.integer ('Age of quitting',help="Age of quitting smoking"),
 
102
                'alcohol' : fields.boolean ('Drinks Alcohol'),
 
103
                'age_start_drinking' : fields.integer ('Age started to drink ',help="Date to start drinking"),
 
104
                'age_quit_drinking' : fields.integer ('Age quit drinking ',help="Date to stop drinking"),
 
105
                'ex_alcoholic' : fields.boolean ('Ex alcoholic'),
 
106
                'alcohol_beer_number' : fields.integer ('Beer / day'),
 
107
                'alcohol_wine_number' : fields.integer ('Wine / day'),
 
108
                'alcohol_liquor_number' : fields.integer ('Liquor / day'),
 
109
                'drug_usage' : fields.boolean ('Drug Habits'),
 
110
                'ex_drug_addict' : fields.boolean ('Ex drug addict'),
 
111
                'drug_iv' : fields.boolean ('IV drug user',help="Check this option if the patient injects drugs"),
 
112
                'age_start_drugs' : fields.integer ('Age started drugs ',help="Age of start drugs"),
 
113
                'age_quit_drugs' : fields.integer ('Age quit drugs ',help="Date of quitting drugs"),
 
114
                'drugs' : fields.many2many ('medical.drugs_recreational','patient_drugs_recreational_rel','patient_id','drugs_recreational_id','Drugs', help="Name of drugs that the patient consumes"), 
 
115
 
 
116
                'traffic_laws' : fields.boolean ('Obeys Traffic Laws', help="Check if the patient is a safe driver"),
 
117
                'car_revision' : fields.boolean ('Car Revision', help="Maintain the vehicle. Do periodical checks - tires, engine, breaks ..."),
 
118
                'car_seat_belt' : fields.boolean ('Seat belt', help="Safety measures when driving : safety belt"),
 
119
                'car_child_safety' : fields.boolean ('Car Child Safety', help="Safety measures when driving : child seats, proper seat belting, not seating on the front seat, ...."),
 
120
                'home_safety' : fields.boolean ('Home safety', help="Keep safety measures for kids in the kitchen, correct storage of chemicals, ..."),
 
121
                'motorcycle_rider' : fields.boolean ('Motorcycle Rider', help="The patient rides motorcycles"),         
 
122
                'helmet' : fields.boolean ('Uses helmet', help="The patient uses the proper motorcycle helmet"),                
 
123
                                
 
124
                'lifestyle_info' :fields.text ('Extra Information'),
 
125
 
 
126
 
 
127
                'sexual_preferences' : fields.selection([
 
128
                                ('h','Heterosexual'),
 
129
                                ('g','Homosexual'),
 
130
                                ('b','Bisexual'),
 
131
                                ('t','Transexual'),
 
132
                                ], 'Sexual Orientation'),
 
133
 
 
134
                'sexual_practices' : fields.selection([
 
135
                                ('s','Safe / Protected sex'),
 
136
                                ('r','Risky / Unprotected sex'),
 
137
                                ], 'Sexual Practices'),
 
138
 
 
139
                'sexual_partners': fields.selection([
 
140
                                ('m','Monogamous'),
 
141
                                ('t','Polygamous'),
 
142
                                ], 'Sexual Partners'),
 
143
 
 
144
                'sexual_partners_number': fields.integer ('Number of sexual partners'),
 
145
 
 
146
                'first_sexual_encounter': fields.integer ('Age first sexual encounter'),
 
147
 
 
148
                'anticonceptive': fields.selection ([
 
149
                        ('0','None'),
 
150
                        ('1','Pill / Minipill'),
 
151
                        ('2','Male condom'),
 
152
                        ('3','Vasectomy'),
 
153
                        ('4','Female sterilisation'),
 
154
                        ('5','Intra-uterine device'),
 
155
                        ('6','Withdrawal method'),
 
156
                        ('7','Fertility cycle awareness'),
 
157
                        ('8','Contraceptive injection'),
 
158
                        ('9','Skin Patch'),
 
159
                        ('10','Female condom'),
 
160
                        ], 'Anticonceptive Method'),
 
161
 
 
162
                'sex_oral': fields.selection ([
 
163
                        ('0','None'),
 
164
                        ('1','Active'),
 
165
                        ('2','Passive'),
 
166
                        ('3','Both'),                   
 
167
                        ], 'Oral Sex'),
 
168
 
 
169
                'sex_anal': fields.selection ([
 
170
                        ('0','None'),
 
171
                        ('1','Active'),
 
172
                        ('2','Passive'),
 
173
                        ('3','Both'),                   
 
174
                        ], 'Anal Sex'),
 
175
                        
 
176
                'prostitute' : fields.boolean ('Prostitute', help="Check if the patient (he or she) is a prostitute"),
 
177
                'sex_with_prostitutes' : fields.boolean ('Sex with prostitutes', help="Check if the patient (he or she) has sex with prostitutes"),
 
178
 
 
179
                'sexuality_info' :fields.text ('Extra Information'),
 
180
 
 
181
        }
 
182
 
 
183
medical_patient ()
 
184
 
 
185