If you pass deprecated method encounter.setProvider(User) a User that does not have a Provider object associated, this throws an error. This isn't good backwards-compatibility deprecation for module support.
I'd propose that this method now create the User's Provider object if it doesn't exist on the assumption that if someone meant that a given User be the Encounter's provider, its probably OK to make that User a Provider.
- Add a convenience method to ProviderService that takes a user and creates a provider record for them.
- Confirm with Dave/Mark if they really need this to behave as Dave is describing, create a patch that does this only if you switch a global property to true (but have it default to false).
- Create a Providers wiki page and with a groovy script that will show which of the users don't have provider records, and another script that will add provider records for those users