Integrating a JAR file with OpenMRS

HI, I am developing a Module and it requires a Pedigree Tree Drawing functionality. I found the most suitable project for pedigree drawing Pelican Pedigree. But couldn’t link OpenMRS with the Java program. Is there anyway that i can give a link in openMRS to run Pelican? (Pelican is not a web application but Java. and download link is at the bottom of the above mentioned page) Thank you.

I don’t think it’s going to be simple to get Pelican to run inside OpenMRS for a few different reasons, which we can discuss if you like.

Can you describe the problem you’re trying to solve, and your current design and perhaps one of the smart Java developers in the community could suggest a tool that would be easier to integrate into OpenMRS?

1 Like

I don’t think you can invoke a standalone application from a webapp, unless it’s an applet or an ActiveX (whose support will be removed in the near future, look at Flash). Better look for a JS only solution.

1 Like

Requirement is to integrate a pedigree tree system into openmrs, which in return should be capable of draw pedigree trees in large scale, should be capable of saving the tree once its drawn, and retrieve saved tree, add additional textbox for each node. I found a JS project JsPedigree but i couldn’t find a way to Save and Retrieve the pedigree trees, and JsPedigrees malfunctions when adding about 15 nodes horizontally, plus it does’t allow to add additional information for each node.
Thank you for the quick response.

If it’s a JS library it’s normal that loading/saving is not supported. You should implement this part by persisting the graphs in the database.

You can use any tree drawing JavaScript library (e.g. GoJS or Treant), but as @lluismf points out, you’ll probably need to build the functionality yourself (mostly likely as an OpenMRS module) to persist and load your trees.

The paper here: http://bioinformatics.oxfordjournals.org/content/20/14/2327.full.pdf indicates that Pelican can run from Java Web Start or as an applet, although the link to the examples appears to be broken. If that code could be found it would be possible to launch Pelican standalone from within OpenMRS but the files would likely be written to the local client machine; if they are required on the server then there would need to be a way to upload and download them. may still be worth exploring.

1 Like

Java applets won’t run in Chrome …

1 Like

You might want to do some research on whether Pedigree provides an API that you use in OpenMRS or if you can communicate or exchange data with it from another program

1 Like

Thank you very much. Will give it a try and inform.

Went through those libraries. But i am looking for an already implemented solution since i’m not familiar with JS.

There is a PelicanApplet (based on Swing) included in the distribution. Looks like the source code for everything is inside. If you need to save files on the server you could even move the save logic serverside and call it from the applet. Personally I think a more up-to-date library would be better if you could get it to work, but at least the applet is there if you are more comfortable with Java-only solution.

1 Like

Found it, thank you very much. :slight_smile:

Thank you, moved to Firefox and works fine now.