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