refactor
parent
add077636e
commit
bc433b8b8b
|
@ -1,8 +1,8 @@
|
|||
<action> -->
|
||||
<field name="string">HD Report Detail</field>
|
||||
<field name="view_cls">report</field>
|
||||
<field name="model">clinic.report.hd.detail</field>
|
||||
<field name="report_template">report_hd_detail</field>
|
||||
<field name="report_template_xls">report_hd_detail</field>
|
||||
<field name="model">clinic.report.hd.case.detail</field>
|
||||
<field name="report_template">report_hd_case_detail</field>
|
||||
<field name="report_template_xls">report_hd_case_detail</field>
|
||||
<field name="menu">clinic_menu</field>
|
||||
</action>
|
|
@ -1,8 +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="model">clinic.report.hd.case.medical</field>
|
||||
<field name="report_template">report_hd_case_medical</field>
|
||||
<field name="report_template_xls">report_hd_case_medical</field>
|
||||
<field name="menu">clinic_menu</field>
|
||||
</action>
|
|
@ -1,8 +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="model">clinic.report.hd.case.payment</field>
|
||||
<field name="report_template">report_hd_case_payment</field>
|
||||
<field name="report_template_xls">report_hd_case_payment</field>
|
||||
<field name="menu">clinic_menu</field>
|
||||
</action>
|
|
@ -1,8 +1,8 @@
|
|||
<action>
|
||||
<field name="string">HD Report Summary</field>
|
||||
<field name="view_cls">report</field>
|
||||
<field name="model">clinic.report.hd.summary</field>
|
||||
<field name="report_template">report_hd_summary</field>
|
||||
<field name="report_template_xls">report_hd_summary</field>
|
||||
<field name="model">clinic.report.hd.case.summary</field>
|
||||
<field name="report_template">report_hd_case_summary</field>
|
||||
<field name="report_template_xls">report_hd_case_summary</field>
|
||||
<field name="menu">clinic_menu</field>
|
||||
</action>
|
|
@ -1,5 +1,5 @@
|
|||
<action>
|
||||
<field name="string">Schedules</field>
|
||||
<field name="string">Nurse Schedules</field>
|
||||
<field name="view_cls">multi_view</field>
|
||||
<field name="model">clinic.schedule</field>
|
||||
<field name="modes">calendar,list,page,form</field>
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
<field name="patient_categ_id" span="3"/>
|
||||
<field name="doctor_id" span="3"/>
|
||||
<field name="nurse_categ_id" span="3"/>
|
||||
<field name="patient_type" span="3"/>
|
||||
<field name="department_id" span="3"/>
|
||||
<field name="patient_type" span="3"/>
|
||||
</group>
|
||||
<separator string="Select Days"/>
|
||||
<group form_layout="stacked">
|
||||
|
@ -20,10 +20,11 @@
|
|||
<field name="sathurday" span="3"/>
|
||||
<field name="sunday" span="3"/>
|
||||
</group>
|
||||
<separator string="Manual"/>
|
||||
<tabs>
|
||||
<tab string="Patients">
|
||||
<group form_layout="stacked">
|
||||
<field name="patient_lines" nolabel="1">
|
||||
<field name="patient_lines" nolabel="1" span="6">
|
||||
<list>
|
||||
<field name="patient_id"/>
|
||||
</list>
|
||||
|
@ -32,7 +33,7 @@
|
|||
</tab>
|
||||
<tab string="Nurses">
|
||||
<group form_layout="stacked">
|
||||
<field name="nurse_lines" nolabel="1">
|
||||
<field name="nurse_lines" nolabel="1" span="6">
|
||||
<list>
|
||||
<field name="nurse_id"/>
|
||||
</list>
|
||||
|
|
|
@ -24,24 +24,28 @@
|
|||
</item>
|
||||
<item string="Cycles">
|
||||
<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 Dialy" action="clinic_cycle_dialy"/>
|
||||
</item>
|
||||
<item string="Schedules" action="clinic_schedule"/>
|
||||
<item string="Nurse Schedules" action="clinic_schedule"/>
|
||||
<item string="Visits">
|
||||
<item string="Visits" action="clinic_visit"/>
|
||||
<item string="Visit Dialy" action="clinic_visit_dialy"/>
|
||||
<item string="Generate Visit" action="clinic_gen_visit_form"/>
|
||||
</item>
|
||||
<item string="HD Cases" action="clinic_hd_case"/>
|
||||
<item string="Reports">
|
||||
<item string="HD Detail" action="clinic_report_hd_detail"/>
|
||||
<item string="HD Summary" action="clinic_report_hd_summary"/>
|
||||
<item string="Medical Summary" action="clinic_report_hd_medical"/>
|
||||
<item string="Payment Summary" action="clinic_report_hd_payment"/>"
|
||||
<item string="HD Cases">
|
||||
<item string="HD Cases" action="clinic_hd_case"/>
|
||||
<divider/>
|
||||
<header string="REPORTS"/>
|
||||
<item string="HD Summary" action="clinic_report_hd_case_summary"/>
|
||||
<item string="HD Detail" action="clinic_report_hd_case_detail"/>
|
||||
<header string="REPORT SETTINGS"/>
|
||||
<item string="Topics" action="clinic_translate"/>
|
||||
</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="Departments" action="clinic_department"/>
|
||||
<item string="Clinic Settings" action="clinic_setting"/>
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<form model="clinic.report.hd.detail">
|
||||
<form model="clinic.report.hd.case.detail">
|
||||
<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/>
|
|
@ -1,3 +1,3 @@
|
|||
<form model="clinic.report.hd.medical">
|
||||
<form model="clinic.report.hd.case.medical">
|
||||
<field name="date" mode="month" span="2"/>
|
||||
</form>
|
|
@ -1,4 +1,4 @@
|
|||
<form model="clinic.report.hd.payment">
|
||||
<form model="clinic.report.hd.case.payment">
|
||||
<group>
|
||||
<field name="patient_id" span="3"/>
|
||||
<field name="type" span="3"/>
|
|
@ -1,3 +1,3 @@
|
|||
<form model="clinic.report.hd.summary">
|
||||
<form model="clinic.report.hd.case.summary">
|
||||
<field name="date" mode="month" span="2"/>
|
||||
</form>
|
|
@ -7,7 +7,7 @@
|
|||
</head>
|
||||
<group form_layout="stacked">
|
||||
<field name="time_start" span="3"/>
|
||||
<field name="time_start" span="3"/>
|
||||
<field name="time_stop" span="3"/>
|
||||
<field name="cycle_id" span="3"/>
|
||||
<newline/>
|
||||
<field name="nurses" span="8"/>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<list model="clinic.schedule">
|
||||
<field name="name"/>
|
||||
<field name="time_start"/>
|
||||
<field name="time_start"/>
|
||||
<field name="time_stop"/>
|
||||
<field name="state"/>
|
||||
</list>
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
from . import utils
|
||||
from . import setting
|
||||
from . import cause_chronic
|
||||
from . import comorbidity
|
||||
|
@ -30,11 +31,11 @@ from . import cycle_item_doctor
|
|||
from . import cycle_item_line
|
||||
from . import gen_visit
|
||||
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_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 import_data_mg
|
||||
from . import import_data_nhso
|
||||
|
|
|
@ -3,8 +3,8 @@ import time
|
|||
from netforce.model import Model, fields, get_model
|
||||
|
||||
|
||||
class ReportHDDetail(Model):
|
||||
_name="clinic.report.hd.detail"
|
||||
class ReportHDCaseDetail(Model):
|
||||
_name="clinic.report.hd.case.detail"
|
||||
_string="Hemodialysis Report Detail"
|
||||
_transient=True
|
||||
|
||||
|
@ -159,4 +159,4 @@ class ReportHDDetail(Model):
|
|||
}
|
||||
return data
|
||||
|
||||
ReportHDDetail.register()
|
||||
ReportHDCaseDetail.register()
|
|
@ -2,9 +2,8 @@ import time
|
|||
|
||||
from netforce.model import Model, fields, get_model
|
||||
|
||||
|
||||
class ReportHDPayment(Model):
|
||||
_name="clinic.report.hd.payment"
|
||||
class ReportHDCasePayment(Model):
|
||||
_name="clinic.report.hd.case.payment"
|
||||
_string="Hemodialysis Report Payment"
|
||||
_transient=True
|
||||
|
||||
|
@ -171,4 +170,4 @@ class ReportHDPayment(Model):
|
|||
}
|
||||
return data
|
||||
|
||||
ReportHDPayment.register()
|
||||
ReportHDCasePayment.register()
|
|
@ -3,10 +3,11 @@ import time
|
|||
from datetime import datetime
|
||||
from calendar import monthrange
|
||||
from netforce.model import Model, fields, get_model
|
||||
#from netforce.access import get_active_company
|
||||
|
||||
class ReportHDSummary(Model):
|
||||
_name="clinic.report.hd.summary"
|
||||
from . import utils
|
||||
|
||||
class ReportHDCaseSummary(Model):
|
||||
_name="clinic.report.hd.case.summary"
|
||||
_string="Hemodialysis Report Summary"
|
||||
_transient=True
|
||||
|
||||
|
@ -33,17 +34,18 @@ class ReportHDSummary(Model):
|
|||
weekday, total_day=monthrange(year, month)
|
||||
#date_from="%s-%s-01"%(year,month)
|
||||
#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)
|
||||
if next_month == 13:
|
||||
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
|
||||
if previous_month == 0:
|
||||
previous_month = 12
|
||||
#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_stop='2014-%s-%s'%(month,total_day)
|
||||
|
@ -51,8 +53,6 @@ class ReportHDSummary(Model):
|
|||
|
||||
|
||||
dom=[]
|
||||
dom.append(['type','=','mg'])
|
||||
patients_mg=len(get_model("clinic.patient").search(dom))
|
||||
dom.append(['type','=','sc'])
|
||||
patients_sc=len(get_model("clinic.patient").search(dom))
|
||||
dom.append(['type','=','nhso'])
|
||||
|
@ -124,20 +124,13 @@ class ReportHDSummary(Model):
|
|||
'date_to': time_stop,
|
||||
},
|
||||
'topic7':
|
||||
{
|
||||
'month':'',
|
||||
'amount': patients_mg,
|
||||
'date_from': time_start,
|
||||
'date_to': time_stop,
|
||||
},
|
||||
'topic8':
|
||||
{
|
||||
'month':'',
|
||||
'amount': patients_nhso,
|
||||
'date_from': time_start,
|
||||
'date_to': time_stop,
|
||||
},
|
||||
'topic9':
|
||||
'topic8':
|
||||
{
|
||||
'month': '',
|
||||
'amount': patients_pn,
|
||||
|
@ -147,19 +140,41 @@ class ReportHDSummary(Model):
|
|||
}
|
||||
|
||||
lines=[]
|
||||
for item in get_model("clinic.translate").search_browse([]):
|
||||
topic=item.org
|
||||
line=items.get(topic,{})
|
||||
line['topic']=item.tr
|
||||
index=1
|
||||
for item in items:
|
||||
topic='topic%s'%index
|
||||
name=utils.TOPICS[topic]['name']
|
||||
unit=utils.TOPICS[topic]['unit']
|
||||
line=items[topic]
|
||||
line['topic']=name
|
||||
line['unit']=unit
|
||||
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={
|
||||
'month': month_str,
|
||||
'year': year,
|
||||
'lines': lines,
|
||||
'new_pt_lines': new_pt_lines,
|
||||
'resign_pt_lines': resign_pt_lines,
|
||||
'company_name': company_name,
|
||||
}
|
||||
return data
|
||||
|
||||
|
||||
ReportHDSummary.register()
|
||||
ReportHDCaseSummary.register()
|
|
@ -1,9 +1,11 @@
|
|||
from datetime import datetime, timedelta
|
||||
|
||||
from netforce.model import Model, fields
|
||||
from netforce.access import get_active_company
|
||||
|
||||
class Schedule(Model):
|
||||
_name="clinic.schedule"
|
||||
_string="Schedule"
|
||||
_string="Nurse Schedule"
|
||||
#_field_name="cycle_id"
|
||||
|
||||
def _get_name(self,ids,context={}):
|
||||
|
@ -25,6 +27,9 @@ class Schedule(Model):
|
|||
|
||||
_defaults={
|
||||
"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={}):
|
||||
|
|
|
@ -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': 'คน'},
|
||||
}
|
|
@ -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>
|
|
@ -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>
|
|
@ -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>
|
Loading…
Reference in New Issue