Utility method to get a Concept by an identifier, name or mapping

Hi all,

There is an existing utility method in the htmlformentry module that retrieves a concept by either an identifier or concept mapping (see method) ;

I believe such a method should be added or introduced into core, this way we would reuse this utility method across all modules.

Use-case

What triggered us to raise this was: I found myself doing a copy and paste of the above method from the htmlformentry module into the appframework module and we thought of having such a method live in core for reusability across all module. As for now, we shall have the copy of this util live in the appframework module which would be deprecated on completion of the ticket below. Details of what exactly I’m working on in the appframework module : https://issues.openmrs.org/browse/AF-59

Created ticket at : https://issues.openmrs.org/browse/TRUNK-5655

cc: @mksd, @dkayiwa

Are you adding it to the ConceptService? What name would you give to the method?

Are you adding

Well I’m not actively working on this as for now but I would in my free time if no dev took this up :wink:

This method could live in the ConceptService class or some utility class and I would name it like :

public Concept getConcept(String idOrMapping) {
    ......
}