Children with mental disorders in primary care: functional status and risk factors