changed cg_ db table right join to appointment-type is not null, from 'mdi'
in the auto-db-to-cg-table