am not sure if i got you very well, however allow me to post the sql query here so that we can go over it again;

INSERT INTO provider(person_id, identifier, creator, date_created, retired, uuid)
	SELECT u.person_id, CONCAT('prov', SUBSTRING(p.uuid, 5)) , 1, CURRENT_TIMESTAMP , false, UUID()
from person as p
INNER JOIN orders as o ON o.orderer = p.person_id
JOIN users u ON o.orderer = u.user_id
where u.person_id not in (select distinct person_id from provider)