From 1fb1de70cbb45c8f1818767284877637489cec47 Mon Sep 17 00:00:00 2001 From: "watcha.h@almacom.co.th" Date: Fri, 3 Apr 2015 11:58:18 +0700 Subject: [PATCH] fix --- netforce_clinic/models/report_cycle_item.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/netforce_clinic/models/report_cycle_item.py b/netforce_clinic/models/report_cycle_item.py index f2ba1b7..b0326fd 100644 --- a/netforce_clinic/models/report_cycle_item.py +++ b/netforce_clinic/models/report_cycle_item.py @@ -101,7 +101,8 @@ class ReportCycleItem(Model): for hdcase in citem.hd_cases: patient=hdcase.patient_id vascular=patient.vascular_acc - vasculars[vascular.code]['qty']+=1 + if vascular: + vasculars[vascular.code]['qty']+=1 ptype=patient.type_id if ptype_id and ptype_id!=ptype.id: continue