Tuesday, April 27, 2010

Solving design issue

SO far the code worked really well as expected, then we created patches and submitted them. (by the way he create patches option is pretty cool, it helps to see the changes you made, and you may not even remember). Ben Wolfe suggested that we move the javascript that control the pop-up preview from the "encounterDisplay.jsp" file so that PreviewComplexObstag class would have its own built-in js; which would make the take more reusable. We solved this by correcting the css class, instead. Also we move the resize method from PreviewComplexObstag class to ImageHandler, which made more sense in the design prospective.

Thursday, April 15, 2010

thumbnail creation

we are getting closer and closer to the end of our ticket. Since we were avoiding loading the entire image when the user only need to preview the image (memory issue), we had to resize the image to make a thumbnail instead. We resized the image by redrawing the original image and assigning new dimensions.

In our new previewComplexObsTag method, we resize the image and save the its thumbnail, with "thumb_" prefix added on the original title of the image. Because they use the Obs Id to get the link to the complex obs image, we added the view to get the thumbnail; so on the normal hyper link of the complex obs image we added "&view=thumbnail" to return the reference of its thumbnail.
Another issue in resizing was keeping the ratio of the image, but Tyler fixed it too.

Thursday, April 1, 2010

Addition isImageHandler() method

When we started this project the main key was to figure out if a complex observation is an image or not, so that we could provide a preview for it. We tried different ways that ended up working, but we were told they were not the best ways to test a complexObs. This week we added an isImageHandler() method in the Obs class (it returns true if the ComplexObs is an instance of ImageHanlder) and we were still trying to save the thumbnail for an image (which we haven't finished yet).


Once we finish saving the thumbnail, we will probably achieve the end of the task required on the ticket.

Sunday, March 21, 2010

Presentation week

last week was the week before Spring break and it was the presentation week. We didn't do much on our ticket other than preparing and present our progress to the audience. It seems like we are pretty close(hopefully) to finish our project. After the break, we will work on creating and saving thumbnails of a complex obs. Dr. Matocha was able to trace down the location where the complex obs (images and texts) are stored, i think that will help us to save the thumbnails.

Dr. Matocha: "It looks like I have found the images and where they are identified in the database. First, when the initial run wizard creates a folder in my home directory named Application Data\OpenMRS\ On my XP machine, Application Data is hidden and is located at C:\Documents and Settings\matochaj\Application Data\ In this folder, there is a file named openmrs-runtime.properties. More important to you is that after adding a ComplexObs, there should be a complex_obs folder in there that contains the image files that have been submitted with their original names (I believe).

In the openmrs database, look in the obs table. In phpmyadmin, be sure to scroll to the right to see the value_complex field. I have a single observation record whose value_complex field is "jpg image |Water lilies.jpg". I guess that some method in the API tears this back apart into the type, filename, and extension.
"

Tuesday, March 16, 2010

switching to the use of tags

As i mentioned last week that we had two options to view the complex obs, first we tried to pass the view generated in the controller but it didn't work properly. The is a method called getHyperlink() which is supposed to return the link that shows the entire complex observation. But when we called it in jsp page, it returned the link to the encounter.

Since we had a second option of using a custom tag, we tried created a PreviewComplexObs tag in the openmrs.tld file and PreviewComplexObsTag,a taglib class that relates to the tag. Tyler did a fantastic job on this, so that we can call now css classes in java.Now, you can get the link of the observation.

Future work: Creating a thumbnail of the image and store it.
Find a better to test an observation

Thursday, March 11, 2010

JSTL expression language, what in the world?

This past week was full of confusions about the how to access Java methods in JSP; however it seems like this week it's still the same. I changed the returning string (in Java) that indicates the label of the complex obs display, but I did it in the way i can't even explain i wrote -fieldHolder.label- even thoough I thought it would be fieldHolder.getLabel(). We thought there is something else going behind the scene, so that Tyler asked this issue at the mailing list.

Here is the answer from Darius
"The idea behind MVC is that the JSP page is purely for view, and therefore you never really call any methods there. So we use JSTL-EL, which lets you access objects and their properties in the model, e.g. ${patient.gender}, but you cannot do ${patient.setGender(...)}.

Anyway I'm not exactly sure what the code you're working with looks like, but your options are probably:
1. write a custom tag, like
2. generate the preview in the controller and pass it to the view precomputed.
"

He cites these two options, so we are trying to figure out which one we can be able to build.

Monday, March 1, 2010

Is there always a second way in jsp?

After Tyler sent a question on the OpenMRS developpers' mailing list, we found out that we have to handle the complex obs in a different way from how we approached it. It seems like we need to define a java function then call it in jsp. We can use servlets but none of the openMRS structures contain these.

However, since Josh and JK ended up using jsp as well, they may help us discover the syntax. I will definitely have more time to work on our project, because now, i have everything installed on my PC using Xampp.

Let's see if there is a another way to do this

Sunday, February 21, 2010

Better progress

After spending some time to figure out how to write jsp codes, Tyler came up with a conditional statement that to tell you if a piece of data is a complex observation. However we haven't been able to distinguish an image from a text file, they both behave the same way. He did a fantastic job writing a code to pop an image preview; which I was able to resize into a 100*100 thumbnail(even if i am not sure if this is a good way to do it!).

The presentation of "Homesteading the Noosphere" an essay by Raymond, has been taking much if my time this weekend; but next week I will have more time to work on this project.

AT LEAST, WE HAVE A NOTICEABLE PROGRESS.

Saturday, February 13, 2010

Hackers come, OpenMRS complex obs stay ambiguous

Here's another that starts with Josh's presentation about the origin of hackers and ends with snowing in Arkadelphia. The first chapter of the book "The Cathedral and The Bazaar" by Eric Raymond talks about the coming of computer related technology which dates in mid-20th century. The hackers got together through the computer network ARPAnet, the they developed different usable software and impacted the growth of computing.

On the other side, editing the complex obs in the OpenMRs project is still being complicated. we can't get the XSLT forms to add an encounter of the patient. Hopefully next week we will be able to find the forms and the modules' source code, so that we start the real work.
Hope next week will be warmer!

Tuesday, February 2, 2010

OpenMRS project kick-off

Now, we have everything set up to begin our project. We finally got the ticket assigned and the VM installed. We've linked some important links (explaining the features of complex observations) on our blogs, so that it will be EZ to collect correctly all the requirements. This will be a good documentation.

Since me and Tyler leave in the same dorm, we were thinking about setting up the VM in our PC's which would help us to get together out of class periods.

Monday, January 25, 2010

COPY-LEFT uprising against copy-right

After watching Revolution OS,a movie that shows proponent views for free software, it turns out that, besides political movements, there are also software movements. Like the other social movements - I agree only with some parts of their philosophy - you cannot say that the open source movement is completely right. Suggesting that all software should be open, seems to say that all hospitals should be work like Red Cross.

In my opinion, proprietary software increases competitiveness and perfection of the product. On the other hand, free software movement pushes other companies to realize that some policies have to be improved, and gives opportunity to those who can't afford expensive products.

Very soon Tyler and I are starting working on a part of OpenMRS project that consists of displaying a patient's piece of data - that has a lot of information - with an appropriate link.