xxxx
parent
439c0d8f4c
commit
5dab76ee4f
|
@ -12,9 +12,9 @@
|
||||||
<field name="date"/>
|
<field name="date"/>
|
||||||
<tabs>
|
<tabs>
|
||||||
<tab string="HDCase">
|
<tab string="HDCase">
|
||||||
<field name="hd_cases" nolabel="1">
|
<field name="hd_cases" nolabel="1" count="5">
|
||||||
<list>
|
<list model="clinic.hd.case" colors='{"#cfc":[["state","=","completed"]],"#f9e37d":[["state","=","in_progress"]],"#bcbbb9":[["state","=","cancelled"]],"#ACD1E9":[["state","=","waiting_payment"]],"#70DB93":[["state","=","paid"]]}'>
|
||||||
<field name="sickbed_id" span="2"/>
|
<field name="sickbed_id" domain="[['available','=',True]]" span="2"/>
|
||||||
<field name="patient_id" span="2"/>
|
<field name="patient_id" span="2"/>
|
||||||
<field name="time_start" span="2"/>
|
<field name="time_start" span="2"/>
|
||||||
<field name="wt_start" span="2"/>
|
<field name="wt_start" span="2"/>
|
||||||
|
@ -26,6 +26,7 @@
|
||||||
<field name="time_stop" span="2"/>
|
<field name="time_stop" span="2"/>
|
||||||
<field name="wt_stop" span="2"/>
|
<field name="wt_stop" span="2"/>
|
||||||
<field name="bp_stop" span="2"/>
|
<field name="bp_stop" span="2"/>
|
||||||
|
<field name="hd_case_id" span="2"/>
|
||||||
</list>
|
</list>
|
||||||
</field>
|
</field>
|
||||||
</tab>
|
</tab>
|
||||||
|
@ -44,10 +45,8 @@
|
||||||
<button string="Validate" type="success" method="validate" icon="ok" size="small" states="draft" />
|
<button string="Validate" type="success" method="validate" icon="ok" size="small" states="draft" />
|
||||||
</tab>
|
</tab>
|
||||||
</tabs>
|
</tabs>
|
||||||
<foot>
|
|
||||||
<!--<button string="Validate" type="success" method="validate" icon="ok" states="draft" />-->
|
|
||||||
</foot>
|
|
||||||
<related>
|
<related>
|
||||||
<field name="visits"/>
|
<field name="visits"/>
|
||||||
|
<field name="comments"/>
|
||||||
</related>
|
</related>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -8,18 +8,15 @@
|
||||||
<group span="6" columns="1">
|
<group span="6" columns="1">
|
||||||
<field name="number"/>
|
<field name="number"/>
|
||||||
<field name="ref"/>
|
<field name="ref"/>
|
||||||
<field name="patient_id"/>
|
<field name="patient_id" required="1"/>
|
||||||
<field name="date"/>
|
<field name="date"/>
|
||||||
<field name="member_type"/>
|
<field name="exp_date"/>
|
||||||
<field name="bid_flow_rate"/>
|
|
||||||
<field name="ultrafittration"/>
|
|
||||||
</group>
|
</group>
|
||||||
<group span="6" columns="1">
|
<group span="6" columns="1">
|
||||||
<field name="product_id"/>
|
<field name="product_id"/>
|
||||||
<field name="dialyzer_type"/>
|
<field name="dialyzer_type"/>
|
||||||
<field name="use_time" readonly="1"/>
|
<field name="use_time" readonly="1"/>
|
||||||
<field name="max_use_time"/>
|
<field name="max_use_time"/>
|
||||||
<field name="exp_date"/>
|
|
||||||
<field name="description"/>
|
<field name="description"/>
|
||||||
</group>
|
</group>
|
||||||
<foot>
|
<foot>
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
</head>
|
</head>
|
||||||
<group form_layout="stacked">
|
<group form_layout="stacked">
|
||||||
<field name="number" span="2"/>
|
<field name="number" span="2"/>
|
||||||
<field name="sickbed_id" span="2" required="1"/>
|
<field name="sickbed_id" domain="[['available','=',True]]" span="2"/>
|
||||||
<field name="patient_id" span="2" onchange="onchange_patient"/>
|
<field name="patient_id" span="2" onchange="onchange_patient"/>
|
||||||
<field name="patient_type_id" span="2"/>
|
<field name="patient_type_id" span="2"/>
|
||||||
<field name="cycle_id" span="2" required="1" onchange="onchange_cycle"/>
|
<field name="cycle_id" span="2" required="1" onchange="onchange_cycle"/>
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
<list model="clinic.hd.case" colors='{"#cfc":[["state","=","completed"]],"#f9e37d":[["state","=","in_progress"]],"#bcbbb9":[["state","=","cancelled"]],"#ACD1E9":[["state","=","waiting_payment"]],"#70DB93":[["state","=","paid"]]}'>
|
<list model="clinic.hd.case" colors='{"#cfc":[["state","=","completed"]],"#f9e37d":[["state","=","in_progress"]],"#bcbbb9":[["state","=","cancelled"]],"#ACD1E9":[["state","=","waiting_payment"]],"#70DB93":[["state","=","paid"]]}'>
|
||||||
<field name="number"/>
|
<field name="number"/>
|
||||||
<field name="sickbed_id" span="2"/>
|
|
||||||
<field name="date"/>
|
<field name="date"/>
|
||||||
|
<field name="patient_id"/>
|
||||||
|
<field name="sickbed_id"/>
|
||||||
<field name="cycle_id"/>
|
<field name="cycle_id"/>
|
||||||
<field name="department_id"/>
|
<field name="department_id"/>
|
||||||
<field name="doctor_id"/>
|
<field name="doctor_id"/>
|
||||||
|
|
|
@ -36,6 +36,7 @@ class CycleItem(Model):
|
||||||
'company_id': fields.Many2One("company", "Company"),
|
'company_id': fields.Many2One("company", "Company"),
|
||||||
"state": fields.Selection([("draft","Draft"),("validated","Validated")],"Status",required=True),
|
"state": fields.Selection([("draft","Draft"),("validated","Validated")],"Status",required=True),
|
||||||
'user_id': fields.Many2One("base.user","Validator"),
|
'user_id': fields.Many2One("base.user","Validator"),
|
||||||
|
"comments": fields.One2Many("message","related_id","Comments"), "company_id": fields.Many2One("company","Company"),
|
||||||
}
|
}
|
||||||
|
|
||||||
def _get_vark(self,context={}):
|
def _get_vark(self,context={}):
|
||||||
|
|
|
@ -18,10 +18,7 @@ class Dialyzer(Model):
|
||||||
"use_time": fields.Integer("Use Time"),
|
"use_time": fields.Integer("Use Time"),
|
||||||
"max_use_time": fields.Integer("Max Use Time"),
|
"max_use_time": fields.Integer("Max Use Time"),
|
||||||
"exp_date": fields.Date("Expiry Date",search=True),
|
"exp_date": fields.Date("Expiry Date",search=True),
|
||||||
"member_type": fields.Selection([("unsub","Unsub cellul"),("sub","Sub cellul"),("synthetic","Synthetic")],"Membrane Type"),
|
|
||||||
"dialyzer_type": fields.Selection([("low","low flux"),("high","high flux"),("dbl","dbl hifulx")],"Dialyzer Type"),
|
"dialyzer_type": fields.Selection([("low","low flux"),("high","high flux"),("dbl","dbl hifulx")],"Dialyzer Type"),
|
||||||
"bid_flow_rate": fields.Integer("Bid Flow Rate (ml/min)",search=True),
|
|
||||||
"ultrafittration": fields.Float("Ultrafittration Kg.",search=True),
|
|
||||||
"state": fields.Selection([("new","New"),("active","Active"),("drop","Drop"),("expire","Expire"),('cancelled','Cancelled')],"Status"),
|
"state": fields.Selection([("new","New"),("active","Active"),("drop","Drop"),("expire","Expire"),('cancelled','Cancelled')],"Status"),
|
||||||
"comments": fields.One2Many("message","related_id","Comments"),
|
"comments": fields.One2Many("message","related_id","Comments"),
|
||||||
"company_id": fields.Many2One("company","Company"),
|
"company_id": fields.Many2One("company","Company"),
|
||||||
|
@ -86,8 +83,8 @@ class Dialyzer(Model):
|
||||||
id=ids[0]
|
id=ids[0]
|
||||||
obj=self.browse(id)
|
obj=self.browse(id)
|
||||||
patient=obj.patient_id
|
patient=obj.patient_id
|
||||||
if not patient:
|
#if not patient:
|
||||||
raise Exception("Patient is required")
|
#raise Exception("Patient is required")
|
||||||
partner=patient.partner_id
|
partner=patient.partner_id
|
||||||
if not partner:
|
if not partner:
|
||||||
raise Exception("Contact not for this patient")
|
raise Exception("Contact not for this patient")
|
||||||
|
|
|
@ -190,7 +190,7 @@ class GenVisit(Model):
|
||||||
'cycle_id': cycle.id,
|
'cycle_id': cycle.id,
|
||||||
'time_start': ttime_start,
|
'time_start': ttime_start,
|
||||||
'time_stop': ttime_stop,
|
'time_stop': ttime_stop,
|
||||||
'state': 'draft',
|
'state': 'pending',
|
||||||
}
|
}
|
||||||
visit_vals.append(vals)
|
visit_vals.append(vals)
|
||||||
count+=7
|
count+=7
|
||||||
|
@ -200,7 +200,7 @@ class GenVisit(Model):
|
||||||
dom.append(['time_stop','<=','%s %s'%(tmp.strftime(FMT_DATE)[0:10],' 23:59:59')])
|
dom.append(['time_stop','<=','%s %s'%(tmp.strftime(FMT_DATE)[0:10],' 23:59:59')])
|
||||||
dom.append(['patient_id', '=', patient_id])
|
dom.append(['patient_id', '=', patient_id])
|
||||||
dom.append(['cycle_id', '=', obj.cycle_id.id]) #XXX
|
dom.append(['cycle_id', '=', obj.cycle_id.id]) #XXX
|
||||||
dom.append(['state','=','draft'])
|
dom.append(['state','=','pending'])
|
||||||
vids=visit_obj.search(dom)
|
vids=visit_obj.search(dom)
|
||||||
visit_obj.delete(vids)
|
visit_obj.delete(vids)
|
||||||
key='%s/%s'%(vals['cycle_id'], vals['time_start'])
|
key='%s/%s'%(vals['cycle_id'], vals['time_start'])
|
||||||
|
@ -209,7 +209,7 @@ class GenVisit(Model):
|
||||||
'cycle_id': obj.cycle_id.id,
|
'cycle_id': obj.cycle_id.id,
|
||||||
'time_start': ttime_start,
|
'time_start': ttime_start,
|
||||||
'time_stop': ttime_stop,
|
'time_stop': ttime_stop,
|
||||||
'state':'draft',
|
'state':'pending',
|
||||||
}
|
}
|
||||||
start_date=tmp
|
start_date=tmp
|
||||||
user_id=get_active_user()
|
user_id=get_active_user()
|
||||||
|
@ -292,10 +292,11 @@ class GenVisit(Model):
|
||||||
dom=[]
|
dom=[]
|
||||||
dom.append(['time_start','>=','%s %s'%(obj.date_from[0:10],' 00:00:00')])
|
dom.append(['time_start','>=','%s %s'%(obj.date_from[0:10],' 00:00:00')])
|
||||||
dom.append(['time_stop','<=','%s %s'%(date_to2[0:10],' 23:59:59')])
|
dom.append(['time_stop','<=','%s %s'%(date_to2[0:10],' 23:59:59')])
|
||||||
dom.append(['state','=','draft'])
|
dom.append(['state','=','pending'])
|
||||||
vids=visit_obj.search(dom)
|
vids=visit_obj.search(dom)
|
||||||
visit_obj.delete(vids)
|
visit_obj.delete(vids)
|
||||||
schedule_obj=get_model("clinic.schedule")
|
schedule_obj=get_model("clinic.schedule")
|
||||||
|
dom[-1][2]='draft' #XXX
|
||||||
schedules=schedule_obj.search_browse(dom)
|
schedules=schedule_obj.search_browse(dom)
|
||||||
schedule_ids=[]
|
schedule_ids=[]
|
||||||
for sch in schedules:
|
for sch in schedules:
|
||||||
|
@ -336,7 +337,7 @@ class GenVisit(Model):
|
||||||
dom.append(['time_start','>=','%s'%time_start])
|
dom.append(['time_start','>=','%s'%time_start])
|
||||||
dom.append(['time_stop','<=','%s'%time_stop])
|
dom.append(['time_stop','<=','%s'%time_stop])
|
||||||
dom.append(['patient_id','=','%s'%patient_id])
|
dom.append(['patient_id','=','%s'%patient_id])
|
||||||
dom.append(['state','=','draft'])
|
dom.append(['state','=','pending'])
|
||||||
count+=7
|
count+=7
|
||||||
vids=visit_obj.search(dom)
|
vids=visit_obj.search(dom)
|
||||||
if vids:
|
if vids:
|
||||||
|
@ -350,7 +351,7 @@ class GenVisit(Model):
|
||||||
dom.append(['time_start','>=','%s'%time_start])
|
dom.append(['time_start','>=','%s'%time_start])
|
||||||
dom.append(['time_stop','<=','%s'%time_stop])
|
dom.append(['time_stop','<=','%s'%time_stop])
|
||||||
dom.append(['patient_id','=','%s'%patient_id])
|
dom.append(['patient_id','=','%s'%patient_id])
|
||||||
dom.append(['state','=','draft'])
|
dom.append(['state','=','pending'])
|
||||||
vids=visit_obj.search(dom)
|
vids=visit_obj.search(dom)
|
||||||
if vids:
|
if vids:
|
||||||
visit_ids.append(vids[0])
|
visit_ids.append(vids[0])
|
||||||
|
|
|
@ -29,7 +29,7 @@ class HDCase(Model):
|
||||||
res[obj.id]=obj.amount
|
res[obj.id]=obj.amount
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def _get_total(self,ids,context={}):
|
def _get_all(self,ids,context={}):
|
||||||
vals={}
|
vals={}
|
||||||
for obj in self.browse(ids):
|
for obj in self.browse(ids):
|
||||||
total=0
|
total=0
|
||||||
|
@ -59,6 +59,7 @@ class HDCase(Model):
|
||||||
'fee_amount': fee_amt,
|
'fee_amount': fee_amt,
|
||||||
'mdc_amount': mdc_amt,
|
'mdc_amount': mdc_amt,
|
||||||
'srv_amount': srv_amt,
|
'srv_amount': srv_amt,
|
||||||
|
'hd_case_id': obj.id,
|
||||||
}
|
}
|
||||||
return vals
|
return vals
|
||||||
|
|
||||||
|
@ -80,16 +81,16 @@ class HDCase(Model):
|
||||||
"patient_type_id": fields.Many2One("clinic.patient.type", "Type",function="_get_patient_type"),
|
"patient_type_id": fields.Many2One("clinic.patient.type", "Type",function="_get_patient_type"),
|
||||||
"nurse_id": fields.Many2One("clinic.staff","Approve By", domain=[['type','=','nurse']]),
|
"nurse_id": fields.Many2One("clinic.staff","Approve By", domain=[['type','=','nurse']]),
|
||||||
"department_id": fields.Many2One("clinic.department", "Department",search=True),
|
"department_id": fields.Many2One("clinic.department", "Department",search=True),
|
||||||
"wt_start": fields.Float("Start Wt (Kg)"),
|
"wt_start": fields.Float("Start Wt (kg.)"),
|
||||||
"wt_stop": fields.Float("Stop Wt (Kg)"),
|
"wt_stop": fields.Float("Finish Wt (kg.)"),
|
||||||
"bp_start": fields.Char("Start BP"),
|
"bp_start": fields.Char("Start BP"),
|
||||||
"bp_stop": fields.Char("Stop BP"),
|
"bp_stop": fields.Char("Finish BP"),
|
||||||
"membrane_type": fields.Selection([("unsub","Unsub cellul"),("sub","Sub cellul"),("synthetic","Synthetic")],"Member Type"),
|
"membrane_type": fields.Selection([("unsub","Unsub cellul"),("sub","Sub cellul"),("synthetic","Synthetic")],"Member Type"),
|
||||||
"hd_acc": fields.Selection([("o","O"),("i","I")],"HD Acc"),
|
"hd_acc": fields.Selection([("o","O"),("i","I")],"HD Acc"),
|
||||||
"hd_mode": fields.Selection([("chronic","Chronic"),("acute","Acute")],"HD Moode"),
|
"hd_mode": fields.Selection([("chronic","Chronic"),("acute","Acute")],"HD Moode"),
|
||||||
"vascular_acc": fields.Many2One("clinic.vascular.access","Vascular Ac."),
|
"vascular_acc": fields.Many2One("clinic.vascular.access","Vascular Ac."),
|
||||||
"bid_flow_rate": fields.Integer("Bid Flow Rate (ml/min)"),
|
"bid_flow_rate": fields.Integer("Bid Flow Rate (ml/min)"),
|
||||||
"ultrafittration": fields.Float("Ultrafittration Kg."),
|
"ultrafittration": fields.Float("Ultrafittration (kg.)"),
|
||||||
"hct": fields.Integer("Hct",required=True),
|
"hct": fields.Integer("Hct",required=True),
|
||||||
"hct_msg" : fields.Char(""),
|
"hct_msg" : fields.Char(""),
|
||||||
"state": fields.Selection([("draft","Draft"),('waiting_treatment','Waiting Treatment'),("in_progress","In Progress"),("completed","Finish Treatment"),('paid','Paid'),("waiting_payment","Waiting Payment"),("discountinued","Discountinued"),("cancelled","Cancelled")],"Status",required=True),
|
"state": fields.Selection([("draft","Draft"),('waiting_treatment','Waiting Treatment'),("in_progress","In Progress"),("completed","Finish Treatment"),('paid','Paid'),("waiting_payment","Waiting Payment"),("discountinued","Discountinued"),("cancelled","Cancelled")],"Status",required=True),
|
||||||
|
@ -104,11 +105,11 @@ class HDCase(Model):
|
||||||
"expenes": fields.One2Many("clinic.hd.case.expense","hd_case_id","Expenses"),
|
"expenes": fields.One2Many("clinic.hd.case.expense","hd_case_id","Expenses"),
|
||||||
'visit_id': fields.Many2One("clinic.visit", "Visit"),
|
'visit_id': fields.Many2One("clinic.visit", "Visit"),
|
||||||
'duration': fields.Integer("Duration (Hours)",function="_get_duration"),
|
'duration': fields.Integer("Duration (Hours)",function="_get_duration"),
|
||||||
"total": fields.Float("Total",function="_get_total",readonly=True,function_multi=True),
|
"total": fields.Float("Total",function="_get_all",readonly=True,function_multi=True),
|
||||||
"fee_amount": fields.Float("Fee",function="_get_total",readonly=True,function_multi=True),
|
"fee_amount": fields.Float("Fee",function="_get_all",readonly=True,function_multi=True),
|
||||||
"mdc_amount": fields.Float("Medicine",function="_get_total",readonly=True,function_multi=True),
|
"mdc_amount": fields.Float("Medicine",function="_get_all",readonly=True,function_multi=True),
|
||||||
"srv_amount": fields.Float("Service",function="_get_total",readonly=True,function_multi=True),
|
"srv_amount": fields.Float("Service",function="_get_all",readonly=True,function_multi=True),
|
||||||
"amount": fields.Float("Due Amount",function="_get_total",readonly=True,function_multi=True),
|
"amount": fields.Float("Due Amount",function="_get_all",readonly=True,function_multi=True),
|
||||||
'fee_partner_id': fields.Many2One("partner","Contact Fee"),
|
'fee_partner_id': fields.Many2One("partner","Contact Fee"),
|
||||||
'fee_paid': fields.Boolean("Fee Paid"),
|
'fee_paid': fields.Boolean("Fee Paid"),
|
||||||
'note': fields.Text("Note"),
|
'note': fields.Text("Note"),
|
||||||
|
@ -127,6 +128,7 @@ class HDCase(Model):
|
||||||
"invoice_policy": fields.Selection([("fee","Only Fee"),("fee_mdc","Fee & Medicine")],"Government pay for:"),
|
"invoice_policy": fields.Selection([("fee","Only Fee"),("fee_mdc","Fee & Medicine")],"Government pay for:"),
|
||||||
"invoice_option": fields.Selection([("fee_mdc_plus","Combine Fee & Medicine"),("fee_mdc_split","Split Fee & Medicine")],"Invoice:"),
|
"invoice_option": fields.Selection([("fee_mdc_plus","Combine Fee & Medicine"),("fee_mdc_split","Split Fee & Medicine")],"Invoice:"),
|
||||||
'req_fee': fields.Integer("Request Expense"),
|
'req_fee': fields.Integer("Request Expense"),
|
||||||
|
'hd_case_id': fields.Many2One("clinic.hd.case","HD",function="_get_all",function_multi=True), # XXX
|
||||||
}
|
}
|
||||||
|
|
||||||
def _get_number(self,context={}):
|
def _get_number(self,context={}):
|
||||||
|
@ -560,6 +562,9 @@ class HDCase(Model):
|
||||||
#TODO should find dlz when confirm visit
|
#TODO should find dlz when confirm visit
|
||||||
if not obj.dialyzers:
|
if not obj.dialyzers:
|
||||||
raise Exception("Please input dialyzer!")
|
raise Exception("Please input dialyzer!")
|
||||||
|
obj.sickbed_id.write({
|
||||||
|
'available': False,
|
||||||
|
})
|
||||||
vals={
|
vals={
|
||||||
'state': 'in_progress',
|
'state': 'in_progress',
|
||||||
}
|
}
|
||||||
|
@ -772,6 +777,9 @@ class HDCase(Model):
|
||||||
obj.write({
|
obj.write({
|
||||||
'state': 'completed',
|
'state': 'completed',
|
||||||
})
|
})
|
||||||
|
obj.sickbed_id.write({
|
||||||
|
'available': False,
|
||||||
|
})
|
||||||
return {
|
return {
|
||||||
'next': {
|
'next': {
|
||||||
'name': 'clinic_hd_case',
|
'name': 'clinic_hd_case',
|
||||||
|
|
|
@ -310,7 +310,7 @@ class Visit(Model):
|
||||||
|
|
||||||
def delete(self,ids,context={}):
|
def delete(self,ids,context={}):
|
||||||
for obj in self.browse(ids):
|
for obj in self.browse(ids):
|
||||||
if obj.state!='draft':
|
if obj.state not in ('draft','pending'):
|
||||||
raise Exception("Can not delete visit %s because state is not draft!"%obj.number)
|
raise Exception("Can not delete visit %s because state is not draft!"%obj.number)
|
||||||
super().delete(ids,context=context)
|
super().delete(ids,context=context)
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,12 @@
|
||||||
cycle item
|
cycle item
|
||||||
- list's nurse
|
- list's nurse
|
||||||
- list hd case + U
|
- list hd case + U
|
||||||
|
- xxx
|
||||||
|
- change datetime
|
||||||
|
|
||||||
|
visit:
|
||||||
|
- confirm
|
||||||
|
- copy data to hdcase -> cycle item
|
||||||
=====
|
=====
|
||||||
- design
|
- design
|
||||||
1. create cycle item
|
1. create cycle item
|
||||||
|
|
Loading…
Reference in New Issue