Starting out to develop Modules.Need Someone to Guide Me

So I installed the basic sdk for Openmrs and got the basic example to run. But the structure for the module seems very complex to me. Can someone guide me on how do I start developing my own modules.I have a basic knowledge of Spring MVC and I can develop my own small Spring MVC apps like a login application,calculator,getting data from DB etc. But I am not able to understand the way OpenMRS implements Spring MVC. Can someone please guide me. Mr @darius recommended that I create a post here. It would really be helpful if someone explains me the flow of the basicexample. Thank you!

1 Like

@krishnanspace, welcome!

I suggest that as far as learning about OpenMRS module development, you do continue to look at the OpenMRS-provided resources for this. Especially for questions like what the module layout looks like, how we use Hibernate, etc. But you don’t need to learn the OpenMRS UI Framework (with its custom GSP pages) since we don’t use those in Bahmni.

When it comes to questions of how something looks in the Bahmni UI, you should ask specific questions here.

Do you have an example of some real feature that you might want to be working on, that you can use as a test case? If not, maybe @mjsanish can point you to the piece of work he’s doing now, and this can be a practical place to get started looking at code.

Thanks a lot!

@krishnanspace I think this would be a good place to learn about developing a new module. The wiki also explains about the maven module structure to be followed in order to develop modules.

1 Like

If I want to create a module which adds two numbers which all files would I require?I wouldn’t require all the files mentioned the the module file structure right?Can you please tell me the steps to create addition of two numbers module if possible?This would help me understand how module creation works.Thanks a lot for your reply!!

@krishnanspace Its about the standard all module developers follow. The two child-modules api and omod have their own usage; one for the business logic and another for the web resource.

All your web-resource goes into the omod module. You can add other resources like Hibernate mapping, module config file here. For your case maybe you can add web-resource to accept two numbers, validate them and call a service to add them and return result.

All your core business logic for your module goes into api module. The services, DAO ,etc are present here. In your case, you can add services for adding two numbers, maybe even you would like to store the result or log these result into database, etc.

I think following this standard would help to develop a proper module and learn about the module creation in. But if you simply just want to create a module to add two numbers, you can just create a maven project and move forward with it. But make sure that your final build is in “omod” format as we deploy our developed modules in that format.

1 Like

Thanks for the quick reply.Will try it out and let you know!