Add fields to HDcase Daily Report

conv_bal
chayut.s 2014-10-15 18:46:19 +07:00
parent 2f663da539
commit 4563914e01
11 changed files with 245 additions and 7 deletions

View File

@ -0,0 +1,8 @@
<action>
<field name="string">Summary of the Hemodialysis</field>
<field name="view_cls">report</field>
<field name="model">clinic.hd.report.monthly</field>
<field name="report_template">report_hd_monthly</field>
<field name="report_template_xls">hd_report_monthly</field>
<field name="menu">clinic_menu</field>
</action>

View File

@ -1,6 +1,9 @@
<form model="clinic.hd.report"> <form model="clinic.hd.report">
<group form_layout="stacked"> <group>
<field name="date" span="2"/> <field name="date" span="2"/>
<field name="cycle_id" span="2"/> <field name="cycle_id" span="2"/>
<field name="patient_id" span="2"/>
<field name="nurse_id" span="2"/>
<field name="doctor_id" span="2"/>
</group> </group>
</form> </form>

View File

@ -0,0 +1,3 @@
<form model="clinic.hd.report.monthly">
<field name="date" mode="month" span="2"/>
</form>

View File

@ -23,7 +23,8 @@
<header string="Dialyzers"/> <header string="Dialyzers"/>
<item string="Dialyzers Drop" action="clinic_dialyzer_report"/> <item string="Dialyzers Drop" action="clinic_dialyzer_report"/>
<header string="HD Case"/> <header string="HD Case"/>
<item string="Treatment Summary" action="clinic_hd_report"/> <item string="Daily" action="clinic_hd_report"/>
<item string="Monthly" action="clinic_hd_report_monthly"/>
</item> </item>
<item string="Imports"> <item string="Imports">
<item string="Import Payments" action="clinic_import_payment"/> <item string="Import Payments" action="clinic_import_payment"/>

View File

@ -2,7 +2,6 @@
<search> <search>
<field name="number"/> <field name="number"/>
<field name="cycle_id"/> <field name="cycle_id"/>
<field name="date"/>
<field name="patient_id"/> <field name="patient_id"/>
<field name="doctor_id"/> <field name="doctor_id"/>
<field name="nurse_id"/> <field name="nurse_id"/>

View File

@ -31,3 +31,4 @@ from . import file_sheet
from . import cycle from . import cycle
from . import gen_visit from . import gen_visit
from . import gen_visit_line from . import gen_visit_line
from . import report_hd_monthly

View File

@ -9,6 +9,9 @@ class HDReport(Model):
_fields={ _fields={
"date": fields.Date("Start-Date"), "date": fields.Date("Start-Date"),
"patient_id" : fields.Many2One("clinic.patient","Patient"),
"doctor_id" : fields.Many2One("clinic.doctor","Doctor"),
"nurse_id" : fields.Many2One("clinic.nurse","Nurse"),
#"time_start": fields.DateTime("Time start",required=False,search=True), #"time_start": fields.DateTime("Time start",required=False,search=True),
#"time_stop": fields.DateTime("Time stop",required=False,search=True), #"time_stop": fields.DateTime("Time stop",required=False,search=True),
"cycle_id": fields.Many2One("clinic.cycle","Cycle"), "cycle_id": fields.Many2One("clinic.cycle","Cycle"),
@ -44,9 +47,17 @@ class HDReport(Model):
dom.append([ dom.append([
'cycle_id','=',obj.cycle_id.id, 'cycle_id','=',obj.cycle_id.id,
]) ])
if obj.patient_id:
dom.append([
'patient_id','=',obj.patient_id.id,
])
if obj.doctor_id:
dom.append([
'doctor_id','=',obj.doctor_id.id,
])
dom.append(['time_start', ">=", date+" 00:00:00"]) dom.append(['time_start', ">=", date+" 00:00:00"])
dom.append(['time_stop', "<=", date+" 23:59:59"]) dom.append(['time_stop',"<=", date+" 23:59:59"])
print("dom ", dom)
lines=[] lines=[]
cycles=[] cycles=[]
index=0 index=0

View File

@ -0,0 +1,22 @@
import time
from netforce.model import Model, fields
class HDReportMonth(Model):
_name="clinic.hd.report.monthly"
_string="Summary of the Hemodialysis"
_transient=True
_fields={
"date": fields.Date("Month"),
}
_defaults={
'date': lambda *a: time.strftime("%Y-%m-%d"),
}
def get_report_data(self,ids,context={}):
data={}
return data
HDReportMonth.register()

Binary file not shown.

View File

@ -0,0 +1,95 @@
<center>
<h2>
Summary of the Hemodialysis
</h2>
<h3>
[Ratchawat : Saamsan4]<br/>
As at October 2014
</h3>
</center>
<table class="table table-striped">
<thead class="scroll-header">
</thead>
<tbody>
<tr>
<th>
The number of times the Hemodialysis
</th>
<th>
Current month
</th>
<th>
xxxx times
</th>
</tr>
<tr>
<th>
Many patients come from
</th>
<th>
Previous month
</th>
<th>
xxxx person
</th>
</tr>
<tr>
<th>
Number of new patients
</th>
<th>
Current month
</th>
<th>
xxxx person
</th>
</tr>
<tr>
<th>
Number of patients discharged
</th>
<th>
Current month
</th>
<th>
xxxx person
</th>
</tr>
<tr>
<th>
Number of patients to raise
</th>
<th>
Current month
</th>
<th>
xxxx person
</th>
</tr>
<tr>
<th>
Number of patients withdrawn SSO
</th>
<th>
</th>
<th>
xxxx person
</th>
</tr>
<tr>
<th>
Many patients pay themselves
</th>
<th>
</th>
<th>
xxxx person
</th>
</tr>
</tbody>
<tfoot>
<tr style="font-weight:bold">
</tr>
</tfoot>
</table>

View File

@ -0,0 +1,95 @@
<center>
<h2>
Summary of the Hemodialysis
</h2>
<h3>
[Ratchawat : Saamsan4]<br/>
As at October 2014
</h3>
</center>
<table class="table table-striped">
<thead class="scroll-header">
</thead>
<tbody>
<tr>
<th>
The number of times the Hemodialysis
</th>
<th>
Current month
</th>
<th>
xxxx times
</th>
</tr>
<tr>
<th>
Many patients come from
</th>
<th>
Previous month
</th>
<th>
xxxx person
</th>
</tr>
<tr>
<th>
Number of new patients
</th>
<th>
Current month
</th>
<th>
xxxx person
</th>
</tr>
<tr>
<th>
Number of patients discharged
</th>
<th>
Current month
</th>
<th>
xxxx person
</th>
</tr>
<tr>
<th>
Number of patients to raise
</th>
<th>
Current month
</th>
<th>
xxxx person
</th>
</tr>
<tr>
<th>
Number of patients withdrawn SSO
</th>
<th>
</th>
<th>
xxxx person
</th>
</tr>
<tr>
<th>
Many patients pay themselves
</th>
<th>
</th>
<th>
xxxx person
</th>
</tr>
</tbody>
<tfoot>
<tr style="font-weight:bold">
</tr>
</tfoot>
</table>