Category Archives: Computer Science

Beginning OpenMRS

One of the first projects that I’ve been working on this semester is the OpenMRS Project.  “OpenMRS is a collaborative open source project to develop software to support the delivery of health care in developing countries.”  I found this to be an interesting project to work on since it’s an open source project with many talented developers as well as supporting a good cause.  However, the setup to begin developing was definitely challenging.

Since OpenMRS is open source, all of their code is published on GitHub, so being able to jump in to developing should be easy. Wrong (for me at least).  First I was introduced to a new IDE, which is no big deal, that’s easy enough.  The IDE I was starting to learn was called IntelliJ IDEA, or as I like to call it, IntelliJelli.  What’s nice about IntelliJelli is that you can directly import a project from GitHub.  However, I did not do this at first.  I thought it would be easier to pull the code from GitHub and just import it myself.  Upon doing this, as planned it imported all the code, but it was missing everything; and what I mean by everything is that it wasn’t created as a maven project, it was missing some maven imports, it even had errors that I don’t know how to explain.  After being very confused and disgruntled with all the unknown errors I had, I decided I would try importing directly from GitHub.  Why I didn’t think of that in the first place is beyond me.  It worked flawlessly.  It created it as a maven project by default, it had all the imports it needed, everything was perfect except for a couple of lines that had a few errors (later I would find out that these errors are not important).

In order to finish getting a working build of this code, I had to open the console and use a few commands to get things working.  First I needed to work my way towards the OpenMRS directory and do a clean maven install.  This built the project as a maven project (again I believe? If not officially for the first time so it’s recognized).  Once the maven clean install and updates were finished, I was ready to start the server that’s contained within.

OpenMRS works within a browser so I had to work my way to the webapp folder and start the jetti program.  Now starting the jetti server worked, however I had nothing to actually work with, I needed some form of UI and database to work with while developing.  Thankfully, OpenMRS supplies an option upon the initial setup to create a fake database of people with certain information and characteristics.  To store this database, I also needed MySQL.

So the first step to this was downloading and installing MySQL, which also needed Python, visual basics, SQL connector, etc.  So before I could even get the database setup, I needed other programs and languages as well.  After installing those and finishing the installation of MySQL, I was ready to begin the installation of the Legacy UI supported by OpenMRS.  Thankfully there was a very helpful tutorial provided by OpenMRS on their wiki page, so I followed those instructions and placed the generated UI file into my appdata folder.  With this I was finally ready to begin the initial setup of OpenMRS in my browser.

Upon starting MySQL and the OpenMRS jetti server, I opened up my browser and went to localhost port number 8080.  I went through the custom / advanced setup so that I could select creating a database of fake people to use and to communicate with MySQL.  It took awhile for it to create the data, but it finally worked and redirected me to the log in page. Success.  I logged in and went straight to the database to see what I could find for data.  I found 2 people.  I can tell that the identification numbers for the people are not in chronological order, but I feel like I should have more than 2 people in my database.  I’m hoping to resolve this issue soon.

In the coming days / weeks I’ll be working on a new project with OpenMRS that deals with radiology.  The radiology team seems excited to be helping us students succeed, which is very thoughtful of them and I’m grateful for that.  Working on the tickets they suggested we look into will be interesting and I’m hoping it will put my knowledge to the test.

Until next time… Nick

From the blog CS@Worcester – Nick Richard by Nick Richard and used with permission of the author. All other rights reserved by the author.

Just Starting Out

Hello everyone,

I’m Nick Richard I’m a senior in my last semester here at Worcester State University.  I majored in computer science with a minor in mathematics, and I’m very excited, yet nervous, to finally be graduating from school.  Soon I’ll be thrown into the real world and have to make a living like everyone else.  I have no doubts that I’ll struggle though, I think I’ll do just fine.

But enough about the formal talk, I’ll talk about some of my interests and wrap things up.  When I’m not at school, or working diligently during classes, of course, I work at the local Webster Kmart. Yes, Kmart’s still exist, who would have thought.  You can tell the place is dated when you walk inside however.  Other than that I am an occasional video game player (PC, sorry console players), feel free to discuss games with me.  I also like being outdoors in the summer with camping, snowboarding in the winter, and I’m looking to start going off-roading in my 2005 Ford Escape XLT.

Well, that’s enough about me, I’m looking forward to posting on this blog and sharing my ideas with all who are interested.

Nick

From the blog CS@Worcester – Nick Richard by Nick Richard and used with permission of the author. All other rights reserved by the author.

CS-383 Cloud, Parallel, and Distributed Programming

I am currently enrolled in the CS-383 class at Worcester State University. The class is called Cloud, Parallel, and Distributed Programming, and is the second class for those taking a Big Data concentration. I am in the Software Development concentration, however, I am using electives to take some of the classes from the other track.

From the blog shatos » cs-wsu by shatos and used with permission of the author. All other rights reserved by the author.

Installing Ubuntu on a Google Chromebook

Here is an extremely useful tutorial to get Ubuntu running on a Google Chromebook (netbook).

The link to the resource can be found here.

-Michael Malloy

From the blog Michael Malloy - Worcester State Computer Science » CS@Worcester by mmalloy1 and used with permission of the author. All other rights reserved by the author.

Installing Ubuntu on a Google Chromebook

Here is an extremely useful tutorial to get Ubuntu running on a Google Chromebook (netbook).

The link to the resource can be found here.

-Michael Malloy

From the blog Michael Malloy - Worcester State Computer Science » CS@Worcester by mmalloy1 and used with permission of the author. All other rights reserved by the author.

Unit Test: @should annotations

Basically what I’ve been doing is introducing the “@should” javadoc annotation. Each api method will get one or more @should annotations that simply state a behavior of that method need testing, in other words, each @should annotations should be phrased. For instance:

  • @should not fail given null parameter
  • @should return empty list if no results

The example above would become unit test named (given the method was findPatient):

  • public void findPatient_shouldNotFailGivenNullParameter()
  • public void findPatient_shouldReturnEmptyListIfNoResults()

These are the step I followed to get started on this task:

  • Import the OpenMRS-core Repository from Eclipse
      • In Eclipse, choose File:Import
      • Choose Git: Projects from Git
      • Select Repository Source: URI
      • Browse the location of the local file on the PC (file: openmrs-core)
      • Select the master branch
      • Choose the directory you want to clone into
      • Select Use the New Project Wizard
      • Choose Java: Java Project
      • Enter a project name (To get all files imported, the given name has to be exactly the same as the local file name. In this case the project name should be: openmrs-core)
  •  Start searching all methods that do not have tests
      • In Git Bash, type command:  $grep –r ‘@should’ openmrs-core  (This command line will recurs into sub-directories to look for all “@should” instances)
      • Command:  $grep –r ‘@should’ openmrs-core > file.txt   (This line will save the output to a file text)
  • Browse ‘@should’ annotations in the packages  
      • The txt.file will output all packages that still have ‘@should’ annotations.
      • In Eclipse, look for such packages and start modifying them, so those methods become unit test names.
      • For example: /api/src/main/java/org/openmrs/somepackage/SomeObject.java:

In Eclipse: /api/src/main/java/org/openmrs/aop/AuthorizationAdvice.java:

From the blog Naty Zelaya » CS@Worcester by natyzelaya and used with permission of the author. All other rights reserved by the author.

General Update

So, turns out that whole compilation/posting of our completed ticket wasn’t as ‘complete’ as we’d thought. That is to say, rather than compile everything and post it to GitHub, we ended up trying to compile all our individual code first….repeatedly. It took a bit of playing around with, but we figured out that it could all be compiled and pushed up through the GitHub GUI. For whatever reason, whenever we tried it on the Bash, it just wouldn’t work properly.

After finally getting it sent up, we still hadn’t heard back from the admins about whether we’d properly fulfilled the requirements, so we’re not sure where to go with all of this. As a group, we pretty much decided to focus on the book reports that would be due soon, and just wait for confirmation. As I’ve still not heard from Dhimitris (who originally claimed the ticket), all I’ve been doing is reading more from my book.

Frankly, I was right. Reading glorified textbooks isn’t that fun. I prefer sci-fi/fantasy to non-fiction 😛

From the blog Kyle's Works » CS@Worcester by kyleprimmer and used with permission of the author. All other rights reserved by the author.

Taking Care of Backlog…

So, apparently, I’m really bad at keeping these sorts of things regular. So, let’s start off with two weeks ago, shall we?

Two weeks ago, we did a sort-of lab in class, one that involved downloading various applications and such before it could really get going; well, it involved all that for me, seeing as I was using vastly outdated software/programs. In order to get things working, I had to download the latest version of Eclipse available (Helios, I believe?), as well as a better version of Java in order to properly run everything. I tried to do this all in class, but for whatever reason my internet connection in the classroom seems especially bad. It was at the point that the estemated completion time was several hours, at the lowest. I think the highest I saw was about 10 hours.

Either way, after I got home, everything seemed to work out well enough. The downloads finished rather quickly, and I soon was running the proper software. Unfortunately, everything wasn’t perfect at this point, and thus I had to play around with the Eclipse settings for a bit. Now, while I really should have been typing this up as I did it, so I could remember everything I did, I was an idiot, and failed to do so. So, let’s see how much I can remember, and how much I can re-work through…

It still wasn’t letting me run files as JUnit Tests, so I had to go into the settings and preferences and such to find out why this thing still wasn’t working. Come to find, in spite of downloading the latest of Java and Eclipse, it was still trying to use an old system library, 1.6 I believe it was. I had to go in, forcibly re-direct which Build Path it was using, then I had to force it to run as JUnit Test (unfortunately, I can’t quite remember what I ended up having to do to get that to work properly, but it still didn’t want to run it).

After that fiasco was over and done with, our group finished up our ticket and got ready to compile it all together and send it. I’m not sure if we decided on a new ticket or anything, yet, but I suppose I’ll find out later today in class. In the meantime, I’ve been taking a look at that book I’m apparantly supposed to give a report on. Not gonna lie, I’m not looking foreward to reading what looks to amount to a specialized textbook. I generally shunt those off to be used as references, at best. And even then, the Internet’s generally faster for me. Well, here’s hoping this doesn’t turn out as painful as it’s starting to sound.

From the blog Kyle's Works » CS@Worcester by kyleprimmer and used with permission of the author. All other rights reserved by the author.

How Much Are We Responsible For..?

So, found more info on the project. Dhimitris found most of the sections where we need to add the comments, so that should work well. On the other hand, from what we can see, the last person to work on this project also went about building actual test classes for the project, so we’re not entirely sure whether or not to do the same.

There’s also some question about which sections still need to get done. Taking a look through the project, we found a few cases mentioning the need for ‘tests’, but didn’t specifically mention JUnit tests, so there’s some question of whether or not those were just lazy typo’s, or if they’re separate things we are not responsible for.

Most likely, we’ll first focus on the TODO requests in HibernateFormDAO.java, and HibernatePatientDAO.java to add the @should comments. It seems that they have some Plug-in available that uses such comments to generate test classes, so the comments are first priority. Maybe afterwards, we might be making those test classes themselves, after asking the ticket publisher.

From the blog Kyle's Works » CS@Worcester by kyleprimmer and used with permission of the author. All other rights reserved by the author.

Group Status Report

As a group, we started the week finding out that our original ticket, TRUNK-324, had been claimed by someone else. We had a quick meeting and agreed to work on the TRUNK-3009 instead. TRUNK-3009 is a documentation bug.

For this ticket we are supposed to look for all references in the wiki to Global Preferences, and change them to Settings. According to the description given in OpenMRS the “Global Properties” page was renamed and updated to just a “Settings” page for version 1.9. So if the wiki mentions GPs they need to be updated, as there are still hundreds of references to Global Properties on the wiki.

The description of the bug is somewhat vague, so before we start working on this one of our team member, Connor Kelly, put a comment on the page to make sure that our understanding of the ticket is what they want. The comment was as follows:

“My intention is to go through the whole wiki and replace any instance of “Global Properties” or “global properties” with “Settings (formerly Global properties)”, is my undesrtanding correct on this or am I missing something? I don’t want to mess up the whole wiki.”

On Saturday, March 8, 2014, we got an answer on the comment saying that the update should include that the change only affects version 1.9 and above.

We are now ready to get started on searching and replacing any string “global property” within the wiki page.

The change and what users will find while reading the wiki page is as follows:

Settings (formerly Global Properties 1.8 and below)

Finally, as a group we have agreed to split up the documentation section found in the left panel of the OpenMRS Wiki home page.

From the blog Naty Zelaya » CS@Worcester by natyzelaya and used with permission of the author. All other rights reserved by the author.