How can I call an Arden Syntax MLM file in Java?

Application Name: OpenMRS Platform Version Number: 2015-04-20 21:42 Version: 1.11.2 Build 3854fe

**Good day all, I need to embed Arden Syntax ( Medical Logic Module MLM) in a Java Application that will be used for testing Alerts and Triggers during Antenatal registration in OpenMRS. I can compile the MLM by itself using Eclipse and run it without any problem. Now my biggest challenge is to evoke this .MLM in a Java code. In simple terms how can I call .MLM file in a Java code. Thank you in advance;

As far as I know, this is not something currently supported by OpenMRS. I think we had an implementation previously, but we’ve since moved away from using Arden.

Can you describe your use case and perhaps we can propose an alternative solution?

EDIT: I found this thread where some of our CDS experts are talking about using Arden. Maybe @tmdugan can help you understand how she compiles her Arden to bytecode (possibly using this?).

Cheten,

We do this with our CHICA CDS system. There is code within OpenMRS to convert Arden mlms into java rules that can be executed by the openmrs logic service. We use OpenMRS version 1.7.x which contains an arden package. I believe in later versions of Openmrs there is a separate arden module. The version of the parser that were currently use in 1.7.x does not use arden2bytecode. It uses our own grammar which is a bit idiosyncratic. We have a new, working version of the parser that has not been regression tested so it is not in production.

Thanks to @pascal and @tmdugan

I’m not sure if we do have an Arden module at the moment. Maybe @burke can help us out.

As @tmdugan points out, we put an ArdenService and began developing a LogicService to process logic rules. The logic service got complicated and usage fell to the point that it was only being used by the CHICA team. Logic was pulled out into a module, was used almost solely by CHICA with an older version of OpenMRS (maybe 1.6?), and I don’t believe ever got ported to subsequent versions of OpenMRS. The ArdenService actually still exists in openmrs-core, but hasn’t gotten any attention or use since circa 1.6 (>5 years ago?). This will eventually get removed from core, but (obviously) hasn’t been a priority for the community.

If there’s interest in using Arden with OpenMRS, I would suggest migrating the ArdenService into a module and evolving it into a proper Arden Module that could be used by other modules that want to compile & run MLMs.

It might have been @tmdugan, but I believe @vanand was working with her and did the bulk of the coding for the ArdenService. Not sure is she’s still hanging around (Vibha, that is). :slight_smile:

1 Like

I can clarify a few things. We are using the Arden Service with OpenMRS 1.7.x. We have a new version of the parser that uses Arden2Bytecode that is much better. The old version has some problems and is not Arden compliant. I am familiar with the parser code and can answer questions about it if needed. Vibha wrote the grammar for the parser and I wrote most of the java translation to logic rules. We have the code changes for OpenMRS in an private IU repository at the moment. If you are interested, we can share it. It is branched off of OpenMRS 1.7.x.

@burke, Thanks for highlighting this

Good to hear this! @tmdugan. Is this new parser open source and available to the OpenMRS community? If so, please provide a link.

Hi Team,

I am posting here since i also need to call MLM from Java files but couldnot understand discussion above since i am new to medical Knowledge representation . I have started reading about Arden usage in MLMs. But being a new to use, please guide me through some sample MLMs for reference. I have downloaded Arden V2.3 manual for clearing my basics from HL7 web site but need some references of working examples too to learn Arden Syntax.

Thanks and Regards