mekomsolutions / openmrs-module-initializer

The OpenMRS Initializer module is an API-only module that processes the content of the configuration folder when it is found inside OpenMRS' application data directory.
MIT License
23 stars 77 forks source link

Not able to set a `Location` person attribute #243

Closed riteshghiya90 closed 2 months ago

riteshghiya90 commented 1 year ago

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.

mks-d commented 2 months ago

@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