[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Health-dev] What is wrong with my function field?

From: Bounmy Sihaphom
Subject: [Health-dev] What is wrong with my function field?
Date: Mon, 27 Oct 2014 16:40:00 +0700

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')

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

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

Best Regards;

Bounmy Sihaphom

reply via email to

[Prev in Thread] Current Thread [Next in Thread]