Treatment_Summary & Dialyzer_Drop [Report]
parent
5aee7a60b5
commit
a307836918
|
@ -0,0 +1,6 @@
|
||||||
|
<action>
|
||||||
|
<field name="string">Cycle</field>
|
||||||
|
<field name="view_cls">multi_view</field>
|
||||||
|
<field name="model">clinic.cycle</field>
|
||||||
|
<field name="menu">clinic_menu</field>
|
||||||
|
</action>
|
|
@ -0,0 +1,8 @@
|
||||||
|
<action>
|
||||||
|
<field name="string">Dialyzer</field>
|
||||||
|
<field name="view_cls">report</field>
|
||||||
|
<field name="model">report.dialyzer.drop</field>
|
||||||
|
<field name="report_template">report_dialyzer_drop</field>
|
||||||
|
<field name="report_template_xls">dialyzer_drop</field>
|
||||||
|
<field name="menu">clinic_menu</field>
|
||||||
|
</action>
|
|
@ -0,0 +1,6 @@
|
||||||
|
<action>
|
||||||
|
<field name="type">report_odt</field>
|
||||||
|
<field name="model">clinic.round.report</field>
|
||||||
|
<field name="method">get_data</field>
|
||||||
|
<field name="template">round</field>
|
||||||
|
</action>
|
|
@ -3,6 +3,6 @@
|
||||||
<field name="view_cls">multi_view</field>
|
<field name="view_cls">multi_view</field>
|
||||||
<field name="model">clinic.visit</field>
|
<field name="model">clinic.visit</field>
|
||||||
<field name="tabs">[["All",[]],["Draft",[["state","=","draft"]]],["Waiting Treatment",[["state","=","waiting_treatment"]]],["Treatment",[["state","=","treatment"]]],["Cancelled",[["state","=","cancelled"]]]]</field>
|
<field name="tabs">[["All",[]],["Draft",[["state","=","draft"]]],["Waiting Treatment",[["state","=","waiting_treatment"]]],["Treatment",[["state","=","treatment"]]],["Cancelled",[["state","=","cancelled"]]]]</field>
|
||||||
<field name="modes">list,calendar,form</field>
|
<field name="modes">list,calendar,form</field>
|
||||||
<field name="menu">clinic_menu</field>
|
<field name="menu">clinic_menu</field>
|
||||||
</action>
|
</action>
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
<form model="clinic.cycle">
|
||||||
|
<field name="name"/>
|
||||||
|
</form>
|
|
@ -0,0 +1,3 @@
|
||||||
|
<list model="clinic.cycle">
|
||||||
|
<field name="name"/>
|
||||||
|
</list>
|
|
@ -0,0 +1,5 @@
|
||||||
|
<form model="report.dialyzer.drop">
|
||||||
|
<group form_layout="stacked">
|
||||||
|
<field name="date" span="4"/>
|
||||||
|
</group>
|
||||||
|
</form>
|
|
@ -8,16 +8,17 @@
|
||||||
<group span="6" columns="1">
|
<group span="6" columns="1">
|
||||||
<field name="number"/>
|
<field name="number"/>
|
||||||
<field name="date"/>
|
<field name="date"/>
|
||||||
|
<field name="nurse_id"/>
|
||||||
<field name="time_start"/>
|
<field name="time_start"/>
|
||||||
<field name="total_time"/>
|
<field name="cycle_id"/>
|
||||||
<field name="visit_id"/>
|
<field name="department_id"/>
|
||||||
</group>
|
</group>
|
||||||
<group span="6" columns="1">
|
<group span="6" columns="1">
|
||||||
|
<field name="visit_id"/>
|
||||||
<field name="patient_id" onchange="onchange_patient"/>
|
<field name="patient_id" onchange="onchange_patient"/>
|
||||||
<field name="doctor_id"/>
|
<field name="doctor_id"/>
|
||||||
<field name="time_stop"/>
|
<field name="time_stop"/>
|
||||||
<field name="nurse_id"/>
|
<field name="total_time"/>
|
||||||
<field name="department_id"/>
|
|
||||||
</group>
|
</group>
|
||||||
<tabs>
|
<tabs>
|
||||||
<tab string="Dialyzer">
|
<tab string="Dialyzer">
|
||||||
|
@ -44,7 +45,7 @@
|
||||||
<field name="per_bp_stop"/>
|
<field name="per_bp_stop"/>
|
||||||
<field name="epo_tn"/>
|
<field name="epo_tn"/>
|
||||||
<field name="epo_unit"/>
|
<field name="epo_unit"/>
|
||||||
<field name="hct" onchange="onchange_htc"/>
|
<field name="hct" onchange="onchange_hct"/>
|
||||||
</tab>
|
</tab>
|
||||||
<tab string="Next Visit">
|
<tab string="Next Visit">
|
||||||
<separator string="Click Options-> New Visit"/>
|
<separator string="Click Options-> New Visit"/>
|
||||||
|
@ -64,7 +65,6 @@
|
||||||
</tabs>
|
</tabs>
|
||||||
<separator string="Other Expenses"/>
|
<separator string="Other Expenses"/>
|
||||||
<field name="lines" count="3" nolabel="1">
|
<field name="lines" count="3" nolabel="1">
|
||||||
>>>>>>> e1240368c0b451851115891dd7ace7423682a225
|
|
||||||
<list>
|
<list>
|
||||||
<field name="product_id" onchange="onchange_product"/>
|
<field name="product_id" onchange="onchange_product"/>
|
||||||
<field name="description"/>
|
<field name="description"/>
|
||||||
|
@ -84,9 +84,7 @@
|
||||||
<field name="price" onchange="onchange_line"/>
|
<field name="price" onchange="onchange_line"/>
|
||||||
<field name="amount"/>
|
<field name="amount"/>
|
||||||
</list>
|
</list>
|
||||||
</field>
|
</field>
|
||||||
<field name="fee" offset="7"/>
|
|
||||||
<field name="fee_partner_id" domain="[['type','=','org']]" attrs='{"required":[["fee","!=",0]]}' offset="7"/>
|
|
||||||
<group span="4" columns="1">
|
<group span="4" columns="1">
|
||||||
</group>
|
</group>
|
||||||
<separator string="HD Case Treatment Summary"/>
|
<separator string="HD Case Treatment Summary"/>
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
<list model="clinic.hd.case">
|
<list model="clinic.hd.case">
|
||||||
<field name="number"/>
|
<field name="number"/>
|
||||||
<field name="time_start"/>
|
|
||||||
<field name="time_stop"/>
|
|
||||||
<field name="patient_id"/>
|
<field name="patient_id"/>
|
||||||
<field name="doctor_id"/>
|
<field name="doctor_id"/>
|
||||||
|
<field name="fee"/>
|
||||||
<field name="nurse_id"/>
|
<field name="nurse_id"/>
|
||||||
<field name="state"/>
|
<field name="state"/>
|
||||||
</list>
|
</list>
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
<form model="clinic.hd.report">
|
<form model="clinic.hd.report">
|
||||||
<field name="cycle"/>
|
<group form_layout="stacked">
|
||||||
<field name="date"/>
|
<field name="date" span="2"/>
|
||||||
|
<field name="cycle_id" span="2"/>
|
||||||
|
</group>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -23,15 +23,18 @@
|
||||||
<!--<item string="Visit" action="clinic_visit"/>-->
|
<!--<item string="Visit" action="clinic_visit"/>-->
|
||||||
<!--</item>-->
|
<!--</item>-->
|
||||||
<item string="Reports">
|
<item string="Reports">
|
||||||
<item string="Treatment Report" action="clinic_hd_report"/>
|
<header string="Dialyzers"/>
|
||||||
<item string="Clinic Round(Testing)" action="clinic_round_report"/>
|
<item string="Dialyzers Drop" action="clinic_dialyzer_report"/>
|
||||||
|
<header string="HD Case"/>
|
||||||
|
<item string="Treatment Summary" action="clinic_hd_report"/>
|
||||||
</item>
|
</item>
|
||||||
<item string="Imports">
|
<item string="Imports">
|
||||||
<item string="Import Payments" action="clinic_import_payment"/>
|
<item string="Import Payments" action="clinic_import_payment"/>
|
||||||
</item>
|
</item>
|
||||||
<item string="Settings">
|
<item string="Settings">
|
||||||
<item string="Round" action="clinic_round"/>
|
<!-- <item string="Cycle" action="clinic_cycle"/>-->
|
||||||
<item string="Departments" action="clinic_department"/>
|
<item string="Departments" action="clinic_department"/>
|
||||||
|
<item string="Cycle" action="clinic_cycle"/>
|
||||||
<item string="Clinic Settings" action="clinic_setting"/>
|
<item string="Clinic Settings" action="clinic_setting"/>
|
||||||
</item>
|
</item>
|
||||||
</menu>
|
</menu>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<!--<calendar model="clinic.visit" states='waiting_treatment' date_field="date_visit" colors='{"#090":[["cycle","=",1]],"#2400ff":[["cycle","=",2]],"#ebff00":[["cycle","=",3]],"#f20000":[["cycle","=",4]]}'>-->
|
<!--<calendar model="clinic.visit" states='waiting_treatment' date_field="date_visit" colors='{"#090":[["cycle","=",1]],"#2400ff":[["cycle","=",2]],"#ebff00":[["cycle","=",3]],"#f20000":[["cycle","=",4]]}'>-->
|
||||||
<calendar model="clinic.visit" states='waiting_treatment' date_field="date_visit" start_field="time_start" end_field="time_stop" colors='{"#090":[["cycle","=",1]],"#2400ff":[["cycle","=",2]],"orange":[["cycle","=",3]],"#f20000":[["cycle","=",4]]}'>
|
<calendar model="clinic.visit" states='waiting_treatment' date_field="date_visit" start_field="time_start" end_field="time_stop" colors='{"#090":[["cycle","=",1]],"#2400ff":[["cycle","=",2]],"orange":[["cycle","=",3]],"#f20000":[["cycle","=",4]]}'>
|
||||||
<field name="patient_id"/>
|
<field name="patient_id"/>
|
||||||
<field name="cycle"/>
|
<field name="cycle_id"/>
|
||||||
<field name="number"/>
|
<field name="number"/>
|
||||||
<field name="doctor_id"/>
|
<field name="doctor_id"/>
|
||||||
<field name="nurse_id"/>
|
<field name="nurse_id"/>
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
<group span="6" columns="1">
|
<group span="6" columns="1">
|
||||||
<field name="number"/>
|
<field name="number"/>
|
||||||
<field name="date_visit" onchange="onchange_date_visit"/>
|
<field name="date_visit" onchange="onchange_date_visit"/>
|
||||||
<field name="cycle"/>
|
<field name="cycle_id" onchange="onchange_cycle"/>
|
||||||
</group>
|
</group>
|
||||||
<group span="6" columns="1">
|
<group span="6" columns="1">
|
||||||
<field name="patient_id" onchange="onchange_patient"/>
|
<field name="patient_id" onchange="onchange_patient"/>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<field name="late_visit" invisible="1"/>
|
<field name="late_visit" invisible="1"/>
|
||||||
<field name="number"/>
|
<field name="number"/>
|
||||||
<field name="date_visit"/>
|
<field name="date_visit"/>
|
||||||
<field name="cycle"/>
|
<field name="cycle_id"/>
|
||||||
<field name="patient_id"/>
|
<field name="patient_id"/>
|
||||||
<field name="doctor_id"/>
|
<field name="doctor_id"/>
|
||||||
<field name="nurse_id"/>
|
<field name="nurse_id"/>
|
||||||
|
|
|
@ -1,36 +1,37 @@
|
||||||
from . import comorbidity
|
|
||||||
from . import morbidity
|
|
||||||
from . import education
|
|
||||||
from . import setting
|
|
||||||
from . import graduation
|
|
||||||
from . import nation
|
|
||||||
from . import race
|
|
||||||
from . import cause_chronic
|
from . import cause_chronic
|
||||||
from . import schedule
|
from . import comorbidity
|
||||||
|
from . import cycle
|
||||||
|
from . import department
|
||||||
|
from . import dialyzer
|
||||||
|
from . import dialyzer_line
|
||||||
|
from . import doctor
|
||||||
|
from . import education
|
||||||
|
from . import file_sheet
|
||||||
|
from . import graduation
|
||||||
|
from . import hd_case
|
||||||
|
from . import hd_case_line
|
||||||
|
from . import hd_case_discont
|
||||||
|
from . import import_payment
|
||||||
|
from . import morbidity
|
||||||
|
from . import nation
|
||||||
|
from . import nurse
|
||||||
from . import patient
|
from . import patient
|
||||||
from . import patient_schedule
|
from . import patient_schedule
|
||||||
from . import patient_cause_line
|
from . import patient_cause_line
|
||||||
from . import patient_comorbidity_line
|
from . import patient_comorbidity_line
|
||||||
from . import patient_morbidity_line
|
from . import patient_morbidity_line
|
||||||
from . import department
|
from . import race
|
||||||
from . import doctor
|
from . import report_hd
|
||||||
from . import nurse
|
from . import report_dialyzer_drop
|
||||||
|
from . import schedule
|
||||||
|
from . import setting
|
||||||
from . import visit
|
from . import visit
|
||||||
from . import visit_plan
|
from . import visit_plan
|
||||||
from . import clinic_round
|
|
||||||
from . import clinic_round_report
|
|
||||||
from . import report_hd
|
|
||||||
from . import hd_case
|
|
||||||
from . import hd_case_line
|
|
||||||
from . import hd_case_discont
|
|
||||||
from . import dialyzer
|
|
||||||
from . import department
|
|
||||||
from . import education
|
|
||||||
from . import setting
|
|
||||||
from . import graduation
|
|
||||||
from . import nation
|
|
||||||
from . import race
|
|
||||||
from . import cause_chronic
|
|
||||||
from . import dialyzer_line
|
|
||||||
from . import import_payment
|
|
||||||
from . import file_sheet
|
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
from . import comorbidity
|
||||||
|
from . import morbidity
|
||||||
|
from . import education
|
||||||
|
from . import setting
|
||||||
|
from . import graduation
|
||||||
|
from . import nation
|
||||||
|
from . import race
|
||||||
|
from . import cycle
|
||||||
|
from . import cause_chronic
|
||||||
|
from . import schedule
|
||||||
|
from . import patient
|
||||||
|
from . import patient_schedule
|
||||||
|
from . import patient_cause_line
|
||||||
|
from . import patient_comorbidity_line
|
||||||
|
from . import patient_morbidity_line
|
||||||
|
from . import department
|
||||||
|
from . import doctor
|
||||||
|
from . import nurse
|
||||||
|
from . import visit
|
||||||
|
from . import visit_plan
|
||||||
|
from . import report_hd
|
||||||
|
from . import hd_case
|
||||||
|
from . import hd_case_line
|
||||||
|
from . import hd_case_discont
|
||||||
|
from . import dialyzer
|
||||||
|
from . import report_dialyzer_drop
|
||||||
|
from . import department
|
||||||
|
from . import education
|
||||||
|
from . import setting
|
||||||
|
from . import graduation
|
||||||
|
from . import nation
|
||||||
|
from . import race
|
||||||
|
from . import cause_chronic
|
||||||
|
from . import dialyzer_line
|
||||||
|
from . import import_payment
|
||||||
|
from . import file_sheet
|
|
@ -0,0 +1,11 @@
|
||||||
|
from netforce.model import Model, fields
|
||||||
|
|
||||||
|
class Cycle(Model):
|
||||||
|
_name="clinic.cycle"
|
||||||
|
_string="Cycle"
|
||||||
|
|
||||||
|
_fields={
|
||||||
|
"name": fields.Char("Name",required=True,search=True),
|
||||||
|
}
|
||||||
|
|
||||||
|
Cycle.register()
|
|
@ -32,7 +32,10 @@ class Dialyzer(Model):
|
||||||
|
|
||||||
def _get_number(self,context={}):
|
def _get_number(self,context={}):
|
||||||
while 1:
|
while 1:
|
||||||
seq_id=get_model("sequence").find_sequence(name="Clinic Dializer")
|
seq_name='Clinic Dialyzer'
|
||||||
|
seq_id=get_model("sequence").find_sequence(name=seq_name)
|
||||||
|
if not seq_id:
|
||||||
|
raise Exception("Can not found sequence %s"%seq_name)
|
||||||
num=get_model("sequence").get_next_number(seq_id,context=context)
|
num=get_model("sequence").get_next_number(seq_id,context=context)
|
||||||
if not num:
|
if not num:
|
||||||
return None
|
return None
|
||||||
|
@ -61,7 +64,8 @@ class Dialyzer(Model):
|
||||||
_defaults={
|
_defaults={
|
||||||
"state": "new",
|
"state": "new",
|
||||||
"date": lambda *a: time.strftime("%Y-%m-%d"),
|
"date": lambda *a: time.strftime("%Y-%m-%d"),
|
||||||
"number": _get_number,
|
#"number": _get_number,
|
||||||
|
'number': '/',
|
||||||
"max_use_time": 10,
|
"max_use_time": 10,
|
||||||
"use_time": 0,
|
"use_time": 0,
|
||||||
"company_id": lambda *a: get_active_company(),
|
"company_id": lambda *a: get_active_company(),
|
||||||
|
@ -105,7 +109,7 @@ class Dialyzer(Model):
|
||||||
cust_loc_id=res[0]
|
cust_loc_id=res[0]
|
||||||
|
|
||||||
prod=obj.product_id
|
prod=obj.product_id
|
||||||
wh_loc_id=prod.location_id.id
|
wh_loc_id=prod.location_id.id # product -> tab inventory -> warehouse filed
|
||||||
if not wh_loc_id:
|
if not wh_loc_id:
|
||||||
res=get_model("stock.location").search([["type","=","internal"]])
|
res=get_model("stock.location").search([["type","=","internal"]])
|
||||||
if not res:
|
if not res:
|
||||||
|
@ -127,7 +131,13 @@ class Dialyzer(Model):
|
||||||
pick_id=picking_obj.create(pick_vals,context={"pick_type": "out"})
|
pick_id=picking_obj.create(pick_vals,context={"pick_type": "out"})
|
||||||
pick=picking_obj.browse(pick_id)
|
pick=picking_obj.browse(pick_id)
|
||||||
pick.set_done([pick_id])
|
pick.set_done([pick_id])
|
||||||
obj.write({"state": "active"})
|
number=obj.number.replace("/","")
|
||||||
|
if not number:
|
||||||
|
number=self._get_number(context)
|
||||||
|
obj.write({
|
||||||
|
"number": number,
|
||||||
|
"state": "active",
|
||||||
|
})
|
||||||
return {
|
return {
|
||||||
'next':{
|
'next':{
|
||||||
'name': 'clinic_dialyzer',
|
'name': 'clinic_dialyzer',
|
||||||
|
|
|
@ -27,9 +27,8 @@ class HDcase(Model):
|
||||||
"patient_id": fields.Many2One("clinic.patient","Patient",required=True,search=True),
|
"patient_id": fields.Many2One("clinic.patient","Patient",required=True,search=True),
|
||||||
"doctor_id": fields.Many2One("clinic.doctor","Doctor", required=True,search=True),
|
"doctor_id": fields.Many2One("clinic.doctor","Doctor", required=True,search=True),
|
||||||
"nurse_id": fields.Many2One("clinic.nurse","Nurse", required=True,search=True),
|
"nurse_id": fields.Many2One("clinic.nurse","Nurse", required=True,search=True),
|
||||||
"date_start": fields.DateTime("Time start",required=True,search=True),
|
|
||||||
"date_stop": fields.DateTime("Time stop",required=True,search=True),
|
|
||||||
"department_id": fields.Many2One("clinic.department", "Department",search=True),
|
"department_id": fields.Many2One("clinic.department", "Department",search=True),
|
||||||
|
"cycle_id" : fields.Many2One("clinic.cycle","Cycle", required=True),
|
||||||
"wh_start": fields.Float("Wt.Kg start"),
|
"wh_start": fields.Float("Wt.Kg start"),
|
||||||
"wh_stop": fields.Float("Wt.Kg stop"),
|
"wh_stop": fields.Float("Wt.Kg stop"),
|
||||||
"bp_start": fields.Integer("BP mmHG start"),
|
"bp_start": fields.Integer("BP mmHG start"),
|
||||||
|
@ -81,13 +80,17 @@ class HDcase(Model):
|
||||||
return num
|
return num
|
||||||
get_model("sequence").increment_number(seq_id,context=context)
|
get_model("sequence").increment_number(seq_id,context=context)
|
||||||
|
|
||||||
|
|
||||||
def _get_nurse(self,context={}):
|
def _get_nurse(self,context={}):
|
||||||
user_id=get_active_user()
|
user_id=get_active_user()
|
||||||
print("user_id ",user_id)
|
print("user_id ",user_id)
|
||||||
nurse_ids=get_model("clinic.nurse").search([['user_id','=',user_id]])
|
nurse_ids=get_model("clinic.nurse").search([['user_id','=',user_id]])
|
||||||
if nurse_ids:
|
if nurse_ids:
|
||||||
return nurse_ids[0]
|
return nurse_ids[0]
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
_defaults={
|
_defaults={
|
||||||
"state": "draft",
|
"state": "draft",
|
||||||
|
@ -97,7 +100,6 @@ class HDcase(Model):
|
||||||
'nurse_id': _get_nurse,
|
'nurse_id': _get_nurse,
|
||||||
"number": _get_number,
|
"number": _get_number,
|
||||||
"company_id": lambda *a: get_active_company(),
|
"company_id": lambda *a: get_active_company(),
|
||||||
"fee": 1500,
|
|
||||||
}
|
}
|
||||||
_order="date desc,number desc"
|
_order="date desc,number desc"
|
||||||
|
|
||||||
|
@ -162,18 +164,20 @@ class HDcase(Model):
|
||||||
line['amount']=amt
|
line['amount']=amt
|
||||||
total+=amt
|
total+=amt
|
||||||
data['total']=total
|
data['total']=total
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
def onchange_hct(self,context={}):
|
||||||
|
data=context['data']
|
||||||
|
hct=data['hct']
|
||||||
|
if (hct>39):
|
||||||
|
print ("Test1")
|
||||||
|
else:
|
||||||
|
print ("Test3")
|
||||||
|
|
||||||
def onchange_htc(self,context={}):
|
|
||||||
data=context['htc']
|
|
||||||
total=0.0
|
|
||||||
if (htc > 39):
|
|
||||||
data['htc']=total
|
|
||||||
return data
|
|
||||||
|
|
||||||
def cancelled(self,ids,context={}):
|
def cancelled(self,ids,context={}):
|
||||||
obj=self.browse(ids)[0]
|
obj=self.browse(ids)[0]
|
||||||
obj.write({"state":"cancelled"})
|
obj.write({" state":"cancelled"})
|
||||||
|
|
||||||
def make_invoices(self,ids,context={}):
|
def make_invoices(self,ids,context={}):
|
||||||
setting=get_model("settings").browse(1)
|
setting=get_model("settings").browse(1)
|
||||||
|
@ -382,7 +386,7 @@ class HDcase(Model):
|
||||||
'mode': 'form',
|
'mode': 'form',
|
||||||
'form_view_xml': 'clinic_hd_case_form',
|
'form_view_xml': 'clinic_hd_case_form',
|
||||||
'active_id': ids[0],
|
'active_id': ids[0],
|
||||||
}
|
}
|
||||||
|
|
||||||
def delete(self,ids,context={}):
|
def delete(self,ids,context={}):
|
||||||
for obj in self.browse(ids):
|
for obj in self.browse(ids):
|
||||||
|
@ -475,7 +479,7 @@ class HDcase(Model):
|
||||||
'active_id': visit_id,
|
'active_id': visit_id,
|
||||||
},
|
},
|
||||||
'flash': "New visit is created",
|
'flash': "New visit is created",
|
||||||
}
|
}
|
||||||
|
|
||||||
def onchange_dateplane(self,context={}):
|
def onchange_dateplane(self,context={}):
|
||||||
data=context["data"]
|
data=context["data"]
|
||||||
|
@ -498,7 +502,7 @@ class HDcase(Model):
|
||||||
if not line.get('state'):
|
if not line.get('state'):
|
||||||
line['state']='open'
|
line['state']='open'
|
||||||
|
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
|
||||||
HDcase.register()
|
HDcase.register()
|
||||||
|
|
|
@ -0,0 +1,39 @@
|
||||||
|
import time
|
||||||
|
|
||||||
|
from netforce.model import Model, fields, get_model
|
||||||
|
|
||||||
|
class DialyzerDrop(Model):
|
||||||
|
_name="report.dialyzer.drop"
|
||||||
|
_string="Dialyzer [Drop]"
|
||||||
|
_transient=True
|
||||||
|
|
||||||
|
_fields={
|
||||||
|
"date": fields.Date("Date"),
|
||||||
|
}
|
||||||
|
|
||||||
|
_defaults={
|
||||||
|
'date': lambda *a: time.strftime("%Y-%m-%d"),
|
||||||
|
"state" : "drop",
|
||||||
|
}
|
||||||
|
|
||||||
|
def get_report_data(self,ids,context={}):
|
||||||
|
lines=[]
|
||||||
|
|
||||||
|
dialyzer_ids=get_model("clinic.dialyzer").search([["state","=","drop"]])
|
||||||
|
hd_cases=get_model("clinic.dialyzer").search_browse([])
|
||||||
|
for dialyzer_ids in hd_cases:
|
||||||
|
lines.append({
|
||||||
|
'number' : dialyzer_ids.number,
|
||||||
|
'usetime': dialyzer_ids.use_time,
|
||||||
|
'maxuse' : dialyzer_ids.max_use_time,
|
||||||
|
'createdate' : dialyzer_ids.date,
|
||||||
|
'expdate' : dialyzer_ids.exp_date,
|
||||||
|
'patient' : dialyzer_ids.patient_id.name,
|
||||||
|
})
|
||||||
|
|
||||||
|
data={
|
||||||
|
'lines': lines or "Dialyzer Drop [Empty]",
|
||||||
|
}
|
||||||
|
return data
|
||||||
|
|
||||||
|
DialyzerDrop.register()
|
|
@ -1,6 +1,6 @@
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from netforce.model import Model, fields
|
from netforce.model import Model, fields, get_model
|
||||||
|
|
||||||
class HDReport(Model):
|
class HDReport(Model):
|
||||||
_name="clinic.hd.report"
|
_name="clinic.hd.report"
|
||||||
|
@ -9,21 +9,39 @@ class HDReport(Model):
|
||||||
|
|
||||||
_fields={
|
_fields={
|
||||||
"date": fields.Date("Date"),
|
"date": fields.Date("Date"),
|
||||||
"cycle": fields.Selection([("1","One"),("2","Two"),("3","Three"),("4","Four")],"Cycle"),
|
"cycle_id": fields.Many2One("clinic.cycle","Cycle"),
|
||||||
}
|
}
|
||||||
|
|
||||||
_defaults={
|
_defaults={
|
||||||
'date': lambda *a: time.strftime("%Y-%m-%d"),
|
'date': lambda *a: time.strftime("%Y-%m-%d"),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_order="cycle_id desc"
|
||||||
|
|
||||||
def get_report_data(self,ids,context={}):
|
def get_report_data(self,ids,context={}):
|
||||||
print(">>>>>>>>>>>>>>>>>>>>>>>>>>>>.")
|
lines=[]
|
||||||
if not ids:
|
|
||||||
return {}
|
hd_case_ids=get_model("clinic.dialyzer").search([["state","=","completed"]])
|
||||||
obj=self.browse(ids)[0]
|
hd_cases=get_model("clinic.hd.case").search_browse([])
|
||||||
|
for hd_case_ids in hd_cases:
|
||||||
|
lines.append({
|
||||||
|
'cycle' : hd_case_ids.cycle_id.name,
|
||||||
|
'patient': hd_case_ids.patient_id.name,
|
||||||
|
'doctor' : hd_case_ids.doctor_id.name,
|
||||||
|
#'Patient_Type' : patient.type,
|
||||||
|
'total' : hd_case_ids.fee,
|
||||||
|
'rc_no' : hd_case_ids.number,
|
||||||
|
#'dz' : hd_case.dialyzers,
|
||||||
|
'nurse' : hd_case_ids.nurse_id.name,
|
||||||
|
})
|
||||||
|
|
||||||
#get_model('clinic.patient').search
|
#get_model('clinic.patient').search
|
||||||
|
#[{'name': 1}, {'name': 2}]
|
||||||
data={
|
data={
|
||||||
'cycle': obj.cycle or "Empty Cyle"
|
'cycle_id': hd_case_ids.cycle or "Empty Cyle",
|
||||||
|
#'patient_id' : obj.patient or "",
|
||||||
|
#'doctor_id' : obj.doctor or "",
|
||||||
|
'lines': lines,
|
||||||
}
|
}
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ class Visit(Model):
|
||||||
"doctor_id": fields.Many2One("clinic.doctor","Doctor",search=True),
|
"doctor_id": fields.Many2One("clinic.doctor","Doctor",search=True),
|
||||||
"nurse_id": fields.Many2One("clinic.nurse","Nurse",search=True),
|
"nurse_id": fields.Many2One("clinic.nurse","Nurse",search=True),
|
||||||
"department_id": fields.Many2One("clinic.department", "Department",search=True),
|
"department_id": fields.Many2One("clinic.department", "Department",search=True),
|
||||||
"cycle": fields.Selection([("1","One"),("2","Two"),("3","Tree"),("4","Four")],"Cycle",required=True),
|
"cycle_id" : fields.Many2One("clinic.cycle","Cycle",required=True),
|
||||||
"state": fields.Selection([("draft","Draft"),("waiting_treatment","Waiting Treatment"),('treatment','Treatment'),("cancelled","Cancelled")],"Status",required=True),
|
"state": fields.Selection([("draft","Draft"),("waiting_treatment","Waiting Treatment"),('treatment','Treatment'),("cancelled","Cancelled")],"Status",required=True),
|
||||||
"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"),
|
||||||
|
@ -45,9 +45,12 @@ class Visit(Model):
|
||||||
'hd_cases': fields.One2Many('clinic.hd.case','visit_id',"HD Cases",readonly=True),
|
'hd_cases': fields.One2Many('clinic.hd.case','visit_id',"HD Cases",readonly=True),
|
||||||
}
|
}
|
||||||
|
|
||||||
def _get_number(self,context={}):
|
def _get_number( self,context={}):
|
||||||
while 1:
|
while 1:
|
||||||
seq_id=get_model("sequence").find_sequence(name="Clinic Visit")
|
seq_name='Clinic Visit'
|
||||||
|
seq_id=get_model("sequence").find_sequence(name=seq_name)
|
||||||
|
if not seq_id:
|
||||||
|
raise Exception("Can not found sequence %s"%seq_name)
|
||||||
num=get_model("sequence").get_next_number(seq_id,context=context)
|
num=get_model("sequence").get_next_number(seq_id,context=context)
|
||||||
if not num:
|
if not num:
|
||||||
return None
|
return None
|
||||||
|
@ -65,8 +68,25 @@ class Visit(Model):
|
||||||
nurse_ids=get_model("clinic.nurse").search([['user_id','=',user_id]])
|
nurse_ids=get_model("clinic.nurse").search([['user_id','=',user_id]])
|
||||||
if nurse_ids:
|
if nurse_ids:
|
||||||
return nurse_ids[0]
|
return nurse_ids[0]
|
||||||
|
return None
|
||||||
|
|
||||||
|
def _get_doctor(self,context={}):
|
||||||
|
user_id=get_active_user()
|
||||||
|
print("user_id",user_id)
|
||||||
|
doctor_ids=get_model("clinic.doctor").search([['user_id','=',user_id]])
|
||||||
|
if doctor_ids:
|
||||||
|
return doctor_ids[0]
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
def _get_cycle(self,context={}):
|
||||||
|
user_id=get_active_user()
|
||||||
|
print("user_id",user_id)
|
||||||
|
cycle_ids=get_model("clinic.cycle").search([['user_id','=',user_id]])
|
||||||
|
if cycle_ids:
|
||||||
|
return cycle_ids[0]
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
def _get_time_start(self,context={}):
|
def _get_time_start(self,context={}):
|
||||||
now=datetime.datetime.now()
|
now=datetime.datetime.now()
|
||||||
starttime=now.strftime("%Y-%m-%d %H:%M:%S")
|
starttime=now.strftime("%Y-%m-%d %H:%M:%S")
|
||||||
|
@ -80,13 +100,15 @@ class Visit(Model):
|
||||||
|
|
||||||
_defaults={
|
_defaults={
|
||||||
"state": "draft",
|
"state": "draft",
|
||||||
"cycle": "1",
|
#"cycle": "One",
|
||||||
'date_visit': lambda *a: time.strftime("%Y-%m-%d"),
|
'date_visit': lambda *a: time.strftime("%Y-%m-%d"),
|
||||||
'time_start': _get_time_start,
|
'time_start': _get_time_start,
|
||||||
'time_stop': _get_time_stop,
|
'time_stop': _get_time_stop,
|
||||||
"number": "/",
|
"number": "/",
|
||||||
"company_id": lambda *a: get_active_company(),
|
"company_id": lambda *a: get_active_company(),
|
||||||
'nurse_id': _get_nurse,
|
'nurse_id': _get_nurse,
|
||||||
|
'doctor_id' : _get_doctor,
|
||||||
|
'cycle_id' : _get_cycle ,
|
||||||
'time_use': 1,
|
'time_use': 1,
|
||||||
}
|
}
|
||||||
_order="id desc"
|
_order="id desc"
|
||||||
|
@ -127,6 +149,7 @@ class Visit(Model):
|
||||||
'department_id': obj.department_id.id,
|
'department_id': obj.department_id.id,
|
||||||
'time_start': obj.time_start,
|
'time_start': obj.time_start,
|
||||||
'time_stop': obj.time_stop,
|
'time_stop': obj.time_stop,
|
||||||
|
'cycle_id' : obj.cycle_id.id,
|
||||||
'visit_id': obj.id,
|
'visit_id': obj.id,
|
||||||
'fee': include_fee and 1500.00 or 0.0,
|
'fee': include_fee and 1500.00 or 0.0,
|
||||||
'fee_type': obj.patient_id.type,
|
'fee_type': obj.patient_id.type,
|
||||||
|
@ -145,7 +168,7 @@ class Visit(Model):
|
||||||
categ_name=patient_type.get(obj.patient_id.type)
|
categ_name=patient_type.get(obj.patient_id.type)
|
||||||
categ_ids=get_model("partner.categ").search([['name','=',categ_name]])
|
categ_ids=get_model("partner.categ").search([['name','=',categ_name]])
|
||||||
if not categ_ids:
|
if not categ_ids:
|
||||||
raise Exception("Category: %s not found"%categ_name)
|
raise Exception("Partner Category: %s not found"%categ_name)
|
||||||
partner_id=None
|
partner_id=None
|
||||||
if obj.patient_id.type in ("mg","sc","nhso"):
|
if obj.patient_id.type in ("mg","sc","nhso"):
|
||||||
partner_obj=get_model("partner")
|
partner_obj=get_model("partner")
|
||||||
|
@ -184,9 +207,10 @@ class Visit(Model):
|
||||||
obj=self.browse(ids)[0]
|
obj=self.browse(ids)[0]
|
||||||
obj.write({"state":"cancelled"})
|
obj.write({"state":"cancelled"})
|
||||||
|
|
||||||
def reopen(self,ids,context={}):
|
def reopen(self,ids,context={ }):
|
||||||
obj=self.browse(ids)[0]
|
obj=self.browse(ids)[0]
|
||||||
obj.write({"state":"draft"})
|
obj.write({"state":"draf t"})
|
||||||
|
|
||||||
|
|
||||||
def onchange_patient(self,context={}):
|
def onchange_patient(self,context={}):
|
||||||
data=context['data']
|
data=context['data']
|
||||||
|
@ -204,9 +228,29 @@ class Visit(Model):
|
||||||
else:
|
else:
|
||||||
data['doctor_id']=None
|
data['doctor_id']=None
|
||||||
data['department_id']=None
|
data['department_id']=None
|
||||||
return data
|
|
||||||
|
return data
|
||||||
|
|
||||||
def copy(self,ids,context={}):
|
def onchange_cycle(self,context={}):
|
||||||
|
data=context['data']
|
||||||
|
cycle_id=data['cycle_id']
|
||||||
|
visits=self.search_browse([['cycle_id','=',cycle_id]],order="number desc")
|
||||||
|
if visits:
|
||||||
|
visit=visits[0]
|
||||||
|
data['doctor_id']=visit.doctor_id.id
|
||||||
|
data['patient']=visit.patient_id.id
|
||||||
|
cycle=int(visit.cycle)+1
|
||||||
|
data['cycle']=str(cycle)
|
||||||
|
if cycle>4:
|
||||||
|
data['cycle']='1'
|
||||||
|
else:
|
||||||
|
data['doctor_id']=None
|
||||||
|
data['patient_id']=None
|
||||||
|
data['department_id']=None
|
||||||
|
|
||||||
|
return data
|
||||||
|
|
||||||
|
def copy(self,ids,context={}) :
|
||||||
obj=self.browse(ids[0])
|
obj=self.browse(ids[0])
|
||||||
vals={
|
vals={
|
||||||
'patient_id': obj.patient_id.id,
|
'patient_id': obj.patient_id.id,
|
||||||
|
@ -230,20 +274,10 @@ class Visit(Model):
|
||||||
'mode': 'form',
|
'mode': 'form',
|
||||||
'active_id': new_id,
|
'active_id': new_id,
|
||||||
},
|
},
|
||||||
|
|
||||||
'flash': 'Visit %s is copy to %s'%(obj.number,new_obj.number),
|
'flash': 'Visit %s is copy to %s'%(obj.number,new_obj.number),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def get_visit_demo(self,context={}):
|
|
||||||
if not context.get('number'):
|
|
||||||
return {}
|
|
||||||
visit_id=int(context['number'])
|
|
||||||
visit=self.browse(visit_id)
|
|
||||||
|
|
||||||
data={
|
|
||||||
'number' : visit.number
|
|
||||||
}
|
|
||||||
return data
|
|
||||||
|
|
||||||
def delete(self,ids,context={}):
|
def delete(self,ids,context={}):
|
||||||
for obj in self.browse(ids):
|
for obj in self.browse(ids):
|
||||||
|
@ -257,7 +291,7 @@ class Visit(Model):
|
||||||
return {}
|
return {}
|
||||||
ref_id=int(ref_id)
|
ref_id=int(ref_id)
|
||||||
obj=self.browse(ref_id)
|
obj=self.browse(ref_id)
|
||||||
cycle_list={'1': 'One','2': 'Two','3': 'Tree','4': 'Four'}
|
#cycle_list={'1': 'One','2': 'Two','3': 'Tree','4': 'Four'}
|
||||||
data={
|
data={
|
||||||
'number': obj.number,
|
'number': obj.number,
|
||||||
'date_visit': obj.date_visit,
|
'date_visit': obj.date_visit,
|
||||||
|
@ -265,10 +299,10 @@ class Visit(Model):
|
||||||
'patient_name': obj.patient_id.name or "",
|
'patient_name': obj.patient_id.name or "",
|
||||||
'doctor_name': obj.doctor_id.name or "",
|
'doctor_name': obj.doctor_id.name or "",
|
||||||
'nurse_name': obj.nurse_id.name or "",
|
'nurse_name': obj.nurse_id.name or "",
|
||||||
'cycle': cycle_list.get(obj.cycle,""),
|
'cycle_name': obj.cycle_id.name or "",
|
||||||
'print_date': time.strftime("%d/%m/%Y"),
|
'print_date': time.strftime("%d/%m/%Y"),
|
||||||
}
|
}
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def onchange_dialyzer(self,context={}):
|
def onchange_dialyzer(self,context={}):
|
||||||
data=context["data"]
|
data=context["data"]
|
||||||
|
@ -288,7 +322,7 @@ class Visit(Model):
|
||||||
line["bid_flow_rate"]=dialyzer.bid_flow_rate
|
line["bid_flow_rate"]=dialyzer.bid_flow_rate
|
||||||
line["ultrafittration"]=dialyzer.ultrafittration
|
line["ultrafittration"]=dialyzer.ultrafittration
|
||||||
line["state"]=dialyzer.state
|
line["state"]=dialyzer.state
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def onchange_timeuse(self,context={}):
|
def onchange_timeuse(self,context={}):
|
||||||
data=context["data"]
|
data=context["data"]
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,58 @@
|
||||||
|
<center>
|
||||||
|
<h2>
|
||||||
|
Dialyzers [Drop]
|
||||||
|
</h2>
|
||||||
|
</center>
|
||||||
|
<table class="table table-striped">
|
||||||
|
<thead class="scroll-header">
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
Number
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
Use (Time)
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
Max Use (Time)
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
Create Date
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
Expire Date
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
Patient
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{{#each lines context=context}}
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
{{number}}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{usetime}}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{maxuse}}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{createdate}}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{expdate}}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{patient}}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{{/each}}
|
||||||
|
</tbody>
|
||||||
|
<tfoot>
|
||||||
|
<tr style="font-weight:bold">
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
</tfoot>
|
||||||
|
</table>
|
|
@ -0,0 +1,63 @@
|
||||||
|
<center>
|
||||||
|
<h2>
|
||||||
|
HD Case Report
|
||||||
|
</h2>
|
||||||
|
</center>
|
||||||
|
<table class="table table-striped">
|
||||||
|
<thead class="scroll-header">
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
Cycle
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
Patient
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
Doctor
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
HD Fee
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
RC.No
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
Nurse
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{{#each lines context=context}}
|
||||||
|
<tr>
|
||||||
|
<td colspan="10" style="font-weight:bold">
|
||||||
|
{{cycle}}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{patient}}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{doctor}}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{total}}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{rc_no}}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{nurse}}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{{/each}}
|
||||||
|
</tbody>
|
||||||
|
<tfoot>
|
||||||
|
<tr style="font-weight:bold">
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
</tfoot>
|
||||||
|
</table>
|
|
@ -1 +1,63 @@
|
||||||
<h1 style="color: red">Cycle {{cycle}}</h1>
|
<center>
|
||||||
|
<h2>
|
||||||
|
HD Case Report
|
||||||
|
</h2>
|
||||||
|
</center>
|
||||||
|
<table class="table table-striped">
|
||||||
|
<thead class="scroll-header">
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
Cycle
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
Patient
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
Doctor
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
HD Fee
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
RC.No
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
Nurse
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{{#each lines context=context}}
|
||||||
|
<tr>
|
||||||
|
<td colspan="10" style="font-weight:bold">
|
||||||
|
{{cycle}}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{patient}}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{doctor}}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{total}}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{rc_no}}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{nurse}}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{{/each}}
|
||||||
|
</tbody>
|
||||||
|
<tfoot>
|
||||||
|
<tr style="font-weight:bold">
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
</tfoot>
|
||||||
|
</table>
|
||||||
|
|
Loading…
Reference in New Issue