Q fever is diagnosed by demonstrating that the patient's immune system is making increasing numbers of antibodies (special immune cells) against markers (antigens) that are found on C. burnetii.
Prevention involves good hygiene and decent living conditions. When this is impossible, insecticide dusting powders are available to apply to clothing.