conv_bal
watcha.h 2014-11-03 18:22:48 +07:00
parent add077636e
commit bc433b8b8b
30 changed files with 205 additions and 128 deletions

View File

@ -1,8 +1,8 @@
<action> --> <action> -->
<field name="string">HD Report Detail</field> <field name="string">HD Report Detail</field>
<field name="view_cls">report</field> <field name="view_cls">report</field>
<field name="model">clinic.report.hd.detail</field> <field name="model">clinic.report.hd.case.detail</field>
<field name="report_template">report_hd_detail</field> <field name="report_template">report_hd_case_detail</field>
<field name="report_template_xls">report_hd_detail</field> <field name="report_template_xls">report_hd_case_detail</field>
<field name="menu">clinic_menu</field> <field name="menu">clinic_menu</field>
</action> </action>

View File

@ -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.medical</field> <field name="model">clinic.report.hd.case.medical</field>
<field name="report_template">report_hd_medical</field> <field name="report_template">report_hd_case_medical</field>
<field name="report_template_xls">report_hd_medical</field> <field name="report_template_xls">report_hd_case_medical</field>
<field name="menu">clinic_menu</field> <field name="menu">clinic_menu</field>
</action> </action>

View File

@ -1,8 +1,8 @@
<action> <action>
<field name="string">Payment Report Summary</field> <field name="string">Payment Report Summary</field>
<field name="view_cls">report</field> <field name="view_cls">report</field>
<field name="model">clinic.report.hd.payment</field> <field name="model">clinic.report.hd.case.payment</field>
<field name="report_template">report_hd_payment</field> <field name="report_template">report_hd_case_payment</field>
<field name="report_template_xls">report_hd_payment</field> <field name="report_template_xls">report_hd_case_payment</field>
<field name="menu">clinic_menu</field> <field name="menu">clinic_menu</field>
</action> </action>

View File

@ -1,8 +1,8 @@
<action> <action>
<field name="string">HD Report Summary</field> <field name="string">HD Report Summary</field>
<field name="view_cls">report</field> <field name="view_cls">report</field>
<field name="model">clinic.report.hd.summary</field> <field name="model">clinic.report.hd.case.summary</field>
<field name="report_template">report_hd_summary</field> <field name="report_template">report_hd_case_summary</field>
<field name="report_template_xls">report_hd_summary</field> <field name="report_template_xls">report_hd_case_summary</field>
<field name="menu">clinic_menu</field> <field name="menu">clinic_menu</field>
</action> </action>

View File

@ -1,5 +1,5 @@
<action> <action>
<field name="string">Schedules</field> <field name="string">Nurse Schedules</field>
<field name="view_cls">multi_view</field> <field name="view_cls">multi_view</field>
<field name="model">clinic.schedule</field> <field name="model">clinic.schedule</field>
<field name="modes">calendar,list,page,form</field> <field name="modes">calendar,list,page,form</field>

View File

@ -7,8 +7,8 @@
<field name="patient_categ_id" span="3"/> <field name="patient_categ_id" span="3"/>
<field name="doctor_id" span="3"/> <field name="doctor_id" span="3"/>
<field name="nurse_categ_id" span="3"/> <field name="nurse_categ_id" span="3"/>
<field name="patient_type" span="3"/>
<field name="department_id" span="3"/> <field name="department_id" span="3"/>
<field name="patient_type" span="3"/>
</group> </group>
<separator string="Select Days"/> <separator string="Select Days"/>
<group form_layout="stacked"> <group form_layout="stacked">
@ -20,10 +20,11 @@
<field name="sathurday" span="3"/> <field name="sathurday" span="3"/>
<field name="sunday" span="3"/> <field name="sunday" span="3"/>
</group> </group>
<separator string="Manual"/>
<tabs> <tabs>
<tab string="Patients"> <tab string="Patients">
<group form_layout="stacked"> <group form_layout="stacked">
<field name="patient_lines" nolabel="1"> <field name="patient_lines" nolabel="1" span="6">
<list> <list>
<field name="patient_id"/> <field name="patient_id"/>
</list> </list>
@ -32,7 +33,7 @@
</tab> </tab>
<tab string="Nurses"> <tab string="Nurses">
<group form_layout="stacked"> <group form_layout="stacked">
<field name="nurse_lines" nolabel="1"> <field name="nurse_lines" nolabel="1" span="6">
<list> <list>
<field name="nurse_id"/> <field name="nurse_id"/>
</list> </list>

View File

@ -24,24 +24,28 @@
</item> </item>
<item string="Cycles"> <item string="Cycles">
<item string="Cycles" action="clinic_cycle"/> <item string="Cycles" action="clinic_cycle"/>
<item string="Cycle Dialy" action="clinic_cycle_dialy"/>
<item string="Cycle Items" action="clinic_cycle_item"/> <item string="Cycle Items" action="clinic_cycle_item"/>
<item string="Cycle Dialy" action="clinic_cycle_dialy"/>
</item> </item>
<item string="Schedules" action="clinic_schedule"/> <item string="Nurse Schedules" action="clinic_schedule"/>
<item string="Visits"> <item string="Visits">
<item string="Visits" action="clinic_visit"/> <item string="Visits" action="clinic_visit"/>
<item string="Visit Dialy" action="clinic_visit_dialy"/> <item string="Visit Dialy" action="clinic_visit_dialy"/>
<item string="Generate Visit" action="clinic_gen_visit_form"/> <item string="Generate Visit" action="clinic_gen_visit_form"/>
</item> </item>
<item string="HD Cases">
<item string="HD Cases" action="clinic_hd_case"/> <item string="HD Cases" action="clinic_hd_case"/>
<item string="Reports"> <divider/>
<item string="HD Detail" action="clinic_report_hd_detail"/> <header string="REPORTS"/>
<item string="HD Summary" action="clinic_report_hd_summary"/> <item string="HD Summary" action="clinic_report_hd_case_summary"/>
<item string="Medical Summary" action="clinic_report_hd_medical"/> <item string="HD Detail" action="clinic_report_hd_case_detail"/>
<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>
<item string="Reports">
<item string="Medical Summary" action="clinic_report_hd_case_medical"/>
<item string="Payment Summary" action="clinic_report_hd_case_payment"/>"
</item>
<item string="Settings"> <item string="Settings">
<item string="Departments" action="clinic_department"/> <item string="Departments" action="clinic_department"/>
<item string="Clinic Settings" action="clinic_setting"/> <item string="Clinic Settings" action="clinic_setting"/>

View File

@ -1,7 +1,6 @@
<form model="clinic.report.hd.detail"> <form model="clinic.report.hd.case.detail">
<group> <group>
<field name="patient_id" span="3"/> <field name="patient_id" span="3"/>
<!--<field name="type" span="3"/>-->
<field name="doctor_id" span="3"/> <field name="doctor_id" span="3"/>
<field name="nurse_id" span="3"/> <field name="nurse_id" span="3"/>
<newline/> <newline/>

View File

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

View File

@ -1,4 +1,4 @@
<form model="clinic.report.hd.payment"> <form model="clinic.report.hd.case.payment">
<group> <group>
<field name="patient_id" span="3"/> <field name="patient_id" span="3"/>
<field name="type" span="3"/> <field name="type" span="3"/>

View File

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

View File

@ -7,7 +7,7 @@
</head> </head>
<group form_layout="stacked"> <group form_layout="stacked">
<field name="time_start" span="3"/> <field name="time_start" span="3"/>
<field name="time_start" span="3"/> <field name="time_stop" span="3"/>
<field name="cycle_id" span="3"/> <field name="cycle_id" span="3"/>
<newline/> <newline/>
<field name="nurses" span="8"/> <field name="nurses" span="8"/>

View File

@ -1,6 +1,6 @@
<list model="clinic.schedule"> <list model="clinic.schedule">
<field name="name"/> <field name="name"/>
<field name="time_start"/> <field name="time_start"/>
<field name="time_start"/> <field name="time_stop"/>
<field name="state"/> <field name="state"/>
</list> </list>

View File

@ -1,3 +1,4 @@
from . import utils
from . import setting from . import setting
from . import cause_chronic from . import cause_chronic
from . import comorbidity from . import comorbidity
@ -30,11 +31,11 @@ from . import cycle_item_doctor
from . import cycle_item_line from . import cycle_item_line
from . import gen_visit from . import gen_visit
from . import gen_visit_line from . import gen_visit_line
from . import report_hd_detail
from . import report_hd_summary
from . import report_hd_medical
from . import report_hd_payment
from . import report_clinic from . import report_clinic
from . import report_hd_case_detail
from . import report_hd_case_summary
from . import report_hd_case_medical
from . import report_hd_case_payment
from . import fin_setting from . import fin_setting
from . import import_data_mg from . import import_data_mg
from . import import_data_nhso from . import import_data_nhso

View File

@ -3,8 +3,8 @@ import time
from netforce.model import Model, fields, get_model from netforce.model import Model, fields, get_model
class ReportHDDetail(Model): class ReportHDCaseDetail(Model):
_name="clinic.report.hd.detail" _name="clinic.report.hd.case.detail"
_string="Hemodialysis Report Detail" _string="Hemodialysis Report Detail"
_transient=True _transient=True
@ -159,4 +159,4 @@ class ReportHDDetail(Model):
} }
return data return data
ReportHDDetail.register() ReportHDCaseDetail.register()

View File

@ -2,9 +2,8 @@ import time
from netforce.model import Model, fields, get_model from netforce.model import Model, fields, get_model
class ReportHDCasePayment(Model):
class ReportHDPayment(Model): _name="clinic.report.hd.case.payment"
_name="clinic.report.hd.payment"
_string="Hemodialysis Report Payment" _string="Hemodialysis Report Payment"
_transient=True _transient=True
@ -171,4 +170,4 @@ class ReportHDPayment(Model):
} }
return data return data
ReportHDPayment.register() ReportHDCasePayment.register()

View File

@ -3,10 +3,11 @@ import time
from datetime import datetime from datetime import datetime
from calendar import monthrange from calendar import monthrange
from netforce.model import Model, fields, get_model from netforce.model import Model, fields, get_model
#from netforce.access import get_active_company
class ReportHDSummary(Model): from . import utils
_name="clinic.report.hd.summary"
class ReportHDCaseSummary(Model):
_name="clinic.report.hd.case.summary"
_string="Hemodialysis Report Summary" _string="Hemodialysis Report Summary"
_transient=True _transient=True
@ -33,17 +34,18 @@ class ReportHDSummary(Model):
weekday, total_day=monthrange(year, month) weekday, total_day=monthrange(year, month)
#date_from="%s-%s-01"%(year,month) #date_from="%s-%s-01"%(year,month)
#date_to="%s-%s-%s"%(year,month,total_day) #date_to="%s-%s-%s"%(year,month,total_day)
month_str=datetime.strptime(date,'%Y-%m-%d').strftime("%B") #month_str=datetime.strptime(date,'%Y-%m-%d').strftime("%B")
month_str=utils.MONTHS['th_TH'][int(datetime.strptime(date,'%Y-%m-%d').strftime('%m'))]
next_month = str(month + 1) next_month = str(month + 1)
if next_month == 13: if next_month == 13:
next_month = 12 next_month = 12
next_month_str=datetime.strptime(next_month,'%m').strftime("%B") next_month_str=utils.MONTHS['th_TH'][int(datetime.strptime(next_month,'%m').strftime("%m"))]
previous_month = month-1 previous_month = month-1
if previous_month == 0: if previous_month == 0:
previous_month = 12 previous_month = 12
#tip previous_month=str(month-1 == 0 and 12 or month) #tip previous_month=str(month-1 == 0 and 12 or month)
previous_month_str=datetime.strptime('%s'%previous_month,'%m').strftime("%B") previous_month_str=utils.MONTHS['th_TH'][int(datetime.strptime('%s'%previous_month,'%m').strftime("%m"))]
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)
@ -51,8 +53,6 @@ class ReportHDSummary(Model):
dom=[] dom=[]
dom.append(['type','=','mg'])
patients_mg=len(get_model("clinic.patient").search(dom))
dom.append(['type','=','sc']) dom.append(['type','=','sc'])
patients_sc=len(get_model("clinic.patient").search(dom)) patients_sc=len(get_model("clinic.patient").search(dom))
dom.append(['type','=','nhso']) dom.append(['type','=','nhso'])
@ -124,20 +124,13 @@ class ReportHDSummary(Model):
'date_to': time_stop, 'date_to': time_stop,
}, },
'topic7': 'topic7':
{
'month':'',
'amount': patients_mg,
'date_from': time_start,
'date_to': time_stop,
},
'topic8':
{ {
'month':'', 'month':'',
'amount': patients_nhso, 'amount': patients_nhso,
'date_from': time_start, 'date_from': time_start,
'date_to': time_stop, 'date_to': time_stop,
}, },
'topic9': 'topic8':
{ {
'month': '', 'month': '',
'amount': patients_pn, 'amount': patients_pn,
@ -147,19 +140,41 @@ class ReportHDSummary(Model):
} }
lines=[] lines=[]
for item in get_model("clinic.translate").search_browse([]): index=1
topic=item.org for item in items:
line=items.get(topic,{}) topic='topic%s'%index
line['topic']=item.tr name=utils.TOPICS[topic]['name']
unit=utils.TOPICS[topic]['unit']
line=items[topic]
line['topic']=name
line['unit']=unit
lines.append(line) lines.append(line)
index+=1
new_pt_lines=[]
for i in range(3):
new_pt_lines.append({
'no': i+1,
'name': 'xxxxx',
'note': '',
})
resign_pt_lines=[]
for i in range(5):
resign_pt_lines.append({
'no': i+1,
'name': 'xxxxx',
'note': '',
})
data={ data={
'month': month_str, 'month': month_str,
'year': year, 'year': year,
'lines': lines, 'lines': lines,
'new_pt_lines': new_pt_lines,
'resign_pt_lines': resign_pt_lines,
'company_name': company_name, 'company_name': company_name,
} }
return data return data
ReportHDCaseSummary.register()
ReportHDSummary.register()

View File

@ -1,9 +1,11 @@
from datetime import datetime, timedelta
from netforce.model import Model, fields from netforce.model import Model, fields
from netforce.access import get_active_company from netforce.access import get_active_company
class Schedule(Model): class Schedule(Model):
_name="clinic.schedule" _name="clinic.schedule"
_string="Schedule" _string="Nurse Schedule"
#_field_name="cycle_id" #_field_name="cycle_id"
def _get_name(self,ids,context={}): def _get_name(self,ids,context={}):
@ -25,6 +27,9 @@ class Schedule(Model):
_defaults={ _defaults={
"company_id": lambda *a: get_active_company(), "company_id": lambda *a: get_active_company(),
'time_start': lambda *a: datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
'time_stop': lambda *a: (datetime.now()+timedelta(seconds=3600)).strftime("%Y-%m-%d %H:%M:%S"),
'state': 'draft',
} }
def confirm(self,ids,context={}): def confirm(self,ids,context={}):

View File

@ -0,0 +1,17 @@
DAYS={ 'th_TH': ['จันทร์', 'อังคาร', 'พุธ', 'พฤหัสบดี', 'ศุกร์', 'เสาร์', 'อาทิตย์']
, 'en_US': ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
}
MONTHS={ 'th_TH': [None, 'มกราคม', 'กุมภาพันธ์', 'มีนาคม', 'เมษายน', 'พฤษภาคม', 'มิถุนายน', 'กรกฎาคม', 'สิงหาคม', 'กันยายน', 'ตุลาคม', 'พฤศจิกายน', 'ธันวาคม']
, 'en_US': [None, 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
}
TOPICS={
'topic1': {'name': 'จำนวนครั้งการทำ Hemodialysis', 'unit': 'ครั้ง'},
'topic2': {'name': 'จำนวนผู้ป่วยยกมาจากเดือน', 'unit': 'คน'},
'topic3': {'name': 'จำนวนผู้ป่วยรับใหม่เดือน', 'unit': 'คน'},
'topic4': {'name': 'จำนวนผู้ป่วยจำหน่ายเดือน', 'unit': 'คน'},
'topic5': {'name': 'จำนวนผู้ป่วยยกไปเดือน', 'unit': 'คน'},
'topic6': {'name': 'จำนวนผู้ป่วยเบิก ปกส.', 'unit': 'คน'},
'topic7': {'name': 'จำนวนผู้ป่วยเบิก สปกส.', 'unit': 'คน'},
'topic8': {'name': 'จำนวนผู้ป่วยจ่ายเอง', 'unit': 'คน'},
}

View File

@ -0,0 +1,99 @@
<center>
<h2>
ใบสรุปการทำ Hemodialysis
</h2>
<h3>
ศูนย์ไตเทียมราชวัตร {{company_name}}<br/>
</h3>
<h4>
ประจำเดือน {{month}} {{year}}
</h4>
</center>
<table class="table">
<thead class="scroll-header">
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
</thead>
<tbody>
{{#each lines}}
<tr>
<td>{{topic}}</td>
<td>{{month}}</td>
<td>เท่ากับ</td>
<td><a style="text-decoration: underline" href="ui#name=clinic_report_hd_detail&defaults.date_from={{date_from}}&defaults.date_to={{date_to}}" >{{amount}}</a></td>
<td>{{unit}}</td>
</tr>
{{/each}}
</tbody>
</table>
<table class="table">
<tr>
<td>
<table class="table">
<thead>
<th><h4>รายชื่อผู้ป่วยรับใหม่</h4></th>
<th></th>
<th></th>
</thead>
<tbody>
{{#each new_pt_lines}}
<tr>
<td>{{no}}</td>
<td>{{name}}</td>
<td>{{note}}</td>
</tr>
{{/each}}
</tbody>
<tfoot>
</tfoot>
</table>
</td>
<td>
<table class="table">
<thead>
<th><h4>รายชื่อผู้ป่วยจำหน่าย<h4></th>
<th></th>
<th></th>
</thead>
<tbody>
{{#each resign_pt_lines}}
<tr>
<td>{{no}}</td>
<td>{{name}}</td>
<td>{{note}}</td>
</tr>
{{/each}}
</tbody>
<tfoot>
</tfoot>
</table>
</td>
</tr>
</table>
<table>
<tr>
<td>
<table class="table">
<thead>
<th><h4>รวมจำนวนยาที่ใช้ประจำเดือน</h4></th>
<th></th>
<th></th>
<th></th>
</thead>
<tbody>
<tr>
<td><b>ปกส.</b></td>
<td><b>uc</b></td>
<td><b>ซื้อ</b></td>
<td><b>รวม</b></td>
</tr>
</tbody>
<tfoot>
</tfoot>
</table>
</td>
</tr>
</table>

View File

@ -1,29 +0,0 @@
<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>

View File

@ -1,34 +0,0 @@
<center>
<h2>
Summary of the Hemodialysis
</h2>
<h3>
[{{company_name}}]<br/>
</h3>
<h4>
As at {{month}} {{year}}
</h4>
</center>
<table class="table table-bordered">
<thead class="scroll-header">
<th>Topic</th>
<th>Month</th>
<th>Amount</th>
</thead>
<tbody>
{{#each lines}}
<tr>
<td>{{topic}}</td>
<td>{{month}}</td>
<td><a style="text-decoration: underline" href="ui#name=clinic_report_hd_detail&defaults.date_from={{date_from}}&defaults.date_to={{date_to}}" >{{amount}}</a></td>
</tr>
{{/each}}
</tbody>
<tfoot>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
</tfoot>
</table>