merge
commit
7ceeb51d2b
|
@ -1,8 +1,8 @@
|
||||||
<action>
|
<action>
|
||||||
<field name="string">Medical Report Summary</field>
|
<field name="string">Medical Report Summary</field>
|
||||||
<field name="view_cls">report</field>
|
<field name="view_cls">report</field>
|
||||||
<field name="model">clinic.report.hd.madical</field>
|
<field name="model">clinic.report.hd.medical</field>
|
||||||
<field name="report_template">report_hd_madical</field>
|
<field name="report_template">report_hd_medical</field>
|
||||||
<field name="report_template_xls">report_hd_madical</field>
|
<field name="report_template_xls">report_hd_medical</field>
|
||||||
<field name="menu">clinic_menu</field>
|
<field name="menu">clinic_menu</field>
|
||||||
</action>
|
</action>
|
|
@ -0,0 +1,8 @@
|
||||||
|
<action>
|
||||||
|
<field name="string">Payment Report Summary</field>
|
||||||
|
<field name="view_cls">report</field>
|
||||||
|
<field name="model">clinic.report.hd.payment</field>
|
||||||
|
<field name="report_template">report_hd_payment</field>
|
||||||
|
<field name="report_template_xls">report_hd_payment</field>
|
||||||
|
<field name="menu">clinic_menu</field>
|
||||||
|
</action>
|
|
@ -29,8 +29,10 @@
|
||||||
<header string="HD CASE"/>
|
<header string="HD CASE"/>
|
||||||
<item string="HD Detail" action="clinic_report_hd_detail"/>
|
<item string="HD Detail" action="clinic_report_hd_detail"/>
|
||||||
<item string="HD Summary" action="clinic_report_hd_summary"/>
|
<item string="HD Summary" action="clinic_report_hd_summary"/>
|
||||||
<header string="HD Madical"/>
|
<header string="HD Medical"/>
|
||||||
<item string="Madical Summary" action="clinic_report_hd_madical"/>
|
<item string="Medical Summary" action="clinic_report_hd_medical"/>
|
||||||
|
<header string="HD Payment"/>
|
||||||
|
<item string="Payment Summary" action="clinic_report_hd_payment"/>"
|
||||||
<header string="REPORT SETTINGS"/>
|
<header string="REPORT SETTINGS"/>
|
||||||
<item string="Topics" action="clinic_translate"/>
|
<item string="Topics" action="clinic_translate"/>
|
||||||
</item>
|
</item>
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
<form model="clinic.report.hd.detail">
|
<form model="clinic.report.hd.detail">
|
||||||
<group>
|
<group>
|
||||||
<field name="date_from" span="2"/>
|
<field name="patient_id" span="3"/>
|
||||||
<field name="date_to" span="2"/>
|
<field name="type" span="3"/>
|
||||||
<field name="cycle_id" span="2"/>
|
<field name="doctor_id" span="3"/>
|
||||||
<field name="patient_id" span="2"/>
|
<field name="nurse_id" span="3"/>
|
||||||
<field name="nurse_id" span="2"/>
|
<newline/>
|
||||||
<field name="doctor_id" span="2"/>
|
<field name="date_from" span="3"/>
|
||||||
|
<field name="date_to" span="3"/>
|
||||||
|
<field name="cycle_id" span="3"/>
|
||||||
</group>
|
</group>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
<form model="clinic.report.hd.madical">
|
<form model="clinic.report.hd.medical">
|
||||||
<field name="date" mode="month" span="2"/>
|
<field name="date" mode="month" span="2"/>
|
||||||
</form>
|
</form>
|
|
@ -0,0 +1,12 @@
|
||||||
|
<form model="clinic.report.hd.payment">
|
||||||
|
<group>
|
||||||
|
<field name="patient_id" span="3"/>
|
||||||
|
<field name="type" span="3"/>
|
||||||
|
<field name="doctor_id" span="3"/>
|
||||||
|
<field name="nurse_id" span="3"/>
|
||||||
|
<newline/>
|
||||||
|
<field name="date_from" span="3"/>
|
||||||
|
<field name="date_to" span="3"/>
|
||||||
|
<field name="cycle_id" span="3"/>
|
||||||
|
</group>
|
||||||
|
</form>
|
|
@ -33,7 +33,7 @@ from . import gen_visit
|
||||||
from . import gen_visit_line
|
from . import gen_visit_line
|
||||||
from . import report_hd_detail
|
from . import report_hd_detail
|
||||||
from . import report_hd_summary
|
from . import report_hd_summary
|
||||||
from . import report_hd_madical
|
from . import report_hd_medical
|
||||||
from . import input_data
|
from . import input_data
|
||||||
from . import fin_setting
|
from . import fin_setting
|
||||||
from . import import_data_mg
|
from . import import_data_mg
|
||||||
|
@ -43,4 +43,5 @@ from . import translate
|
||||||
from . import payment
|
from . import payment
|
||||||
from . import account_payment
|
from . import account_payment
|
||||||
from . import account_invoice
|
from . import account_invoice
|
||||||
|
from . import report_hd_payment
|
||||||
from . import personal_categ
|
from . import personal_categ
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from netforce.model import Model, fields, get_model
|
from netforce.model import Model, fields, get_model
|
||||||
#from netforce.access import get_active_company
|
|
||||||
|
|
||||||
class ReportHDDetail(Model):
|
class ReportHDDetail(Model):
|
||||||
_name="clinic.report.hd.detail"
|
_name="clinic.report.hd.detail"
|
||||||
|
@ -15,6 +15,8 @@ class ReportHDDetail(Model):
|
||||||
"date_from": fields.Date("From"),
|
"date_from": fields.Date("From"),
|
||||||
"date_to": fields.Date("To"),
|
"date_to": fields.Date("To"),
|
||||||
"cycle_id": fields.Many2One("clinic.cycle","Cycle"),
|
"cycle_id": fields.Many2One("clinic.cycle","Cycle"),
|
||||||
|
"type": fields.Selection([("mg","Medical Goverment"),("sc","Social Security"),("nhso","NHSO (30B)"),("personal","Personal"),("other","Other")],"Type"),
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_defaults={
|
_defaults={
|
||||||
|
@ -38,20 +40,14 @@ class ReportHDDetail(Model):
|
||||||
|
|
||||||
date_from=time.strftime("%Y-%m-%d")
|
date_from=time.strftime("%Y-%m-%d")
|
||||||
date_to=time.strftime("%Y-%m-%d")
|
date_to=time.strftime("%Y-%m-%d")
|
||||||
# print('date_from ',date_from)
|
|
||||||
defaults=context.get("defaults")
|
defaults=context.get("defaults")
|
||||||
if defaults:
|
if defaults:
|
||||||
if defaults.get("date_from"):
|
if defaults.get("date_from"):
|
||||||
date_from=defaults['date_from']
|
date_from=defaults['date_from']
|
||||||
if defaults.get("date_to"):
|
if defaults.get("date_to"):
|
||||||
date_to=defaults['date_to']
|
date_to=defaults['date_to']
|
||||||
# date_to=context['date_to']
|
|
||||||
# default => key => dataults
|
|
||||||
# date_from=context['date_from']
|
|
||||||
# print(context['date_from'])
|
|
||||||
#'2014-10-13'
|
|
||||||
# print('date_from ',date_from)
|
|
||||||
# print('date_to ',date_to)
|
|
||||||
PATIENT_TYPE={
|
PATIENT_TYPE={
|
||||||
"mg":"Medical Government",
|
"mg":"Medical Government",
|
||||||
"sc":"Social Security",
|
"sc":"Social Security",
|
||||||
|
@ -84,6 +80,10 @@ class ReportHDDetail(Model):
|
||||||
dom.append([
|
dom.append([
|
||||||
'doctor_id','=',obj.doctor_id.id,
|
'doctor_id','=',obj.doctor_id.id,
|
||||||
])
|
])
|
||||||
|
if obj.type_id:
|
||||||
|
dom.append([
|
||||||
|
'type','=',obj.type_id.name,
|
||||||
|
])
|
||||||
|
|
||||||
dom.append(['time_start', ">=", date_from+" 00:00:00"])
|
dom.append(['time_start', ">=", date_from+" 00:00:00"])
|
||||||
dom.append(['time_stop',"<=", date_to+" 23:59:59"])
|
dom.append(['time_stop',"<=", date_to+" 23:59:59"])
|
||||||
|
@ -92,10 +92,13 @@ class ReportHDDetail(Model):
|
||||||
index=0
|
index=0
|
||||||
no_patient=0
|
no_patient=0
|
||||||
for hd_case in get_model("clinic.hd.case").search_browse(dom,order="cycle_id.sequence"):
|
for hd_case in get_model("clinic.hd.case").search_browse(dom,order="cycle_id.sequence"):
|
||||||
|
|
||||||
|
for total in get_model("clinic.hd.case.line").search_browse([]):
|
||||||
|
total_fee=total.price or ""
|
||||||
|
|
||||||
|
dialyzer_number=hd_case.dlz_id.id or ""
|
||||||
patient_type=hd_case.patient_id.type
|
patient_type=hd_case.patient_id.type
|
||||||
patient_type=PATIENT_TYPE.get(patient_type)
|
patient_type=PATIENT_TYPE.get(patient_type)
|
||||||
#dialyzer_name=hd_case.dialyzers.id
|
|
||||||
#dialyzer_name=DIALYZER_NAME.get(dialyzer_name)
|
|
||||||
cycle_name=hd_case.cycle_id.name or ""
|
cycle_name=hd_case.cycle_id.name or ""
|
||||||
show_cycle=False
|
show_cycle=False
|
||||||
if not cycle_name in cycles:
|
if not cycle_name in cycles:
|
||||||
|
@ -122,14 +125,18 @@ class ReportHDDetail(Model):
|
||||||
vals={
|
vals={
|
||||||
'show_cycle': show_cycle,
|
'show_cycle': show_cycle,
|
||||||
'cycle' : cycle_name,
|
'cycle' : cycle_name,
|
||||||
'patient': hd_case.patient_id.name,
|
'patient_id': hd_case.patient_id.id,
|
||||||
|
'patient_name': hd_case.patient_id.name,
|
||||||
'patient_type' : patient_type,
|
'patient_type' : patient_type,
|
||||||
'no_patient': 0,
|
'no_patient': 0,
|
||||||
'doctor' : hd_case.doctor_id.name,
|
'doctor_id': hd_case.doctor_id.id,
|
||||||
'total' : hd_case.total,
|
'doctor_name' : hd_case.doctor_id.name,
|
||||||
|
'total' : total_fee,
|
||||||
|
'hd_case_id' : hd_case.id,
|
||||||
'rc_no' : hd_case.number,
|
'rc_no' : hd_case.number,
|
||||||
'dialyzer_name' : 'DZ-xxx',
|
'dialyzer_number' : dialyzer_number,
|
||||||
'nurse' : hd_case.nurse_id.name,
|
'nurse_id': hd_case.nurse_id.id,
|
||||||
|
'nurse_name' : hd_case.nurse_id.name,
|
||||||
}
|
}
|
||||||
lines.append(vals)
|
lines.append(vals)
|
||||||
|
|
||||||
|
|
|
@ -1,158 +0,0 @@
|
||||||
import time
|
|
||||||
|
|
||||||
from datetime import datetime
|
|
||||||
from calendar import monthrange
|
|
||||||
from netforce.model import Model,fields,get_model
|
|
||||||
|
|
||||||
class ReportHDMadical(Model):
|
|
||||||
_name="clinic.report.hd.madical"
|
|
||||||
_string="Hemodialysis Report Madical Summary"
|
|
||||||
_transient=True
|
|
||||||
|
|
||||||
_fields={
|
|
||||||
"date": fields.Date("Month", required=True),
|
|
||||||
}
|
|
||||||
|
|
||||||
_defaults={
|
|
||||||
'date': lambda *a: time.strftime("%Y-%m-%d"),
|
|
||||||
}
|
|
||||||
|
|
||||||
def get_report_data(self,ids,context={}):
|
|
||||||
|
|
||||||
for item in get_model("company").search_browse([]):
|
|
||||||
company_name=item.name
|
|
||||||
|
|
||||||
date=datetime.now().strftime("%Y-%m-%d")
|
|
||||||
#datemonth=datetime.now().strftime("%m")
|
|
||||||
if ids:
|
|
||||||
obj=self.browse(ids)[0]
|
|
||||||
date=obj.date
|
|
||||||
year=int(date[0:4])
|
|
||||||
month=int(date[5:7])
|
|
||||||
month_str=datetime.strptime(date,'%Y-%m-%d').strftime("%B")
|
|
||||||
|
|
||||||
next_month = str(month + 1)
|
|
||||||
if next_month == 13:
|
|
||||||
next_month = 12
|
|
||||||
#next_month_str=datetime.strptime(next_month,'%m').strftime("%B")
|
|
||||||
previous_month = str(month - 1)
|
|
||||||
if previous_month == 0:
|
|
||||||
previous_month = 12
|
|
||||||
#previous_month_str=datetime.strptime(previous_month,'%m').strftime("%B")
|
|
||||||
|
|
||||||
#madical=get_model("clinic.hd.case.gm.line").search_browse()
|
|
||||||
#patients_mg=get_model("clinic.patient").search_browse(['type','=','mg'])
|
|
||||||
|
|
||||||
weekday, total_day=monthrange(year, month)
|
|
||||||
time_start='2014-%s-01 00:00:00'%(month)
|
|
||||||
time_stop='2014-%s-%s 23:59:59'%(month,total_day)
|
|
||||||
|
|
||||||
dom=[]
|
|
||||||
dom.append(['state','=','completed'])
|
|
||||||
dom.append(['time_start','>=',time_start])
|
|
||||||
dom.append(['time_stop','<=',time_stop])
|
|
||||||
#hd_cases=get_model("clinic.hd.case.gm.line").search_browse(dom)
|
|
||||||
|
|
||||||
lines=[
|
|
||||||
{
|
|
||||||
'madical' : 'H4',
|
|
||||||
'sc': '437',
|
|
||||||
'uc': '',
|
|
||||||
'buy' : '4',
|
|
||||||
'total' : '441',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'madical' : 'H2',
|
|
||||||
'sc': '',
|
|
||||||
'uc': '',
|
|
||||||
'buy' : '',
|
|
||||||
'total' : '',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'madical' : 'Epr4',
|
|
||||||
'sc': '216',
|
|
||||||
'uc': '',
|
|
||||||
'buy' : '',
|
|
||||||
'total' : '216',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'madical' : 'Epr2',
|
|
||||||
'sc': '',
|
|
||||||
'uc': '',
|
|
||||||
'buy' : '',
|
|
||||||
'total' : '',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'madical' : 'Epk4',
|
|
||||||
'sc': '70',
|
|
||||||
'uc': '',
|
|
||||||
'buy' : '',
|
|
||||||
'total' : '70',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'madical' : 'Epk2',
|
|
||||||
'sc': '',
|
|
||||||
'uc': '',
|
|
||||||
'buy' : '',
|
|
||||||
'total' : '',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'madical' : 'Epg4',
|
|
||||||
'sc': '98',
|
|
||||||
'uc': '',
|
|
||||||
'buy' : '',
|
|
||||||
'total' : '98',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'madical' : 'Epg2',
|
|
||||||
'sc': '',
|
|
||||||
'uc': '',
|
|
||||||
'buy' : '',
|
|
||||||
'total' : '',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'madical' : 'Rng4',
|
|
||||||
'sc': '34',
|
|
||||||
'uc': '',
|
|
||||||
'buy' : '9',
|
|
||||||
'total' : '43',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'madical' : 'Rng2',
|
|
||||||
'sc': '',
|
|
||||||
'uc': '',
|
|
||||||
'buy' : '',
|
|
||||||
'total' : '',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'madical' : 'Epi4',
|
|
||||||
'sc': '264',
|
|
||||||
'uc': '',
|
|
||||||
'buy' : '9',
|
|
||||||
'total' : '43',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'madical' : 'Epi2',
|
|
||||||
'sc': '',
|
|
||||||
'uc': '',
|
|
||||||
'buy' : '',
|
|
||||||
'total' : '',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'madical' : 'Vnf',
|
|
||||||
'sc': '',
|
|
||||||
'uc': '',
|
|
||||||
'buy' : '',
|
|
||||||
'total' : '',
|
|
||||||
},
|
|
||||||
]
|
|
||||||
|
|
||||||
data={
|
|
||||||
'month': month_str,
|
|
||||||
'year': year,
|
|
||||||
'lines': lines,
|
|
||||||
'company_name': company_name,
|
|
||||||
}
|
|
||||||
return data
|
|
||||||
|
|
||||||
ReportHDMadical.register()
|
|
|
@ -0,0 +1,77 @@
|
||||||
|
import time
|
||||||
|
|
||||||
|
from datetime import datetime
|
||||||
|
from calendar import monthrange
|
||||||
|
from netforce.model import Model,fields,get_model
|
||||||
|
|
||||||
|
class ReportHDMedical(Model):
|
||||||
|
_name="clinic.report.hd.medical"
|
||||||
|
_string="Hemodialysis Report Medical Summary"
|
||||||
|
_transient=True
|
||||||
|
|
||||||
|
_fields={
|
||||||
|
"date": fields.Date("Month", required=True),
|
||||||
|
}
|
||||||
|
|
||||||
|
_defaults={
|
||||||
|
'date': lambda *a: time.strftime("%Y-%m-%d"),
|
||||||
|
}
|
||||||
|
|
||||||
|
def get_report_data(self,ids,context={}):
|
||||||
|
|
||||||
|
for item in get_model("company").search_browse([]):
|
||||||
|
company_name=item.name
|
||||||
|
|
||||||
|
date=datetime.now().strftime("%Y-%m-%d")
|
||||||
|
#datemonth=datetime.now().strftime("%m")
|
||||||
|
if ids:
|
||||||
|
obj=self.browse(ids)[0]
|
||||||
|
date=obj.date
|
||||||
|
year=int(date[0:4])
|
||||||
|
month=int(date[5:7])
|
||||||
|
month_str=datetime.strptime(date,'%Y-%m-%d').strftime("%B")
|
||||||
|
|
||||||
|
#dom=[]
|
||||||
|
#dom.append(['fee_type','=','mg'])
|
||||||
|
|
||||||
|
weekday, total_day=monthrange(year, month)
|
||||||
|
time_start='2014-%s-01 00:00:00'%(month)
|
||||||
|
time_stop='2014-%s-%s 23:59:59'%(month,total_day)
|
||||||
|
|
||||||
|
dom=[]
|
||||||
|
dom.append(['state','=','completed'])
|
||||||
|
dom.append(['time_start','>=',time_start])
|
||||||
|
dom.append(['time_stop','<=',time_stop])
|
||||||
|
|
||||||
|
lines=[]
|
||||||
|
index=0
|
||||||
|
for product in get_model("product").search_browse(['type','=','stock']):
|
||||||
|
product_id=product.id or ""
|
||||||
|
product_code=product.code or ""
|
||||||
|
product_name=product.name or ""
|
||||||
|
product_amount=len(str(product_code))
|
||||||
|
#total=len(str(product_amount))
|
||||||
|
|
||||||
|
index+=1
|
||||||
|
vals={
|
||||||
|
'product_code' : product_code,
|
||||||
|
'medical' : product_name,
|
||||||
|
'mg' : '-',
|
||||||
|
'uc' : '-',
|
||||||
|
'sc' : '-',
|
||||||
|
'buy' : '-',
|
||||||
|
'amount' : product_amount,
|
||||||
|
'product_id': product_id,
|
||||||
|
}
|
||||||
|
lines.append(vals)
|
||||||
|
|
||||||
|
|
||||||
|
data={
|
||||||
|
'month': month_str,
|
||||||
|
'year': year,
|
||||||
|
'lines': lines,
|
||||||
|
'company_name': company_name,
|
||||||
|
}
|
||||||
|
return data
|
||||||
|
|
||||||
|
ReportHDMedical.register()
|
|
@ -0,0 +1,174 @@
|
||||||
|
import time
|
||||||
|
|
||||||
|
from netforce.model import Model, fields, get_model
|
||||||
|
|
||||||
|
|
||||||
|
class ReportHDPayment(Model):
|
||||||
|
_name="clinic.report.hd.payment"
|
||||||
|
_string="Hemodialysis Report Payment"
|
||||||
|
_transient=True
|
||||||
|
|
||||||
|
_fields={
|
||||||
|
"patient_id" : fields.Many2One("clinic.patient","Patient"),
|
||||||
|
"doctor_id" : fields.Many2One("clinic.doctor","Doctor"),
|
||||||
|
"nurse_id" : fields.Many2One("clinic.nurse","Nurse"),
|
||||||
|
"date_from": fields.Date("From"),
|
||||||
|
"date_to": fields.Date("To"),
|
||||||
|
"cycle_id": fields.Many2One("clinic.cycle","Cycle"),
|
||||||
|
"type": fields.Selection([("mg","Medical Goverment"),("sc","Social Security"),("nhso","NHSO (30B)"),("personal","Personal"),("other","Other")],"Type"),
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
_defaults={
|
||||||
|
'date_from': lambda *a: time.strftime("%Y-%m-%d"),
|
||||||
|
'date_to': lambda *a: time.strftime("%Y-%m-%d"),
|
||||||
|
}
|
||||||
|
|
||||||
|
_order="cycle_id desc"
|
||||||
|
|
||||||
|
|
||||||
|
def get_report_data(self,ids,context={}):
|
||||||
|
|
||||||
|
# company_id=get_active_company
|
||||||
|
# comp=get_model("company").browse(company_id)
|
||||||
|
# context=> dict
|
||||||
|
# inside context => keys => defaults => type => dict
|
||||||
|
# dict => key: value => '', 1, [], {}
|
||||||
|
# context['default'] => defaults(dict) => key => inside key => value => '2014-10-22'
|
||||||
|
for item in get_model("company").search_browse([]):
|
||||||
|
company_name=item.name
|
||||||
|
|
||||||
|
date_from=time.strftime("%Y-%m-%d")
|
||||||
|
date_to=time.strftime("%Y-%m-%d")
|
||||||
|
|
||||||
|
defaults=context.get("defaults")
|
||||||
|
if defaults:
|
||||||
|
if defaults.get("date_from"):
|
||||||
|
date_from=defaults['date_from']
|
||||||
|
if defaults.get("date_to"):
|
||||||
|
date_to=defaults['date_to']
|
||||||
|
|
||||||
|
PATIENT_TYPE={
|
||||||
|
"mg":"Medical Government",
|
||||||
|
"sc":"Social Security",
|
||||||
|
"nhso":"NHSO (30฿)",
|
||||||
|
"personal": "Personal",
|
||||||
|
"others": "Others",
|
||||||
|
}
|
||||||
|
|
||||||
|
dom=[]
|
||||||
|
dom.append(['state','=','completed'])
|
||||||
|
if ids:
|
||||||
|
obj=self.browse(ids)[0]
|
||||||
|
if obj.date_from:
|
||||||
|
date_from=obj.date_from
|
||||||
|
if obj.date_to:
|
||||||
|
date_to=obj.date_to
|
||||||
|
if obj.cycle_id:
|
||||||
|
dom.append([
|
||||||
|
'cycle_id','=',obj.cycle_id.id,
|
||||||
|
])
|
||||||
|
if obj.patient_id:
|
||||||
|
dom.append([
|
||||||
|
'patient_id','=',obj.patient_id.id,
|
||||||
|
])
|
||||||
|
if obj.nurse_id:
|
||||||
|
dom.append([
|
||||||
|
'nurse_id','=',obj.nurse_id.id,
|
||||||
|
])
|
||||||
|
if obj.doctor_id:
|
||||||
|
dom.append([
|
||||||
|
'doctor_id','=',obj.doctor_id.id,
|
||||||
|
])
|
||||||
|
if obj.type_id:
|
||||||
|
dom.append([
|
||||||
|
'type','=',obj.type_id.id,
|
||||||
|
])
|
||||||
|
|
||||||
|
dom.append(['time_start', ">=", date_from+" 00:00:00"])
|
||||||
|
dom.append(['time_stop',"<=", date_to+" 23:59:59"])
|
||||||
|
lines=[]
|
||||||
|
cycles=[]
|
||||||
|
index=0
|
||||||
|
no_patient=0
|
||||||
|
for hd_case in get_model("clinic.hd.case").search_browse(dom,order="cycle_id.sequence"):
|
||||||
|
#print('='*50)
|
||||||
|
#for line in hd_case.line:
|
||||||
|
# dialyzer_id=line.dialyzer_id
|
||||||
|
# if dialyzer_id:
|
||||||
|
# dialyzer_number=line.number or ""
|
||||||
|
# print(dialyzer_number)
|
||||||
|
|
||||||
|
#print('='*50)
|
||||||
|
patient_type=hd_case.patient_id.type
|
||||||
|
patient_type=PATIENT_TYPE.get(patient_type)
|
||||||
|
#dialyzer=get_model("clinic.dialyzer").search_browse([])
|
||||||
|
cycle_name=hd_case.cycle_id.name or ""
|
||||||
|
show_cycle=False
|
||||||
|
if not cycle_name in cycles:
|
||||||
|
cycles.append(cycle_name)
|
||||||
|
show_cycle=True
|
||||||
|
vals={
|
||||||
|
'color': 'success',
|
||||||
|
'show_cycle': False,
|
||||||
|
'cycle' : "",
|
||||||
|
'patient': "",
|
||||||
|
'no_patient': no_patient,
|
||||||
|
'patient_type' : "",
|
||||||
|
'doctor' : "",
|
||||||
|
'total' : "",
|
||||||
|
'rc_no' : "",
|
||||||
|
'dialyzer_name' : "",
|
||||||
|
'nurse' : "",
|
||||||
|
}
|
||||||
|
lines.append(vals)
|
||||||
|
no_patient=1
|
||||||
|
else:
|
||||||
|
no_patient+=1
|
||||||
|
index+=1
|
||||||
|
vals={
|
||||||
|
'show_cycle': show_cycle,
|
||||||
|
'cycle' : cycle_name,
|
||||||
|
'patient_id': hd_case.patient_id.id,
|
||||||
|
'patient_name': hd_case.patient_id.name,
|
||||||
|
'patient_type' : patient_type,
|
||||||
|
'no_patient': 0,
|
||||||
|
'doctor_id': hd_case.doctor_id.id,
|
||||||
|
'doctor_name' : hd_case.doctor_id.name,
|
||||||
|
'total' : hd_case.total,
|
||||||
|
'hd_case_id' : hd_case.id,
|
||||||
|
'rc_no' : hd_case.number,
|
||||||
|
'dialyzer_number' : 'DZ-XXXX',
|
||||||
|
'nurse_id': hd_case.nurse_id.id,
|
||||||
|
'nurse_name' : hd_case.nurse_id.name,
|
||||||
|
}
|
||||||
|
lines.append(vals)
|
||||||
|
|
||||||
|
# XXX
|
||||||
|
if lines:
|
||||||
|
vals={
|
||||||
|
'color': 'success',
|
||||||
|
'show_cycle': False,
|
||||||
|
'cycle' : "",
|
||||||
|
'patient': "",
|
||||||
|
'no_patient': no_patient,
|
||||||
|
'patient_type' : "",
|
||||||
|
'doctor' : "",
|
||||||
|
'total' : "",
|
||||||
|
'rc_no' : "",
|
||||||
|
'dialyzer_name' : "",
|
||||||
|
'nurse' : "",
|
||||||
|
}
|
||||||
|
lines.append(vals)
|
||||||
|
#XXX
|
||||||
|
del lines[0]
|
||||||
|
data={
|
||||||
|
'lines': lines,
|
||||||
|
'same_date': date_from==date_to,
|
||||||
|
'date_from': date_from,
|
||||||
|
'date_to': date_to,
|
||||||
|
'company_name': company_name,
|
||||||
|
}
|
||||||
|
return data
|
||||||
|
|
||||||
|
ReportHDPayment.register()
|
|
@ -19,9 +19,6 @@ class ReportHDSummary(Model):
|
||||||
}
|
}
|
||||||
|
|
||||||
def get_report_data(self,ids,context={}):
|
def get_report_data(self,ids,context={}):
|
||||||
# company_id=get_active_company
|
|
||||||
# company_name=get_model("company").search("name")
|
|
||||||
# company_name=get_model("company").search_browse()
|
|
||||||
for item in get_model("company").search_browse([]):
|
for item in get_model("company").search_browse([]):
|
||||||
company_name=item.name
|
company_name=item.name
|
||||||
|
|
||||||
|
@ -51,11 +48,6 @@ class ReportHDSummary(Model):
|
||||||
time_start='2014-%s-01'%(month) # 2014-10-20
|
time_start='2014-%s-01'%(month) # 2014-10-20
|
||||||
time_stop='2014-%s-%s'%(month,total_day)
|
time_stop='2014-%s-%s'%(month,total_day)
|
||||||
|
|
||||||
dom=[]
|
|
||||||
dom.append(['time_start','>=',time_start])
|
|
||||||
dom.append(['time_stop','<=',time_stop])
|
|
||||||
|
|
||||||
|
|
||||||
dom=[]
|
dom=[]
|
||||||
dom.append(['type','=','mg'])
|
dom.append(['type','=','mg'])
|
||||||
patients_mg=len(get_model("clinic.patient").search(dom))
|
patients_mg=len(get_model("clinic.patient").search(dom))
|
||||||
|
@ -67,14 +59,15 @@ class ReportHDSummary(Model):
|
||||||
patients_nhso=len(get_model("clinic.patient").search(dom))
|
patients_nhso=len(get_model("clinic.patient").search(dom))
|
||||||
dom.append(['type','=','pn'])
|
dom.append(['type','=','pn'])
|
||||||
patients_pn=len(get_model("clinic.patient").search(dom))
|
patients_pn=len(get_model("clinic.patient").search(dom))
|
||||||
|
#New Patients
|
||||||
|
#dom.append(['type','=','All'])
|
||||||
patients=len(get_model("clinic.patient").search_browse(['type','=','All']))
|
patients=len(get_model("clinic.patient").search_browse(['type','=','All']))
|
||||||
#new_patients=len(patients)
|
|
||||||
|
|
||||||
dom=[]
|
dom=[]
|
||||||
dom.append(['state','=','completed'])
|
dom.append(['state','=','completed'])
|
||||||
dom.append(['time_start','>=',time_start])
|
dom.append(['time_start','>=',time_start])
|
||||||
dom.append(['time_stop','<=',time_stop])
|
dom.append(['time_stop','<=',time_stop])
|
||||||
|
|
||||||
cur_total_case=len(get_model("clinic.hd.case").search(dom))
|
cur_total_case=len(get_model("clinic.hd.case").search(dom))
|
||||||
|
|
||||||
weekday, prev_total_day=monthrange(year, previous_month)
|
weekday, prev_total_day=monthrange(year, previous_month)
|
||||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -9,7 +9,7 @@
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</h4>
|
</h4>
|
||||||
</center>
|
</center>
|
||||||
<table class="table table-striped">
|
<table class="table table-bordered">
|
||||||
<thead class="scroll-header">
|
<thead class="scroll-header">
|
||||||
<tr>
|
<tr>
|
||||||
<th>
|
<th>
|
||||||
|
@ -18,9 +18,6 @@
|
||||||
<th>
|
<th>
|
||||||
Patient
|
Patient
|
||||||
</th>
|
</th>
|
||||||
<th>
|
|
||||||
Doctor
|
|
||||||
</th>
|
|
||||||
<th>
|
<th>
|
||||||
Patient Type
|
Patient Type
|
||||||
</th>
|
</th>
|
||||||
|
@ -33,6 +30,9 @@
|
||||||
<th>
|
<th>
|
||||||
Dialyzer
|
Dialyzer
|
||||||
</th>
|
</th>
|
||||||
|
<th>
|
||||||
|
Doctor
|
||||||
|
</th>
|
||||||
<th>
|
<th>
|
||||||
Nurse
|
Nurse
|
||||||
</th>
|
</th>
|
||||||
|
@ -53,26 +53,18 @@
|
||||||
<td>{{no_patient}}</td>
|
<td>{{no_patient}}</td>
|
||||||
{{else}}
|
{{else}}
|
||||||
<td></td>
|
<td></td>
|
||||||
<td>{{patient}}</td>
|
<td><a style="text-decoration: underline" href="ui#name=clinic_patient&mode=page&active_id={{patient_id}}">{{patient_name}}</a></td>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<td>
|
|
||||||
{{doctor}}
|
|
||||||
</td>
|
|
||||||
<td>
|
<td>
|
||||||
{{patient_type}}
|
{{patient_type}}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{{total}}
|
{{total}}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td><a style="text-decoration: underline" href="ui#name=clinic_hd_case&mode=page&active_id={{hd_case_id}}">{{rc_no}}</a></td>
|
||||||
{{rc_no}}
|
<td><a style="text-decoration: underline" href="ui#name=clinic_dialyzer&mode=page&active_id={{dialyzer_number}}">{{dialyzer_number}}</a></td>
|
||||||
</td>
|
<td><a style="text-decoration: underline" href="ui#name=clinic_doctor&mode=page&active_id={{doctor_id}}">{{doctor_name}}</a></td>
|
||||||
<td>
|
<td><a style="text-decoration: underline" href="ui#name=clinic_nurse&mode=page&active_id={{nurse_id}}">{{nurse_name}}</a></td>
|
||||||
{{dialyzer_name}}
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
{{nurse}}
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
@ -0,0 +1,48 @@
|
||||||
|
<center>
|
||||||
|
<h2>
|
||||||
|
Summary of the Medical
|
||||||
|
</h2>
|
||||||
|
<h3>
|
||||||
|
[{{company_name}}]<br/>
|
||||||
|
</h3>
|
||||||
|
<h4>
|
||||||
|
As at {{month}} {{year}}
|
||||||
|
</h4>
|
||||||
|
</center>
|
||||||
|
<table class="table table-bordered">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Product ID</th>
|
||||||
|
<th>Product Name</th>
|
||||||
|
<th>MG</th>
|
||||||
|
<th>UC</th>
|
||||||
|
<th>NHSO (30B)</th>
|
||||||
|
<th>Pay</th>
|
||||||
|
<th>Total</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{{#each lines}}
|
||||||
|
<tr>
|
||||||
|
<td>{{product_code}}</td>
|
||||||
|
<td><a style="text-decoration: underline" href=ui#name=product&mode=form&active_id={{product_id}}>{{medical}}</a></td>
|
||||||
|
<td>{{mg}}</td>
|
||||||
|
<td>{{uc}}</td>
|
||||||
|
<td>{{sc}}</td>
|
||||||
|
<td style color="red"></style>{{buy}}</td>
|
||||||
|
<td style color="blue"></style>{{amount}}</td>
|
||||||
|
</tr>
|
||||||
|
{{/each}}
|
||||||
|
</tbody>
|
||||||
|
<tfoot>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
<td>-</td>
|
||||||
|
<td>-</td>
|
||||||
|
<td>-</td>
|
||||||
|
<td>-</td>
|
||||||
|
<td><b>32</b></td>
|
||||||
|
</tr>
|
||||||
|
</tfoot>
|
||||||
|
</table>
|
|
@ -0,0 +1,61 @@
|
||||||
|
<center>
|
||||||
|
<h2>Detail of the Hemodialysis</h2>
|
||||||
|
<h2>Payment</h2>
|
||||||
|
<h3>[{{company_name}}]</h3>
|
||||||
|
<h4>
|
||||||
|
{{#if same_date}}
|
||||||
|
As at {{fmt_date date_from}}
|
||||||
|
{{else}}
|
||||||
|
From {{fmt_date date_from}} to {{fmt_date date_to}}
|
||||||
|
{{/if}}
|
||||||
|
</h4>
|
||||||
|
</center>
|
||||||
|
<table class="table table-bordered">
|
||||||
|
<thead class="scroll-header">
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
Cycle
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
RC.No
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
Doctor
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
Nurce
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
HD Fee
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{{#each lines context=context}}
|
||||||
|
{{#if show_cycle}}
|
||||||
|
<tr>
|
||||||
|
<td colspan="10" style="font-weight:bold">
|
||||||
|
{{cycle}}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{{/if}}
|
||||||
|
<tr class="{{color}}"/>
|
||||||
|
<td></td>
|
||||||
|
<td><a style="text-decoration: underline" href="ui#name=clinic_hd_case&mode=page&active_id={{hd_case_id}}">{{rc_no}}</a></td>
|
||||||
|
<td><a style="text-decoration: underline" href="ui#name=clinic_doctor&mode=page&active_id={{doctor_id}}">{{doctor_name}}</a></td>
|
||||||
|
<td><a style="text-decoration: underline" href="ui#name=clinic_nurse&mode=page&active_id={{nurse_id}}">{{nurse_name}}</a></td>
|
||||||
|
{{#if total}}
|
||||||
|
<td><b>Total</b></td>
|
||||||
|
<td>{{total}}</td>
|
||||||
|
{{else}}
|
||||||
|
<td><a style="text-decoration: underline">{{total}}</a></td>
|
||||||
|
{{/if}}
|
||||||
|
</tr>
|
||||||
|
{{/each}}
|
||||||
|
</tbody>
|
||||||
|
<tfoot>
|
||||||
|
<tr style="font-weight:bold">
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
</tfoot>
|
||||||
|
</table>
|
|
@ -4,10 +4,12 @@
|
||||||
</h2>
|
</h2>
|
||||||
<h3>
|
<h3>
|
||||||
[{{company_name}}]<br/>
|
[{{company_name}}]<br/>
|
||||||
As at {{month}} {{year}}
|
|
||||||
</h3>
|
</h3>
|
||||||
|
<h4>
|
||||||
|
As at {{month}} {{year}}
|
||||||
|
</h4>
|
||||||
</center>
|
</center>
|
||||||
<table class="table table-striped">
|
<table class="table table-bordered">
|
||||||
<thead class="scroll-header">
|
<thead class="scroll-header">
|
||||||
<th>Topic</th>
|
<th>Topic</th>
|
||||||
<th>Month</th>
|
<th>Month</th>
|
||||||
|
@ -22,4 +24,11 @@
|
||||||
</tr>
|
</tr>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
<tfoot>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</tfoot>
|
||||||
</table>
|
</table>
|
||||||
|
|
Loading…
Reference in New Issue