Error while building

I used them in controller.js but not in controller.java

I dealt with the API but not with PageController.java .

ya , i was looking at the conditon list widget, it only relies on rest calls

I’m working on one of my previous PR: Edit conditions . @dkayiwa suggested to use post instead of get. So I created a form element in gsp and trying to post it using PageController.java for which I need Condition object , but its throwing error. Is there any other way to implement post without having to use PageController.java?

I havent looked into that widget into details , but how is the Conditon created in the first place?? , i would think “editing” a condition would be much easier, given that it can be created.

isn’t this a POST of a condition ??

1 Like

How is that innitially done when creating a new condition . is still passed as a URL ??

Because According to the ticket , when a user clicks the pencil icon , hes taken to almost the same form form as when creating a condition. So how is the innitial form for creating a condition implemented, does it also use a get ??

1 Like

What’s the major issue here, are you failing to do the import of the Condition class? Or it’s a uiframework specific issue?

1 Like

This post is to save data to database. In my implementation, when user clicks on the edit button, condition data would be sent to redirectToEditCondition() function defined in manageconditions.controller.js , where in I would pass the data to editConditions page using window.location as url. So data related to the condition would be passed in the url itself. I’m extracting this data in edit conditions, to show the information in fields on loading.

While creating a new condition, I’m not supplying any values to the fields while loading, so it has just patientId and returnURL parameters in the URL.

Failing to do import of Condition class

Which Condition model are you targeting, the retired one in the emr module or the new one in openmrs-core since 2.2.x?

Condition class of openmrs-core

Are you working from this maven project module https://github.com/openmrs/openmrs-module-coreapps/tree/master/api-2.2?

Shes doing it in the controler …OMOD project

here is the class https://pastebin.com/SALdkYCB

1 Like

i thought about that. do you think when she puts the logic class that calls/imports the Condition class in that maven project api-2.2 , and just call that class in her controller , it will work ?

1 Like

@haripriya can you try creating a dummy class in the maven project api-2.2 , and try importing the condition class, and see whether it complains?

Can the PageController live in the api-2.2 module, I think the uiframework does a package scan for loading these controllers?

So ensure a correct package naming : org.openmrs.module.coreapps.page.controller.*

1 Like

I tried this, yet I’m getting this error

@samuel34 i ddnt mean a page controller. i just meant some other nomal class to do the condition logic in the api-2.2 module , and the call that class in the controller