conv_bal
watcha.h 2015-05-28 16:27:41 +07:00
parent ad85b78a23
commit 9d7ae15077
7 changed files with 29 additions and 28 deletions

View File

@ -36,7 +36,7 @@
<item string="Visits" action="clinic_visit"/>
<item string="Visit Board" action="clinic_visit_board"/>
<divider/>
<item string="New Visit" action="clinic_visit" action_options="mode=form"/>
<item string="New Tempolary Visit" action="clinic_visit" action_options="mode=form&amp;defaults.manual=true"/>
<!--<item string="Make An Appointment" action="clinic_make_apt"/>-->
</item>
<item string="HD Cases" perm="clinic_hdcase">

View File

@ -16,6 +16,7 @@
<field name="doctor_id" required="1"/>
<field name="department_id" required="1"/>
<field name="walkin"/>
<field name="vascular_acc"/>
<field name="active" invisible="1"/>
<tabs>
<tab string="General">
@ -39,11 +40,11 @@
<field name="phone"/>
<field name="weight"/>
<field name="height"/>
<field name="vascular_acc"/>
<!--<field name="vascular_acc"/>-->
<field name="company_id" invisible="1"/>
</group>
</tab>
<tab string="Health Information">
<tab string="Health Information" perm="clinic_patient_health">
<field name="smoke"/>
<field name="withdrawal"/>
<field name="first_hemodialysis"/>
@ -106,7 +107,7 @@
<group span="4" columns="1">
</group>
</tab>
<tab string="Accounting">
<tab string="Accounting" perm="clinic_patient_account">
<field name="partner_id" domain='[["is_patient","=","true"]]'/>
</tab>
<tab string="Dispose Info">

View File

@ -30,6 +30,7 @@
</tab>
<tab string="Note">
<field name="note" nolabel="1"/>
<field name="manual" help="XXX"/>
</tab>
</tabs>
<foot>

View File

@ -346,25 +346,22 @@ class Patient(Model):
pt.delete()
super().delete(ids)
def check_vals(self,vals):
return vals
def write(self,ids,vals,**kw):
if 'cycles' in vals.keys():
index=0
for cvals in vals['cycles']:
mode=cvals[0]
if mode=='delete':
continue
elif mode=='create':
cycle_vals=cvals[1]
elif mode=='write':
continue
cycle_vals=cvals[2]
cdom=[]
for f, v in cycle_vals.items():
cdom.append([f,'=',v])
print('cdom ', cdom)
for c in get_model('clinic.patient.cycle').search_browse(cdom):
c.delete()
index+=1
datenow=time.strftime("%Y-%m-%d")
vdom=[
['patient_id','in',ids],
['visit_date','>',datenow],
['state','=','pending'],
['manual','=',False],
]
visit_ids=get_model("clinic.visit").search(vdom)
print('removing visit .. ', len(visit_ids))
get_model("clinic.visit").delete(visit_ids)
if 'type_id' in vals.keys():
#update patient in hd case which state is condition below
for obj in self.browse(ids):

View File

@ -20,7 +20,7 @@ class PatientCycle(Model):
'department_id': _get_department,
}
_sql_constraints=("pcycle_uniq","unique(patient_id,cycle_id,day,department_id)","patient_id,cycle_id,day,department_id should be unique"),
__sql_constraints=("pcycle_uniq","unique(patient_id,cycle_id,day,department_id)","patient_id,cycle_id,day,department_id should be unique"),
_order="department_id,cycle_id"
PatientCycle.register()

View File

@ -52,6 +52,7 @@ class Visit(Model):
'cycle_color': fields.Char('Color',function="_get_all",function_multi=True,store=True),
'note': fields.Text('Note'),
'branch_id': fields.Many2One("clinic.branch","Branch"),
'manual': fields.Boolean("Manual Tempolary Visit"),
}
def _get_number(self,context={}):
@ -97,6 +98,7 @@ class Visit(Model):
"number": "/",
"company_id": lambda *a: get_active_company(),
'nurse_id': _get_nurse,
'manual': False,
}
#_sql_constraints=("clinic_visit_key_uniq","unique(patient_id,visit_date,cycle_id,department_id)","Patient is already exist in this date"),

View File

@ -37,9 +37,9 @@
<span class="glyphicon glyphicon-arrow-right">&nbsp;{{number}}</span>
{{else}}
{{#ifeq number "Cancelled"}}
<span class="glyphicon glyphicon-thumbs-down">&nbsp;{{number}}</span>
<span class="glyphicon glyphicon-remove-sign">&nbsp;{{number}}</span>
{{else}}
<span class="glyphicon glyphicon-thumbs-up">&nbsp;{{number}}</span>
<span class="glyphicon glyphicon-ok-sign">&nbsp;{{number}}</span>
{{/ifeq}}
{{/ifeq}}
</a>
@ -73,7 +73,7 @@
{{#ifeq hd_case_state "cancelled"}}
<span class="glyphicon glyphicon-remove">
{{else}}
<span class="glyphicon glyphicon-ok">
<span class="glyphicon glyphicon-ok-sign">
{{/ifeq}}
{{/ifeq}}
{{/ifeq}}