~vcs-imports-ii/health/trunk

« back to all changes in this revision

Viewing changes to tryton/health/health.py

  • Committer: Luis Falcon
  • Date: 2011-10-04 14:06:20 UTC
  • Revision ID: hg-v1:82f568e43009614875d363a158f421835dd67453
Use selection fields for Glasgow coma scale

Completes task http://savannah.gnu.org/task/?11399

Fixes error in medicament categories datafile

Show diffs side-by-side

added added

removed removed

Lines of Context:
1284
1284
        help='Level of Consciousness - on Glasgow Coma Scale :' \
1285
1285
        '  1=coma - 15=normal',
1286
1286
        on_change_with=['loc_verbal', 'loc_motor', 'loc_eyes'])
1287
 
    loc_eyes = fields.Integer('Level of Consciousness - Eyes',
1288
 
        help="Eyes Response - Glasgow Coma Scale - 1 to 4")
1289
 
    loc_verbal = fields.Integer('Level of Consciousness - Verbal',
1290
 
        help="Verbal Response - Glasgow Coma Scale - 1 to 5")
1291
 
    loc_motor = fields.Integer('Level of Consciousness - Motor',
1292
 
        help="Motor Response - Glasgow Coma Scale - 1 to 6")
 
1287
    loc_eyes = fields.Selection([
 
1288
       ('1', 'Does not Open Eyes'),
 
1289
       ('2', 'Opens eyes in response to painful stimuli'),
 
1290
       ('3', 'Opens eyes in response to voice'),
 
1291
       ('4', 'Opens eyes spontaneously'),
 
1292
        ], 'Glasgow - Eyes', sort=False)
 
1293
 
 
1294
    loc_verbal = fields.Selection([
 
1295
       ('1', 'Makes no sounds'),
 
1296
       ('2', 'Incomprehensible sounds'),
 
1297
       ('3', 'Utters inappropriate words'),
 
1298
       ('4', 'Confused, disoriented'),
 
1299
       ('5', 'Oriented, converses normally'),
 
1300
        ], 'Glasgow - Verbal', sort=False)
 
1301
 
 
1302
    loc_motor = fields.Selection([
 
1303
       ('1', 'Makes no movement'),
 
1304
       ('2', 'Extension to painful stimuli - decerebrate response -'),
 
1305
       ('3', 'Abnormal flexion to painful stimuli (decorticate response)'),
 
1306
       ('4', 'Flexion / Withdrawal to painful stimuli'),
 
1307
       ('5', 'Localizes painful stimuli'),
 
1308
       ('6', 'Obeys commands'),
 
1309
        ], 'Glasgow - Motor', sort=False)
 
1310
 
1293
1311
    tremor = fields.Boolean('Tremor', help='If associated  to a ' \
1294
1312
        'disease, please encode it on the patient disease history')
1295
1313
    violent = fields.Boolean('Violent Behaviour',
1436
1454
        loc_motor = vals.get('loc_motor')
1437
1455
        loc_eyes = vals.get('loc_eyes')
1438
1456
        loc_verbal = vals.get('loc_verbal')
1439
 
        loc = loc_motor + loc_eyes + loc_verbal
 
1457
        loc = int(loc_motor) + int(loc_eyes) + int(loc_verbal)
1440
1458
 
1441
1459
        return loc
1442
1460