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="Visits" action="clinic_visit"/>
<item string="Visit Board" action="clinic_visit_board"/> <item string="Visit Board" action="clinic_visit_board"/>
<divider/> <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 string="Make An Appointment" action="clinic_make_apt"/>-->
</item> </item>
<item string="HD Cases" perm="clinic_hdcase"> <item string="HD Cases" perm="clinic_hdcase">

View File

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

View File

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

View File

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

View File

@ -20,7 +20,7 @@ class PatientCycle(Model):
'department_id': _get_department, '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" _order="department_id,cycle_id"
PatientCycle.register() PatientCycle.register()

View File

@ -52,6 +52,7 @@ class Visit(Model):
'cycle_color': fields.Char('Color',function="_get_all",function_multi=True,store=True), 'cycle_color': fields.Char('Color',function="_get_all",function_multi=True,store=True),
'note': fields.Text('Note'), 'note': fields.Text('Note'),
'branch_id': fields.Many2One("clinic.branch","Branch"), 'branch_id': fields.Many2One("clinic.branch","Branch"),
'manual': fields.Boolean("Manual Tempolary Visit"),
} }
def _get_number(self,context={}): def _get_number(self,context={}):
@ -97,6 +98,7 @@ class Visit(Model):
"number": "/", "number": "/",
"company_id": lambda *a: get_active_company(), "company_id": lambda *a: get_active_company(),
'nurse_id': _get_nurse, '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"), #_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> <span class="glyphicon glyphicon-arrow-right">&nbsp;{{number}}</span>
{{else}} {{else}}
{{#ifeq number "Cancelled"}} {{#ifeq number "Cancelled"}}
<span class="glyphicon glyphicon-thumbs-down">&nbsp;{{number}}</span> <span class="glyphicon glyphicon-remove-sign">&nbsp;{{number}}</span>
{{else}} {{else}}
<span class="glyphicon glyphicon-thumbs-up">&nbsp;{{number}}</span> <span class="glyphicon glyphicon-ok-sign">&nbsp;{{number}}</span>
{{/ifeq}} {{/ifeq}}
{{/ifeq}} {{/ifeq}}
</a> </a>
@ -65,15 +65,15 @@
--> -->
{{else}} {{else}}
{{#ifeq hd_case_state "waiting_treatment"}} {{#ifeq hd_case_state "waiting_treatment"}}
<span class="glyphicon glyphicon-arrow-right"> <span class="glyphicon glyphicon-arrow-right">
{{else}} {{else}}
{{#ifeq hd_case_state "in_progress"}} {{#ifeq hd_case_state "in_progress"}}
<span class="glyphicon glyphicon-refresh"> <span class="glyphicon glyphicon-refresh">
{{else}} {{else}}
{{#ifeq hd_case_state "cancelled"}} {{#ifeq hd_case_state "cancelled"}}
<span class="glyphicon glyphicon-remove"> <span class="glyphicon glyphicon-remove">
{{else}} {{else}}
<span class="glyphicon glyphicon-ok"> <span class="glyphicon glyphicon-ok-sign">
{{/ifeq}} {{/ifeq}}
{{/ifeq}} {{/ifeq}}
{{/ifeq}} {{/ifeq}}