Good afternoon

I have 3 different databases that relate the risk stratification in the 
patient's oral health.

1) Patient registration

2) Stratification data (eg smoking, pain, cavities, water with fluoride, etc.)

3) stratification result (Low Risk, Medium Risk, High Risk)

the BD 2 and 3 are referenced by the patient

I am creating graphs, but I can not relate, for example, to the smoker with the 
degree of risk. There are 36 stratified smokers, I would like to know how many 
are Low Risk, Medium Risk and High Risk.

Stratification Db

   
   


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/fd312b9f-b68a-4986-a536-273f13cfc10d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
# -*- coding: utf-8 -*-

db.define_table('estratifica',
                Field ('paciente', 'reference paciente'),
                Field ('data', 'date', default = request.now),
                Field ('condicao', 'string', default ="n.d.n"),
                Field ('cronica', 'integer', default = 0),
                Field ('intelectual', 'integer', default = 0),
                Field ('acamado', 'integer', default = 0),
                Field ('tabaco', 'integer', default = 0),
                Field ('cri', 'integer', default = 0),
                Field ('dor', 'integer', default = 0),
                Field ("mb", 'integer', default = 0),
                Field ('seca', 'integer', default = 0),
                Field ('car3', 'integer', default = 0),
                Field ('car4', 'integer', default = 0),
                Field ('car8', 'integer', default = 0),
                Field ('ferida', 'integer', default = 0),
                Field ('sangue', 'integer', default = 0),
                Field ('mole', 'integer', default = 0),
                Field ('total', 'integer', default = 0),
                Field ('parcial', 'integer', default = 0),
                Field ('perda', 'integer', default = 0),
                Field ('endo', 'integer', default = 0),
                Field ('perio', 'integer', default = 0),
                Field ('cirurgia', 'integer', default = 0),
                Field ('diag', 'integer', default = 0),
                Field ('esp', 'integer', default = 0),
                Field ('escol', 'integer', default = 0),
                Field ('doce', 'integer', default = 0),
                Field ('fluor', 'integer', default = 0),
                Field ('pasta', 'integer', default = 0),
                Field ('escovar', 'integer', default = 0),
                Field ('servico', 'integer', default = 0),
                Field ('mamadeira', 'integer', default = 0),
                Field ('chupeta', 'integer', default = 0),
                Field ('comportamento', 'integer', default = 0),
                Field ('supervisao', 'integer', default = 0),
                Field ('defeito', 'integer', default = 0),
                format = "%(data)s")

db.define_table('estratificacao',
                Field ('paciente', 'reference paciente', label = "Nome do Paciente:"),
                Field ('data', 'date', label = "Exame Data: ", requires = IS_DATE(format = '%d/%m/%Y', error_message="Data Inválida Ex.: 27/07/1984")),
                Field ('condicao', 'string', label = "Condição : ", requires = IS_IN_SET(['n.d.n.', 'gestante', '< 3 anos', "3<x>6 anos", "> 6 anos", "6<x>12 anos", "adolescente", "idoso", "paciente especial",'diabético', 'saúde mental'])),
                Field ('risco', 'string', label = "Risco : ", requires = IS_IN_SET(['Baixo Risco ', 'Médio Risco', 'Alto Risco'])),
                Field ('escore', 'integer', label = "Escore : "),
                format = "%(date)s")
                

db.estratifica.data.requires = IS_DATE(format = '%d/%m/%Y', error_message="Data Inválida Ex.: 27/07/1984")
db.estratifica.condicao.requires = IS_IN_SET(['n.d.n.', 'gestante', '< 3 anos', "3<x>6 anos", "> 6 anos", "6<x>12 anos", "adolescente", "idoso", "paciente especial",'diabético', 'pós-parto'])

Reply via email to