report(90%)

conv_bal
watcha.h 2015-03-17 19:41:22 +07:00
parent fd33b9b1d0
commit 82cc4eb6ab
4 changed files with 10 additions and 5 deletions

View File

@ -13,5 +13,6 @@
<field name="walkin"/>
<field name="department_names"/>
<field name="doctor_id"/>
<field name="dispose"/>
<!--<field name="image" preview='1'/>-->
</list>

View File

@ -72,6 +72,8 @@ class ReportDiscontinuePatient(Model):
dom=[]
dom.append(['resign_date','>=',time_start])
dom.append(['resign_date','<=',time_stop])
dom.append(['walkin','=',"no"])
dom.append(['dispose','=',True])
if branch_id:
dom.append(['branch_id','=',branch_id])
if department_id:

View File

@ -184,7 +184,7 @@ class ReportHDCaseSummary(Model):
resign_patients=[]
for pt in get_model('clinic.patient').search_browse(dom):
resign_patients_qty+=1
resign_patients.append(pt.name)
resign_patients.append(pt.id)
dom=replace_quote('%s'%dom)
items['topic%s'%count]={
'month': month_str,
@ -231,17 +231,18 @@ class ReportHDCaseSummary(Model):
time_stop='%s-%s-%s'%(year,str(crr_month).zfill(2),crr_total_day)
dom.append(['reg_date','<=',time_stop])
dom.append(['type_id','=',ptype['id']])
dom.append(['walkin','=',"no"])
dom.append(['dispose','=',False])
#if resign_patients:
#dom.append(['id','not in',resign_patients])
if branch_id:
dom.append(['branch_id','=',branch_id])
if department_id:
dom.append(['department_id','=',department_id])
dom.append(['walkin','=',"no"])
dom.append(['dispose','=',False])
npatients_qty=0
for pt in get_model("clinic.patient").search(dom):
npatients_qty+=1
dom=replace_quote('%s'%dom)
print(">>> <<< ", dom)
items[tkey]={
'month': '',
'qty': npatients_qty,

View File

@ -71,11 +71,12 @@ class ReportRecentPatient(Model):
dom=[]
dom.append(['reg_date','>=',time_start])
dom.append(['reg_date','<=',time_stop])
dom.append(['walkin','=',"no"])
dom.append(['dispose','=',False])
if branch_id:
dom.append(['branch_id','=',branch_id])
if department_id:
dom.append(['department_id','=',department_id])
print("recent ", dom)
records=get_model('clinic.patient').search_browse(dom)
lines=[]
no=1