Hi all!
I am having problems with query, here is what I did:
...
cmr_numpatients=pool.get('gnuhealth.appointment').__table__()
...
return cmr_numpatients.select(
cmr_numpatients.appointment_type.as_('id'),
Max(cmr_numpatients.create_uid).as_('create_uid'),
Max(cmr_numpatients.create_date).as_('create_date'),
Max(cmr_numpatients.write_uid).as_('write_uid'),
Max(cmr_numpatients.write_date).as_('write_date'),
cmr_numpatients.appointment_type.as_('appointment_type'),
Count(
cmr_numpatients.id).as_('cmr_numpatients'),
where=where,
group_by=
cmr_numpatients.id)
I want to count the number of patients based on appointment_type (selection fields), type char, When I run the query it give me the error message:ValueError: invalid literal for int() with base 10: 'ambulatory'
Your help is greatly appreciated.
Best Regards;
Bounmy Sihaphom