OpenmrsProfile Annotation

When I do the following

import org.openmrs.annotation.OpenmrsProfile;
@OpenmrsProfile(openmrsVersion = "2.2.* - 2.*")
public class ConditionServiceImpl extends BaseOpenmrsService implements ConditionService {
. . .

}

I get the following error when I compile:

cannot find symbol
  symbol:   method openmrsVersion()
  location: @interface org.openmrs.annotation.OpenmrsProfile

How do I fix this

cc: @dkayiwa

Since that bean is already in here https://github.com/openmrs/openmrs-module-emrapi/blob/master/api/src/main/resources/moduleApplicationContext.xml#L38-L64 let us abandon the annotation profile approach and instead use the second one as described below:

Loading resources conditionally

Alternately or in addition to the above you can instruct the OpenMRS module loader to skip loading resources based on the OpenMRS version. After you create a maven submodule for a specific OpenMRS version, maven packages it in a jar file and puts in your omod in the lib directory. In config.xml in your module you can declare:

as described here: https://wiki.openmrs.org/display/docs/Supporting+different+OpenMRS+versions

1 Like

Okay, @dkayiwa. Thanks