xxxx
parent
dc8282afde
commit
1830090e04
|
@ -2,9 +2,8 @@
|
||||||
<head>
|
<head>
|
||||||
<field name="state"/>
|
<field name="state"/>
|
||||||
<button string="Options" dropdown="1">
|
<button string="Options" dropdown="1">
|
||||||
<!--<item string="Load Nurses" method="load_nurse_from_schedule" states='draft'/>-->
|
|
||||||
<item string="Copy Nurses" method="cycle_item_copy" states='draft'/>
|
<item string="Copy Nurses" method="cycle_item_copy" states='draft'/>
|
||||||
<item string="Recheck HD Case" method="update_hdcase" states="draft" confirm="Are you sure?"/>
|
<!--<item string="Recheck HD Case" method="update_hdcase" states="draft" confirm="Are you sure?"/>-->
|
||||||
<item string="View Schedule" method="view_schedule"/>
|
<item string="View Schedule" method="view_schedule"/>
|
||||||
<item string="To Draft" method="to_draft" states="validated" />
|
<item string="To Draft" method="to_draft" states="validated" />
|
||||||
</button>
|
</button>
|
||||||
|
@ -23,7 +22,6 @@
|
||||||
<field name="nurse_id" domain='[["type","=","nurse"]]' onchange="onchange_nurse"/>
|
<field name="nurse_id" domain='[["type","=","nurse"]]' onchange="onchange_nurse"/>
|
||||||
<field name="level_id"/>
|
<field name="level_id"/>
|
||||||
<field name="categ_id"/>
|
<field name="categ_id"/>
|
||||||
<!--<field name="state"/>-->
|
|
||||||
</list>
|
</list>
|
||||||
</field>
|
</field>
|
||||||
</tab>
|
</tab>
|
||||||
|
@ -33,7 +31,6 @@
|
||||||
</tab>
|
</tab>
|
||||||
</tabs>
|
</tabs>
|
||||||
<related>
|
<related>
|
||||||
<!--<field name="visits"/>-->
|
|
||||||
<field name="hd_cases"/>
|
<field name="hd_cases"/>
|
||||||
<field name="comments"/>
|
<field name="comments"/>
|
||||||
</related>
|
</related>
|
||||||
|
|
|
@ -44,7 +44,7 @@ class Patient(Model):
|
||||||
'type_id': fields.Many2One("clinic.patient.type","Type",search=True,required=True),
|
'type_id': fields.Many2One("clinic.patient.type","Type",search=True,required=True),
|
||||||
"number": fields.Char("HN Number",required=True,search=True),
|
"number": fields.Char("HN Number",required=True,search=True),
|
||||||
"trt_no": fields.Char("TRT",search=True),
|
"trt_no": fields.Char("TRT",search=True),
|
||||||
"hn_no": fields.Char("HN",function="_get_hn_no"),
|
"hn_no": fields.Char("HN",function="_get_hn_no",store=True),
|
||||||
"hn": fields.Char("REF/HN",search=False),
|
"hn": fields.Char("REF/HN",search=False),
|
||||||
"name": fields.Char("Name",required=True,search=True),
|
"name": fields.Char("Name",required=True,search=True),
|
||||||
"reg_date": fields.Date("Register Date",required=False,search=True),
|
"reg_date": fields.Date("Register Date",required=False,search=True),
|
||||||
|
@ -250,8 +250,11 @@ class Patient(Model):
|
||||||
vals=[]
|
vals=[]
|
||||||
for obj in self.browse(ids):
|
for obj in self.browse(ids):
|
||||||
name=obj.name or ''
|
name=obj.name or ''
|
||||||
|
nick_name=obj.nick_name or ""
|
||||||
|
if nick_name:
|
||||||
|
name+=" (%s)"%nick_name
|
||||||
if obj.hn_no:
|
if obj.hn_no:
|
||||||
name+=" (HN: %s)"%obj.hn_no
|
name+=" / %s"%obj.hn_no
|
||||||
vals.append((obj.id,name,obj.image))
|
vals.append((obj.id,name,obj.image))
|
||||||
return vals
|
return vals
|
||||||
|
|
||||||
|
@ -260,16 +263,13 @@ class Patient(Model):
|
||||||
if domain:
|
if domain:
|
||||||
dom=[dom,domain]
|
dom=[dom,domain]
|
||||||
ids1=self.search(dom)
|
ids1=self.search(dom)
|
||||||
dom=[["number","ilike","%"+name+"%"]]
|
|
||||||
|
dom=[["hn_no","ilike","%"+name+"%"]]
|
||||||
if domain:
|
if domain:
|
||||||
dom=[dom,domain]
|
dom=[dom,domain]
|
||||||
ids2=self.search(dom)
|
ids2=self.search(dom)
|
||||||
|
|
||||||
ids=list(set(ids1+ids2))
|
ids=list(set(ids1+ids2))
|
||||||
#dom=[["hn","ilike","%"+name+"%"]]
|
|
||||||
#if domain:
|
|
||||||
#dom=[dom,domain]
|
|
||||||
#ids3=self.search(dom)
|
|
||||||
#ids=list(set(ids1+ids2+ids3))
|
|
||||||
return self.name_get(ids,context=context)
|
return self.name_get(ids,context=context)
|
||||||
|
|
||||||
def simple_address(self,ids,context={}):
|
def simple_address(self,ids,context={}):
|
||||||
|
|
|
@ -108,50 +108,9 @@ class ClinicSetting(Model):
|
||||||
if user_id !=1:
|
if user_id !=1:
|
||||||
print("Only admin!!")
|
print("Only admin!!")
|
||||||
return
|
return
|
||||||
obj=self.browse(1)
|
for pt in get_model("clinic.patient").search_browse([]):
|
||||||
categs={}
|
pt.write({
|
||||||
for ct in get_model("clinic.staff.categ").search_read([['type','=','nurse']],['name']):
|
'hn_no': pt.number or "",
|
||||||
categs[ct['name']]=ct['id']
|
|
||||||
|
|
||||||
for cline in get_model("clinic.cycle.item.line").search_browse([]):
|
|
||||||
nr=cline.nurse_id
|
|
||||||
st=nr.state or ""
|
|
||||||
if st=='part_time':
|
|
||||||
st='Part Time'
|
|
||||||
elif st=='full_time':
|
|
||||||
st='Full Time'
|
|
||||||
else:
|
|
||||||
st='Others'
|
|
||||||
ct_id=categs.get(st,None)
|
|
||||||
cline.write({
|
|
||||||
'categ_id': ct_id,
|
|
||||||
})
|
|
||||||
|
|
||||||
for cline in get_model("clinic.labor.cost.line").search_browse([]):
|
|
||||||
staff=cline.staff_id
|
|
||||||
st=staff.state or ""
|
|
||||||
if st=='part_time':
|
|
||||||
st='Part Time'
|
|
||||||
elif st=='full_time':
|
|
||||||
st='Full Time'
|
|
||||||
else:
|
|
||||||
st='Others'
|
|
||||||
ct_id=categs.get(st,None)
|
|
||||||
cline.write({
|
|
||||||
'categ_id': ct_id,
|
|
||||||
})
|
|
||||||
|
|
||||||
for staff in get_model("clinic.staff").search_browse([]):
|
|
||||||
st=staff.state
|
|
||||||
if st=='part_time':
|
|
||||||
st='Part Time'
|
|
||||||
elif st=='full_time':
|
|
||||||
st='Full Time'
|
|
||||||
else:
|
|
||||||
st='Others'
|
|
||||||
ct_id=categs.get(st,None)
|
|
||||||
staff.write({
|
|
||||||
'categ_id': ct_id,
|
|
||||||
})
|
})
|
||||||
print("Done! ")
|
print("Done! ")
|
||||||
|
|
||||||
|
|
|
@ -197,8 +197,11 @@ class Staff(Model):
|
||||||
for obj in self.browse(ids):
|
for obj in self.browse(ids):
|
||||||
level=obj.level_id
|
level=obj.level_id
|
||||||
name=obj.name or ""
|
name=obj.name or ""
|
||||||
|
nickname=obj.nick_name or ""
|
||||||
if level:
|
if level:
|
||||||
name+=" (%s)"%(level.name or "")
|
if nickname:
|
||||||
|
name+=" (%s)"%(nickname)
|
||||||
|
name+=" - %s"%(level.name or "")
|
||||||
vals.append((obj.id,name))
|
vals.append((obj.id,name))
|
||||||
return vals
|
return vals
|
||||||
|
|
||||||
|
@ -216,8 +219,12 @@ class Staff(Model):
|
||||||
level_id=x['level_id'][0]
|
level_id=x['level_id'][0]
|
||||||
if level_id in level_ids:
|
if level_id in level_ids:
|
||||||
ids2.append(x['id'])
|
ids2.append(x['id'])
|
||||||
|
dom=[["nick_name","ilike","%"+name+"%"]]
|
||||||
|
if domain:
|
||||||
|
dom=[dom,domain]
|
||||||
|
ids3=self.search(dom)
|
||||||
|
|
||||||
ids=list(set(ids1+ids2))
|
ids=list(set(ids1+ids2+ids3))
|
||||||
return self.name_get(ids,context=context)
|
return self.name_get(ids,context=context)
|
||||||
|
|
||||||
Staff.register()
|
Staff.register()
|
||||||
|
|
|
@ -246,6 +246,7 @@ class Visit(Model):
|
||||||
# clear old nurse in cycle item
|
# clear old nurse in cycle item
|
||||||
item_id=item_ids[0]
|
item_id=item_ids[0]
|
||||||
item=item_obj.browse(item_id)
|
item=item_obj.browse(item_id)
|
||||||
|
|
||||||
#FIXME problem 1 staff can have many department
|
#FIXME problem 1 staff can have many department
|
||||||
user_id=get_active_user()
|
user_id=get_active_user()
|
||||||
set_active_user(1)
|
set_active_user(1)
|
||||||
|
@ -257,10 +258,11 @@ class Visit(Model):
|
||||||
for line in schedule.lines:
|
for line in schedule.lines:
|
||||||
if line.cycle_id.id==cycle.id:
|
if line.cycle_id.id==cycle.id:
|
||||||
nurse=line.nurse_id
|
nurse=line.nurse_id
|
||||||
|
dpt=line.department_id
|
||||||
item_vals['lines'].append(('create',{
|
item_vals['lines'].append(('create',{
|
||||||
'nurse_id': nurse.id,
|
'nurse_id': nurse.id,
|
||||||
'level_id': nurse.level_id.id,
|
'level_id': nurse.level_id.id,
|
||||||
#'state': nurse.state,
|
'department_id': dpt.id,
|
||||||
'categ_id': nurse.categ_id.id,
|
'categ_id': nurse.categ_id.id,
|
||||||
}))
|
}))
|
||||||
item.write(item_vals)
|
item.write(item_vals)
|
||||||
|
@ -276,9 +278,11 @@ class Visit(Model):
|
||||||
lines=[]
|
lines=[]
|
||||||
for line in item2.lines:
|
for line in item2.lines:
|
||||||
nr=line.nurse_id
|
nr=line.nurse_id
|
||||||
|
dpt=line.department_id
|
||||||
lines.append(('create', {
|
lines.append(('create', {
|
||||||
'nurse_id': nr.id,
|
'nurse_id': nr.id,
|
||||||
'level_id': nr.level_id.id,
|
'level_id': nr.level_id.id,
|
||||||
|
'department_id': dpt.id,
|
||||||
'categ_id': nr.categ_id.id,
|
'categ_id': nr.categ_id.id,
|
||||||
}))
|
}))
|
||||||
if lines:
|
if lines:
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
todo:
|
todo:
|
||||||
|
- urgent:
|
||||||
|
- set nurse's profile -> many2many
|
||||||
|
- change department on user profile
|
||||||
|
|
||||||
- change profile
|
- change profile
|
||||||
- Because of one user can access more than branch
|
- Because of one user can access more than branch
|
||||||
- report doctor & nurse ***
|
- report doctor & nurse ***
|
||||||
|
|
Loading…
Reference in New Issue