fix error link report_summary

conv_bal
chayut.s 2014-10-20 18:48:39 +07:00
parent 5c897e2cdf
commit 0a4068fd91
23 changed files with 237 additions and 14 deletions

View File

@ -0,0 +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="menu">clinic_menu</field>
</action>

View File

@ -0,0 +1,8 @@
<action>
<field name="string">Medical Report Summary</field>
<field name="view_cls">report</field>
<field name="model">clinic.report.hd.madical</field>
<field name="report_template">report_hd_madical</field>
<field name="report_template_xls">report_hd_madical</field>
<field name="menu">clinic_menu</field>
</action>

View File

@ -0,0 +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="menu">clinic_menu</field>
</action>

View File

@ -0,0 +1,7 @@
<action>
<field name="string">Translation</field>
<field name="view_cls">multi_view</field>
<field name="model">clinic.translate</field>
<field name="modes">list,form</field>
<field name="menu">clinic_menu</field>
</action>

View File

@ -0,0 +1 @@
#

View File

@ -20,12 +20,15 @@
<item string="Treatments" action="clinic_hd_case"/>
<item string="Reports">
<header string="HD CASE"/>
<item string="Daily" action="clinic_report_hd_dialy"/>
<item string="Monthly" action="clinic_report_hd_monthly"/>
<item string="HD Detail" action="clinic_report_hd_detail"/>
<item string="HD Summary" action="clinic_report_hd_summary"/>
<header string="HD Madical"/>
<item string="Madical Summary" action="clinic_report_hd_madical"/>
</item>
<item string="Settings">
<item string="Cycles" action="clinic_cycle"/>
<item string="Departments" action="clinic_department"/>
<item string="Translate" action="clinic_translate"/>
<item string="Clinic Settings" action="clinic_setting"/>
</item>
</menu>

View File

@ -0,0 +1,10 @@
<form model="clinic.report.hd.detail">
<group>
<field name="date_from" span="2"/>
<field name="date_to" 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>
</form>

View File

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

View File

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

View File

@ -0,0 +1,4 @@
<form model="clinic.translate">
<field name="original_string"/>
<field name="translate"/>
</form>

View File

@ -0,0 +1,4 @@
<list model="clinic.translate">
<field name="original_string"/>
<field name="translate"/>
</list>

View File

@ -35,3 +35,4 @@ from . import payment
from . import payment_line
from . import input_data
from . import report_hd_madical
from . import translate

View File

@ -42,7 +42,7 @@ class HDcase(Model):
"epo_tn" : fields.Char("EpoTn (Drug name)"),
"epo_unit" : fields.Integer("EpoUnit (Unit of Used drug)"),
"hct": fields.Integer("HCT %", required=True),
"hct_alert" : fields.Char("",function="onchange_hct",readonly=True,function_multi=True),
"hct_alert" : fields.Char("",readonly=True,function_multi=True),
"check_goverment_pay" : fields.Boolean("The Government Pay"),
"check_personal_pay" : fields.Boolean("Pay yourself"),
"state": fields.Selection([("draft","Draft"),("in_progress","In Progress"),("completed","Completed"),("discountinued","Discountinued"),("in_completed","In completed")],"Status",required=True),
@ -458,6 +458,7 @@ class HDcase(Model):
def onchange_hct(self,context={}):
print(">"*50)
data=context['data']
hct_alert=data.get("hct","")
if(hct_alert<=36):

View File

@ -70,6 +70,10 @@ class ReportHDDetail(Model):
dom.append([
'patient_id','=',obj.patient_id.id,
])
if obj.nurse_id:
dom.append([
'nurse_id','=',obj.nurse_id.id,
])
if obj.doctor_id:
dom.append([
'doctor_id','=',obj.doctor_id.id,

View File

@ -41,33 +41,37 @@ class ReportHDSummary(Model):
#tip previous_month=str(month-1 == 0 and 12 or month)
previous_month_str=datetime.strptime('%s'%previous_month,'%m').strftime("%B")
patients=get_model("clinic.patient").search_browse(['type','=','All'])
time_start='2014-%s-01'%(month) # 2014-10-20
time_stop='2014-%s-%s'%(month,total_day)
dom=[]
dom.append(['time_start','>=',time_start])
dom.append(['time_stop','<=',time_stop])
patients=get_model("clinic.patient").search_browse(['type','=','All'])
new_patients=len(patients)
patients_mg=get_model("clinic.patient").search_browse(['type','=','mg'])
patients_sc=get_model("clinic.patient").search_browse(['type','=','sc'])
patients_nhso=get_model("clinic.patient").search_browse(['type','=','nhso'])
patients_pn=get_model("clinic.patient").search_browse(['type','=','personal'])
new_patients=len(patients)
time_start='2014-%s-01'%(month) # 2014-10-20
time_stop='2014-%s-%s'%(month,total_day)
dom=[]
dom.append(['state','=','completed'])
dom.append(['time_start','>=',time_start])
dom.append(['time_stop','<=',time_stop])
cur_total_case=len(get_model("clinic.hd.case").search(dom))
weekday, prev_total_day=monthrange(year, previous_month)
time_start_pre='2014-%s-01'%(previous_month) # 2014-10-20
time_stop_pre='2014-%s-%s'%(previous_month,prev_total_day)
dom=[]
dom.append(['state','=','completed'])
dom.append(['time_start','>=',time_start_pre])
dom.append(['time_stop','<=',time_stop_pre])
prev_total_case=len(get_model("clinic.hd.case").search(dom))
lines=[
{
'topic': 'The number of times the Hemodialysis',
@ -100,7 +104,7 @@ class ReportHDSummary(Model):
{
'topic':'The number of cases brought',
'month': next_month_str,
'amount': 0,
'amount': 'N/A',
'date_from': time_start,
'date_to': time_stop,
},

View File

@ -17,6 +17,9 @@ class ClinicSetting(Model):
"sc_partner_id": fields.Many2One("partner","Partner Social Security"),
"ar_sc_id": fields.Many2One("account.account","Account Receiveble Social Security"),
"ap_sc_id": fields.Many2One("account.account","Account Payment Social Security"),
#"ori_str": fields.Char("ori_str","Original String"),
#"translate": fields.Char("translate","Translation"),
}
ClinicSetting.register()

View File

@ -0,0 +1,13 @@
from netforce.model import Model, fields
class Translate(Model):
_name="clinic.translate"
_string="Translate"
_fields={
"original_string": fields.Char("original_string","Original String",required=True,search=True),
"translate": fields.Char("translate","Translate"),
}
Translate.register()

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,84 @@
<center>
<h2>Detail of the Hemodialysis</h2>
<h3>Clinic [Ratchawat]</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-striped">
<thead class="scroll-header">
<tr>
<th>
Cycle
</th>
<th>
Patient
</th>
<th>
Doctor
</th>
<th>
Patient Type
</th>
<th>
HD Fee
</th>
<th>
RC.No
</th>
<th>
Dialyzer
</th>
<th>
Nurse
</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}}">
{{#if no_patient}}
<td><b>TOTAL</b></td>
<td>{{no_patient}}</td>
{{else}}
<td></td>
<td>{{patient}}</td>
{{/if}}
<td>
{{doctor}}
</td>
<td>
{{patient_type}}
</td>
<td>
{{total}}
</td>
<td>
{{rc_no}}
</td>
<td>
{{dialyzer_name}}
</td>
<td>
{{nurse}}
</td>
</tr>
{{/each}}
</tbody>
<tfoot>
<tr style="font-weight:bold">
</tr>
</tfoot>
</table>

View File

@ -0,0 +1,29 @@
<center>
<h2>
Summary of the Madical
</h2>
<h3>
[Ratchawat : Saamsan4]<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

@ -0,0 +1,25 @@
<center>
<h2>
Summary of the Hemodialysis
</h2>
<h3>
[Ratchawat : Saamsan4]<br/>
As at {{month}} {{year}}
</h3>
</center>
<table class="table table-striped">
<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>
</table>