Location Attributes missing some methods

classic Classic list List threaded Threaded
3 messages Options
sunbiz sunbiz
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Location Attributes missing some methods

Comparing the newly introduced LocationAttribute and LocationAttributeType to the PersonAttribute and PersonAttributeType, I see some differences in their methods.

for e.g. We do not have the LocationAttributeType search by name which is convenient in the PersonAttributeType through the PersonService.getPersonAttributeTypeByName(String name) available, but is missing in LocationService to find LocationAttributeType. Also similar with getPersonAttributeTypes(String exactName, String format, Integer foreignKey, Boolean searchable) is missing from LocationService.

There is also the missing convenience method Location.removeLocationAttribute(LocationAttribute) that is available in Person.removePersonAttribute(PersonAttribute). There might be other differences as well.

Is there some way we can ensure that the API methods are similar across similar domain objects?? May be the BaseAttributeType is the way to do it, but PersonAttributeType is not part of it...

---
Regards,
Saptarshi PURKAYASTHA

My Tech Blog:  http://sunnytalkstech.blogspot.com
You Live by CHOICE, Not by CHANCE
[hidden email] from OpenMRS Developers' mailing list
Burke Mamlin Burke Mamlin
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Location Attributes missing some methods

Agree these should be aligned.  Not sure if there is an automatic way to align them.

-Burke

On Thu, May 17, 2012 at 12:14 PM, Saptarshi Purkayastha <[hidden email]> wrote:
Comparing the newly introduced LocationAttribute and LocationAttributeType to the PersonAttribute and PersonAttributeType, I see some differences in their methods.

for e.g. We do not have the LocationAttributeType search by name which is convenient in the PersonAttributeType through the PersonService.getPersonAttributeTypeByName(String name) available, but is missing in LocationService to find LocationAttributeType. Also similar with getPersonAttributeTypes(String exactName, String format, Integer foreignKey, Boolean searchable) is missing from LocationService.

There is also the missing convenience method Location.removeLocationAttribute(LocationAttribute) that is available in Person.removePersonAttribute(PersonAttribute). There might be other differences as well.

Is there some way we can ensure that the API methods are similar across similar domain objects?? May be the BaseAttributeType is the way to do it, but PersonAttributeType is not part of it...

---
Regards,
Saptarshi PURKAYASTHA

My Tech Blog:  http://sunnytalkstech.blogspot.com
You Live by CHOICE, Not by CHANCE
[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list
Darius Jazayeri-3 Darius Jazayeri-3
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Location Attributes missing some methods

I don't know of a way to align the service methods, since our services can handle multiple domain classes, so we can't just define an interface for it.

All our classes that support the new-style attributes implement org.openmrs.customdatatype.Customizable<A extends Attribute>. It does not have a remove method, so could you propose one? (Note that we'd typically want to *void* the attribute, not actually remove it from the db.)

Unfortunately, PersonAttribute does not implement the new Attribute interface--we'll have to deal with retrofitting that at some point, but we can definitely focus on making sure that the new-style Attributes (LocationAttribute, ProviderAttribute, VisitAttribute) behave consistently with all the methods we want.

-Darius

On Thu, May 17, 2012 at 11:56 AM, Burke Mamlin <[hidden email]> wrote:
Agree these should be aligned.  Not sure if there is an automatic way to align them.

-Burke


On Thu, May 17, 2012 at 12:14 PM, Saptarshi Purkayastha <[hidden email]> wrote:
Comparing the newly introduced LocationAttribute and LocationAttributeType to the PersonAttribute and PersonAttributeType, I see some differences in their methods.

for e.g. We do not have the LocationAttributeType search by name which is convenient in the PersonAttributeType through the PersonService.getPersonAttributeTypeByName(String name) available, but is missing in LocationService to find LocationAttributeType. Also similar with getPersonAttributeTypes(String exactName, String format, Integer foreignKey, Boolean searchable) is missing from LocationService.

There is also the missing convenience method Location.removeLocationAttribute(LocationAttribute) that is available in Person.removePersonAttribute(PersonAttribute). There might be other differences as well.

Is there some way we can ensure that the API methods are similar across similar domain objects?? May be the BaseAttributeType is the way to do it, but PersonAttributeType is not part of it...

---
Regards,
Saptarshi PURKAYASTHA

My Tech Blog:  http://sunnytalkstech.blogspot.com
You Live by CHOICE, Not by CHANCE
[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list
Loading...