name of nurse not order

report_acc_hdcase_summary
watcha.h 2016-01-07 21:20:57 +07:00
parent d7e1ee21b8
commit eb21830246
1 changed files with 18 additions and 1 deletions

View File

@ -19,7 +19,7 @@ class ReportCycleItem(Model):
"ptype_id": fields.Many2One("clinic.patient.type","Patient Type"),
'branch_id': fields.Many2One("clinic.branch","Branch"),
'department_id': fields.Many2One("clinic.department","Department"),
'sort_by': fields.Selection([['hdcase_number','HDCase Number'],['pname','Pateint Name'],['mdc_name','EPO']],'Sort By'),
'sort_by': fields.Selection([['hdcase_number','HDCase Number'],['pname','Patient Name'],['mdc_name','EPO']],'Sort By'),
}
def default_get(self,field_names=None,context={},**kw):
@ -277,7 +277,17 @@ class ReportCycleItem(Model):
index=len(nlines)
date_txt=''
cseq_txt=''
nurse_items=[]
for cline in clines:
if cline.get('nfirst_name'):
nurse_items.append({
'nurse': cline.get('nurse'),
'nfirst_name': cline.get('nfirst_name'),
'ctid': cline.get('ctid'),
})
cline['nurse']=''
cline['nfirst_name']=''
cline['ctid']=''
if cline.get('cseq_txt'):
date_txt=cline.get('date_txt')
cseq_txt=cline.get('cseq_txt')
@ -288,6 +298,13 @@ class ReportCycleItem(Model):
no+=1
nlines[index]['date_txt']=date_txt
nlines[index]['cseq_txt']=cseq_txt
for nurse_item in sorted(nurse_items,key=lambda nitem: nitem['nfirst_name']):
nlines[index].update({
'nurse': nurse_item['nurse'],
'nfirst_name': nurse_item['nfirst_name'],
'ctid': nurse_item['ctid'],
})
index+=1
clines=[]
nlines.append({
'sub': 'show',