gen visit
parent
81ab2ff33d
commit
db29c0cc2c
|
@ -32,7 +32,7 @@ class MakeAPT(Model):
|
||||||
for pc in get_model("clinic.patient.cycle").search_browse([]):
|
for pc in get_model("clinic.patient.cycle").search_browse([]):
|
||||||
patient=pc.patient_id
|
patient=pc.patient_id
|
||||||
dpt=pc.department_id
|
dpt=pc.department_id
|
||||||
key='%s-%s'%(patient.id,dpt.id)
|
key=(patient.id,dpt.id)
|
||||||
if not pts.get(key):
|
if not pts.get(key):
|
||||||
pts[key]={
|
pts[key]={
|
||||||
'mon_cycle_id': None,
|
'mon_cycle_id': None,
|
||||||
|
@ -62,9 +62,11 @@ class MakeAPT(Model):
|
||||||
|
|
||||||
lines=[]
|
lines=[]
|
||||||
for k, vals in pts.items():
|
for k, vals in pts.items():
|
||||||
pt_id, dpt_id=k.split("-")
|
pt_id, dpt_id=k
|
||||||
vals['patient_id']=pt_id
|
if pt_id:
|
||||||
vals['department_id']=dpt_id
|
vals['patient_id']=pt_id
|
||||||
|
if dpt_id:
|
||||||
|
vals['department_id']=dpt_id
|
||||||
lines.append(('create',vals))
|
lines.append(('create',vals))
|
||||||
|
|
||||||
for line in obj.lines:
|
for line in obj.lines:
|
||||||
|
|
|
@ -217,6 +217,8 @@ class VisitBoard(Model):
|
||||||
has_duration=False
|
has_duration=False
|
||||||
if date_from != date_to:
|
if date_from != date_to:
|
||||||
has_duration=True
|
has_duration=True
|
||||||
|
import pprint
|
||||||
|
pprint.pprint(lines)
|
||||||
data={
|
data={
|
||||||
'lines': lines,
|
'lines': lines,
|
||||||
'date': utils.date2thai(date_from,format='ประจำวัน%(Td)s ที่ %(d)s %(Tm)s %(BY)s'),
|
'date': utils.date2thai(date_from,format='ประจำวัน%(Td)s ที่ %(d)s %(Tm)s %(BY)s'),
|
||||||
|
|
Loading…
Reference in New Issue