NoSuchMethodError for PatientService.getProblems

Hello all

I’m new here, I’m trying to get Problems from Specific Patient with this two-line of code :

Patient patient = Context.getPatientService().getPatientByUuid(patientId);

List problems = Context.getPatientService().getProblems(patient.getPerson());

and get the error like this :

Caused by: java.lang.NoSuchMethodError: org.openmrs.api.PatientService.getProblems(Lorg/openmrs/Person;)Ljava/util/List; at org.openmrs.module.cwmrs.auditlog.fragment.controller.EncounterFragmentController.controller( … 91 more

Any idea what happens? Note: this error also occurs when getting Allergy by patient

Hi @lykuong,

PatientService#getProblems(..) was removed as part of this commit for TRUNK-4747 and was released as part of Core 2.0.0.

I am guessing that you are building a module that depends on a version of Core < 2.0.0 and then you face this error at runtime against Core ≥ 2.0.0?

i’m still confuse the term Core 2.0.0 , does it refer to "OpenMRS platform " or “Core Apps Module” ?

I found this on my server :

OpenMRS platform : 2.3.2 Build 437b7f

Core Apps Module : v 1.31.0

Reference Application Module : v2.11.0

What I referred to is OpenMRS Platform, which is thus version 2.3.2.

The module you’re attempting to run on that instance was compiled and built against a much older version of the Platform. Hence the error you bumped into.

1 Like

Hey @lykuong use this branch GitHub - openmrs/openmrs-core at 2.3.2. I am personally using this from last one month working with no issue in my case.

And for modules use 2.11.0. Thanks

OpenMrs core means the platform that you are using (openmrs.war) and additionally you are plugging the different modules as per your need, which is referred as Reference Application Modules.

Hi @mksd thanks for the explanation

so is there any solution to this problem ? or should I upgrade the platform to a higher one?

Hi @lykuong,

As a dependency in your custom module? Yes, if you want to keep using it with more recent versions of Core, such as 2.3.2 that you seem to be running.

@all it work, I just change the dependency in the module to 2.3.2 that all. thank for your help guy!

1 Like