[GSoC 2017] - Operation Theater Module Workflow Enhancements

Hello all,

This thread aims to keep track of the Operation Theater Module Workflow Enhancements project. My mentor is @akshika47 .

The main objectives of this project are as follows:

  • Migrate the OT module to current OpenMRS version

  • Add pre-, in-, and post-theater workflow enhancements to the module.

  • Provide reports on OT activity

The project source code is at: GitHub - merovingienne/openmrs-module-operationtheater: Managing and scheduling Operation Theater activities for OpenMRS

A rough timeline of the project is shown below.

I’ll be blogging on the progress of the project on my personal blog.

Best regards :slight_smile:

2 Likes

I have modified the OT module and managed to get it running on the Reference Application 2.6 - on platform 2.0.5. A small note on what I did can be found here.

The module boots up properly and the app shows up on the dashboard. Next step would be checking each action for proper functionality. I plan to use the tests previously written for the module and current logs for this.

2 Likes

Great. Please update what are working and what are not working so we could help you out :smiley:

2 Likes

I’ve been working on the module and all of a sudden now it won’t get loaded. The error says it’s a class loader constraint violation.

Previously, the module could be loaded to the Ref App 2.6 through the web interface. OpenMRS refreshed context and loaded classes without any problem.

But once I shut down the server, restarting it would throw an error saying the following:

… nested exception is java.lang.LinkageError: loader constraint violation: loader (instance of org/openmrs/util/OpenmrsClassLoader) previously initiated loading for a different type with name "org/joda/time/DateTime"

The full stack trace is in this paste : upload_error_jodaTime - Pastebin.com

Apparently, the class loader encounters a conflict with multiple Joda time versions. However, I could delete the module from the server’s folder manually, start the server and then load the module via the web interface for testing.

The class loader constraint violation would come up whenever I restarted the server.

But this week, I could not load the module even in a fresh server. When I load the module via the web interface, the server would crash while refreshing the server. The error is the same.

I looked at other modules using the Joda time library - EMR API and Reporting. I tried the following so far;

  • Use Joda Time version mentioned in the other modules and give scope as provided.

  • Give dependency with compile scope.

So far, not so good. The error’s still there and I found this on Stack Overflow - Spring java.lang.LinkageError: loader constraint violation: loader previously initiated loading for a different type with name X - Stack Overflow But that wasn’t exactly applicable to this instance.

Next step was checking if Joda time dependency could be fully replaced with Java time available in Java 8. I started doing this but Java Time is not a full replacement for Joda time. Some features such as intervals do not have equivalents in Java time.

The best move as I see it would be continuing to use the latest version of Joda Time by eliminating the class loading error. This should be possible as the other modules work together without any problem. It’d be better to use a tried and tested (and already implemented) library than come up with a hasty replacement.

Any help is welcome :slight_smile:

Yes, we had issues with the joda time. Better to use newest one. :slight_smile: and eliminate using joda time as separate dependency.

Great, I’ll first try with Joda Time 2.9.9 then.

Could you kindly clarify what you meant?

And it’s not clear to me how Joda Time 2.9.2 and 2.3 versions separately get loaded and work together in EMR API and Reporting modules, but we can’t load either for OT module.

I meant to use the joda time which comes with java 8. :slight_smile:

Maybe I was confusing before. There’s no Joda Time version that comes with Java 8.

Java 8 has a library called Time for similar behaviour but it’s not as feature-rich as Joda Time.

Some features only available in Joda are used in the OT module. So we can’t directly replace Joda with what’s available in Java 8 :slight_smile:

@dkayiwa, if you had a chance to look at the error logs I sent you, please let me know if you have any suggestions.

@merovingienne we had the same problems with joda time before as well. If we can getrid of it, it should be best. Are there any major features not available in java8? If not let’s built them with java8 time features.

@harsha89 I’m on it. Started doing that while trying to solve the loader violation.

I found that the author of the Java 8 Time library has written another lightweight library called ThreeTen-Extra. By the looks of it, it has exactly what we need - Intervals. ThreeTen-Extra builds on and complements the built-in Time library.

So we can fully eliminate joda-time with a mix of Java Time and ThreeTen-Extra. Do you have any concerns over this?

1 Like

That’s great. No concern what so ever.

Awesome, I’ll keep working on it. Sorry about the delays in updates, it’s because I’m having exams. I hope you understand :slight_smile:

Also, @akshika47 @harsha89 shouldn’t we bring the OT module to a repo under the OMRS org in GitHub? It seems that Lukas isn’t active there anymore anyway.

1 Like

That’s fine. Yes we need to move to an OpenMRS repository.

@akshika47 can you drop a mail to infrastucture group to create a new repository?

1 Like

Sure I will do it :slight_smile:

1 Like

Weekly update #1 : http://blog.chanukawijayakoon.me/2017/06/gsoc-2017-week-1/

1 Like

Happy to report that after rewriting 40 files, module OT is Joda-free.

It was a tedious task tbh - understanding the context, the class structure and best fits was more exhausting than expected. :grin:

I’m not completely sure if all the edges have been smoothed out, with the best possible replacements. But for now, the module is free of Joda Time and it boots up. I’ll get a blog post up soon.

4 Likes

Awesome work indeed!

1 Like

Weekly update #2 - http://blog.chanukawijayakoon.me/2017/06/gsoc-2017-week-2/.

The insight into OpenMRS, concepts of Time in programming and the experience of replacing a library are the highlights of the week. Learning a lot :slight_smile:

3 Likes

Since 2013, we have been collecting a post-operative note which is completed by the surgeon. (I assume that you are calling this “post-theater”). This is used at University Hospital in Mirebalais (Haiti) where we have 6 modern operating rooms. This is not packaged in a pretty way – we include all the htmlforms and metadata for all the Mirebalais functionality in 2 modules, available in English or French, currently run on OpenMRS platform 1.10 without the latest RefApp release, however all the code and metadata is available on github. The PIH modules should work with the latest RefApp. This is the Post-op form:

Post-Op htmlform

If you want to see how the page is rendered, I can provide screen-shots or a guest account on a demo server.

Sorry for the much delayed response. Very glad to see your positive contributions on this.

Ellen Ball Partners In Health

@ball that would make a wonderful addition to the OT module! Thank you for bringing this up :smiley: I mentioned this kind of feature while making the proposal. This gives a solid foundation to build upon.

At the moment we’re concentrating on migrating the module. Next steps will be doing workflow enhancements including data collection. We could add this feature while doing that.

I’ll take a look at the code and get back to you. I must say it’ll be a few weeks before we get to that stage though.