diff --git a/netforce_clinic/actions/clinic_hd_report_monthly.xml b/netforce_clinic/actions/clinic_hd_report_monthly.xml new file mode 100644 index 0000000..784e5f6 --- /dev/null +++ b/netforce_clinic/actions/clinic_hd_report_monthly.xml @@ -0,0 +1,8 @@ + + Summary of the Hemodialysis + report + clinic.hd.report.monthly + report_hd_monthly + hd_report_monthly + clinic_menu + diff --git a/netforce_clinic/layouts/clinic_hd_report.xml b/netforce_clinic/layouts/clinic_hd_report.xml index d3fe7e1..39eabc5 100644 --- a/netforce_clinic/layouts/clinic_hd_report.xml +++ b/netforce_clinic/layouts/clinic_hd_report.xml @@ -1,6 +1,9 @@
- + + + + diff --git a/netforce_clinic/layouts/clinic_hd_report_monthly.xml b/netforce_clinic/layouts/clinic_hd_report_monthly.xml new file mode 100644 index 0000000..af7ea12 --- /dev/null +++ b/netforce_clinic/layouts/clinic_hd_report_monthly.xml @@ -0,0 +1,3 @@ +
+ + diff --git a/netforce_clinic/layouts/clinic_menu.xml b/netforce_clinic/layouts/clinic_menu.xml index a47c875..f8d67d1 100644 --- a/netforce_clinic/layouts/clinic_menu.xml +++ b/netforce_clinic/layouts/clinic_menu.xml @@ -23,7 +23,8 @@
- + + diff --git a/netforce_clinic/layouts/clinic_visit_list.xml b/netforce_clinic/layouts/clinic_visit_list.xml index d790f04..868840b 100644 --- a/netforce_clinic/layouts/clinic_visit_list.xml +++ b/netforce_clinic/layouts/clinic_visit_list.xml @@ -2,7 +2,6 @@ - diff --git a/netforce_clinic/models/__init__.py b/netforce_clinic/models/__init__.py index a5fb461..a1e1001 100644 --- a/netforce_clinic/models/__init__.py +++ b/netforce_clinic/models/__init__.py @@ -31,3 +31,4 @@ from . import file_sheet from . import cycle from . import gen_visit from . import gen_visit_line +from . import report_hd_monthly diff --git a/netforce_clinic/models/report_hd.py b/netforce_clinic/models/report_hd.py index 6607a4d..b2ec68d 100644 --- a/netforce_clinic/models/report_hd.py +++ b/netforce_clinic/models/report_hd.py @@ -9,6 +9,9 @@ class HDReport(Model): _fields={ "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_stop": fields.DateTime("Time stop",required=False,search=True), "cycle_id": fields.Many2One("clinic.cycle","Cycle"), @@ -23,7 +26,7 @@ class HDReport(Model): _order="cycle_id desc" - def get_report_data(self,ids,context={}): + def get_report_data(self,ids,context={}): PATIENT_TYPE={ "mg":"Medical Government", "sc":"Social Security", @@ -44,10 +47,18 @@ class HDReport(Model): dom.append([ '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_stop', "<=", date+" 23:59:59"]) - print("dom ", dom) - lines=[] + dom.append(['time_stop',"<=", date+" 23:59:59"]) + + lines=[] cycles=[] index=0 no_patient=0 diff --git a/netforce_clinic/models/report_hd_monthly.py b/netforce_clinic/models/report_hd_monthly.py new file mode 100644 index 0000000..5989303 --- /dev/null +++ b/netforce_clinic/models/report_hd_monthly.py @@ -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() diff --git a/netforce_clinic/reports/hd_report_monthly.xlsx b/netforce_clinic/reports/hd_report_monthly.xlsx new file mode 100644 index 0000000..117d38d Binary files /dev/null and b/netforce_clinic/reports/hd_report_monthly.xlsx differ diff --git a/netforce_clinic/templates/report_hd_monthly.hbs b/netforce_clinic/templates/report_hd_monthly.hbs new file mode 100644 index 0000000..f72cf03 --- /dev/null +++ b/netforce_clinic/templates/report_hd_monthly.hbs @@ -0,0 +1,95 @@ +
+

+ Summary of the Hemodialysis +

+

+ [Ratchawat : Saamsan4]
+ As at October 2014 +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ The number of times the Hemodialysis + + Current month + + xxxx times +
+ Many patients come from + + Previous month + + xxxx person +
+ Number of new patients + + Current month + + xxxx person +
+ Number of patients discharged + + Current month + + xxxx person +
+ Number of patients to raise + + Current month + + xxxx person +
+ Number of patients withdrawn SSO + + + xxxx person +
+ Many patients pay themselves + + + xxxx person +
diff --git a/netforce_clinic/templates/report_hd_monthly.hbs~ b/netforce_clinic/templates/report_hd_monthly.hbs~ new file mode 100644 index 0000000..f72cf03 --- /dev/null +++ b/netforce_clinic/templates/report_hd_monthly.hbs~ @@ -0,0 +1,95 @@ +
+

+ Summary of the Hemodialysis +

+

+ [Ratchawat : Saamsan4]
+ As at October 2014 +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ The number of times the Hemodialysis + + Current month + + xxxx times +
+ Many patients come from + + Previous month + + xxxx person +
+ Number of new patients + + Current month + + xxxx person +
+ Number of patients discharged + + Current month + + xxxx person +
+ Number of patients to raise + + Current month + + xxxx person +
+ Number of patients withdrawn SSO + + + xxxx person +
+ Many patients pay themselves + + + xxxx person +