Finally I too have gotten around to submitting the foreign student certification form and the required proof of enrollment as a student. Wasn’t as hard as I expected, quite painless actually, the program administrators seem to do a very good job
The last week has been a bit slow for me, electricity disappeared one or two times, internet disconnects several times a day - and even Skype gave me problems this week. Usually Skype calls give me no problem here, but I was unable to stay in a conference call with my mentor Maros, another intern that will work on the project and a third developer/mentor. After a few tries we just gave up - really a shame as it would probably have been useful for me too to listen to the conversation about the project. Also there’s quite a few things I need to fix before I leave Vietnam, buying some of those “required” gifts forcing me to pay even more for overweight luggage. Then trying to avoid some of that by finding a solution for sending stuff back home without having to either wait 3 months, or pay as much as the overweight would cost me.. and so on.
I got my development setup early in the week without any big problems. Many of the prerequisites was already present as I’m working on another project that use many of the same tools. I actually think the setup is easier on OS X than in many of the Windows/Linux cases, I’m certainly happy with the Mac as a development machine. Updated the Ant 1.6.5 that was installed with XCode to Ant 1.7. I installed Tomcat, as I usually use Jetty for development testing, run from Maven. Earlier I also updated Subversion to the latest version and compiled it with SSL support as I was having trouble with the initial code checkout in the beginning. It worked afterwards, but I’m not convinced that the SSL support actually was the key.. as normal http checkout too worked fine when I re-tried that.. anyway, it works now.
I’ve had a look around the code trying to figure out how this project works compared to DHIS. Think I’ve got the very basics now, been a while since I touched JSPs. Also been looking over some key classes in the OpenMRS API. My database is now populated with the demo data that was just made available for version 1.1 yesterday, meaning I’ve got a fairly large data set to test synchronization on I guess with the 476000+ observations and 5200+ patients that was imported. Actually, it’s not big at all, but it should be sufficient to test synchronization for now at least.
As for the actual project I’m going to work on it’s synchronization of the OpenMRS data between different servers/installations. It’s fairly complex if all possible combinations of servers/clients, sync-cases etc. shall be handled properly. I’m supposed to implement 3 parts of the system this summer, and we’re going to leave some parts out, e.g. some of the advanced conflict handling, though provide hooks so that this can be implemented fairly easy when that time comes. The first part, which actually won’t be implemented first, is the generation of a changeset - the data changed since last synchronization. I have a feeling that that part might not be as straight forward as it sounds, since not all of the data is timestamped currently. Another potential problem would be the time on the different servers out of sync, which might leave us with some “lost” records. One option would be to implement some kind of changelog and base the changeset on that, then clear it when a synchronization is confirmed from the receiver. Another option would be to define a main server, and use the time/time offset from that somehow when generating the changeset - but then we’d need timestamps everywhere again, we’ll see what we end up with I guess.
Until now, XML has been pretty much the only mentioned data format, and quite naturally so. Unfortunately - it does take up a lot more bytes than e.g. plain CSV. In the DHIS project we built in compression using Javas Zip-classes. Since most of the XML-specific stuff is repeated over and over again, the compression results was quite good. I guess that in OpenMRS too, some kind of built in compression in the transportation layer would be interesting to speed things up on the often slow connections in the field. I expect the OpenMRS’ implementation to face similar limitations as DHIS in that regard.
Task one will be to select and implement a data model serialization mechanism. I’ll have to take a look at the different options for generating XML again, with JAXB as a potential solution. So far I’ve been working with XStream which is great software with a good mailing list - but unfortunately I’ve run into problems with XStream and Hibernate due to CGLib proxies earlier, and I guess that will be a problem in this project too. I really like the Converters from XStream rather than annotations based implementations.. gives a lot more flexibility when it comes to multi-format serialization. Might not need that in OpenMRS though. Another task is figuring out in what order the data have to be committed in to maintain referential integrity, unless this can be handled by the framework automatically in some way during serialization so that de-serialization automatically builds a object hierarchy in the right order. XStream solves this with references in the XML, and child classes wrapped in parent class XML, and then it rebuilds the object hierarchy from the leaf nodes and up. The mentioned problem with changeset detection and lack of timestamps needs to be addressed over the next few weeks too.
I’m most worried about the last part really, importing the data and handling conflicts isn’t straight forward. I understand that there might be some related functionality in OpenMRS already though with the dictionary import. Haven’t taken a look at that yet, but I guess it’s on my list.
Looking forward to actually writing some code soon, but first - some more research I guess.
