mekomsolutions/openmrs-module-initializer

Not able to set a `Location` person attribute

riteshghiya90 opened this issue · 1 comments

sample entry in personattributetypes/registration_pat.csv:

Uuid,Void/Retire,Name,Description,Format,Foreign uuid,Searchable,_order:1000
113f9a02-f4ac-11ed-a05b-0242ac120003,,registrationLocations,,org.openmrs.Location,0fbbeaf4-f3ea-11ed-a05b-0242ac120002,,

Here the uuid refers to one of the location uuid.
When we start openmrs with this configuration then person attribute is being added with foreign key as 0.

@riteshghiya90 person attribute types' foreign keys are only supported when the person attribute type's format is org.openmrs.Concept (see here). So this indeed doesn't work 😞

However, assuming that you could set the foreign key for a location-based person attribute type, it is unclear what the effect would be... 🤔 As far as we know, this isn't actually handled and wouldn't have any effect. See this conversation on Slack → https://openmrs.slack.com/archives/C021QUDSD5K/p1719847297508189?thread_ts=1719845922.806849&cid=C021QUDSD5K