Getting location attribute through the API?

Tags: #<Tag:0x00007f828df4c290>

How do you get the location attribute of a given location attribute type for a given location through the OpenMRS API?

I’ve looked through the LocationService and seen nothing I can use for this. Am I missing something or is there some alternative method?

LocationAttributes are subproperties of Location, and the API (only) lets you fetch them via the Location.

Look for a method like Location.getActiveAttributes or something like that. (It’s probably defined on a base class.)

I guess he is asking for a method that returns location attributes of a given attribute type and that is

Location.getActiveAttributes(CustomValueDescriptor ofType)

1 Like

That does it. Thanks!