customize report
parent
6ff15dc241
commit
12ff2c49fb
|
@ -0,0 +1,8 @@
|
||||||
|
<action>
|
||||||
|
<field name="string">Medical Report Summary</field>
|
||||||
|
<field name="view_cls">report</field>
|
||||||
|
<field name="model">clinic.report.hd.medical</field>
|
||||||
|
<field name="report_template">report_hd_medical</field>
|
||||||
|
<field name="report_template_xls">report_hd_medical</field>
|
||||||
|
<field name="menu">clinic_menu</field>
|
||||||
|
</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>
|
|
@ -33,8 +33,6 @@
|
||||||
<item string="Medical Summary" action="clinic_report_hd_medical"/>
|
<item string="Medical Summary" action="clinic_report_hd_medical"/>
|
||||||
<header string="HD Payment"/>
|
<header string="HD Payment"/>
|
||||||
<item string="Payment Summary" action="clinic_report_hd_payment"/>"
|
<item string="Payment Summary" action="clinic_report_hd_payment"/>"
|
||||||
<header string="HD Madical"/>
|
|
||||||
<item string="Madical Summary" action="clinic_report_hd_madical"/>
|
|
||||||
<header string="REPORT SETTINGS"/>
|
<header string="REPORT SETTINGS"/>
|
||||||
<item string="Topics" action="clinic_translate"/>
|
<item string="Topics" action="clinic_translate"/>
|
||||||
</item>
|
</item>
|
||||||
|
|
|
@ -82,7 +82,7 @@ class ReportHDDetail(Model):
|
||||||
])
|
])
|
||||||
if obj.type_id:
|
if obj.type_id:
|
||||||
dom.append([
|
dom.append([
|
||||||
'type','=',obj.type_id.id,
|
'type','=',obj.type_id.name,
|
||||||
])
|
])
|
||||||
|
|
||||||
dom.append(['time_start', ">=", date_from+" 00:00:00"])
|
dom.append(['time_start', ">=", date_from+" 00:00:00"])
|
||||||
|
@ -92,17 +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"):
|
||||||
#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)
|
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=get_model("clinic.dialyzer").search_browse([])
|
|
||||||
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:
|
||||||
|
@ -135,10 +131,10 @@ class ReportHDDetail(Model):
|
||||||
'no_patient': 0,
|
'no_patient': 0,
|
||||||
'doctor_id': hd_case.doctor_id.id,
|
'doctor_id': hd_case.doctor_id.id,
|
||||||
'doctor_name' : hd_case.doctor_id.name,
|
'doctor_name' : hd_case.doctor_id.name,
|
||||||
'total' : hd_case.total,
|
'total' : total_fee,
|
||||||
'hd_case_id' : hd_case.id,
|
'hd_case_id' : hd_case.id,
|
||||||
'rc_no' : hd_case.number,
|
'rc_no' : hd_case.number,
|
||||||
'dialyzer_number' : 'DZ-XXXX',
|
'dialyzer_number' : dialyzer_number,
|
||||||
'nurse_id': hd_case.nurse_id.id,
|
'nurse_id': hd_case.nurse_id.id,
|
||||||
'nurse_name' : hd_case.nurse_id.name,
|
'nurse_name' : hd_case.nurse_id.name,
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,134 +43,28 @@ class ReportHDMedical(Model):
|
||||||
dom.append(['time_start','>=',time_start])
|
dom.append(['time_start','>=',time_start])
|
||||||
dom.append(['time_stop','<=',time_stop])
|
dom.append(['time_stop','<=',time_stop])
|
||||||
|
|
||||||
for product in get_model("clinic.hd.case.gm.line").search_browse([]):
|
lines=[]
|
||||||
product_id=product.product_id.Product_id
|
index=0
|
||||||
#product_total=len(product_id)
|
for product in get_model("product").search_browse(['type','=','stock']):
|
||||||
#print(product_id)
|
product_id=product.id or ""
|
||||||
if product_id:
|
product_code=product.code or ""
|
||||||
product_name=product.description or ""
|
product_name=product.name or ""
|
||||||
#product_id=product.product_id.id 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)
|
||||||
|
|
||||||
lines=[
|
|
||||||
{
|
|
||||||
'product_id' : 'MD-XXXX',
|
|
||||||
'madical' : product_name,
|
|
||||||
'mg': '',
|
|
||||||
'uc': '437',
|
|
||||||
'sc': '',
|
|
||||||
'buy' : '4',
|
|
||||||
'total' : '441',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'product_id' : 'MD-XXXX',
|
|
||||||
'madical' : 'H2',
|
|
||||||
'mg': '',
|
|
||||||
'uc': '',
|
|
||||||
'sc': '',
|
|
||||||
'buy' : '',
|
|
||||||
'total' : '',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'product_id' : 'MD-XXXX',
|
|
||||||
'madical' : 'Epr4',
|
|
||||||
'mg': '',
|
|
||||||
'uc': '216',
|
|
||||||
'sc': '',
|
|
||||||
'buy' : '',
|
|
||||||
'total' : '216',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'product_id' : 'MD-XXXX',
|
|
||||||
'madical' : 'Epr2',
|
|
||||||
'mg': '437',
|
|
||||||
'uc': '',
|
|
||||||
'sc': '',
|
|
||||||
'buy' : '',
|
|
||||||
'total' : '',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'product_id' : 'MD-XXXX',
|
|
||||||
'madical' : 'Epk4',
|
|
||||||
'mg': '437',
|
|
||||||
'uc': '70',
|
|
||||||
'sc': '',
|
|
||||||
'buy' : '',
|
|
||||||
'total' : '70',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'product_id' : 'MD-XXXX',
|
|
||||||
'madical' : 'Epk2',
|
|
||||||
'mg': '437',
|
|
||||||
'uc': '',
|
|
||||||
'sc': '',
|
|
||||||
'buy' : '',
|
|
||||||
'total' : '',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'product_id' : 'MD-XXXX',
|
|
||||||
'madical' : 'Epg4',
|
|
||||||
'mg': '437',
|
|
||||||
'uc': '98',
|
|
||||||
'sc': '',
|
|
||||||
'buy' : '',
|
|
||||||
'total' : '98',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'product_id' : 'MD-XXXX',
|
|
||||||
'madical' : 'Epg2',
|
|
||||||
'mg': '437',
|
|
||||||
'uc': '',
|
|
||||||
'sc': '',
|
|
||||||
'buy' : '',
|
|
||||||
'total' : '',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'product_id' : 'MD-XXXX',
|
|
||||||
'madical' : 'Rng4',
|
|
||||||
'mg': '437',
|
|
||||||
'uc': '34',
|
|
||||||
'sc': '',
|
|
||||||
'buy' : '9',
|
|
||||||
'total' : '43',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'product_id' : 'MD-XXXX',
|
|
||||||
'madical' : 'Rng2',
|
|
||||||
'mg': '437',
|
|
||||||
'uc': '',
|
|
||||||
'sc': '',
|
|
||||||
'buy' : '',
|
|
||||||
'total' : '',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'product_id' : 'MD-XXXX',
|
|
||||||
'madical' : 'Epi4',
|
|
||||||
'mg': '437',
|
|
||||||
'uc': '264',
|
|
||||||
'sc': '',
|
|
||||||
'buy' : '9',
|
|
||||||
'total' : '43',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'product_id' : 'MD-XXXX',
|
|
||||||
'madical' : 'Epi2',
|
|
||||||
'mg': '437',
|
|
||||||
'uc': '',
|
|
||||||
'sc': '',
|
|
||||||
'buy' : '',
|
|
||||||
'total' : '',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'product_id' : 'MD-XXXX',
|
|
||||||
'madical' : 'Vnf',
|
|
||||||
'mg': '437',
|
|
||||||
'uc': '',
|
|
||||||
'sc': '',
|
|
||||||
'buy' : '',
|
|
||||||
'total' : '',
|
|
||||||
},
|
|
||||||
]
|
|
||||||
|
|
||||||
data={
|
data={
|
||||||
'month': month_str,
|
'month': month_str,
|
||||||
|
|
|
@ -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,10 +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))
|
||||||
|
@ -66,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.
Binary file not shown.
|
@ -62,7 +62,7 @@
|
||||||
{{total}}
|
{{total}}
|
||||||
</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_hd_case&mode=page&active_id={{hd_case_id}}">{{rc_no}}</a></td>
|
||||||
<td><a style="text-decoration: underline" href="ui#name=clinic_dialyzer&mode=page">{{dialyzer_number}}</a></td>
|
<td><a style="text-decoration: underline" href="ui#name=clinic_dialyzer&mode=page&active_id={{dialyzer_number}}">{{dialyzer_number}}</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_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>
|
<td><a style="text-decoration: underline" href="ui#name=clinic_nurse&mode=page&active_id={{nurse_id}}">{{nurse_name}}</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
<center>
|
||||||
|
<h2>
|
||||||
|
Summary of the Madical
|
||||||
|
</h2>
|
||||||
|
<h3>
|
||||||
|
[{{company_name}}]<br/>
|
||||||
|
As at {{month}} {{year}}
|
||||||
|
</h3>
|
||||||
|
</center>
|
||||||
|
<table class="table table-striped">
|
||||||
|
<thead class="scroll-header">
|
||||||
|
<th>Madical</th>
|
||||||
|
<th>Social Security</th>
|
||||||
|
<th>uc</th>
|
||||||
|
<th>Buy</th>
|
||||||
|
<th>Total</th>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{{#each lines}}
|
||||||
|
<tr>
|
||||||
|
<td>{{madical}}</td>
|
||||||
|
<td>{{sc}}</td>
|
||||||
|
<td>{{uc}}</td>
|
||||||
|
<td style color="red"></style>{{buy}}</td>
|
||||||
|
<td style color="blue"></style>{{total}}</td>
|
||||||
|
</tr>
|
||||||
|
{{/each}}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
|
@ -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>
|
Loading…
Reference in New Issue