Patients will be able to find out whether they have genes linked to cancer using a world-leading tool developed by the NHS.