From c4eb3b0aee1266411bceb35c50d4b4f994e29ece Mon Sep 17 00:00:00 2001 From: "watcha.h@almacom.co.th" Date: Mon, 19 Jan 2015 15:30:51 +0700 Subject: [PATCH] report --- netforce_clinic/layouts/clinic_cycle_form.xml | 6 +-- netforce_clinic/layouts/clinic_make_apt.xml | 4 +- netforce_clinic/layouts/clinic_menu.xml | 2 +- netforce_clinic/models/visit_board.py | 38 ++++++++++++++---- netforce_clinic/reports/visit_board.xlsx | Bin 5043 -> 5233 bytes netforce_clinic/templates/visit_board.hbs | 14 +++++-- 6 files changed, 47 insertions(+), 17 deletions(-) diff --git a/netforce_clinic/layouts/clinic_cycle_form.xml b/netforce_clinic/layouts/clinic_cycle_form.xml index 725f602..30322be 100644 --- a/netforce_clinic/layouts/clinic_cycle_form.xml +++ b/netforce_clinic/layouts/clinic_cycle_form.xml @@ -12,8 +12,8 @@ - - - + + + diff --git a/netforce_clinic/layouts/clinic_make_apt.xml b/netforce_clinic/layouts/clinic_make_apt.xml index 7515862..f6a1c99 100644 --- a/netforce_clinic/layouts/clinic_make_apt.xml +++ b/netforce_clinic/layouts/clinic_make_apt.xml @@ -1,5 +1,5 @@ -
- + + diff --git a/netforce_clinic/layouts/clinic_menu.xml b/netforce_clinic/layouts/clinic_menu.xml index ff172e4..c21663e 100644 --- a/netforce_clinic/layouts/clinic_menu.xml +++ b/netforce_clinic/layouts/clinic_menu.xml @@ -39,7 +39,7 @@ - + diff --git a/netforce_clinic/models/visit_board.py b/netforce_clinic/models/visit_board.py index 355c7f7..1f5e26f 100644 --- a/netforce_clinic/models/visit_board.py +++ b/netforce_clinic/models/visit_board.py @@ -110,12 +110,16 @@ class VisitBoard(Model): patient_types={t['id']:t['name'] for t in get_model("clinic.patient.type").search_read([[]],['name'])} cycle_names={t['id']:t['name'] for t in get_model("clinic.cycle").search_read([[]],['name'])} + brch_names={t['id']:t['name'] for t in get_model("clinic.branch").search_read([[]],['name'])} + dpt_names={t['id']:t['name'] for t in get_model("clinic.department").search_read([[]],['name'])} total_wait=0 total_done=0 total_cancel=0 types={} cycles={} no=1 + dpt={} + brch={} for visit in get_model("clinic.visit").search_browse(dom): if visit.state in ('draft','pending'): total_wait+=1 @@ -137,7 +141,7 @@ class VisitBoard(Model): hd_case_id=hd_case.id, if hd_case.number=='/': - hd_case_number='*รอการรรักษา' + hd_case_number='*Waiting' else: hd_case_number=hd_case.number @@ -150,7 +154,7 @@ class VisitBoard(Model): number=visit.number if number=='/': - number='*รอการยืนยัน' + number='*Waiting' cycle=visit.cycle_id patient=visit.patient_id branch=visit.branch_id @@ -164,9 +168,11 @@ class VisitBoard(Model): if visit.state=='cancelled': visit_color='#dbdbdb', if visit.number=='/': - number='*(ยกเลิก)' + number='*(Cancelled)' else: - number+='(ยกเลิก)' + number+='(Cancelled)' + + line={ 'number': number, 'hn_name': hn_name, @@ -195,6 +201,8 @@ class VisitBoard(Model): 'details1':'', 'details2':'', 'details3':'', + 'details4':'', + 'details5':'', 'no': no, 'note': visit.note, 'hd_case_state':HD_STATE.get(hd_case_state,''), @@ -212,6 +220,18 @@ class VisitBoard(Model): [cycle_name.setdefault(cid,0) for cid in cycle_names.keys()] cycles[visit_date]=cycle_name cycles[visit_date][cycle.id]+=1 + + if not brch.get(visit_date): + brch_name={} + [brch_name.setdefault(cid,0) for cid in brch_names.keys()] + brch[visit_date]=brch_name + brch[visit_date][branch.id]+=1 + + if not dpt.get(visit_date): + dpt_name={} + [dpt_name.setdefault(cid,0) for cid in dpt_names.keys()] + dpt[visit_date]=dpt_name + dpt[visit_date][department.id]+=1 dates=[] index=0 @@ -236,11 +256,15 @@ class VisitBoard(Model): line=empty_line.copy() patient_str='%s'%', '.join('%s: %s'%(patient_types[k],v) for k,v in types[date].items()) cycle_str='%s'%', '.join('%s: %s'%(cycle_names[k],v) for k,v in cycles[date].items()) + brch_str='%s'%', '.join('%s: %s'%(brch_names[k],v) for k,v in brch[date].items()) + dpt_str='%s'%', '.join('%s: %s'%(dpt_names[k],v) for k,v in dpt[date].items()) summary_str='%s'%', '.join(['รับไว้: %s'%total_wait,'จำหน่ายแล้ว: %s'%total_done, 'ยกเลิก: %s'%total_cancel]) line['details']='ทั้งหมด %s: %s'%(total_qty,', '.join([summary_str,cycle_str,patient_str])) - line['details1']=summary_str - line['details2']=cycle_str - line['details3']=patient_str + line['details2']=summary_str + line['details3']=cycle_str + line['details1']=brch_str + line['details4']=dpt_str + line['details5']=patient_str line['footer']=True line['title']=False lines.insert(index,line) diff --git a/netforce_clinic/reports/visit_board.xlsx b/netforce_clinic/reports/visit_board.xlsx index 47b0b02c1a7a456edbcc9c91fe2d02d8a457f06e..0769abf8f7fe65f2a1cc2eea1ee390c904a0179e 100644 GIT binary patch delta 3123 zcmZWrc{mhm7ay`441+W#vTF!~LiVv6S&}sphGZLA#%`?BkR?V)k}XSRFS3*@*)BsO zP4+?deJR;K?!C{~{qA@E`knVV?|Yu}p6C3|uUce7l-U@0hKe0PM@I+Xl9SP{Waglt zItA4t6r6t{f;y!*c0?W&I#CYV?k}<(6GwWxHt4R%+g`X9Dd-Uqnt!RApFb9+MY{Gr z?0$h~npqC<7W6`zJoKr8l1x3Yh&QYtwx;#f1=%MHHTDY-;uTpz5~dIvXnn{!Z{2Ld znHTLGP}nqyIF>s0s4rTs!^6Kr0H}`!NeX?E2Gw8NONV`2AWoJ@<7rTac`W7 zsH8slbESBn0c)3Uj8}6Qb(A(MX;Nq`^&;^trM&g5vv-N!gJ zMTB02y@bxq1N>gP4RK2(hy@q)Ez78Pk-R4>2vRT3gF}0_k^AItn3xCKKlRt&&u6)D zXBzL`k^hWUwirf0bET(-XCR$JU=r?u zkw*57&gO^2H25ZE-^N(wW%^g(WUc0xRn@qP^R2zD*ADr1QVdogZk`)#-17R*I3XLD0ZPU6}T zO=d|KBD<(K`Kp4@rkq)YVtf2ApEY#v(m(J=cr0zOfsHjE3cSePmkYQL){86YNd6h4 z6*uLi{ACih!86)hT2coVoZ<~QET75ZQMin`ImN)H-kxa=C8!o!=SJgSit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MB3jEq@Po^O>vKravlrR{+({%e_`Vq+`W@cH zx1$hHy898UyB%0n1dBDAzRb`Mdmf^%eSeDN;FysY6Z2+y`ySc1wctze(FdLNPK4GO z^treMlSY@&)5SVBhw^bqx{d_>i^j^4eb<*@i$_L4Adu%?W&h5#d&Xa@?i|$e?-}w5 z=Y@ajoLlwhSV{2ZHiGQWm;WbiLKC;T$iC?x#@Hte*gvQJl&_;CCN%4Q>^^9cL|{o51H-$0i*2(NgAe?6DMgE)`{A+W+k Xe(hyohyx2yf(cCWpxa*bL7@Ku#90}Z diff --git a/netforce_clinic/templates/visit_board.hbs b/netforce_clinic/templates/visit_board.hbs index 74efa42..fa801c3 100644 --- a/netforce_clinic/templates/visit_board.hbs +++ b/netforce_clinic/templates/visit_board.hbs @@ -34,14 +34,20 @@ {{#each lines }} {{#if footer}} - สรุป - {{details1}} + สรุป + {{details1}} - {{details2}} + {{details2}} - {{details3}} + {{details3}} + + + {{details4}} + + + {{details5}} {{else}}