dispose
commit
605671e4f5
|
@ -3,10 +3,9 @@
|
||||||
<field name="view_cls">multi_view</field>
|
<field name="view_cls">multi_view</field>
|
||||||
<field name="model">clinic.patient</field>
|
<field name="model">clinic.patient</field>
|
||||||
<field name="tabs">[
|
<field name="tabs">[
|
||||||
["All",[]],
|
["All",[["state","=","admit"]]],
|
||||||
["Archived",[["active","=","False"]]],
|
["Archived",[["active","=","False"]]],
|
||||||
["Admit",[["state","=","admit"]]],
|
["Disposed",[["state","=","dispose"]]]]
|
||||||
["Dispose",[["state","=","dispose"]]]]
|
|
||||||
</field>
|
</field>
|
||||||
<field name="menu">clinic_menu</field>
|
<field name="menu">clinic_menu</field>
|
||||||
<field name="limit">25</field>
|
<field name="limit">25</field>
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
<field name="categ_id"/>
|
<field name="categ_id"/>
|
||||||
<field name="branch_id" required="1"/>
|
<field name="branch_id" required="1"/>
|
||||||
<field name="department_id" required="1" domain='[["branch_id","=",branch_id]]'/>
|
<field name="department_id" required="1" domain='[["branch_id","=",branch_id]]'/>
|
||||||
|
<field name="active" invisible="1"/>
|
||||||
<tabs>
|
<tabs>
|
||||||
<tab string="General">
|
<tab string="General">
|
||||||
<group span="6" columns="1">
|
<group span="6" columns="1">
|
||||||
|
@ -77,10 +78,13 @@
|
||||||
<field name="partner_id" domain='[["is_patient","=","true"]]'/>
|
<field name="partner_id" domain='[["is_patient","=","true"]]'/>
|
||||||
</tab>
|
</tab>
|
||||||
<tab string="Other">
|
<tab string="Other">
|
||||||
<field name="state"/>
|
<group layout_form="stacked">
|
||||||
<field name="resign_date" attrs='{"required":[["state","=","resign"]]}'/>
|
<field name="dispose" span="3"/>
|
||||||
<field name="hn_no"/>
|
<field name="resign_date" attrs='{"required":[["dispose","=","true"]]}' span="4"/>
|
||||||
<field name="note" attrs='{"required":[["state","=","resign"]]}'/>
|
<field name="note" attrs='{"required":[["dispose","=","true"]]}' span="4"/>
|
||||||
|
<field name="state" invisible="1"/>
|
||||||
|
<field name="hn_no" invisible="1"/>
|
||||||
|
</group>
|
||||||
</tab>
|
</tab>
|
||||||
</tabs>
|
</tabs>
|
||||||
<related>
|
<related>
|
||||||
|
|
|
@ -13,6 +13,5 @@
|
||||||
<field name="branch_id"/>
|
<field name="branch_id"/>
|
||||||
<field name="department_id"/>
|
<field name="department_id"/>
|
||||||
<field name="doctor_id"/>
|
<field name="doctor_id"/>
|
||||||
<field name="state"/>
|
|
||||||
<!--<field name="image" preview='1'/>-->
|
<!--<field name="image" preview='1'/>-->
|
||||||
</list>
|
</list>
|
||||||
|
|
|
@ -118,7 +118,8 @@ class Patient(Model):
|
||||||
"hd_cases": fields.One2Many("clinic.hd.case","patient_id","HD Cases"),
|
"hd_cases": fields.One2Many("clinic.hd.case","patient_id","HD Cases"),
|
||||||
"partner_id": fields.Many2One("partner","Contact"),
|
"partner_id": fields.Many2One("partner","Contact"),
|
||||||
"dialyzers": fields.One2Many("clinic.dialyzer","patient_id","Dialyzers"),
|
"dialyzers": fields.One2Many("clinic.dialyzer","patient_id","Dialyzers"),
|
||||||
"active":fields.Boolean("Active", search=True),
|
"active":fields.Boolean("Active"),
|
||||||
|
"dispose":fields.Boolean("Dispose"),
|
||||||
'note': fields.Text("Note"),
|
'note': fields.Text("Note"),
|
||||||
'categ_id': fields.Many2One("clinic.patient.categ","Category"),
|
'categ_id': fields.Many2One("clinic.patient.categ","Category"),
|
||||||
'doctor_id': fields.Many2One("clinic.staff","Doctor",domain=[['type','=','doctor']]),
|
'doctor_id': fields.Many2One("clinic.staff","Doctor",domain=[['type','=','doctor']]),
|
||||||
|
@ -185,6 +186,8 @@ class Patient(Model):
|
||||||
|
|
||||||
def check_idcard(self,idcard=''):
|
def check_idcard(self,idcard=''):
|
||||||
res=True
|
res=True
|
||||||
|
if idcard=='/':
|
||||||
|
return True
|
||||||
if idcard.isalpha():
|
if idcard.isalpha():
|
||||||
res=False
|
res=False
|
||||||
elif len(idcard)!=13:
|
elif len(idcard)!=13:
|
||||||
|
@ -242,6 +245,11 @@ class Patient(Model):
|
||||||
super().delete(ids)
|
super().delete(ids)
|
||||||
|
|
||||||
def write(self,ids,vals,**kw):
|
def write(self,ids,vals,**kw):
|
||||||
|
if 'dispose' in vals.keys():
|
||||||
|
if vals['dispose']:
|
||||||
|
vals['state']='dispose'
|
||||||
|
else:
|
||||||
|
vals['state']='admit'
|
||||||
if 'card_no' in vals.keys():
|
if 'card_no' in vals.keys():
|
||||||
self.check_idcard(vals['card_no'])
|
self.check_idcard(vals['card_no'])
|
||||||
ctx={}
|
ctx={}
|
||||||
|
@ -393,5 +401,8 @@ class Patient(Model):
|
||||||
},'flash': 'New Dialyzer successfully',
|
},'flash': 'New Dialyzer successfully',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def onchange_state(self,ids,context={}):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
Patient.register()
|
Patient.register()
|
||||||
|
|
|
@ -110,6 +110,14 @@ class ClinicSetting(Model):
|
||||||
if user_id !=1:
|
if user_id !=1:
|
||||||
print("Only admin!!")
|
print("Only admin!!")
|
||||||
return
|
return
|
||||||
|
for cpt in get_model("clinic.patient.cycle").search_browse([]):
|
||||||
|
patient=cpt.patient_id
|
||||||
|
if patient.state!='admit':
|
||||||
|
print(patient.name)
|
||||||
|
cpt.delete()
|
||||||
|
print("Done!")
|
||||||
|
return
|
||||||
|
|
||||||
for pt in get_model("clinic.patient").search_browse([]):
|
for pt in get_model("clinic.patient").search_browse([]):
|
||||||
pt.write({
|
pt.write({
|
||||||
'state': 'admit',
|
'state': 'admit',
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
todo:
|
todo:
|
||||||
- set patient_id with domain state=='treatment'
|
|
||||||
|
|
||||||
- compute labor cost
|
- compute labor cost
|
||||||
- update level
|
- update level -> ok
|
||||||
|
- set patient_id with domain state=='admit' -> ok
|
||||||
|
|
||||||
convbal -> not yet (wait yui) -> ok but have to update memo
|
convbal -> not yet (wait yui) -> ok but have to update memo
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue