From e2a8ec74316ae583bc35d7c296524b7519ab60b2 Mon Sep 17 00:00:00 2001 From: "chayut.s" Date: Thu, 16 Oct 2014 18:45:32 +0700 Subject: [PATCH] HD Case Report Summary [monthly] --- netforce_clinic/models/report_hd_monthly.py | 75 ++++++++++++++++-- netforce_clinic/reports/report_hd_dialy.xlsx | Bin 0 -> 6092 bytes .../reports/report_hd_monthly.xlsx | Bin 0 -> 5298 bytes 3 files changed, 70 insertions(+), 5 deletions(-) create mode 100644 netforce_clinic/reports/report_hd_dialy.xlsx create mode 100644 netforce_clinic/reports/report_hd_monthly.xlsx diff --git a/netforce_clinic/models/report_hd_monthly.py b/netforce_clinic/models/report_hd_monthly.py index 0cf58b5..abfd984 100644 --- a/netforce_clinic/models/report_hd_monthly.py +++ b/netforce_clinic/models/report_hd_monthly.py @@ -1,4 +1,5 @@ import time + from datetime import datetime from calendar import monthrange @@ -19,27 +20,92 @@ class ReportHDMonthly(Model): def get_report_data(self,ids,context={}): date=datetime.now().strftime("%Y-%m-%d") + datemonth=datetime.now().strftime("%m") if ids: obj=self.browse(ids)[0] date=obj.date year=int(date[0:4]) month=int(date[5:7]) month_str=datetime.strptime(date,'%Y-%m-%d').strftime("%B") + next_month = str(month + 1) + if next_month == 13: + next_month = 12 + next_month_str=datetime.strptime(next_month,'%m').strftime("%B") + + previous_month = str(month - 1) + if previous_month == 0: + previous_month = 12 + previous_month_str=datetime.strptime(previous_month,'%m').strftime("%B") + + patients=get_model("clinic.patient").search_browse(['type','=','All']) + patients_mg=get_model("clinic.patient").search_browse(['type','=','mg']) + patients_sc=get_model("clinic.patient").search_browse(['type','=','sc']) + patients_nhso=get_model("clinic.patient").search_browse(['type','=','nhso']) + patients_pn=get_model("clinic.patient").search_browse(['type','=','personal']) + + new_patients=0 + if datemonth==month: + new_patients= len(patients) + weekday, total_day=monthrange(year, month) time_start='2014-%s-01 00:00:00'%(month) time_stop='2014-%s-%s 23:59:59'%(month,total_day) - lines=[] + dom=[] dom.append(['state','=','completed']) dom.append(['time_start','>=',time_start]) dom.append(['time_stop','<=',time_stop]) + hd_cases=get_model("clinic.hd.case").search_browse(dom) - for hd_case in hd_cases: - lines.append({ + + lines=[ + { 'topic': 'The number of times the Hemodialysis', 'month': month_str, 'amount': len(hd_cases), - }) + }, + + { + 'topic':'The number of cases brought', + 'month': previous_month_str, + 'amount': 'N/A', + }, + { + 'topic':'Number of new patients', + 'month': month_str, + 'amount': new_patients, + }, + { + 'topic':'Number of patients discharged', + 'month': month_str, + 'amount': 'N/A', + }, + { + 'topic':'The number of cases brought', + 'month': next_month_str, + 'amount': 0, + }, + { + 'topic':'Number of patients withdrawn Social Security', + 'month': '', + 'amount': len(patients_sc), + }, + { + 'topic':'Number of patients withdrawn Medical Government', + 'month':'', + 'amount': len(patients_mg), + }, + { + 'topic':'Number of patients withdrawn NHSO(30B)', + 'month':'', + 'amount': len(patients_nhso), + }, + { + 'topic':'Many patients pay themselves', + 'month': '', + 'amount': len(patients_pn), + }, + ] data={ 'month': month_str, @@ -47,6 +113,5 @@ class ReportHDMonthly(Model): 'lines': lines, } return data - ReportHDMonthly.register() diff --git a/netforce_clinic/reports/report_hd_dialy.xlsx b/netforce_clinic/reports/report_hd_dialy.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..f8cb9027271e05bc4433addb84350e09abc5f64a GIT binary patch literal 6092 zcmaJ_1z1$w)~2Mpq#NlR5D=uh8|m&Iy4yjeQ5cZ!lx_x)4k;Kf(x(wWJhH?Mj6lm?_!NvJ-u1p$N zMC8E*9R$5j2=HknlD4XYL{Gez4+;f;x-}O_<0kbA3Wz{8C@n;ZR|q~C6_83_z_&Sj zogw#H*0s!lEhg@oBp^Q<8@5Xhanu{7AJbK2z_A=Io9=ZwrAcyuuO;XHYNXNq!sOYC zSs_IW$ZEkVAkx{`6!Fe#>pZ&je9><4DpnT+i%hL9-IWFTteGIl3Qex)ym}R*D z?RaYA(pow>WU6gWTt1fps;JB}hBeF4?wQTnbur*hFOe1yFjI_RGxEc&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EsWDdo6vSiofhF=HJ8rn>haI`g@^yD7L>W_P)COS$hBU{ymu< yiqS7C$N$ayU#00!_us#ahm8AWkM2?YfAUXV>Cyc@77h;W{t&xgA0MKJtN#J6DSB=I literal 0 HcmV?d00001 diff --git a/netforce_clinic/reports/report_hd_monthly.xlsx b/netforce_clinic/reports/report_hd_monthly.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..2e639747d21bd582953078831307070dfaf3fcb8 GIT binary patch literal 5298 zcmaJ_2|QG7`?ieiOBjuvjD#{srI0Pl*!O+k!k8f=jHR-Kw`7SJl6}vF$V3K(jO?=S zA#0YAB{6*FegE%Q|Gw{guk)L8=KOx=xzBm7=iJwQo!da062MMILqkKRY-^xK_6z7w z{@eSydLbbaq&?i9V!o|Jw>X1wIr}cYo8k=Tw>Am%W1ndXv(VQQ$uAGUv{rrtdRV=#kj(lyj z?{h`A#mJXO$ZKzC)Z>rppXe@kxDPh+63cXZ z-n8QwgS%f3!QZy9X=<4AsmTxu5;OXn`$7FD^A`R`WQV4>j}pV~rBQLOPnNAp&EOU)Z4*C=1B*%D%8Eiq_! zd|qkvYD2Syg_6Nm363o{XjwJ{*Gx4lWc8Uf=t?qBQz;3~YbO;eeYphBJAKEwNGZSi zaLBW-%JDSa47V+>C#NlxOP!?Z)5grFI+!!Xql-`9V-1o2#;3*$#|H)^o_h1g)SE3$i^0&uU&%-z)SNHSK|~Dt(OQ zTL%FpwS}S1d7bw)v>Ks%1#=146h$wt51*%2Q@~Ci<>PfsJnuzhx?{itxa^Ww`gHL# zuiC~cV9czQl<8FBVB{+T*#z;WlW<#2W%2+qIEJf5>$s!%OYy8x?1vY;?a~w1EVKC? z&e%XpUfRfuZsbd(jl8p!r#n2aV+(mad7Jg)gL}`fxuc1K3l7P#&3Ik5tD2#ZhS+PK z=w`tMcXq(s(8|2@!W+l9XmrwPca}iLxA!=a{gUy~=ud_{^MnUiiWrgCo4y9;X=?Md zLchjCoTC(SpiBW4@!<8lslM1ht|p@zu@FDy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