improve visit board (add icon)

conv_bal
watcha.h@almacom.co.th 2015-04-30 16:41:34 +07:00
parent 4cda6b2cac
commit 70dc4dbb6a
8 changed files with 73 additions and 41 deletions

View File

@ -0,0 +1,6 @@
<action>
<field name="string">HDCase Staff</field>
<field name="view_cls">multi_view</field>
<field name="model">clinic.hd.case.staff</field>
<field name="menu">clinic_menu</field>
</action>

View File

@ -0,0 +1,6 @@
<form model="clinic.hd.case.staff">
<field name="hd_case_id"/>
<field name="type"/>
<field name="staff_id"/>
<field name="priop"/>
</form>

View File

@ -0,0 +1,6 @@
<list model="clinic.hd.case.staff">
<field name="hd_case_id"/>
<field name="type"/>
<field name="staff_id"/>
<field name="priop"/>
</list>

View File

@ -12,7 +12,7 @@ class HDCasePopupDiscontinue(Model):
def _get_hd_case_id(self,context={}):
hd_case_id=context.get("refer_id")
print("hd case deault")
print("clinic.hd.case.popup.discontinue default")
if not hd_case_id:
return None
return int(hd_case_id)

View File

@ -16,7 +16,7 @@ class HDCasePopupDlz(Model):
def _get_hd_case_id(self,context={}):
hd_case_id=context.get("refer_id")
print("hd case deault")
print("clinic.hd.case.popup.dlz default")
if not hd_case_id:
return None
return int(hd_case_id)

View File

@ -1,3 +1,5 @@
import time
from netforce.model import Model, fields
class HDCaseStaff(Model):
@ -14,30 +16,30 @@ class HDCaseStaff(Model):
'patient_id': patient.id,
'patient_type_id': patient.type_id.id,
'cycle_id': hd_case.cycle_id.id,
'date': hd_case.date,
'department_id': hd_case.department_id.id,
'state': hd_case.state,
}
return res
_fields={
"hd_case_id": fields.Many2One("clinic.hd.case","HD Case",required=True,on_delete="cascade"),
"hd_case_id": fields.Many2One("clinic.hd.case","HD Case",required=True,on_delete="cascade",search=True),
"staff_id": fields.Many2One("clinic.staff","Doctor",search=True),
"type": fields.Selection([("doctor","Doctor"),('nurse','Nurse'),("staff","Staff")],"Type",required=True),
"priop": fields.Selection([("personal","Personal"),('other','Other')],"Priority"),
"type": fields.Selection([("doctor","Doctor"),('nurse','Nurse'),("staff","Staff")],"Type",required=True,search=True),
"priop": fields.Selection([("personal","Personal"),('other','Other')],"Priority",search=True),
'note': fields.Char("Note"),
'sickbed_id': fields.Many2One("clinic.sickbed","Sickbed",function="_get_all",function_multi=True),
'patient_id': fields.Many2One("clinic.patient","Patient",domain=[['state','=','admit']], function="_get_all",function_multi=True),
'patient_type_id': fields.Many2One("clinic.patient.type","Patient Type",function="_get_all",function_multi=True),
'cycle_id': fields.Many2One("clinic.cycle","Cycle",function="_get_all",function_multi=True),
'department_id': fields.Many2One("clinic.department","Department",function="_get_all",function_multi=True),
'date': fields.Date("Date",function="_get_all",function_multi=True),
'date': fields.Date("Date",search=True),
"state": fields.Selection([("draft","Draft"),('waiting_treatment','Waiting Treatment'),("in_progress","In Progress"),("completed","Finish Treatment"),('paid','Paid'),("waiting_payment","Waiting Payment"),("discountinued","Discountinued"),("cancelled","Cancelled")],"Status",function="_get_all",function_multi=True),
}
_defaults={
'type': 'doctor',
'priop': 'personal',
'date': lambda *a: time.strftime("%Y-%m-%d"),
}
HDCaseStaff.register()

View File

@ -160,22 +160,19 @@ class VisitBoard(Model):
sickbed_name=hd_case.sickbed_id.name or "N/A"
sickbed_id=hd_case.sickbed_id.id
hd_case_id=hd_case.id,
if hd_case.number=='/':
hd_case_number='*Waiting'
hd_case_number='Waiting'
else:
hd_case_number=hd_case.number
hd_case_state=hd_case.state
if hd_case_state=='completed':
visit_color='#99ff99'
hd_case_number+=" (เสร็จสิ้น)"
elif hd_case_state=='in_progress':
hd_case_number+=' (กำลังรักษา)'
visit_color='#f9e37d'
pass
number=visit.number
if number=='/':
number='*Waiting'
number='Waiting'
cycle=visit.cycle_id
patient=visit.patient_id
if not patient.active:
@ -192,9 +189,9 @@ class VisitBoard(Model):
if visit.state=='cancelled':
visit_color='#dbdbdb',
if visit.number=='/':
number='*Cancelled'
number='Cancelled'
else:
number+='*Cancelled'
number+='Cancelled'
line={
'number': number,
'hn_name': hn_name,
@ -214,6 +211,8 @@ class VisitBoard(Model):
'doctor_name': visit.doctor_id.name,
'doctor_id': visit.doctor_id.id,
'hd_case_number': hd_case_number,
'hd_case_state': hd_case_state,
'hd_case_state_txt':HD_STATE.get(hd_case_state,''),
'hd_case_id': hd_case_id,
'visit_color': visit_color,
'date': visit_date,
@ -227,7 +226,6 @@ class VisitBoard(Model):
'details5':'',
'no': no,
'note': visit.note,
'hd_case_state':HD_STATE.get(hd_case_state,''),
}
lines.append(line)
no+=1
@ -305,7 +303,6 @@ class VisitBoard(Model):
'date_from': utils.date2thai(date_from,format='%(d)s %(Tm)s %(By)s',lang="th_TH2"),
'date_to': utils.date2thai(date_to,format='%(d)s %(Tm)s %(By)s',lang="th_TH2"),
}
#set_active_user(user_id)
return data
def onchange_date(self,context={}):

View File

@ -19,28 +19,10 @@
{{#if footer}}
<tr>
<td rowspan="3" align="middle" style="vertical-align:middle; background-color:#4183c4;color:white"><span><b>สรุป</b></span></td>
<!--
<td colspan="12" style="text-align:right; background-color:#dbdbdb"><b>{{details1}}</b></td>
-->
</tr>
<!--
<tr>
<td colspan="12" style="text-align:right; background-color:#dbdbdb"><b>{{details2}}</b></td>
</tr>
-->
<!--
<tr>
<td colspan="12" style="text-align:right; background-color:#dbdbdb"><b>{{details3}}</b></td>
</tr>
-->
<tr>
<td colspan="12" style="text-align:right; background-color:#dbdbdb"><b>{{details4}}</b></td>
</tr>
<!--
<tr>
<td colspan="12" style="text-align:right; background-color:#dbdbdb"><b>{{details5}}</b></td>
</tr>
-->
{{else}}
<tr style="background-color:{{visit_color}}">
{{#if title}}
@ -49,12 +31,17 @@
{{else}}
<td style="background-color:{{cycle_color}};color:white;width:6%"><center>{{cycle_name}}</center></td>
<td style="background-color:{{visit_color}}">{{no}}</td>
<td style="background-color:{{visit_color}};width:8%"><a href="/ui#name=clinic_visit&active_id={{visit_id}}&mode=form">{{number}}</a></td>
<td style="background-color:{{visit_color}};width:8%">
<a href="/ui#name=clinic_visit&active_id={{visit_id}}&mode=form">
{{#ifeq number "Waiting"}}
<span class="glyphicon glyphicon-arrow-right">&nbsp;{{number}}</span>
{{else}}
{{number}}
{{/ifeq}}
</a>
</td>
<td style="background-color:{{visit_color}}">{{hn_name}}</td>
<td style="background-color:{{visit_color}}"><a href="/ui#name=clinic_patient&active_id={{patient_id}}&mode=form">{{patient_name}}</a></td>
<!--
<td style="background-color:{{visit_color}}"><a href="/ui#name=clinic_branch&active_id={{branch_id}}&mode=form">{{branch_name}}</a></td>
-->
<td style="background-color:{{visit_color}}">{{patient_type}}</td>
<td style="background-color:{{visit_color}}"><a href="/ui#name=clinic_staff&active_id={{doctor_id}}&mode=form">{{doctor_name}}</a></td>
<td style="background-color:{{visit_color}}"><a href="/ui#name=clinic_department&active_id={{department_id}}&mode=form">{{department_name}}</a></td>
@ -63,7 +50,35 @@
{{else}}
<td style="background-color:{{visit_color}}">{{sickbed_name}}</td>
{{/if}}
<td style="background-color:{{visit_color}}"><a href="/ui#name=clinic_hd_case&active_id={{hd_case_id}}&mode=form">{{hd_case_number}}</a></td>
<td style="background-color:{{visit_color}}">
<a href="/ui#name=clinic_hd_case&active_id={{hd_case_id}}&mode=form">
{{#ifeq number "Waiting"}}
{{else}}
{{#ifeq number "Cancelled"}}
<!--
<span class="glyphicon glyphicon-thumbs-down">
-->
{{else}}
{{#ifeq hd_case_state "waiting_treatment"}}
<span class="glyphicon glyphicon-arrow-right">
{{else}}
{{#ifeq hd_case_state "in_progress"}}
<span class="glyphicon glyphicon-refresh">
{{else}}
{{#ifeq hd_case_state "cancelled"}}
<span class="glyphicon glyphicon-ban-cycle">
{{else}}
<span class="glyphicon glyphicon-ok">
{{/ifeq}}
{{/ifeq}}
{{/ifeq}}
{{hd_case_number}}
{{/ifeq}}
{{/ifeq}}
</span>
</a>
</td>
{{/if}}
</tr>
{{/if}}