Adding webservices to exisiting Pharmacy module developed by Harini.How to make it compatable with reference application 2.0.5.

Pharmacy module is available for the standalone version 2.3 but it does not have webservices.We need to discuss the requirements for making it available for the openmrs community to develop full functional openmrs-pharmacy by adding webservices to the module.

Are you asking if a module that isn’t RESTful should become RESTful?

yes,I want to make it restful.

Ok so the consensus is certainly that this is a good thing and that you should go ahead with starting implementing REST resources in the module in question.

I am looking for the basic demo how to add webservice to the existing module and I also work on it but somehow it does not work.Can you look at my code and find why it’s not working.I uploaded the code please have a look at it.

You will have to provide (a lot) more details as to what doesn’t work exactly.

Are you asking about my code?

Before looking at your code it would be useful to expand on “somehow it doesn’t work”.

Have you got a unit test running on your new REST resource for a start?

No I skip the test and I am able to upload it to my reference application and view it on jsp page.When I try to use postman for calling the method it does not work.

I run with test and also getting the same error.

What do you mean by “running with test”? You mean that you get this error in the output of your Maven build?

No sorry I got this error while i try to get the query of conceptnames,but I solved it right now I am getting this error.

This looks like an infinite loop…

I would strongly suggest that you attempt to write a unit test for your REST resource, and then share it with us. You will find many examples of such test in the REST WS module. For example with ProviderResource:

  • The ProviderResource1_9 here.
  • Its test ProviderController1_9Test here.

Could you put together a controller test for your new resource on the model of the above, and reproduce your error in the context of that test? This will help troubleshoot what’s not working.

thanks mksd.I solved it with the help of dkayiwa.

Can you suggest me some links how to write the swagger documentation for the api?

Have you seen this: ‘Documenting REST Resources’?

1 Like

thanks,I am trying to use the harini module but it’s only worked with the standalone application 2.3. How can I would be able to run on my reference application platform 2.0.5? Do I need to update pharmacy module,If yes how can I update the module to run it on my reference application.

(I have no idea what the harini module is.)

Yes a module that was initially designed to un against Core 1.x (Ref App 2.3) might very well have to be changed to run against Core 2.x.

How you would be able to do so depends on the kind of errors that are experienced when attempting the Core upgrade. What do you experience, what are your findings?

the HariniParth module link

I run this module on standalone application 2.3 with proper installation of dependencies it run successfully.Now I want to run this module for the openmrs reference application.But I am confused how can I update the module,do I need to rebuild it again or something else.

Note:When I try to put the pharmacy.omod file into my reference application it’s does not start and give this errror

My goal is to run the module on reference application.if it run successfully then we will write webservices to make it available.

This isn’t the original issue. Could you look at what is printed in openmrs.log when you attempt to start that specific module?