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