Healthcare Inspectorate Wales's main functions and responsibilities are drawn from the following legislation: