patient cycle

conv_bal
watcha.h@almacom.co.th 2015-01-15 14:37:36 +07:00
parent 45a088f485
commit 326999bb47
14 changed files with 61 additions and 6 deletions

View File

@ -0,0 +1,6 @@
<action>
<field name="string">New Dialyzer</field>
<field name="view_cls">form_popup</field>
<field name="model">clinic.hd.case.popup.dlz</field>
<field name="target">_popup</field>
</action>

View File

@ -0,0 +1,7 @@
<action>
<field name="string">Patient Cycles</field>
<field name="view_cls">multi_view</field>
<field name="model">clinic.patient.cycle</field>
<field name="menu">clinic_menu</field>
<field name="limit">25</field>
</action>

View File

@ -0,0 +1,7 @@
<form model="clinic.hd.case.popup.dlz">
<field name="hd_case_id" invisible="1"/>
<field name="product_id"/>
<foot>
<button string="Validate" type="success" method="new_dlz"/>
</foot>
</form>

View File

@ -3,6 +3,7 @@
<field name="state"/>
<button string="Options" dropdown="1">
<item string="New Dialyzer" method="new_dialyzer" states="draft,waiting_treatment"/>
<item string="New Dialyzer(Testing)" action="clinic_hd_case_dlz" states="draft,waiting_treatment" perm="clinic_new_dlz"/>
<item string="To Draft" method="to_draft" states="paid,waiting_payment,completed,cancelled"/>
</button>
</head>

View File

@ -17,6 +17,7 @@
<item string="Dialyzers" action="clinic_dialyzer"/>
<divider/>
<header string="SETTINGS"/>
<item string="Patient Cycles" action="clinic_patient_cycle"/>
<item string="Patient Types" action="clinic_patient_type"/>
<item string="Categories" action="clinic_patient_categ"/>
<item string="Cause Chronics" action="clinic_cause_chronic"/>

View File

@ -0,0 +1,5 @@
<form model="clinic.patient.cycle">
<field name="patient_id"/>
<field name="cycle_id"/>
<field name="day"/>
</form>

View File

@ -0,0 +1,5 @@
<list model="clinic.patient.cycle">
<field name="patient_id"/>
<field name="cycle_id"/>
<field name="day"/>
</list>

View File

@ -45,7 +45,12 @@
</tab>
<tab string="Cycles">
<group span="8" columns="1">
<field name="cycles"/>
<field name="cycles" nolabel="1">
<list>
<field name="cycle_id"/>
<field name="day"/>
</list>
</field>
</group>
<group span="4" columns="1">
<field name="cycle_id"/>

View File

@ -10,6 +10,5 @@
<field name="department_id"/>
<field name="doctor_id"/>
<field name="type_id"/>
<field name="cycles"/>
<field name="image" preview='1'/>
</list>

View File

@ -15,6 +15,7 @@ from . import partner
from . import patient
from . import patient_type
from . import patient_categ
from . import patient_cycle
from . import patient_cause
from . import patient_comorbidity
from . import patient_morbidity

View File

@ -71,8 +71,8 @@ class HDCase(Model):
"number": fields.Char("Number",required=True,search=True),
'sickbed_id': fields.Many2One("clinic.sickbed",'Sickbed'),
"ref": fields.Char("Ref",search=True),
"time_start": fields.DateTime("Start Time",required=True,search=True),
"time_stop": fields.DateTime("Finish Time",required=True,search=True),
"time_start": fields.DateTime("Start Time",required=True),
"time_stop": fields.DateTime("Finish Time",required=True),
"date": fields.Date("Date",required=True,search=True),
"patient_id": fields.Many2One("clinic.patient","Patient",required=True,search=True),
"patient_type_id": fields.Many2One("clinic.patient.type", "Type",function="_get_patient_type"),

View File

@ -6,7 +6,11 @@ class HDCasePopupDlz(Model):
_fields={
"hd_case_id": fields.Many2One("clinic.hd.case","HdCase",required=True,on_delete="cascade"),
"note": fields.Text("Description"),
'product_id': fields.Many2One("product", "Product",required=True),
"dialyzer_type": fields.Selection([("low","low flux"),("high","high flux"),("dbl","dbl hifulx")],"Dialyzer Type"),
"max_use_time": fields.Integer("Max Use Time"),
"exp_date": fields.Date("Expiry Date"),
"note": fields.Text("Note"),
}
def _get_hd_case_id(self,context={}):

View File

@ -100,7 +100,7 @@ class Patient(Model):
'department_id': fields.Many2One("clinic.department","Department"),
'cycle_id': fields.Many2One("clinic.cycle","Last Cycle",function="_get_last_cycle"),
'branch_id': fields.Many2One("clinic.branch","Branch",search=True),
'cycles': fields.Many2Many("clinic.cycle","Cycles"),
'cycles': fields.One2Many("clinic.patient.cycle","patient_id", "Cycles"),
}
def _get_number(self,context={}):

View File

@ -0,0 +1,14 @@
from netforce.model import Model, fields
class PatientCycle(Model):
_name="clinic.patient.cycle"
_string="Patient Cycle"
_key=['patient_id','cycle_id','day']
_fields={
"patient_id": fields.Many2One('clinic.patient',"Patient",required=True,on_delete="cascade",search=True),
"cycle_id": fields.Many2One('clinic.cycle',"Cycle",search=True),
'day': fields.Selection([('mon', 'Monday'), ('tue','Tuesday'), ('wed','Wedsday'),('thu','Thursday'),('fri','Friday'),('sat','Satherday'),('sun','Sunday')], 'Days',search=True),
}
PatientCycle.register()