Unkown provider showing up as my user in the UI

Hi all,

In the context of a bulk import of legacy data I set the provider as unknown (since the info has been lost):

legacyEncounter.setProvider(
    encounterService.getEncounterRoleByUuid("a0b03050-c99b-11e0-9572-0800200c9a66"),
    providerService.getUnknownProvider());

However then when I look at the result in the visits dashboard, the provider shows up as the user that was used for the bulk import (it happens through an activator): Any idea why this is happening?

This displays the first non-voided provider as the primary provider. So could you be having more than one provider for this encounter where this is the first non voided?

Honestly, no. The above line is the only place where I set the provider on a freshly instantiated Encounter. Is there a way for me to force set the unknown provider as primary?

What does this return?

 select * from encounter_provider where encounter_id=id

Of course replace it with your encounterId :smile:

Sorry, here you go:

28 28 14 1 38 2015-08-11 09:53:51 \N \N 0 \N \N \N d3af731b-9ce8-4ad0-b32e-5bf591617e82

@dkayiwa, could this give you any clues?

Which provider is this row mapping to?

To the provider such that provider_id = '1'. Leading also to the person such that person_id = '1'. … and what we saw in my initial screenshot is indeed the name of that person.

Is that the wanted effect of using the unknown provider?

If you look at Encounter.setProvider(role, provider), you will notice that there are cases where passed role and provider are not added to the encounter. Could this be what is happening for your scenario?