Hi all!
I am trying to write a simple reports to count the number of patients based
on visit_type,Model:appointmentreport. We want to show total of patients
for today, Total Patients with visit_type=='New health condition', Total
Patients with visit_type=='Followup'

class AppointmentReportbm(ModelSQL, ModelView):
...
 cmr_newpatients =
fields.Function(fields.Integer('cmr_newpatients'),'get_cmr_newpatients')


@classmethod
    def table_query(cls):
        pool = Pool()
        appointment = pool.get('gnuhealth.appointment').__table__()
        party = pool.get('party.party').__table__()
        patient = pool.get('gnuhealth.patient').__table__()
...

   def get_cmr_newpatients(self, name):
        x=0
        for appointment in appointment:
        if self.visit_type == 'new':
            x+=1
        return x
Can someone help please. Thanks.

Best Regards;

Bounmy Sihaphom
mail. [email protected]

Reply via email to