haripriya
(Haripriya Reddy)
July 21, 2019, 10:08am
1
I’m trying to use Condition class in EditConditionPageController.java (coreapps) . The build fails with the error: cannot find symbol Condition. Though I have given import org.openmrs.Condition I’m encountering the following error during build : https://pastebin.com/NG38qZ36
Any help is appreciated. Thank you
mozzy
(Moses Mutesasira)
July 21, 2019, 10:21am
2
that error is usually thrown when the compiler can not find the variable or object used.
and am seeing this
org.openmrs.module.emrapi.conditionslist.contract does not exist
can you paste one class here where you have used the Condition class??
haripriya
(Haripriya Reddy)
July 21, 2019, 12:58pm
3
Does this mean that I will also have to import org.openmrs.module.emrapi.conditionslist.contract.Condition as well? Here is the class where I’m trying to use Condition: https://pastebin.com/nkRqCQu0
mozzy
(Moses Mutesasira)
July 21, 2019, 1:26pm
4
have you made any change in the EditConditionPageController
class ?? i cant see the error lines the compiler was complaining about.
can you paste it as it was at the time of compliling ??
mozzy
(Moses Mutesasira)
July 21, 2019, 1:33pm
5
on line 42 ,
@RequestParam("condition") Condition condition,
are you sure we have a converter for the condition class ??
or have you personally written a converter for the condition ??
haripriya
(Haripriya Reddy)
July 21, 2019, 1:50pm
6
haripriya
(Haripriya Reddy)
July 21, 2019, 1:51pm
7
I didn’t understand what you meant by converter?
mozzy
(Moses Mutesasira)
July 21, 2019, 2:55pm
8
example is when you do
@RequestParam("patientId") Patient patient
,
The patient converter converts a patient id to a patient object of the same id.
Am not sure we have a converter for a condition object also
as you did here
@RequestParam("condition") Condition condition,
youll have to register/create it your self
here is a list of converters
see https://wiki.openmrs.org/display/docs/Type+Converters
haripriya
(Haripriya Reddy)
July 21, 2019, 3:19pm
9
Thank you @mozzy . I will try this out and report to you
1 Like
mozzy
(Moses Mutesasira)
July 21, 2019, 3:22pm
10
can you first try rebuilding without this line
@RequestParam("condition") Condition condition,
,
and we see whether it will complain of the import ??
haripriya
(Haripriya Reddy)
July 21, 2019, 3:45pm
11
I’m getting this error https://pastebin.com/1EYYQ2q0 even on keeping just imports.
mozzy
(Moses Mutesasira)
July 21, 2019, 3:50pm
12
What version of reff app are you running ??
specifically which version of the core are you running ??
mozzy
(Moses Mutesasira)
July 21, 2019, 4:55pm
13
are running a core version less than 2.2 in you installation ??
haripriya
(Haripriya Reddy)
July 21, 2019, 4:57pm
14
I’m running openMRSVersion 1.12.0
mozzy
(Moses Mutesasira)
July 21, 2019, 5:07pm
15
Now the error comes up at run time
and at compile time it seems fine. could you try running core version 2.2.
the condition class was introduced from core 2.2…
haripriya
(Haripriya Reddy)
July 21, 2019, 5:17pm
16
I’m getting this error : https://pastebin.com/jG5Pb9Mm , on upgrading version of OpenMRS in pom.xml to 2.2.0
mozzy
(Moses Mutesasira)
July 21, 2019, 5:28pm
17
sorry , it actually occurs at compile time , not run time.
mozzy
(Moses Mutesasira)
July 21, 2019, 5:30pm
18
Are you sure when you make that import ,eclipse doesnt detect any error ??
haripriya
(Haripriya Reddy)
July 21, 2019, 5:32pm
19
Yes, It isn’t showing any error there.
mozzy
(Moses Mutesasira)
July 21, 2019, 5:51pm
20
a quick question , in the previous work in the your GSOC project, didnt you work with a Condition class at all? probably in the API not necessarily in the controller??