From 88fa7ac03974a88ee8a8abd56d8ac6355475f028 Mon Sep 17 00:00:00 2001 From: "watcha.h@almacom.co.th" Date: Fri, 8 May 2015 21:30:52 +0700 Subject: [PATCH] report hd case summary --- .../layouts/clinic_report_hd_case_detail.xml | 7 +- .../layouts/clinic_report_hd_case_summary.xml | 2 +- netforce_clinic/models/:w | 78 --- netforce_clinic/models/report_cycle_item.py | 17 +- .../models/report_hd_case_detail.py | 447 +++++++++++++----- .../models/report_hd_case_summary.py | 224 ++++----- netforce_clinic/models/visit_board.py | 7 +- .../reports/report_hd_case_detail.xlsx | Bin 5302 -> 5003 bytes .../templates/report_hd_case_detail.hbs | 76 ++- .../templates/report_hd_case_summary.hbs | 7 +- netforce_clinic/todo.txt | 3 + 11 files changed, 477 insertions(+), 391 deletions(-) delete mode 100644 netforce_clinic/models/:w diff --git a/netforce_clinic/layouts/clinic_report_hd_case_detail.xml b/netforce_clinic/layouts/clinic_report_hd_case_detail.xml index e62e2ed..1abacac 100644 --- a/netforce_clinic/layouts/clinic_report_hd_case_detail.xml +++ b/netforce_clinic/layouts/clinic_report_hd_case_detail.xml @@ -1,9 +1,10 @@
- + - - + + + diff --git a/netforce_clinic/layouts/clinic_report_hd_case_summary.xml b/netforce_clinic/layouts/clinic_report_hd_case_summary.xml index e7949c1..da9f5e0 100644 --- a/netforce_clinic/layouts/clinic_report_hd_case_summary.xml +++ b/netforce_clinic/layouts/clinic_report_hd_case_summary.xml @@ -2,7 +2,7 @@ + - diff --git a/netforce_clinic/models/:w b/netforce_clinic/models/:w deleted file mode 100644 index 19677df..0000000 --- a/netforce_clinic/models/:w +++ /dev/null @@ -1,78 +0,0 @@ -from netforce.model import Model, fields, get_model - -class HDCasePopupDlz(Model): - _name="clinic.hd.case.popup.dlz" - _transient=True - - _fields={ - "hd_case_id": fields.Many2One("clinic.hd.case","HdCase",required=True,on_delete="cascade"), - 'product_id': fields.Many2One("product", "Product",required=True), - "dialyzer_type": fields.Selection([("low","low flux"),("high","high flux"),("dbl","dbl hifulx")],"Dialyzer Type"), - "max_use_time": fields.Integer("Max Use Time"), - "exp_date": fields.Date("Expiry Date"), - "note": fields.Text("Note"), - "membrane_type": fields.Selection([("unsub","Unsub cellul"),("sub","Sub cellul"),("synthetic","Synthetic")],"Membrane Type"), - } - - def __get_hd_case_id(self,context={}): - hd_case_id=context.get("refer_id") - print("clinic.hd.case.popup.dlz default") - if not hd_case_id: - return None - return int(hd_case_id) - - def default_get(self,field_names=None,context={},**kw): - defaults=context.get("defaults",{}) - hdcase_id=defaults.get('hd_case_id') - dialyzer_type=defaults.get('dialyzer_type') - if not hdcase_id: - hdcase_id=context.get("refer_id") - if hdcase_id: - hdcase=get_model('clinic.hd.case').browse(hdcase_id) - dom=[] - for dlz in get_model('clinic.dialyzer').search_browse(dom): - dialyzer_type=dlz.dialyzer_type or "low" - pass - res={ - 'hd_case_id': hdcase_id, - 'dialyzer_type': 'low', - 'max_use_time': 10, - } - print('res', res) - return res - - def new_dlz(self,ids,context={}): - obj=self.browse(ids)[0] - hd_case=obj.hd_case_id - res={} - if hd_case: - context['is_wiz']=True - context['pop_id']=obj.id - res=hd_case.new_dialyzer(context=context) - print('res ', res) - return res - - def onchange_product(self,context={}): - data=context['data'] - hdcase_id=data['hd_case_id'] - patient=None - if hdcase_id: - hdcase=get_model('clinic.hd.case').browse(hdcase_id) - patient=hdcase.patient_id - product_id=data['product_id'] - data['membrane_type']=None - data['dialyzer_type']=None - data['max_use_time']=10 - dom=[] - if patient: - dom.append(['patient_id','=',patient.id]) - for dlz in get_model("clinic.dialyzer").search_browse(dom): - prod=dlz.product_id - if prod.id==product_id: - data['membrane_type']=dlz.membrane_type - data['dialyzer_type']=dlz.dialyzer_type or "low" - data['max_use_time']=dlz.max_use_time or 10 - break - return data - -HDCasePopupDlz.register() diff --git a/netforce_clinic/models/report_cycle_item.py b/netforce_clinic/models/report_cycle_item.py index c35e296..7b717e6 100644 --- a/netforce_clinic/models/report_cycle_item.py +++ b/netforce_clinic/models/report_cycle_item.py @@ -28,8 +28,12 @@ class ReportCycleItem(Model): date_from=defaults.get('date_from','%s-%s-01'%(year,month)) date_to=defaults.get('date_to','%s-%s-01'%(year,month)) branch_id=defaults.get('branch_id') - ptype_id=defaults.get('ptype_id') + if branch_id: + branch_id=int(branch_id) department_id=defaults.get('department_id') + if department_id: + department_id=int(department_id) + ptype_id=defaults.get('ptype_id') res=get_model('select.company').get_select() if res: if not branch_id: @@ -45,8 +49,9 @@ class ReportCycleItem(Model): 'date_to': date_to, 'branch_id': branch_id, 'department_id': department_id, + 'ptype_id': ptype_id, } - print('res', res) + print('report.cycle.item.defautls', res) return res def get_report_data(self,ids,context={}): @@ -122,9 +127,11 @@ class ReportCycleItem(Model): dlz_drop=True cancel=False row_color='' - if hdcase.state=='cancelled': - cancel=True - row_color='#b6b6b6' + if hdcase.state not in ('paid', 'waiting_payment'): + continue + #if hdcase.state=='cancelled': + #cancel=True + #row_color='#b6b6b6' lines.append({ 'dlz_drop': dlz_drop, 'cancel': cancel, diff --git a/netforce_clinic/models/report_hd_case_detail.py b/netforce_clinic/models/report_hd_case_detail.py index 3e49fc5..4096a59 100644 --- a/netforce_clinic/models/report_hd_case_detail.py +++ b/netforce_clinic/models/report_hd_case_detail.py @@ -4,6 +4,8 @@ from calendar import monthrange from netforce.model import Model,fields,get_model from netforce.access import get_active_company +from . import utils + class ReportHDCaseDetail(Model): _name="clinic.report.hd.case.detail" @@ -14,139 +16,332 @@ class ReportHDCaseDetail(Model): "date": fields.Date("Month"), "date_from": fields.Date("From", required=True), "date_to": fields.Date("To", required=True), - 'patient_type_id': fields.Many2One("clinic.patient.type","Payers"), - 'patient_id': fields.Many2One("clinic.patient","Patient",domain=[['state','=','admit']]), 'branch_id': fields.Many2One("clinic.branch","Branch"), 'department_id': fields.Many2One("clinic.department","Department"), + 'patient_type_id': fields.Many2One("clinic.patient.type","Patient Type"), + 'hdcase_type': fields.Selection([['completed','Completed'],['not_completed','Not Completed']],"HDCase Type"), + 'report_type': fields.Selection([ + ['topic1','จำนวนครั้งการทำ Hemodialysis'], + ['topic2','จำนวนผู้ป่วยยกมาจากเดือน'], + ['topic3','จำนวนผู้ป่วยรับใหม่เดือน'], + ['topic4','จำนวนผู้ป่วยจำหน่ายเดือน'], + ['topic5','จำนวนผู้ป่วยยกไปเดือน'], + ['topic6','ประเภทผู้ป่วย'], + ],"Repor Type",required=True), } - def _get_date_from(self,context={}): - return time.strftime("%Y-%m-%d") - - def _get_date_to(self,context={}): - return time.strftime("%Y-%m-%d") - - _defaults={ - 'date': lambda *a: time.strftime("%Y-%m-%d"), - 'date_from': _get_date_from, - 'date_to': _get_date_to, - } - - def get_report_data(self,ids,context={}): - company_id=get_active_company() - company=get_model('company').browse(company_id) - date_from=time.strftime("%Y-%m-%d") - date_to=time.strftime("%Y-%m-%d") - ptype_id=None - pid=None - dpt_id=None - bid=None - if ids: - obj=self.browse(ids)[0] - date_from=obj.date_from - date_to=obj.date_to - pid=obj.patient_id.id - ptype_id=obj.patient_type_id.id - dpt_id=obj.department_id.id - bid=obj.branch_id.id - lines=[] - dom=[] - dom.append(['date','>=',date_from]) - dom.append(['date','<=',date_to]) - if pid: - dom.append(['patient_id','=',pid]) - if ptype_id: - dom.append(['patient_type_id','=',ptype_id]) - if dpt_id: - dom.append(['department_id','=',dpt_id]) - if bid: - dom.append(['branch_id','=',bid]) - - draft=0 - wait_treat=0 - wait_pay=0 - in_progress=0 - finish_treat=0 - cancel=0 - paid=0 - no=1 - for hdcase in get_model("clinic.hd.case").search_browse(dom): - state=hdcase.state - if state=='in_progress': - in_progress+=1 - elif state=='paid': - paid+=1 - elif state=='cancelled': - cancel+=1 - elif state=='waiting_treatment': - wait_treat+=1 - elif state=='waiting_payment': - wait_pay+=1 - elif state=='completed': - finish_treat+=1 + def default_get(self,field_names=None,context={},**kw): + defaults=context.get("defaults",{}) + date=defaults.get('date',time.strftime("%Y-%m-%d")) + year,month=time.strftime("%Y-%m").split("-") + weekday, total_day=monthrange(int(year), int(month)) + date_from=defaults.get('date_from','%s-%s-01'%(year,month)) + date_to=defaults.get('date_to',"%s-%s-%s"%(year,month,total_day)) + report_type=defaults.get('report_type',"topic1") + if report_type: + index='' + for r in report_type: + if r.isdigit(): + index+=r + if int(index)>=6: + report_type='topic6' + branch_id=defaults.get('branch_id',None) + hdcase_type=defaults.get("hdcase_type","completed") + patient_type_id=defaults.get('patient_type_id') + if patient_type_id: + patient_type_id=int(patient_type_id) + select_dpt=get_model('select.company').get_select() + if not branch_id: + if select_dpt: + branch_id=select_dpt['branch_id'] + else: + branch_id=int(branch_id or "0") + department_id=defaults.get('department_id',None) + if not department_id: + if select_dpt.get('department_ids'): + department_id=select_dpt['department_ids'][0] else: - draft+=1 - - epo=[] - fee_amt=0 - dlz_new='N' - for dlz in hdcase.dialyzers: - if dlz.use_time==1: - dlz_new='Y' - for line in hdcase.lines: - prod=line.product_id - categ=line.product_categ_id - if categ.code=='EPO': - epo.append(line.description or '') - elif categ.code=='FEE': - fee_amt+=line.amount - if not epo: - epo='-' - else: - epo=', '.join([e for e in epo]) - patient=hdcase.patient_id - rmb_amt=hdcase.rmb_amount or 0 - more_amt=hdcase.due_amount or 0 - rmb=0 - if rmb_amt > 0: - rmb=1 - lines.append({ - 'no': no, - 'number': hdcase.number or '', - 'hd_case_id': hdcase.id or '', - 'time_start': hdcase.time_start, - 'epo': epo, - 'patient_name': patient.name, - 'patient_id': patient.id, - 'patient_number': patient.number or '', - 'patient_type': patient.type_id.name or '', - 'hct': hdcase.hct or 0, - 'rmb': rmb, - 'more_amt': more_amt, - 'fee_amt': fee_amt, - 'dlz_new': dlz_new, - }) - no+=1 - - sub_title='' - if bid: - sub_title+="%s "%(obj.branch_id.name or "") - if dpt_id: - sub_title+="%s "%(obj.department_id.name or "") - data={ - 'company_name': company.name or "", - 'parent_company_name': company.parent_id.name or "", - 'lines': lines, + department_id=select_dpt['department_id'] + else: + department_id=int(department_id) + res={ + 'date': date, 'date_from': date_from, 'date_to': date_to, - 'sub_title': sub_title, - 'draft': draft, - 'wait_treat': wait_treat, - 'wait_pay': wait_pay, - 'in_progress': in_progress, - 'cancel': cancel, - 'paid': paid, - 'finish_treat': finish_treat, + 'branch_id': branch_id, + 'department_id': department_id, + 'report_type': report_type, + 'hdcase_type': hdcase_type, + 'patient_type_id': patient_type_id, + } + #print('report.hd.case.detail.defaults ', res) + return res + + def get_report_data(self,ids,context={}): + company_id=get_active_company() + company=get_model("company").browse(company_id) + defaults=self.default_get(context=context) + date=defaults.get('date',time.strftime("%Y-%m-%d")) + year=int(date[0:4]) + crr_month=int(date[5:7]) + weekday, crr_total_day=monthrange(year, crr_month) + date_from=defaults.get('date_from',date) + date_to=defaults.get('date_to',date) + branch_id=defaults.get("branch_id",None) + department_id=defaults.get("department_id",None) + hdcase_type=defaults.get('hdcase_type') + report_type=defaults.get('report_type','topic1') + patient_type_id=defaults.get('patient_type_id') + time_start='%s-%s-01'%(year,str(crr_month).zfill(2)) + time_stop='%s-%s-%s'%(year,str(crr_month).zfill(2),crr_total_day) + titles=dict(self._fields['report_type'].selection) + title=titles.get(report_type,'no title') + if ids: + obj=self.browse(ids)[0] + branch_id=obj.branch_id.id + department_id=obj.department_id.id + date=obj.date + crr_month=int(date[5:7]) + time_start=obj.date_from + time_stop=obj.date_to + year=int(date[0:4]) + date_from=obj.date_from + date_to=obj.date_to + report_type=obj.report_type or 'topic1' + hdcase_type=obj.hdcase_type or 'completed' + patient_type_id=obj.patient_type_id.id + prev_year=year + next_year=year + prev_month=crr_month-1 + next_month=crr_month+1 + if crr_month==1: + prev_month=12 + prev_year-=1 + if crr_month==12: + next_month=1 + next_year+=1 + month_str=utils.MONTHS['th_TH'][crr_month] + next_month_str=utils.MONTHS['th_TH'][next_month] + prev_month_str=utils.MONTHS['th_TH'][prev_month] + + def replace_quote(dom=""): + dom=dom.replace("False","false") + dom=dom.replace("True","true") + return dom.replace("'","\"") + dom=[] + lines=[] + total=0 + # current hd case + if report_type=='topic1': + title=titles.get(report_type,'no title') + dom=[] + dom.append(["date",">=",date_from]) + dom.append(["date","<=",date_to]) + if hdcase_type=='completed': + dom.append(["state","in",["waiting_payment","paid"]]) + else: + dom.append(["state","not in",["waiting_payment","paid"]]) + if branch_id: + dom.append(['branch_id','=',branch_id]) + if department_id: + dom.append(['department_id','=',department_id]) + total=0 + for hdcase in get_model("clinic.hd.case").search_browse(dom,order="number"): + patient=hdcase.patient_id + lines.append({ + 'number': hdcase.number, + 'date': hdcase.date, + 'name': patient.name, + 'note': hdcase.note, + }) + total+=1 + # number of patient from previous month + elif report_type=='topic2': + title=titles.get(report_type,'no title') + title+=' '+prev_month_str + prev_weekday, prev_total_day=monthrange(prev_year, prev_month) + reg_date='%s-%s-%s'%(prev_year,str(prev_month).zfill(2),str(prev_total_day).zfill(2)) + print('topic2 ', reg_date) + dom=[] + dom.append(['reg_date','<=',reg_date]) + 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]) + total=0 + for patient in get_model("clinic.patient").search_browse(dom): + if patient.dispose and patient.resign_date: + if patient.resign_date < date_from: + print('continue >>> ', patient.name, patient.resign_date, date_from, date_to) + continue + elif patient.resign_date > date_to: + pass + elif not patient.resign_date > date_to: + print('pass >>> ', patient.name, patient.resign_date, date_from, date_to) + elif not (patient.resign_date>=date_from and patient.resign_date<=date_to): + print('continue >>> ', patient.name, patient.resign_date, date_from, date_to) + continue + print('pass >>> ', patient.name, patient.resign_date, date_from, date_to) + lines.append({ + 'number': patient.hn_no, + 'pid': patient.id, + 'name': patient.name, + 'note': patient.note, + 'date': patient.reg_date, + }) + total+=1 + # new patient of this month + elif report_type=='topic3': + title=titles.get(report_type,'no title') + title+=' '+month_str + 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]) + total=0 + for patient in get_model('clinic.patient').search_browse(dom): + #if patient.dispose and patient.resign_date < date_from: + #continue + lines.append({ + 'number': patient.hn_no, + 'pid': patient.id, + 'name': patient.name, + 'note': patient.note, + 'date': patient.reg_date, + }) + total+=1 + # number for patient who resign for this month + elif report_type=='topic4': + title=titles.get(report_type,'no title') + title+=' '+month_str + 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: + dom.append(['department_id','=',department_id]) + total=0 + for patient in get_model('clinic.patient').search_browse(dom): + lines.append({ + 'number': patient.hn_no, + 'pid': patient.id, + 'name': patient.name, + 'note': patient.note, + 'date': patient.resign_date, + }) + total+=1 + # all patient who are in hospital on select month + elif report_type=='topic5': + title=titles.get(report_type,'no title') + title+=' '+next_month_str + dom=[] + dom.append(['reg_date','<=',time_stop]) + print('topic5 ', time_stop) + 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]) + total=0 + for patient in get_model('clinic.patient').search_browse(dom,order="reg_date"): + if patient.dispose and patient.resign_date: + if patient.resign_date < date_from: + print('1. continue >>> ', patient.name, patient.resign_date, date_from, date_to) + continue + elif patient.resign_date > date_to: + pass + elif patient.resign_date > date_to: + print('2. pass >>> ', patient.name, patient.resign_date, date_from, date_to) + elif (patient.resign_date>=date_from and patient.resign_date<=date_to): + print('3. continue >>> ', patient.name, patient.resign_date, date_from, date_to) + continue + print('4. pass >>> ', patient.name, patient.resign_date, date_from, date_to) + lines.append({ + 'number': patient.hn_no, + 'pid': patient.id, + 'name': patient.name, + 'note': patient.note, + 'date': patient.reg_date, + 'dispose': patient.dispose and 'yes' or 'no', + }) + total+=1 + elif report_type=='topic6': + #title=titles.get(report_type,'no title') + ptype=None + if patient_type_id: + ptype=get_model('clinic.patient.type').browse(patient_type_id) + if not ptype: + return {'total': 0} + title=ptype.name or '' + dom=[] + dom.append(['reg_date','<=',time_stop]) + dom.append(['type_id','=',ptype['id']]) + dom.append(['walkin','=',"no"]) + #dom.append(['dispose','=',False]) + dom.append(['type_id','=',ptype.id]) + if branch_id: + dom.append(['branch_id','=',branch_id]) + if department_id: + dom.append(['department_id','=',department_id]) + total=0 + print('topic6') + for patient in get_model("clinic.patient").search_browse(dom): + if patient.resign_date: + if patient.dispose and patient.resign_date < date_from: + print('1. continue >>> ', patient.name, patient.resign_date, date_from, date_to) + continue + elif patient.resign_date > date_to: + pass + elif patient.resign_date > date_to: + print('2. pass >>> ', patient.name, patient.resign_date, date_from, date_to) + elif (patient.resign_date>=date_from and patient.resign_date<=date_to): + print('3. continue >>> ', patient.name, patient.resign_date, date_from, date_to) + continue + print('4. pass >>> ', patient.name, patient.resign_date, date_from, date_to) + lines.append({ + 'pid': patient.id, + 'number': patient.hn_no, + 'name': patient.name or '', + 'date': patient.reg_date, + }) + total+=1 + sub_name='' + if department_id: + dpt=get_model("clinic.department").browse(department_id) + sub_name="(%s)" % dpt.name or "" + elif branch_id: + branch=get_model("clinic.branch").browse(branch_id) + sub_name="(%s)" % branch.name or "" + no=1 + for line in lines: + line['no']="{0:,.0f}".format(no) + no+=1 + data={ + 'total_txt': "{0:,.0f}".format(total), + 'total': total, + 'title': title, + 'report_type': report_type, + 'date': date, + 'date_from': date_from, + 'date_to': date_to, + 'month': month_str, + 'year': year, + 'branch_id': branch_id, + 'department_id': department_id, + 'lines': lines, + 'company_name': '%s %s'% (company.name or "", sub_name), + 'parent_company_name': company.parent_id.name or "", } return data diff --git a/netforce_clinic/models/report_hd_case_summary.py b/netforce_clinic/models/report_hd_case_summary.py index df74939..0764a98 100644 --- a/netforce_clinic/models/report_hd_case_summary.py +++ b/netforce_clinic/models/report_hd_case_summary.py @@ -19,7 +19,7 @@ class ReportHDCaseSummary(Model): "date_to": fields.Date("To", required=True), 'branch_id': fields.Many2One("clinic.branch","Branch"), 'department_id': fields.Many2One("clinic.department","Departments"), - 'report_type': fields.Selection([['completed','Completed'],['not_completed','Not Completed']],"Report Type"), + 'hdcase_type': fields.Selection([['completed','Completed'],['not_completed','Not Completed']],"HDCase Type"), } def _get_date_from(self,context={}): @@ -50,7 +50,7 @@ class ReportHDCaseSummary(Model): 'date_to': _get_date_to, 'branch_id': _get_branch, 'department_id': _get_department, - 'report_type': 'completed', + 'hdcase_type': 'completed', } def get_report_data(self,ids,context={}): @@ -65,25 +65,21 @@ class ReportHDCaseSummary(Model): date_to=defaults.get('date_to',date) branch_id=defaults.get("branch_id",None) department_id=defaults.get("department_id",None) - report_type=defaults.get('report_type','completed') + hdcase_type=defaults.get('hdcase_type','completed') if branch_id: branch_id=branch_id[0] if department_id: department_id=department_id[0] - time_start='%s-%s-01 00:00:00'%(year,str(crr_month).zfill(2)) - time_stop='%s-%s-%s 23:59:59'%(year,str(crr_month).zfill(2),crr_total_day) if ids: obj=self.browse(ids)[0] branch_id=obj.branch_id.id department_id=obj.department_id.id date=obj.date crr_month=int(date[5:7]) #XXX - time_start='%s 00:00:00'%obj.date_from - time_stop='%s 23:59:59'%obj.date_to year=int(date[0:4]) date_from=obj.date_from date_to=obj.date_to - report_type=obj.report_type or 'completed' + hdcase_type=obj.hdcase_type or 'completed' prev_year=year next_year=year prev_month=crr_month-1 @@ -105,171 +101,145 @@ class ReportHDCaseSummary(Model): return dom def replace_quote(dom=""): - dom=dom.replace("False","false") #XXX - dom=dom.replace("True","true") #XXX + dom=dom.replace("False","false") + dom=dom.replace("True","true") return dom.replace("'","\"") - - count=1 + + def set_default(dom=[],topic='topic1'): + dom_txt='' + for f,op,v in dom: + if 'in' in op: #XXX + continue + dom_txt+='defaults.%s%s%s&'%(f,op,v) + if date: + dom_txt+='&defaults.date=%s'%date + if date_from: + dom_txt+='&defaults.date_from=%s'%date_from + if date_to: + dom_txt+='&defaults.date_to=%s'%date_to + if topic: + dom_txt+='&defaults.report_type=%s'%topic + if hdcase_type: + dom_txt+='&defaults.hdcase_type=%s'%hdcase_type + return dom_txt + + def set_ctx(dom=[],topic='topic1'): + ctx={'defaults': {}} + ctx['defaults'].update({ + 'report_type': topic, + 'hdcase_type': hdcase_type, + 'date': date, + 'date_from': date_from, + 'date_to': date_to, + }) + for f,op,v in dom: + if 'in' in op: #XXX + continue + ctx['defaults'].update({ + f: v, + }) + return ctx + # number of hd case of this month dom=[] - dom.append(["date",">=",date_from]) - dom.append(["date","<=",date_to]) - if report_type=='completed': - dom.append(["state","in",["waiting_payment","paid"]]) - else: - dom.append(["state","not in",["waiting_payment","paid"]]) - #dom.append(['patient_id.walkin','=','no']) if branch_id: dom.append(['branch_id','=',branch_id]) if department_id: dom.append(['department_id','=',department_id]) - crr_total=len(get_model("clinic.hd.case").search(dom)) - print('---> dom ', dom) + + topic='topic1' + dom_txt=set_default(dom,topic) + ctx=set_ctx(dom,topic) items={} - items['topic%s'%count]={ + item_vals={ 'month': month_str, - 'qty': crr_total or 0, - 'action': 'clinic_hd_case', - 'action_options': 'mode=list&search_domain=%s&tab_no=0'%replace_quote('%s'%dom), + 'qty': get_model("clinic.report.hd.case.detail").get_report_data(ids=[],context=ctx)['total'], + 'link': 'clinic_report_cycle_item&%s'%dom_txt, } - count+=1 + if hdcase_type!='completed': + item_vals['link']='clinic_report_hd_case_detail&%s'%dom_txt + items[topic]=item_vals # number of patient from previous - dom=[] weekday, prev_total_day=monthrange(prev_year, prev_month) - time_stop='%s-%s-%s'%(prev_year,str(prev_month).zfill(2),prev_total_day) - 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("dom ==> ", dom) - npatient=len(get_model("clinic.patient").search(dom)) - dom=replace_quote('%s'%dom) - items['topic%s'%count]={ + topic='topic2' + dom_txt=set_default(dom,topic) + ctx=set_ctx(dom,topic) + items[topic]={ 'month': prev_month_str, - 'qty': npatient or 0, - 'action': 'clinic_patient', - 'action_options': 'mode=list&search_domain=%s'%dom, + 'qty': get_model("clinic.report.hd.case.detail").get_report_data(ids=[],context=ctx)['total'], + 'link': 'clinic_report_hd_case_detail&%s'%dom_txt, } - count+=1 + topic='topic3' + dom_txt=set_default(dom,topic) + ctx=set_ctx(dom,topic) # new patient of this month - dom=[] - weekday, crr_total_day=monthrange(prev_year, crr_month) - time_start='%s-%s-01'%(year,str(crr_month).zfill(2)) - time_stop='%s-%s-%s'%(year,str(crr_month).zfill(2),crr_total_day) - 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]) - new_patients=get_model('clinic.patient').search_browse(dom) - dom=replace_quote('%s'%dom) - items['topic%s'%count]={ + items[topic]={ 'month': month_str, - 'qty': len(new_patients) or 0, + 'qty': get_model("clinic.report.hd.case.detail").get_report_data(ids=[],context=ctx)['total'], 'action': 'clinic_patient', - 'action_options': 'mode=list&search_domain=%s'%dom, + 'link': 'clinic_report_hd_case_detail&%s'%dom_txt, } - count+=1 # number for patient who resign for this month - dom=[] - time_start='%s-%s-01'%(year,str(crr_month).zfill(2)) - time_stop='%s-%s-%s'%(year,str(crr_month).zfill(2),crr_total_day) - 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: - dom.append(['department_id','=',department_id]) - resign_patients_qty=0 - resign_patients=[] - for pt in get_model('clinic.patient').search_browse(dom): - resign_patients_qty+=1 - resign_patients.append(pt.id) - dom=replace_quote('%s'%dom) - items['topic%s'%count]={ + topic='topic4' + dom_txt=set_default(dom,topic) + ctx=set_ctx(dom,topic) + resign_qty=get_model("clinic.report.hd.case.detail").get_report_data(ids=[],context=ctx)['total'] + items[topic]={ 'month': month_str, - 'qty': resign_patients_qty, + 'qty': resign_qty, 'action': 'clinic_patient', - 'action_options': 'mode=list&search_domain=%s&tab_no=3'%dom, + 'link': 'clinic_report_hd_case_detail&%s'%dom_txt, } - count+=1 # all patient who are in hospital on select month - dom=[] - weekday, crr_total_day=monthrange(year, crr_month) - time_stop='%s-%s-%s'%(year,str(crr_month).zfill(2),crr_total_day) - dom.append(['reg_date','<=',time_stop]) - 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]) - total_patient=get_model('clinic.patient').search_browse(dom) - dom=replace_quote('%s'%dom) - total_patient_qty=len(total_patient) or 0 - items['topic%s'%count]={ + topic='topic5' + dom_txt=set_default(dom,topic) + ctx=set_ctx(dom,topic) + total_qty=get_model("clinic.report.hd.case.detail").get_report_data(ids=[],context=ctx)['total'] + + items[topic]={ 'month': next_month_str, - 'qty': total_patient_qty-resign_patients_qty, + #'qty': total_qty-resign_qty, + 'qty': total_qty, 'action': 'clinic_patient', - 'action_options': 'mode=list&search_domain=%s'%dom, + 'link': 'clinic_report_hd_case_detail&%s'%dom_txt, } - count+=1 topics=utils.TOPICS - for ptype in get_model("clinic.patient.type").search_read([[]],['name']): - tkey='topic%s'%count + count=6 + for ptype in get_model("clinic.patient.type").search_browse([[]]): + topic='topic%s'%count topics.update({ - tkey:{ - 'name': ptype['name'], + topic:{ + 'name': ptype.name, 'unit': 'คน', } }) - dom=[] - time_start='%s-%s-01'%(year,str(crr_month).zfill(2)) - 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 branch_id: - dom.append(['branch_id','=',branch_id]) - if department_id: - dom.append(['department_id','=',department_id]) - npatients_qty=0 - for pt in get_model("clinic.patient").search(dom): - npatients_qty+=1 - dom=replace_quote('%s'%dom) - items[tkey]={ + dom2=dom+[['patient_type_id','=',ptype.id]] + dom_txt=set_default(dom2,topic) + ctx=set_ctx(dom2,topic) + qty=get_model("clinic.report.hd.case.detail").get_report_data(ids=[],context=ctx)['total'] + items[topic]={ 'month': '', - 'qty': npatients_qty, + 'qty': qty, 'action': 'clinic_patient', - 'action_options': 'mode=list&tab_no=0&search_domain=%s'%dom, + 'link': 'clinic_report_hd_case_detail&%s'%dom_txt, } count+=1 - lines=[] index=1 for item in items: topic='topic%s'%index - name=utils.TOPICS[topic]['name'] - unit=utils.TOPICS[topic]['unit'] + name=topics[topic]['name'] + unit=topics[topic]['unit'] line=items[topic] line['topic']=name line['unit']=unit lines.append(line) index+=1 - if report_type=='not_completed': + if hdcase_type=='not_completed': lines[0]['topic']='%s (ไม่สำเร็จ)'%lines[0]['topic'] context['defaults']={ 'date': date, @@ -277,7 +247,7 @@ class ReportHDCaseSummary(Model): 'date_to': date_to, 'branch_id': branch_id, 'department_id': department_id, - 'report_type': report_type, + 'hdcase_type': hdcase_type, } medicals=get_model("clinic.report.medical.summary").get_report_data(ids=[],context=context) @@ -290,7 +260,7 @@ class ReportHDCaseSummary(Model): branch=get_model("clinic.branch").browse(branch_id) sub_name="(%s)" % branch.name or "" data={ - 'report_type': report_type, + 'hdcase_type': hdcase_type, 'branch_id': branch_id, 'department_id': department_id, 'date_from': date_from, diff --git a/netforce_clinic/models/visit_board.py b/netforce_clinic/models/visit_board.py index 0eba76f..b29dd00 100644 --- a/netforce_clinic/models/visit_board.py +++ b/netforce_clinic/models/visit_board.py @@ -96,7 +96,7 @@ class VisitBoard(Model): branch_id=obj.branch_id.id def auto_gen_visit(dom=[]): dom.append(['dispose','=',False]) - dom.append(['walkin','=','no']) + #dom.append(['walkin','=','no']) #XXX def daterange(start_date, end_date): for n in range(int ((end_date - start_date).days)): yield start_date + timedelta(n) @@ -123,10 +123,9 @@ class VisitBoard(Model): department=pc.department_id if weekday==w: dom2=[ - ['visit_date','>=',date_txt], - ['visit_date','<=',date_txt], + ['visit_date','=',date_txt], ['patient_id','=',pt.id], - ['cycle_id','=',cycle.id], + #['cycle_id','=',cycle.id], #XXX ['department_id','=',department.id], ] res=get_model("clinic.visit").search(dom2) diff --git a/netforce_clinic/reports/report_hd_case_detail.xlsx b/netforce_clinic/reports/report_hd_case_detail.xlsx index f32520861593d1935f3c09a7bc45205acce65c6a..90380d78f528b7cc3d095d826a7bf6d8caf942a5 100644 GIT binary patch delta 3739 zcmZu!cTf|`*A1Zx1PHx{szjw1kt&fM1VU4qBAw773i!Y%C{<}8bdX*J1VWJB4824; z1VluUM|mK<>JR;9-sqce|Jc1dbMDOU*}M1Li-*Qs0vW@}DOdqCG&BHPL`gM>os9f^ zt&L*%KLeA;D1x>%>JnfL-#lXj9f%hWyhu#8b$wVE)rWU&7T%o(59mCpAhmHcRv6YQ zGi-KsJvEhNC>z=T*eutmQ6Pq(vP!jBt<=calR@7|W3;JnzQ)asqKIQ(uVhcAUHUl0 zMJJ)VWy$Jh^xTuEKmnKDx2KCf5n@&fzt;`rxBpwoqXB)m%=fYE>SlFlyEVU}VdtEo zHp&8TZ!(*;rlWC1YB%Qwb)25YmLyL*6ur})YLlQJp8q^!MKp6IEQLjp{-*Sxw%oqa zR?pf1G8ifG;P^6G_N)skp11}yFwON$K;fqW+8XjO0Z$ylFQ2< zSw@{>vx-^@TLO3$I1!h!oxSG8(T06Ge63tM8$a64yY7@Od&NE2Hg;mctp;KYr=}@k zYu*tf0|2;y0KgyA)?Osz_{A*-M=gr>OsF>Ol41%E$nNxWS;djV#C#*PBcsSV$a(wT z->Dht2+$BH-;AYWhUsaee*_#;O+}1+oS?q=FoC;;WML)vpgI7B+#T3C+pDm+dPDV4 zcX~zAG33o{`Pvdc{katl$7b2^CNlCZg;-supcv?rBo`$veiqmWc^-xLzWD>R15k0a zEQUp|@1MH#-WH?4Q*yksi+eR=g%U9TQK$4pggC9@J)Y{i2AVdL;ZN_Dj#M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%xndS|GBB)6+ADcpe(Q*upU00c#E0tR0~#RaY2F=0ftomGAC4cD z+>nw1A_2SPRxn4mB8pm;W=c0l>b&0Jn__l*ZwfNeXP#h`tfiNg_lb(13YlpWc+6P1 zw>Utp{W-CT)4F3eWbHw9U-kgG>2oLv6aKr^DwGPtZn+iMkKDRc%AFh5ZkX*asF%mUARYS1ds+s z-IA2CduNR1wUr}%K%S4@q>vQJ_=nm&2cIgv=%-)-c+Lt>-7u8bbPvA;sAF&Wv+-N& zg@!5Cw3^_o9MHY=$nklrrs|&YCGifXmm8IKo&?aomJ|`=ez12b#9pJKav#Y4T=Zs; z$RU%Zw9s57tOH-km)kZA=?__o_^nILotwC#dTL_G ziyCaSYK>~2{nQ?6DlKLAt89!ES5zNZ&(-`DN&4p$$(?KT74kvOksMYnt_bZz5N*$a`bLTgTAvJl-~n zp@byk9Rs5IB{UEge`)qd7OavXPWqh>Xq-J#eO1CvHqobo56#{#mgKY(UYYcuusmAo zmpLtemq;K12=IS>Ct8b6{;KappV6@qumI6udLiy#r1qcRCotg8Awz&JrWg3l^k?Y> z{mBEUAVoXT^CGV_{h9h{{$j$A0RRY3iC`Z;54ewyhd9E^6RQ8$>$Lw2DXPDOqbPn0 z`v-)0-uM6iME5|u=qNg7f-q`y9v$cJ_x|Zxbbo2fqCrp5as6ic(^$U(`H!(ji*{n* KCxOvl-Te=~_a!|5 diff --git a/netforce_clinic/templates/report_hd_case_detail.hbs b/netforce_clinic/templates/report_hd_case_detail.hbs index 4130787..dc0b086 100644 --- a/netforce_clinic/templates/report_hd_case_detail.hbs +++ b/netforce_clinic/templates/report_hd_case_detail.hbs @@ -1,57 +1,43 @@

- {{parent_company_name}} {{company_name}} + {{title}}

-

- {{sub_title}}
- From {{date_from}} To {{date_to}} -

-
Draft: {{draft}} Waiting Treatment: {{wait_treat}}, In progress : {{in_progress}}, Finish Treatment: {{finish_treat}}, Waiting Payment: {{wait_pay}} Paid: {{paid}}, Cancelled: {{cancel}}
- - - - - - - - - - - - + + + + + + + + + + + - {{#if lines}} - {{#each lines}} - - - - - - - - - - - - - - - {{/each}} - {{else}} - - + {{#each lines}} + + + + + + + - {{/if}} + {{/each}} + + + + + + + +
#NumberBegHDEpoHNPatientPayersDlzNewHCTPaychkAmountHDCharge
+ TOTAL: {{total_txt}} +
#DateNumberNameNoteDispose
{{no}} - {{view "link" string=number action="clinic_hd_case" action_options="mode=form" active_id=hd_case_id}} - {{time_start}}{{epo}}{{patient_number}} - {{view "link" string=patient_name action="clinic_patient" action_options="mode=form" active_id=patient_id}} - {{patient_type}}{{dlz_new}}{{hct}}{{rmb}}{{more_amt}}{{fee_amt}}
- No items to display. -
{{no}}{{date}}{{number}}{{name}}{{note}}{{dispose}}
diff --git a/netforce_clinic/templates/report_hd_case_summary.hbs b/netforce_clinic/templates/report_hd_case_summary.hbs index 777a307..fec2a65 100644 --- a/netforce_clinic/templates/report_hd_case_summary.hbs +++ b/netforce_clinic/templates/report_hd_case_summary.hbs @@ -1,12 +1,12 @@

- ใบสรุปการทำ Hemodialysis + {{title}}

{{parent_company_name}} {{company_name}}

- ประจำเดือน {{month}} {{year}} + From {{date_from}} To {{date_to}}

@@ -25,7 +25,10 @@ {{#if qty}} {{else}}
เท่ากับ + + {{qty}} diff --git a/netforce_clinic/todo.txt b/netforce_clinic/todo.txt index 5cfdfe0..b3ad719 100644 --- a/netforce_clinic/todo.txt +++ b/netforce_clinic/todo.txt @@ -8,3 +8,6 @@ > note: แก้ไขยาก หากมาเจอข้อผิดพลาดบางครั้ง + +> report K. boy + - number of treatment is not correct