xxxxx
parent
d1e01e048a
commit
7f6d74ff83
|
@ -16,6 +16,7 @@
|
||||||
</list>
|
</list>
|
||||||
</field>
|
</field>
|
||||||
</tab>
|
</tab>
|
||||||
|
<!--
|
||||||
<tab string="Docor">
|
<tab string="Docor">
|
||||||
<field name="doctors" nolabel="1" span="6">
|
<field name="doctors" nolabel="1" span="6">
|
||||||
<list>
|
<list>
|
||||||
|
@ -24,11 +25,12 @@
|
||||||
</list>
|
</list>
|
||||||
</field>
|
</field>
|
||||||
</tab>
|
</tab>
|
||||||
|
-->
|
||||||
</tabs>
|
</tabs>
|
||||||
<foot>
|
<foot>
|
||||||
</foot>
|
</foot>
|
||||||
<related>
|
<related>
|
||||||
<field name="hd_cases"/>
|
|
||||||
<field name="visits"/>
|
<field name="visits"/>
|
||||||
|
<field name="hd_cases"/>
|
||||||
</related>
|
</related>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -24,13 +24,13 @@
|
||||||
</item>
|
</item>
|
||||||
<item string="Cycles">
|
<item string="Cycles">
|
||||||
<item string="Cycles" action="clinic_cycle"/>
|
<item string="Cycles" action="clinic_cycle"/>
|
||||||
|
<item string="Cycle Dialy" action="clinic_cycle_dialy"/>
|
||||||
<item string="Cycle Items" action="clinic_cycle_item"/>
|
<item string="Cycle Items" action="clinic_cycle_item"/>
|
||||||
</item>
|
</item>
|
||||||
<item string="Schedules" action="clinic_schedule"/>
|
<item string="Schedules" action="clinic_schedule"/>
|
||||||
<item string="Visits" action="clinic_visit"/>
|
<item string="Visits" action="clinic_visit"/>
|
||||||
<item string="HD Cases" action="clinic_hd_case"/>
|
<item string="HD Cases" action="clinic_hd_case"/>
|
||||||
<item string="Reports">
|
<item string="Reports">
|
||||||
<item string="Cycle Dialy" action="clinic_cycle_dialy"/>
|
|
||||||
<item string="Visit Dialy" action="clinic_visit_dialy"/>
|
<item string="Visit Dialy" action="clinic_visit_dialy"/>
|
||||||
<item string="HD Detail" action="clinic_report_hd_detail"/>
|
<item string="HD Detail" action="clinic_report_hd_detail"/>
|
||||||
<item string="HD Summary" action="clinic_report_hd_summary"/>
|
<item string="HD Summary" action="clinic_report_hd_summary"/>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from netforce.model import Model, fields
|
from netforce.model import Model, fields, get_model
|
||||||
from netforce.access import get_active_company
|
from netforce.access import get_active_company
|
||||||
|
|
||||||
class CycleItem(Model):
|
class CycleItem(Model):
|
||||||
|
@ -27,6 +27,7 @@ class CycleItem(Model):
|
||||||
'visits': fields.One2Many("clinic.visit","cycle_item_id", "Visits"),
|
'visits': fields.One2Many("clinic.visit","cycle_item_id", "Visits"),
|
||||||
'nurses': fields.One2Many("clinic.cycle.item.nurse",'cycle_item_id','Nurses'),
|
'nurses': fields.One2Many("clinic.cycle.item.nurse",'cycle_item_id','Nurses'),
|
||||||
'doctors': fields.One2Many("clinic.cycle.item.doctor",'cycle_item_id','Doctors'),
|
'doctors': fields.One2Many("clinic.cycle.item.doctor",'cycle_item_id','Doctors'),
|
||||||
|
'sequence': fields.Char("Sequence"),
|
||||||
}
|
}
|
||||||
|
|
||||||
_defaults={
|
_defaults={
|
||||||
|
@ -35,6 +36,20 @@ class CycleItem(Model):
|
||||||
'date': lambda *a: time.strftime("%Y-%m-%d"),
|
'date': lambda *a: time.strftime("%Y-%m-%d"),
|
||||||
}
|
}
|
||||||
|
|
||||||
_order="date asc"
|
_order="sequence"
|
||||||
|
|
||||||
|
def create(self, vals,**kw):
|
||||||
|
date=vals['date']
|
||||||
|
cycle_id=vals['cycle_id']
|
||||||
|
cycle=get_model("clinic.cycle").browse(cycle_id)
|
||||||
|
vals['sequence']='%s-%s'%(date,cycle.sequence) #date-sequence
|
||||||
|
obj_id=super().create(vals,**kw)
|
||||||
|
return obj_id
|
||||||
|
|
||||||
|
def write(self,ids,vals,**kw):
|
||||||
|
obj=self.browse(ids)[0]
|
||||||
|
cycle=obj.cycle_id
|
||||||
|
vals['sequence']='%s-%s'%(obj.date,cycle.sequence) #date-sequence
|
||||||
|
super().write(ids,vals,**kw)
|
||||||
|
|
||||||
CycleItem.register()
|
CycleItem.register()
|
||||||
|
|
|
@ -128,6 +128,14 @@ class GenVisit(Model):
|
||||||
else:
|
else:
|
||||||
raise Exception("Please select some patient or patient type")
|
raise Exception("Please select some patient or patient type")
|
||||||
|
|
||||||
|
nurse_ids=[]
|
||||||
|
for nurse_line in obj.nurse_lines:
|
||||||
|
nurse_id=nurse_line.nurse_id.id
|
||||||
|
# None
|
||||||
|
if nurse_id:
|
||||||
|
nurse_ids.append(nurse_id)
|
||||||
|
if not nurse_ids:
|
||||||
|
nurse_ids=get_model("clinic.personal").search([['type','=','nurse'],['categ_id','=',obj.nurse_categ_id.id]])
|
||||||
schedules={}
|
schedules={}
|
||||||
for patient_id in patients:
|
for patient_id in patients:
|
||||||
patient=get_model("clinic.patient").browse(patient_id)
|
patient=get_model("clinic.patient").browse(patient_id)
|
||||||
|
@ -180,17 +188,8 @@ class GenVisit(Model):
|
||||||
start_date=tmp
|
start_date=tmp
|
||||||
|
|
||||||
for vals in visit_vals:
|
for vals in visit_vals:
|
||||||
|
vals['nurse_ids']=nurse_ids
|
||||||
visit_obj.create(vals)
|
visit_obj.create(vals)
|
||||||
|
|
||||||
nurse_ids=[]
|
|
||||||
for nurse_line in obj.nurse_lines:
|
|
||||||
nurse_id=nurse_line.nurse_id.id
|
|
||||||
# None
|
|
||||||
if nurse_id:
|
|
||||||
nurse_ids.append(nurse_id)
|
|
||||||
if not nurse_ids:
|
|
||||||
nurse_ids=get_model("clinic.personal").search([['type','=','nurse'],['categ_id','=',obj.nurse_categ_id.id]])
|
|
||||||
|
|
||||||
dom=[]
|
dom=[]
|
||||||
dom.append(['time_start','>=','%s %s'%(obj.date_from[0:10],' 00:00:00')])
|
dom.append(['time_start','>=','%s %s'%(obj.date_from[0:10],' 00:00:00')])
|
||||||
dom.append(['time_stop','<=','%s %s'%(start_date.strftime(FMT_DATE)[0:10],' 23:59:59')])
|
dom.append(['time_stop','<=','%s %s'%(start_date.strftime(FMT_DATE)[0:10],' 23:59:59')])
|
||||||
|
|
|
@ -35,7 +35,7 @@ class Visit(Model):
|
||||||
"comments": fields.One2Many("message","related_id","Comments"),
|
"comments": fields.One2Many("message","related_id","Comments"),
|
||||||
'visit_date': fields.Date('Visit Date'),
|
'visit_date': fields.Date('Visit Date'),
|
||||||
'print_date': fields.Date('Print Date',function="_get_print_date"),
|
'print_date': fields.Date('Print Date',function="_get_print_date"),
|
||||||
'cycle_item_id': fields.Many2One("clinic.cycle.item","Cycle Item"), # on_delete="cascade" -> rm visit from cycle item
|
'cycle_item_id': fields.Many2One("clinic.cycle.item","Cycle Item", on_delete="cascade"), #XXX on_delete="cascade" -> rm visit from cycle item
|
||||||
'sequence': fields.Char("Sequence"),
|
'sequence': fields.Char("Sequence"),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,6 +114,12 @@ class Visit(Model):
|
||||||
'state': 'draft',
|
'state': 'draft',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vals['personals'].append(('create',{
|
||||||
|
'personal_id': obj.doctor_id.id,
|
||||||
|
'type': 'doctor',
|
||||||
|
'priop': 'owner',
|
||||||
|
}))
|
||||||
|
|
||||||
products=get_model("product").search_browse([['code','=','FEE']])
|
products=get_model("product").search_browse([['code','=','FEE']])
|
||||||
for product in products:
|
for product in products:
|
||||||
vals['lines'].append(('create',{
|
vals['lines'].append(('create',{
|
||||||
|
@ -290,10 +296,16 @@ class Visit(Model):
|
||||||
item_obj=get_model('clinic.cycle.item')
|
item_obj=get_model('clinic.cycle.item')
|
||||||
item_ids=item_obj.search(dom)
|
item_ids=item_obj.search(dom)
|
||||||
item_id=None
|
item_id=None
|
||||||
|
# XXX
|
||||||
|
nurse_ids=[]
|
||||||
|
if 'nurse_ids' in vals.keys():
|
||||||
|
nurse_ids=vals['nurse_ids']
|
||||||
|
del vals['nurse_ids']
|
||||||
if not item_ids:
|
if not item_ids:
|
||||||
item_id=item_obj.create({
|
item_id=item_obj.create({
|
||||||
'cycle_id': cycle_id,
|
'cycle_id': cycle_id,
|
||||||
'date': date,
|
'date': date,
|
||||||
|
'nurses': [('create',{'nurse_id': nurse_id}) for nurse_id in nurse_ids]
|
||||||
})
|
})
|
||||||
else:
|
else:
|
||||||
item_id=item_ids[0]
|
item_id=item_ids[0]
|
||||||
|
|
|
@ -1,9 +1,16 @@
|
||||||
|
======
|
||||||
|
flow:
|
||||||
|
planing schedule
|
||||||
|
plaining visit
|
||||||
|
- generate visit
|
||||||
|
======
|
||||||
missing:
|
missing:
|
||||||
- search calendar
|
- search calendar
|
||||||
- color calendar
|
- color calendar
|
||||||
- can not move calendar's schedule
|
- can not move calendar's schedule
|
||||||
- order's visit report dialy
|
- order's visit report dialy
|
||||||
- same model & mode (list) but use diffent target
|
- same model & mode (list) but use diffent target
|
||||||
|
|
||||||
dashboard
|
dashboard
|
||||||
: hd summary report -> click and go direct
|
: hd summary report -> click and go direct
|
||||||
cycle item:
|
cycle item:
|
||||||
|
|
Loading…
Reference in New Issue