OpenMRS Planet

June 19, 2018

Chathuranga Muthukuda

UI improvements continues

Hello folks,

After completing the progress Dialog improvements I have moved into the Charts section in the Patient's Dashboard. The current Chart section is quite a mess and it makes the whole tab layout as I promised in my proposal I have created a separate activity and migrated the expandable Listview component to there.
Now when a user clicked on a particular vital the request will open a new activity and show the relevant chart to the user in there.
Currently, I'm optimizing the chart displaying activity and hopes to complete it in this week
That's the wrap for previous week and let's meet next week with some more interesting news.

See ya

by chathuranga ( at June 19, 2018 01:05 AM

Milan Karunarathne

First Evaluation

This is the final week of the GSoC first phase. Every students and mentors were completed their evaluation in the week. At the end of week, I had completed my first evaluation of the GSoC project and got a email about my first evaluation completed. I was really happy about that. I would like to thank my mentors and Their valuable feedback for me.

In this week I were busy on the Muzima api development for the enhance searching function from the database access by the hibrenate framework.

by milankarunarathne at June 19, 2018 12:41 AM

June 18, 2018

Suthagar Kailayapathy

First Evaluations — GSoC 2018

Week 5[June 12,2018 — June 18, 2018]

I am very happy to say that, I have completed my first evaluations for the Google Summer of Code 2018 since I have manged to work on my tasks in the given time peroid with a huge help of my Mentor.

Thanks to the community for a big support to get this success of the first evaluations. I was asked some questions based on my project and the involvements which are categozied into four categories such as “About you”, “Communication”, “Experience”, and “Anything else to Google” during the first evaluations.

After the evaluation period, I received a mail with the Evaluation results. Yes !!! I have passed successfully and recived the feedback from my mentor about the progress.


Project — Current Status

We are very busy on working with access location management for patients. I am still working on this following pull request to complete the initial given use case,

  1. Person attributes are stored normally using the patient registration form which you have configured as such.
  2. When I log in a certain location, i should only see those patients whose person attribute point to that location.

Added implementation for assigning the patients to the locations on registration by suthagar23 · Pull Request #4 · openmrs/openmrs-module-locationbasedaccess

I have implemented a Advise class using AOP methods to wrap the getPatient() and getPatients() methods to restrict the patient search method.

  • When we enter to the patient search page, It will automatically display some rows of the patients which are from mostRecentRegistrationEncounters. Those mostRecentRegistrationEncounters is fetched using the getPatient(id) method.
  • Then when we are start to search for the patients, the patient search page start to fetch the patient through the REST API, then its depend on the getPatients() method.

So I wanted to track those two methods to restrict the patient search based on the access locations.

Following link is the wiki page which contains the App definition for location selection fragment of the patient registration dashboard.

Adding Location Selection to the Patient Registration App - Documentation - OpenMRS Wiki

by Kailayapathy Suthagar at June 18, 2018 06:06 PM

Jeyasumangala Rasanayagam

GSoC 2018 : Week 5[ June 11, 2018 — June 17, 2018]

I am excited!. I passed in first evaluation. Yes! We finished our first evaluation. My mentor give me a positive opinion and he told me to update my daily progress as I was not active during my exam periods( Third and fourth week).

During the 5th week, I completed some tasks:

  • BIR-3 : HashRouter added to the module instead of BrowserRouter
  • BIR-4 : Add Number of Registration for all Locations to the Module
  • BIR-5 : Added implementation to change the view of the bar chart
  • RA-1501 : Added Number of Registrations for all locations Report

And I planned to start the next objective, “Number of Admissions/Discharges/Transfers views should have to changed in way to provide more information to the user”.

by Jeyasumangala Rasanayagam at June 18, 2018 06:02 PM

Jude Niroshan

Google Summer of Code 2018 — Passed the First Evaluation

It’s not just another day I’m just checking my inbox. It was the first day of the week soon after the first evaluation ended in Google Summer of Code 2018. This grabbed my attention as soon as I opened up my inbox.

Frankly, I couldn’t perform my best in last couple of week with some of the assignment submissions and final exams at college. But I was able to manage both my work. There are lot to complete in the project.

My mentor told me the importance of the documentation and why I should do it at the time of writing the code itself. He has even mentioned it in the evaluation feedback.

I was able to learn how to write the documentation using doxygen. It is a tool for python and C++ documentation generation. I actually didn’t know about it earlier. Thanks to my mentor Tommaso, now I know what it can do.

by Jude Niroshan at June 18, 2018 05:25 PM

Eunice Amoh

Fifth Week of GSoC @ OpenMRS

After several hours of coding, I was able to generate the Swagger SDK from the REST API. I have added a new API, which allow users to generate the swagger SDK for given language.

The REST API can be access from below URL.


This API accepts the language which swagger SDK should be generate. I’m currently working on implementing the front end user interface which allow users to generate the SDK from the UI.

Relevant pull request is added in

From next week, I will be able to write a detail blogpost about the feature with the user interface.

by Eunice Amoh at June 18, 2018 05:08 PM

Piyush Kundnani

GSoC with OpenMRS — Week 5 Coding Phase

Hello World! This week was our first evaluation and we were supposed to submit our work to our mentors. I am happy that I have passed the first evaluation. I have already started to work on the targets for my second evaluation. I studied the form schema controller in detail, also had to look into some spring annotation in detail to understand what is actually happening in the code. Most of my time this week went into understanding the code, reading about spring annotations etc. This week I will try to finish the rest of the controllers and start writing tests and testing the controllers. Thanks for reading!

GSoC with OpenMRS — Week 5 Coding Phase was originally published in piyush.kundnani on Medium, where people are continuing the conversation by highlighting and responding to this story.

by Piyush Kundnani at June 18, 2018 04:31 PM

Prabodh Kotasthane

Week 5 – First evaluations completed

This week was filled with fun and new things. The week started with students and mentors completing first evaluations of their respective mentors and students. Then I went on a five days holiday. I was not able to work for hours this week but I was in contact with Sanatt. We discussed about how to integrate functionality of scopes and launch context. We also decided to make sure that the module runs error-free when we run it with reference application.

The week ended on a positive note where I received mail from GSoC that I have successfully passed my first evaluations. Now I am refreshed and ready for the next phase of coding. This week I am planning to make sure that the module runs against some sample applications from the SMART app gallery. Also verify that the module runs fine with the reference application.


See you all next week! 😀

by Prabodh Kotasthane at June 18, 2018 12:41 PM

Isuranga Perera

GSoC @OpenMRS 5th week

This is the end of the 5th week of GSoC coding period. I got my first evaluation completed. I was really happy to have a poitive feesback from my mentor. I would like to make this a chance to thank him for the support and guidance provided so far.

This week I recieved JIRA & Trello boards for the project. In addition to that I was able to integrate Bahmni styling to the OWA module.

by Isuranga Perera at June 18, 2018 11:48 AM

Samuel Male

Week 5

Hi folks,

For this week, I got number of blockers, my machine was down and we had power shortage in my home area. But however, I tried to nab a few of this week's objectives(check down here).

What the module can currently do.

Currently, the module can download or export Patient data in an encrypted format but depending on default configurations.

Steps followed
  • Build the module with "mvn install" (src :- mergepatientdata);
  • Install the module on Reff App 2.x;
  • Move to the module dashboard;
  • Click the export button;
    • This will trigger the whole process, collects all Patient data, encrypts it and a download is automatically triggered. 
  • NB:- Currectly the module supports only Patient and Location as a Resource. I think next week I will add support for other Resources.
More about the dev work this week
  • I looked through my codebase as a module, did some code cleaning and Implemented logging for debugging purposes. 
  • I refactored my Resource Services to a better implementation. 
  • I think as for now I finished with the export logic. Exporting works good, However I haven't tested it with a big dataset ☹️.
  • Written lots of lines of code and Utility methods.
  • And by the way, I successfully completed my first evaluation with Google and Passed 😃
Next week( week 6 ) Expectations

   NB:- I have kept pushing objectives from one week to another which I want to stop this week ☺️
  • I expect to get done with the importing/merging logic from the UI point of view.
    • Need to add a dialog box where one can drag and drop or browse to the ".mpd" file
    • Test whether the entire API can really merge MPD data.
  • Need to also work on the Configuration support from the UI.
    • I think I will add another GSP page that will contain the congs
    • I think I will use the gridJs Library at the front end for indexing, paging, validation etc..
If it doesn't challenge me, then I won't help me. I think I will be strong enough to stand all this. 


Samuel Male

by Male Samuel ( at June 18, 2018 11:12 AM

June 17, 2018

Ridmal Liyanagamge

GSOC 2018 OpenMRS — week 5

This week ends with a lot of happiness. Because i have passed the first evaluation. And I am really grateful towards my mentor for the positive feedback given by him and thankful for all the support and guidance he have given me to complete my tasks.

So in this week also i have done several tasks in the Attachment API

  1. Added new parameter called “includeIsolated” to getAttachments method in Attachment API which will help to decide isolated Attachments (which are not associated with any encounter or visit ) need to be added to the fetching attachments or not.
  2. Created several unit test cases for fetching attachments with isolated attachments , without isolated attachments based on the “includeIsolated” parameter.Also add new test case for check accuracy of the “includeIsolated” parameter.

And i was little bit stuck with a run time error which was occurred when creating the complex Obs inside the unit tests.But my mentor helped me to solve that error by adding some modifications to the code base by himself.And he inserted an API exception ( type of exception used in OpenMRS ) for handling the return of non -complex obs from the Attachment API. ( which can be occurred because of a misconfiguration)

3. So i created the unit test for verify that an API exception is thrown when the module is misconfigured.

So these are my activities done in the 5th week and i sent those modifications for review.So from the first month of GSOC program, i have learned a lot of new things and i am looking forward to learn more knowledge with putting my full effort to assigned tasks.

by Ridmal Madushanka at June 17, 2018 08:11 PM

Harisu Fanyui

Week Five

 Week Five of gsoc

This week  I continued work on Reviewing the not yet  addressed reviews that were left.

Model change

Then i went further to add to the user table another field by name user activation_key.
This newly added field came up again as a series of discurssion which i had with my mentors and 
 we deemed necessary to instead of having another table to keep track of the token, expiry date, and relate it to 
 the user we should rather introduce another field to the already existing user model and this field 
 have as content, The user token which has been hashed (reversible) also going to use the salt which already
already exist and is used for password hashing. and combined to this hashed token will be the timestamp of
when the request for password reset was made(to be used for knowing if the token has expired or not). The hashed token  which will be of the format Hashed_token:timeStamp (xyt354m8912ghx:1233455612) is a sample of what will be stored in the activation_key field.
The token as noticed is separated from the timestamp by a : this will mark the end of hashed token and the beginning of the timestamp. Hence when the user will submit the token that was sent to him or her via email, the hashing is again done and a pattern match is done against the database for the token if found, then the timestamp is verified to make sure it is not expired. Progress done so far on the work can be found Here. Week ended with the feast of Ramadan which was on Friday and a public holiday.

by Harisu fanyui ( at June 17, 2018 06:36 PM

June 16, 2018

Dileka Weerasuriya

Google Summer of Code 2018 with OpenMRS

5th week of Coding

It’s now been a while since GSoC program has started. The past week has been the 5th week of the program. It’s been so exciting with GSoC 2018 so far 😃.

As I described you in the last weekly blog me and my mentor had been working on coming up with mock-ups before implementing generation of patient clinical reports and integrating the reports in mUzima Android App.

Throughout this week also I engaged in designing the mock-ups under the guidance of my mentor Samuel Mbunga. There were several modifications suggested and I could come up with most of them 😛.

Few of the major concerns

  • Making mock-ups simple to the user
  • Making the mock-ups look similar to the real user interfaces (This is to avoid any confusion that we are not proposing changes to existing use cases, but only for the new ones)
  • Adhering to the work-flows of implemented interfaces in similar use cases.

Following are some of the mock-ups that were modified accordingly.

by Dileka Madushan at June 16, 2018 11:45 AM

June 11, 2018

Milan Karunarathne

Go forward with Coding

At the begin, I have faced a problem with creating a data set which is generated Error when creating a registration on the mUzmia module. After discussed with my mentor we tried to create a new dataset from the data registration with the help of the android simulation, app of the mUzima.

There was not any cohort report to download when Configuring the simulated mobile app. Therefore, I just configure OpenMRS instance to cohort report. Even I tried to configure cohort report It gives null point exception on spring framework when I creating cohort report. With the help of my mentor, I follow the steps to create cohort and getting hands dirty with those configurations. Muzima registration form can be downloaded from the repository.

After creating a registration, from the mUzima mobile application and sent it to the Queue data of the OpenMRS instance to process and insert into the registration. It fails every time with the same error. The error was registration was failed on mod 30 validation. Then I had to read more about Luhn algorithm and after getting knowledge about it. I manage issue on the registration. At the final able to create a relevant dataset with errors as I expected.

Especially I would like to thanks, my mentors. Thanks, both of you for the great help

by milankarunarathne at June 11, 2018 11:45 PM

Prabodh Kotasthane

Week 4 – EHR Launch Flow Integrated!

This week was a real race with time. I completed the api layer work on EHR launch flow the past week and this week planned to complete the omod layer to and test the EHR launch flow against sample SMART app. And yes at the end of this past week I did that. Happy to see my code working! 🙂

The week started with adding the option “Run SMART Apps” on the administration page and making sure that its properly displayed. Then I worked on creating a RunSmartAppController which was responsible for controlling the mapping on which we needed to show the list of registered SMART apps and the user too has a option to run a SMART app. Then I designed and coded the views which the controller methods returned. There are basically two mappings, one GET mapping to show the list of registered SMART apps and one post mapping which handles the SMART app to be ran. After successfully coding all these, I tested them and yes the tests were successful. At the end of week, I customized the access confirmation controller so as to verify the launch parameter of the authorization request against the launch value for that SMART app stored in DB.

After everything was done and ready, I tested every functionality and required cases with a sample SMART application and everything did worked out fine. I am really happy that I have successfully integrated the EHR launch flow in the module and completed my first deliverable. Now my next task is to make everything compatible with any app in the SMART app gallery. Going on a 5 day holiday now! Taking a little break so as to comeback fresh and have a great coding time ahead! 🙂 See y’all next week! 😀

by Prabodh Kotasthane at June 11, 2018 08:02 PM

Eunice Amoh

Fourth week of GSoC @ OpenMRS

This week is the week before the first evaluations. When I’m going through the swagger code generation, I notice that swagger code generator allow users to generate both client side SDK and server side SDK. After discussion with my mentor, we plan to support both the options.

I have made very good progress this week. I was able to generate the basic version of the swagger client side SDK generation. Here is partial of sample code generate from the swagger code generation library. Likewise it generated all the methods with required classes which allow users to quickly implement application using generated client.

* Build call for patientGet
* @param identifier A patient identifier (optional)
* @param given A portion of the given name of the patient (optional)
* @param name A server defined search that may match any of the string fields in the HumanName, including family, give, prefix, suffix, suffix, and/or text (optional)
* @param active Whether the patient record is active (optional)
* @param id The ID of the resource (optional)
* @param family A portion of the family name of the patient (optional)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
public com.squareup.okhttp.Call patientGetCall(String identifier, String given, String name, String active, String id, String family, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = “/Patient”;
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
if (identifier != null)
localVarQueryParams.addAll(apiClient.parameterToPair(“identifier”, identifier));
if (given != null)
localVarQueryParams.addAll(apiClient.parameterToPair(“given”, given));
if (name != null)
localVarQueryParams.addAll(apiClient.parameterToPair(“name”, name));
if (active != null)
localVarQueryParams.addAll(apiClient.parameterToPair(“active”, active));
if (id != null)
localVarQueryParams.addAll(apiClient.parameterToPair(“_id”, id));
if (family != null)
localVarQueryParams.addAll(apiClient.parameterToPair(“family”, family));
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
“application/json”, “application/xml”, “application/fhir+xml”, “application/fhir+json”
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put(“Accept”, localVarAccept);
final String[] localVarContentTypes = {
“application/xml”, “application/json”
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put(“Content-Type”, localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
 .body(new ProgressResponseBody(originalResponse.body(), progressListener))
String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, “GET”, localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
private com.squareup.okhttp.Call patientGetValidateBeforeCall(String identifier, String given, String name, String active, String id, String family, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
com.squareup.okhttp.Call call = patientGetCall(identifier, given, name, active, id, family, progressListener, progressRequestListener);
return call;
* Returns Patient matching results
* @param identifier A patient identifier (optional)
* @param given A portion of the given name of the patient (optional)
* @param name A server defined search that may match any of the string fields in the HumanName, including family, give, prefix, suffix, suffix, and/or text (optional)
* @param active Whether the patient record is active (optional)
* @param id The ID of the resource (optional)
* @param family A portion of the family name of the patient (optional)
* @return Patient
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
public Patient patientGet(String identifier, String given, String name, String active, String id, String family) throws ApiException {
ApiResponse<Patient> resp = patientGetWithHttpInfo(identifier, given, name, active, id, family);
return resp.getData();
* Returns Patient matching results
* @param identifier A patient identifier (optional)
* @param given A portion of the given name of the patient (optional)
* @param name A server defined search that may match any of the string fields in the HumanName, including family, give, prefix, suffix, suffix, and/or text (optional)
* @param active Whether the patient record is active (optional)
* @param id The ID of the resource (optional)
* @param family A portion of the family name of the patient (optional)
* @return ApiResponse&lt;Patient&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
public ApiResponse<Patient> patientGetWithHttpInfo(String identifier, String given, String name, String active, String id, String family) throws ApiException {
com.squareup.okhttp.Call call = patientGetValidateBeforeCall(identifier, given, name, active, id, family, null, null);
Type localVarReturnType = new TypeToken<Patient>(){}.getType();
return apiClient.execute(call, localVarReturnType);
* Returns Patient matching results (asynchronously)
* @param identifier A patient identifier (optional)
* @param given A portion of the given name of the patient (optional)
* @param name A server defined search that may match any of the string fields in the HumanName, including family, give, prefix, suffix, suffix, and/or text (optional)
* @param active Whether the patient record is active (optional)
* @param id The ID of the resource (optional)
* @param family A portion of the family name of the patient (optional)
* @param callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
public com.squareup.okhttp.Call patientGetAsync(String identifier, String given, String name, String active, String id, String family, final ApiCallback<Patient> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
com.squareup.okhttp.Call call = patientGetValidateBeforeCall(identifier, given, name, active, id, family, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<Patient>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;

My next target is to complete the local code changes in my local environment and create a pull request. By next week i’m planning to complete the backend implementation of the swagger SDK generation.

by Eunice Amoh at June 11, 2018 05:49 PM

Suthagar Kailayapathy

Location Based Access Control for Patients

Week 4[June 04, 2018 — June 11, 2018]

Hi folks,

This week I was involved to complete the Location Based Access Control implementation for the patients. As the first step, We planned to initiate this task and see what is going on the system!!

According to our plan, Patients should be created with a access location information during their registration. The access location information will be saved as an person attribute for now through the registrations. The workflow can be thouhght in two ways,

  • There is an custom fragment to select the access locations for the patients, So the system patient registration dashboard can be customized with our access locations fragment.
  • If the system doesn't configured with the custom fragment, then the logged in user session location will be taken for the access location for the patients who registered by that user. — The big problem

How to access the session location from API layer?

I need to find a better solution to fetch the session location information from the API Layer level. The session implementation was coded for the web layer and there are no way to directly access from the API layer.

We need to call a back-end API (appui/session) to fetch the session location information form the system. So I spend a huge amount of time to provide a better solution for this.

After some discussion with my mentor and community members, I was decided to make some changes in the App-UI module to store the session location information in the UserContext. Then we can simply get the session location information from the API layer through the UserContext.

How to get the current session Location without REST Call?

After this task, I planned to add the user registration to this workflow.

See you in the next blog!!!

by Kailayapathy Suthagar at June 11, 2018 05:21 PM

Jeyasumangala Rasanayagam

GSoC 2018 : Week 4 [ June 4, 2018 — June 10, 2018]

We are on our 4th week of GSoC. It was a hard time for me because I didn’t spend much time in the 4th week because of my university semester examinations. It took this entire week and I haven’t enough time to work with my project last week. I told my exam schedule to my mentor and my mentor said to finish all the missing tasks as soon as possible after the examinations. I want to say a great thanks to my mentor to understood my situations and support me during the past week.

But, I regularly have a look at others work and spent little time on OpenMRS talk. And I spent little time on my project too. I worked and tested the RA-1501 and BIR-3.

After the examinations, I want to work hard to complete all the missing tasks quickly and I want to start other objectives too. I hope I can spend my whole semester vacation to work on my project and finish all the tasks as soon as possible.

by Jeyasumangala Rasanayagam at June 11, 2018 04:05 PM

Piyush Kundnani

GSoC with OpenMRS — Week 4 Coding Phase

Time passes so fast, its already been four weeks since the inception of coding phase and we already have our first evaluation the coming week. This week I had some relatives at my place so did not spend as much time as I should have on the project. To start with I continued my work on writing controllers for saving and showing html forms. I also looked at another controllers from existing HFE module and have started writing controllers for getting the list of all the html forms available in the system and to get the details of a particular html form probably filled with dummy data. After I finish work on these controllers, I would write unit tests to test them out. Finally I plan to submit my work to my backup mentor bythurdsay eod for evaluation.

Thanks for Reading!

GSoC with OpenMRS — Week 4 Coding Phase was originally published in piyush.kundnani on Medium, where people are continuing the conversation by highlighting and responding to this story.

by Piyush Kundnani at June 11, 2018 02:59 PM

Isuranga Perera

GSoC @OpenMRS 4th week

OpenMRS Modules

An OpenMRS module is composed of 3 major components.

  1. OWA — Application frontend
  2. API — Dao entities and service layer of the application. Expose a set of APIs
  3. OMOD — Expose endpoints to service layer operations. OWA deals with this component
Fig 1. Project Structure

Previous weeks I worked on an OWA which is the frontend of the OpenMRS module. From this week onwards I’ll be working on the backend of the application (omod & api).Even though the frontend of the application use Javascript based technologies backend only uses Java related technologies such as Spring & Hibernate.

API Component

Fig 2. API Component File Structure

As explained earlier API component consist of Dao entities, Dao layer and mainly the service layer of the application. In addition to that API layer contains hibernate mapping files which map each Dao entity to relevant tables and each field to relevant table columns. As you can see in the Fig 2 Event.hbm.xml & Subscription.hbm.xml files are hibernate mapping files.

Fig 3. Bean Configuration

In addition to hibernate mapping files API contains local bean declarations as well. Additionally we can refer beans exposed by the OpenMRS core as well.

by Isuranga Perera at June 11, 2018 11:27 AM

June 10, 2018

Harisu Fanyui

Week four

Gsoc week four.

Week four of the summer work as all other weeks that have passed had a similar experience and it began by me Bringing up a design with functional requirements as was told by my mentors. I brought up the requirements having in mind to use a library which I have been studying and understanding and as such I had to use one of the UML(Unified Modelling Language ) tool to do the design which in this case I chosed the usecase diagram and came up with the following .

I made this use case having in mind to implement using JWT(JSON Web Token) but when I presented it to my mentors. I had a lot of positive feedbacks which I did not see at the instance when I did my design. Most of the discursion and criticism on this is found on talk here . After the deliberations and the feedback I got I had to change my way of thinking about the JWT. New methodology was proposed that of adding another field to the user table (activation_key) which will contain the token and also a ttl(time to live) conclusion was not yet taken on how it will be represented. In accordance with this, I was suggested to check out how the said feature is implemented in WordPress. I took some time to research about it and understood that WordPress combined the timestamp and the token  which is hashed about 8 times generated to form what they refer to as the activation key. Then when they need verifying, the retrieve the activation key and then split to separate the token from the date and then they could check if the token has expired or not from the timestamp and as well if the token is correct to the one the client is requesting with.

This week I also had to continue fixing some reviews that were provided by my mentor on the last pull request I made.

One of the things which didn’t go well during this week was my communication with my mentor. We normally communicate via, email, talk, skype or uberconference and during this week our normal uberconference which is usually a one on one discursion did not take place because of some perturbation of the network which was from my own end. This made me not to have posed some of my issues and gotten the response in time. That not withstanding the other communication media had no issues and I still got feedback through those means.


The week was not a bad one and I had to just do a pull request reviews and redesign

by Harisu fanyui ( at June 10, 2018 11:23 PM

Ridmal Liyanagamge

GSOC 2018 OpenMRS — week 4

This is the last week of the 1st phase in the GSOC 2018.In this week i was able to complete the 1st objective of my project which is create a API for the attachments ( Still at the review process). So basically in this week ,

  1. I created java-docs for AttachmentsSevice ( Attachment API ) and all the the relevant test cases which will be helpful for other developers to understand what this API exactly does.
  2. I implemented a new method called getIsolatedAttachments for fetch attachments which are not associated with any encounters (and hence any visits either).
  3. I added relevant test cases for newly implemented methods and modified the existing test cases by considering the mentors feedback. Most importantly i learned how to write comments properly for this module.

So In the end of this week i sent the PR for review which is implementation of the Attachments API ( AttachmentsService ) with the relevant test cases based on the current requirements.And my mentors were really helpful for me to complete this tasks and because of them i am able to gather knowledge day by day.

by Ridmal Madushanka at June 10, 2018 07:42 PM

Samuel Male

Week 4

Hi all,

Release tasks.

Looking at the lately anticipated tentative release date, I couldn't proceed with the release process when most of the tickets in the Road Map in the batch aren't fixed. Lots of the time for this week was invested in release tasks. We were very ambitious that by this week, Platform 2.2 could released!

Merge Patient Data Module

Basing from the expected  objectives (check here down) for this week,
  •  I'm only and almost done with the Data exporting logic (I mean from the UI end).
  • I did some little work on Exception handling.
  • To be honest, not yet implemented logging in the entire API. I don't know why I consistently forget.
  • The UI 
    • I added a mergepatientdata app link on the OpenMRS Ref app homepage.
    • I created a mergepatientdata dash board. 
    • I'm still caught up assembling the rest of the API to actually get real life application. I started with the Export fuctionality.

Week 5 Expections

  • In week five, we need to do the first program evaluation with Google. So I'm gonna prepare myself. I anticipate doing it tommorow(Monday).
  • I need to make sure the module really gives a basic functionality. At least covering 58% of the project objectives
Thanks for keeping track and getting concerned with this project development.


Samuel Male

by Male Samuel ( at June 10, 2018 11:25 AM

Dileka Weerasuriya

Google Summer of Code 2018 with OpenMRS

4th week of Coding

At the end of the third week I had successfully created main components of the summary report.

Now it is time for configuring this report to be used by mUzima app which is used by the clinicians in remote areas.

I installed the mUzima Android app in my phone to get familiar with the workflows. The mUzima core module is used to connect the openMRS web app with mUzima app. I together with my mentors came at crucial design constraints before the coding really begins 😃.

  • Clinical summary generated through a scheduled task.
  • Summaries are generated for a patient whose Obs have changed.
  • Every patient must have a summary
  • Creating a server Settings page for downloading Cohorts

I designed few mock ups so the community can guide to the best approach 😆

So next week starts with the goal of completing the designing face and then get to the real business, coding 😻

by Dileka Madushan at June 10, 2018 09:56 AM

Chathuranga Muthukuda

Progress Dialog Improvement

Hi Everyone,

It's almost 4th week in the Google Summer of Code 2018 and Everyone including myself has been busy doing the tasks relevant to the projects we have been assigned.
This week I have been busy with improving the Existing progress dialog and with the help of my mentor I was able to redesign it according to the standards requested in the project page.

Above diagram shows the newly redesigned Progress Dialog and I have also made a pull request to Project repository with the latest changes.
Next week I'm expecting to continue the UI improvements by starting the Charts optimizations.I guess that will be all for now. Se you people.

by chathuranga ( at June 10, 2018 05:35 AM

Dileka Weerasuriya

It refers to the number of actual clusters.

It refers to the number of actual clusters. The blog might be useful to get the abstract idea of k-means. Thanks

by Dileka Madushan at June 10, 2018 04:31 AM

June 07, 2018

Jude Niroshan

2000 reputation points in StackOverflow

StackOverflow is undoubtedly the day saver for millions of programmers around the world. You can’t officially call yourself as a programmer if you haven’t visited this awesome website. There are millions of daily users and active contributors. Back in 2014, I started to search around online communities for developers. I found JavaRanch which was really interesting to me. I spend few months there which I checked every single post that pops up. I could see people are answering very politely even for very basic concepts.

After few months, I got to know that StackOverflow is also something similar but that is way too active than the JavaRanch. Every single minute, there are more than 10 new questions being asked. I was like, woah!

So I created an account back in 2014. I started with 1 reputation point. I wanted to raise it up to 50. I tried to answer some questions, but almost all of them were removed from the site. I felt so bad and went back to JavaRanch. After few months, I came back just to check my profile.

Then I saw the privileges alone with the reputation points. I always wanted to have a solid profile in SO. I answered some basic Java questions and eventually I could hit 50 rep. Then I saw that there are chat rooms and people are chatting on those. I went to check those and even got kicked out from those chats. It was terrible.

However I learnt how to deal with those people in SO. After few months I made some friends in those chats. I did some presentations to them. Once you got to know them, it’s really fun. I answered few questions and ultimately I could climb up the reputation ladder to 2000. It was not easy for me to come to that point. I know some people could ask a single question and hit up to 15,000 rep points.

User Jude Niroshan

Key point is to, answer directly to the point. It helps the others to know that you know about this stuff. Even the later reader will find it easy.

by Jude Niroshan at June 07, 2018 03:43 AM

June 05, 2018

Milan Karunarathne

Unxpected experience during Coding Period

This is the third week of the Google Summer of Code 2018 coding period. Since the previous week, I had face problem with my laptop failure. I had to apologize my mentors for that situation. After doing hard try with my laptop, I had to change my laptop during this week due to wasn’t able fixed it even attempt a lot of stuff on it.

After replaced the laptop, I had to set up the whole environment on my another laptop. After that, I looked into the creating new sample data into the database to start my next implementation and I had tried it and I will work on it during next week.

I would like to thank my mentors, They were really kindness within that much hard situation and giving help me during those periods.

by milankarunarathne at June 05, 2018 01:09 AM

June 04, 2018

Eunice Amoh

Third Week of GSoC @ OpenMRS

During this week, my main focus was to understand the java APIs provided by the swagger code generator library to understand the usage and the fucntionality of the APIs. It’s required to create configuration object of CodegenConfigurator and add necessary details.

CodegenConfigurator codegenConfigurator = new CodegenConfigurator();
codegenConfigurator.setOutputDir("output dir");
final ClientOptInput clientOptInput = codegenConfigurator.toClientOptInput();
new DefaultGenerator().opts(clientOptInput).generate();

After filling the configuration, the DefaultGenerator class provide the interface to generate the SDK for the given language. I did a small test locally and it’s working fine.

After generating the SDK for java, I explore the content and structure of the APIs created from the code generator. I hope to include them in next week blogpost.

Next week, my main objective is to complete the initial version of swagger sdk generation for the FHIR module.

by Eunice Amoh at June 04, 2018 06:06 PM

Suthagar Kailayapathy

Customizing the OpenMRS Patient Dashboard with Access Location Information

Week 3[May 28, 2018 — June 04, 2018]

This is the third week of the Google Summer of Code 2018, I mostly completed the design phase of the initial module implementation. This week, I totally played with Customizing Patient Dashboard with Access Location Information field.

Actually, I need a field to assign the patients to locations while they are registering the patients in the system. So the only preferred way is, create a design to customize the OpenMRS Patient Dashboard with Access Location Information field.

Custom Sections and Fields on the Registration App

The OpenMRS Reference Application includes a built-in Registration app that is configured for a common usage. However it is possible to disable the built-in app, and set up our own customized version of a patient registration app definition.

I can simply add a person attribute to the App Definition by providing the UUID of that required person attribute. Then It will add a simple text box to the patient registration form and pass that value as a person attribute.

“type”: “personAttribute”,
“label”: “Mother’s Name”,
“formFieldName”: “mothersName”,
“uuid”: “8d871d18-c2cc-11de-8d13–0010c6dffd0f”,
“widget”: {
“providerName”: “uicommons”,
“fragmentId”: “field/text”

But I need to add a drop down with active locations in that respected system for the selection while they registering the patients. So I can’t simply use the uicommons-field/text method. I need to create a separate fragment inside my module, And that fragment should be linked with this app definition.

“type”: “personAttribute”,
“label”: “Mother’s Name”,
“formFieldName”: “mothersName”,
“uuid”: “8d871d18-c2cc-11de-8d13–0010c6dffd0f”,
“widget”: {
“providerName”: “locationbasedaccess”,
“fragmentId”: “field/locations”

The app definition mentioned above will add the locations fragment to the patient registration dashboard with all active locations information. The view page of the patient registration dashboard will be like this following,

Yes!!!!…. I have configured the new fragment with OpenMRS Patient Registration Dashboard. Now I am working to finalize this implementation and planning to move to the next objective soon.

References :


by Kailayapathy Suthagar at June 04, 2018 06:05 PM

Chathuranga Muthukuda

UI improvements to create a better user experience

Hello everyone
This week I have discussed some new things with my mentor to improve the User experience related tasks which has assigned in the project task list and I have started implementing the Progress Dialog related task.The currently existing progress dialog design has some major problems with the way it renders in the user interface such as It is taking unwanted space from the layout So I have to think of a proper way of redesigning the dialog layout to avoid this space problem.Currently I'm working on it and will make a PR as soon as I have something to push to the main repository.
I'm also continuing the Provider module implementation I have stated as my first task in previous weeks and will update the progress in here.So i guess that is all for this week and hopes to catch you guys later with some cool stuff I did.Until then see ya

by chathuranga ( at June 04, 2018 05:18 PM

Jeyasumangala Rasanayagam

Applying Hash History in Built-in Reports Module.

GSoC 2018 : Built-in Reports module — week 3[May 28,2018 — June 03, 2018]

This is the third week of Google Summer of Code 2018. Still, my university semester exams are going on. So, I couldn’t put my full effort here. But I tried my best to manage the time for exams and this project.

Difference between browser history and hash history in react.js

Browser history is generally preferred for modern web pages .Browser history uses HTML5 history API when available, and falls back to full refreshes otherwise. It requires the additional configuration on the server side to serve up URLs. When compared with browser history Hash History is less preferred than browser history. It uses URL hashes, along with a query key to keep track of state. And it requires no additional server configuration.

Browser’s history’s location array contains more than just the locations that have been visited within the application. Allowing access to this list would leak information about a user’s browsing history.Hash History is reliant as it store all of the path information in the hash of a URL.

Hash router is used for the static page websites. Ideal for browser based projects. Dynamic server can handle dynamic URLs, then BrowserRouter is used in such instances.

Browser router failed to redirect while refreshing the pages.

In my progress, Actual problem was occurred when I tried to click a patient row from Patients for a Diagnosis report to go to the patient dashboard. Then I got 404 error when press the back button from patient dashboard to return to built in reports module. The router was not initiated at this page since we fixed the router in the index page of the module.

Built-in-reports module uses BrowserRouter for the routing. It’s fail while refreshing the web page or pressing back button in the browser. I have changed to HashRouter to resolve this issue and now it’s working as expected.

Yes, My third week progress is about these things !!.

And I have done some required changes for this tickets ( RA-1500, RA-1501).

by Jeyasumangala Rasanayagam at June 04, 2018 04:42 PM

Prabodh Kotasthane

Week 3 – API layer “done and tested!”

It feels really very amazing and exiting when you start working on something and your code starts to merge. This past week was a great one. A major half of my first deliverable is ready. I successfully coded the api layer and tested it too. Did found some bugs during testing but tried to learn and backtrack the bugs and with the help of Sanatt (My amazing mentor) I cracked the problems and finally my work on the api layer was finished.

The week started with adding the DAO classes required. Then came the required services and their implementations. Finally I had something to test. I first figured out the test data needed for the various tests. Then I made the required configurations changes for testing and wrote the testing data-set. When I wrote some successful tests I was confident on what ever code I wrote was correct. Some tests did fail and when I tried to figure out what and why were those bugs coming, I found that there is still much for me to understand. For a little of time, I was frustrated and just wanted Sanatt to help me. But Sanatt said I should try it myself and that is the way I could learn in much better way. I did tried once again and hurray!!! I was able to get rid of the errors and understood what exactly I was missing. Sanatt also did helped me alot. Finally everything was properly tested and Sanatt merged my code.

The coming week I will work on the omod layer and probably finish it before the First evaluations. I am all charged up and ready for much more amazing coding week ahead!

Cheers everyone ! 🙂

by Prabodh Kotasthane at June 04, 2018 03:37 PM

Piyush Kundnani

GSoC with OpenMRS — Week 3 Coding Phase

Hello World! As you all know, this was the third week of coding phase and was quiet an interesting one. To start with, my mentor helped me with the problem I mentioned in the last blog. I now have a basic working module ready and all my workflow setup. Midway during the week, I had to change my laptop due to some issues in the battery, due to which I had to setup the whole environment in my other PC. After that, I looked into some of the existing controllers which I would be transforming into Rest controllers and made some rough plans about how I would go about implementing them. I have started implementing the basic rest endpoints for type 1 endpoints (related to form html form schema management) and hopefully they should be up and running by the next week. Thanks to my mentor, I am optimistic that I shall meet my targets for the first evaluation which is after 2 weeks. Thanks for reading!

GSoC with OpenMRS — Week 3 Coding Phase was originally published in piyush.kundnani on Medium, where people are continuing the conversation by highlighting and responding to this story.

by Piyush Kundnani at June 04, 2018 03:33 PM

Isuranga Perera

GSoC @OpenMRS 3rd week

During the 3rd week of the coding period I had to face several challenges related to ui implementation. I initially used Material-UI to implement components like tables. But the problem was when it comes to form design material ui’s text fields and selects are lot different than the styling used in Bahmni app. Because of that I had to use react-bootstrap libray to implement forms. Below is the subscription edit form implemented using react-bootstrap library.

I was able to complete all basic UIs including subscription management, edit subscriptions and add patients during this work using react & redux. However after discussing with the community they suggested to use Bahmni EMR UI look and feel instead of OpenMRS ref app style. Therefore will have to adapt these UIs to reflect above mentioned changes.

by Isuranga Perera at June 04, 2018 02:04 PM

June 03, 2018

Harisu Fanyui

Gsoc Week three

Implimentation continues.

My week three has been some how challenging though i did not do much of coding during this week. It began with me Looking into resolving the blockers that i had the week which this one followed. One of the blocker which was a design issue and needed me to have it discussed with my mentor. This blocker came up as a result of some pull request reviews which i trying to fix led to a majority of test failing and i got worried, It Actually took a while for me to get it working reason being that the week was full of official public holidays, public and non working hours particularly for my mentor hence it delayed my resolving of the blocker. This did not just end here I after temporally resolving the issue while waiting for my mentor to discuss with them went further into  looking at the rest webservice module how to add my own new endpoint . This from the wiki seemed not to be a tedious work with the example they used. But while i started following the procedure to create mine, I noticed there were just some concept that could not be applicable to me this was because i found out the resource i will be manipulating through the endpoint is not as direct to the point or not a core model that i could just use out of the box So i after some heavy research found out that i needed to create a custom resource before i can use the wiki documentation and it applies for me. One other disturbing factor was the ease of understanding the methods that are being used when creating the new resource.

Extracurricular Activities.

Apart from my normal gsoc activities for this week. I also found mysel engaged with the openmrs community fixing a bug with result from a pull request i made during testing. I am happy i had to interact with the vibrant community and got some good design and approaches on fixing the raised bug. Again with the help from experts in the community i was able to fix the issue though it is still as at now hanging(not yet been merge) RESTWS-706. pull request

This week ended with a talk discurssion with my mentors of the functional requirement that i will use. This also came up as a result of me proposing the use of json web token for managing the token for  the reseting of the password.

by Harisu fanyui ( at June 03, 2018 11:19 PM

Ridmal Liyanagamge

GSOC 2018 OpenMRS — week 3

This week is a really awesome week. Because the problem which i mentioned in Week 2 was solved and my mentor were very helpful to complete the this week tasks.

In this week i finished all the test cases for the Attachment API ( which is developed for fetch the attachments based on the encounter , visit and patient ).And i modified the implementation of the Attachment API. Basically I applied code reuse in several places in the present implementation by developing general method which can be used for several other methods. All these things are sent to review for my mentors.

Also I learned how to create jar containing test classes using maven and applied to the implementation which is help to provide access to classes from one API scope to other. ( For example accessing api’s test classes from the test scope of api-2.0 ). And this was really helpful for me to maintain a common Helper class for the many test cases in different test scopes. So those are the updates of my GSOC project in this week.

by Ridmal Madushanka at June 03, 2018 07:00 PM

Samuel Male

Week 1

Design phase 

Currently, sync2 depends on AtomFeed and Fhir/REST modules for synchronizing Patient and related metadata in Openmrs. As a matter of fact that the MergePatientData module will be an improvement of the sync module, I was advised that it should depend on the sync2 module. What basically fails sync2 is synchronizing data that existed before it was running in the OpenMRS context. Since we are depending on sync2, I spent the 1st week trying to gather information and looking at the entire codebase of sync and how it works. I came with a simple design. MergePatientData should checkout all existing synchronize-able data at a given Node(Could be child/parent). If sync is running, get data from sync tables, do a filtration of data and store it in a zip file with some encryption. The module should be able to download the zip file.
In a nutshell, I have encountered the following:
  • I started designing a workflow of how the project will be best implemented.
  • I closely studied and inspected the codebase of the sync module and left at an average understanding of the entire logic.
  • I created a skeleton(an initialization) of the module(mergepatientdata)


I don't know whether its quite trivial but in the process of studying sync, All I know it uses AtomFeed module to update it of new events/feeds but I have failed to understand how :( . 

by Male Samuel ( at June 03, 2018 09:09 AM

Week 3

More coding 


Week three has been sort of challenging but lots of work has been done. More work has been done on the API of the module.

Work done.

I started work capitalizing on a Patient as the main Resource. Later, I will work on the rest of the Resources like Location, OBs etc.


This client will abstract us from all the logic of exporting and importing data. It simply uses a given configuration, collect the required data from the database, serialize it to a file and then encrypt the file and possibly return an Audit message. It accomplishes all this by delegating the concerned Services that are currently partly implemented.

Week 4 Expectations

  • I expect to get done with the MPDClient(Both export and import logic). 
  • Need to work on Exception handling of the entire API.
  • Need to work on logging in the entire API.
  • Need to work on the UI.
    Implement a module page on the RefApp.

Extra Credit for Week 4

  • The module should be able to export and import data.
  • I'm gonna do some release task since I'm the OpenMRS Release Manager for platform 2.
Best Regards

Samuel Male

by Male Samuel ( at June 03, 2018 07:53 AM

June 02, 2018

Dileka Weerasuriya

Google Summer of Code 2018 with OpenMRS

Create Data Definition to be consumed by a Custom Report (Reporting module)

3rd week of Coding

For the course of this week I worked on completing a html/text based output. I had been using sql data definitions to pull the data from the database into my report so far, and I described how to on my previous weekly blog 😅.

This week I had the task of printing the age of the patient as one of many patient demographics. The best way to do that suggested by mentor Samuel Mbuga was to create a data definition and bind it to the output.

So lets get straight down to how it’s done! 😃

Step 1

Select data definition found in Mange Report Definitions in Administration page.

Web Interface from OpenMRS web app

Step 2

Select the + next to age in the following list.

Available Options for Data Definitions

Step 3

Enter a name of your choice to the data definition

Remember to save the changes 😆

Step 4

We need to then combine our data definition with a data set definition of type Row- Per- Patient Dataset before attaching it with our Custom Report.

So lets create a Row-Per-Patient Report using the reporting module

Data Set Definition Interface

Choose + next to Row- Per- Patient Dataset option. This will carry you to the below interface where you are available to add the required parameters.

Step 5

First name the data set definition using the Edit button, then, add Parameter of type Patient to get details of single patient.

Step 6

Then lets link the data definition we created earlier with this data set definition.

Interface when a definition is added

Remember to save the changes 😛

Step 7

Add this data set definition in your report

Congratulations ! Now you have created a data definition for your Custom Report which can be accessed in any output template similar to the other data set definitions 😃

by Dileka Madushan at June 02, 2018 02:03 PM

May 28, 2018

Jeyasumangala Rasanayagam

GSoC 2018 : Introduction to Built-in Reports module — week 2[May 21,2018 — May 27, 2018]

We successfully completed our second week of coding!. When I compare my second week with the previous one, I didn’t spend much time on my works of GSoC since I have my semester examination. But I had managed my time with the works.

My mentor advised me to do some modifications on my works I did in last week. Like, Add an “Identifier” column with patient primary identifier and a link to a patient dashboard, Change Encounter Date to “Last encounter date”. I did that too.

Then, I started to working on the next objective “ New patient Registrations view and Number of patient registrations view , bar chart should have flexibility to change the view, Like, see by dates, by weeks, by months etc” last week. While working on that, I found some bugs in the existing reports and the queries which displayed some duplicate data in the tables due to the grouping problem.

And I started working on the New patient Registrations reports to change the view depend on the selection. I sent two PRs too. This is the progress of my second week. Meet you again on my third week progress blog!!!

by Jeyasumangala Rasanayagam at May 28, 2018 05:30 PM

Suthagar Kailayapathy

Aspect Oriented Programming (AOP)

Week 2[May 22, 2018 — May 28, 2018]

This is the second week of the Google Summer of Code 2018, I am still working with my mentor to finalize the project design. This week, I totally played with Aspect Oriented Programming with OpenMRS.

What is AOP?

Aspect-oriented programming (AOP) is an approach to programming that allows global properties of a program to determine how it is compiled into an executable program. AOP is a programming paradigm that aims to increase modularity by allowing the separation of cross-cutting concerns. It will mainly help for cross-cutting programming concerns. Typically, AOP techniques are used for logging, authorization, and authentication tasks.

AOP with OpenMRS

OpenMRS uses AOP mainly for the module system to allow the core API (Services) to be extended in an infinite number of ways. Instead of only providing hooks at certain points in the code for specific uses, every service method within the API can be wrapped by a method in a module. Module services can be extended via AOP as well.

There are three ways to wrap an API method in the OpenMRS,

  1. Before the API method called
  2. Around the API method called
  3. After the API method called

How I planned to use AOP in my project?

Actually, I need to store the accessLocation information for each user while they registering to the system. Since I am implementing this as a new module, I need to use the AOP techniques to wrap the OpenMRS core services.

The current plan for this implementation is,

  1. Store the accessLocation information as a personAttribute automatically.
  2. Wrap the saveUser() method in the personService class using AOP techniques to achieve this task.

Progress of the Project is given below,

  • Initial project structure was created and merged with the code repository.

Created new module for Location based access control project by suthagar23 · Pull Request #5 · openmrs/openmrs-module-locationbasedaccess

  • Implemented the plan using the AOP techniques to wrap the saveUser method in the personService class to store the accessLocation person attribute automatically

Added implementation for assigning the patients to the locations on registration by suthagar23 · Pull Request #4 · openmrs/openmrs-module-locationbasedaccess

I worked with my mentor to improve this part to support the access Location selection while registering the patients or users. Hope I can complete that part with in this week :-)

by Kailayapathy Suthagar at May 28, 2018 04:09 PM

Isuranga Perera

GSoC @OpenMRS 2nd week

Today is the last day of the 2nd week of GSoC coding period. I was able to start the implementation of front end of the Bahmni Notification module with the help of my mentor Daniel. Eventhough I started development of frontend using Angular, I moved my development environment to React+Redux after digging through pros and cons of each approach.

However first half of week 2 spent to solve issue with the AngularJS boilerplate generated by the OpenMRS OWA Generator tool. After having a discussion on OpenMRS Talk we were able to confirm that it is a issue with the generated AngularJS code. No further efforts taken to fix this issue since I started development of the frontend using React+Redux.

Second half of the 2nd week was about the actual deveopment of frontend using react. For the ease of development I used Material-UI library. Below is the subscription management page implemented using above mentioned technologies.

Subscription Management

All the codes related to the project can be found in this repository.

by Isuranga Perera at May 28, 2018 01:36 PM

Prabodh Kotasthane

Week 2 : Here we take off!

This week was a power start to the first and major deliverable “EHR Launch flow” integration in the module. I started the week with a call to Sanatt discussing what and how the work is to be done. We were agreed on starting work with adding the database level requirements, so I added the required tables to the DB. Next I worked on the model classes which were mapped to respective tables. The week ended with all these changes merged into a branch gsoc-18. I am presently working on the addition of the required DAO classes. This week was a good take off and now i am looking forward to have a more amazing coding week ahead.

See y’all next week!


by Prabodh Kotasthane at May 28, 2018 11:53 AM

Piyush Kundnani

GSoC with OpenMRS — Week 2 Coding Phase

Hello World! This was the second week of the Coding phase and it has been a rather frustrating one. For starters I created a basic Rest app using spring-boot which worked perfectly fine. After that, I have been trying to set up a basic Rest module which would be compliant with openmrs and also integrate with it. After going through the wiki, looking at some existing rest modules like idgen, etc. I found some things that I was missing, but even after fixing those the module endpoints are not up. Apart from this, setting up a fast paced workflow has been another struggle. I tried using the watch feature of openmrs-sdk but even it takes a good 5..10 minutes to start the server. And after every change, it seems I have to restart the server. This is a blocker which has limited my speed. Once the basic rest module is setup, the development could gain good speed. I have asked my mentor for help regarding the same, and hope to fix the blockers asap. Thanks for reading!

GSoC with OpenMRS — Week 2 Coding Phase was originally published in piyush.kundnani on Medium, where people are continuing the conversation by highlighting and responding to this story.

by Piyush Kundnani at May 28, 2018 06:18 AM

Eunice Amoh

Second Week of GSoC @ OpenMRS

During the past week, I able to upgrade HAPI FHIR library version to the new version. I encounters several API changes and I fixed them. This week my focus is on integrating the swagger code generator to FHIR module. I will explain what is swagger code generator is.

What is Swagger Code Generator?

Swagger codegen project, which allows generation of API client libraries (SDK generation), server stubs and documentation automatically. If someone want to call APIs of FHIR module, they will require to write clients by using a HTTP client and call the REST APIs. This is adding additional overhead. What if someone have a already generated code that contains APIs which user simply wants to call without writing the API client from beginning. Swagger code generator does exactly same. Swagger code generator has the capability to generate API clients in large number of languages which make development works easy. Below are the languages that supports.

  • ActionScript, Ada, Apex, Bash, C# (.net 2.0, 3.5 or later), C++ (cpprest, Qt5, Tizen), Clojure, Dart, Elixir, Elm, Eiffel, Erlang, Go, Groovy, Haskell (http-client, Servant), Java (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java, Rest-assured), Kotlin, Lua, Node.js (ES5, ES6, AngularJS with Google Closure Compiler annotations) Objective-C, Perl, PHP, PowerShell, Python, R, Ruby, Rust (rust, rust-server), Scala (akka, http4s, swagger-async-httpclient), Swift (2.x, 3.x, 4.x), Typescript (Angular1.x, Angular2.x, Fetch, jQuery, Node)
  • Server stubs: Ada, C# (ASP.NET Core, NancyFx), C++ (Pistache, Restbed), Erlang, Go, Haskell (Servant), Java (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, RestEasy, Play Framework, PKMST), Kotlin, PHP (Lumen, Slim, Silex, Symfony, Zend Expressive), Python (Flask), NodeJS, Ruby (Sinatra, Rails5), Rust (rust-server), Scala (Finch, Lagom, Scalatra)

My target is to embed the swagger code generator and allow FHIR module users to generate the client side SDKs with their preferred languages. This week I have added swagger code generator as a dependency and went through the code on plugging the module.

At the end of the week, I have checked the java code gen library APIs and how it’s possible to integrate it with the FHIR module. Next week, my target is to writing the APIs to support this functionality.

by Eunice Amoh at May 28, 2018 01:51 AM

May 27, 2018

Ridmal Liyanagamge

GSOC 2018 OpenMRS — week 2

First of all I need to tell you that week 2 was not very good week for me.Because of some fair reasons my mentors were not available in this week.Therefore i was not able to maintain proper communication with my mentors and did a huge contribution for attachments module.

Before all of these let me explain what is expected from me by end of the phase 1 which is make sure that Attachments module 100% restful.So first step is create an API to retrieve, for a given patient, the list of attachments

  • within a given encounter
  • within a given visit

Creating of the API is almost complete when i got the project . So mentors expect me to complete all the unit test that show that it all works as expected. So in the week 1 , I am able to finish the unit test for first part ( retrieve the list of attachments within a given encounter ). And it is still in review process and By end of this week i finished the unit test for second part (retrieve the list of attachments within a given visit) .

In this week i was little bit stuck with the development because of above mentioned reasons. But i am looking forward to do more work on next week with the help of my mentors and achieve the output they expected from me.

by Ridmal Madushanka at May 27, 2018 10:02 PM

Harisu Fanyui

Gsoc Week Two

Coding continues.

Summarily, Week two of the summer cycle involved me structuring the the core to receive an email address and should be able to return the user using the email and as well to get a grasp of openmrs webservice module
During this week I. Carried out the following activities.
I Added an email field to the openmrs core module then i also added the necessary getters and setters methods, also went further to add all the methods in the interfaces, classes and some other methods and criteria query to retrieve a user by email supplied.
Github pull request Link

I also finished working on reviews from RESTWS-706. with pull request

I also Read up on json web token.
I Had a look up on the figuring out how it works.
I also Read on Resp api design  and naming RESTful resources. 
During this week i also had a meeting with my mentor and we discoursed on how and which json web token library i will use in composing tokens and sending via email for verification. which we had as suggestions prime-jwt and javajwt.


This week was somehow challenging because of the series of internet perturbation with privacy issues.

by Harisu fanyui ( at May 27, 2018 11:14 AM

Chathuranga Muthukuda

Coding Continues

Hey guys,

It has been almost 2 weeks since the coding period started in GSoC and every one is busy including myself to complete the tasks according to the time frame planned. It has been a tough week for me since I had to migrate from the ubuntu to windows so I had to resetup everything from scrath and Now I'm dealing with asome strange error which has happened while building the OpenMRS web application and I have posted in Talk to get some addtional help from the experts regarding this. Let's hope I can solve it soon because runnig the app locally is crucial for my developments.

So if I get in to the things I have done in this week, I have almost completed the provider manager activity and currently doing the UI adjustments and other improvemrnts. Soon I can move in to the provider dash board activity which is one of the most wanted tasks in the whole project so I'm postive about the progress I'm making and will continue this until I can solve everything I have assigned to do in this summer 😊😊. That's all for now. See you guys soon.

by chathuranga ( at May 27, 2018 04:43 AM

May 26, 2018

Dileka Weerasuriya

Google Summer of Code 2018 with OpenMRS

2nd week of Coding

Throughout this week I engaged in rendering a html/text based output for a report which is used in OpenMRS for treating patients. This blog would be useful for anyone who comes across to work with creating patient summary reports.

1st Step-

The first step to create a html/text based report with groovy is to add a sql dataset definition. This interface in OpenMRS webapp lets you create sql definitions of your choice.

Openmrs Web App Interface to add sql dataset definition.

I tried to bring a patient’s weights in my first SQL dataset definition.

SELECT value_numeric as weights FROM obs WHERE person_id = :person AND concept_id = 5089

Important- Here :person in the SQL query is used to embed the specific person Id entered by the user.

3rd Step

Using the following interface a custom report is created by clicking on custom report (advanced) button.

Once the report is created, then the above sql dataset definition is added using New dataset definition button. html/ text based output is created using the dropdown beside Add another button.

4th step

In the html/ text based output, select groovy from the drop down to start creating your groovy script to bring the patient details to be viewed by the user.

weights = reportData.dataSets.get("weights");
for (row in weights) {

for (column in weights.metaData.columns) {
colValue = row.getColumnValue(column);
colValue = (colValue instanceof java.util.Date) ? util.format(colValue, 'dd/MMM/yyyy') :

by Dileka Madushan at May 26, 2018 04:29 PM

May 25, 2018

Samuel Male

Week 2

Implementation phase

In the preceding week, I was basically trying to study  sync2, how it works and technically understanding its codebase. At the beginning of this week, I finalized on the study case, roughly made a design model for the  MergePatientData module. I also came up with a number of properties the project must portray ie:-
  • Serialisation and Encryption(Cryptography):
    Resource data will be serialized to JSON and stored in a file, which will be encrypted to a 'data.mpd' file. This can reversely be decrypted by the module. 
  • Persistance:
    The module should be in position to retrieve/save data from the OpenMRS context after-all the module merges data from one OpenMRS instance to another.
  • Auditing:
    Like in the sync2 module, Auditing is required to keep track of what really happened during a transfer process of data.
  • Configuration and Validation:
    We should configure which type of data is required to be merged.
Late this week, I started with the coding phase. I'm writing code basing on the design I came up with.

Work done so far.

  • Resource domain:
    I wrote code for almost all intended Resources .
  • Implemented a Service layer for some Resources like PatietResourceService .. However, more work is still required here.
  • I came up with a Repository(MergeAbleBatchRepo) that can store all Resources intended to be shared in a format that it could be easy to serialize. 
  • Lots work has been done. (check it out)
Best Regards 

Samuel Male

by Male Samuel ( at May 25, 2018 03:55 PM

May 24, 2018

Milan Karunarathne

Improve mUzima core, Search Patient Registration Errors by Error Attributes

At the begin of the week, I continued final evaluation of the mockups with the Simon and Ada. We continued UI evaluation meeting in three major areas. We discussed UI implementation within three main ideas,

  • The potential merges should be from mUzima Registration pairs (not through OpenMRS Merge Patient Search) – Our final decision was this implementation should not go through OpenMRS Merge Patient Search, It will design new interface as part of the project. It will search Data from the mUzima Registrations Databases, EMR Database and Queue Database. We will develope this project based on the major two types of users. Firts type of user will be use this merging system to merge whatever patient registration data which conflicted on their mUzima registration. Second type of user will be use this merging system for merge known registration by typing, Name, Gender, Birthdate, etc. The first user can use UI “Merge Patient Search – by Select Attribute” as on figure 1.1 and Second type user can use “Merge Patient Search – By Type” as on figure 1.2.

Merge Patient Search - By Select Attribute

figure 1.1 Merge Patient Search – By Select Attribute

Merge Patient Search - By Type

figure 1.2 Merge Patient Search – By Type

  • Two buttons (Merge Queue into EMR and Create New Patient with Queue) will be move to the top of the page instead keep on the foot – As aim of getting more comfortable for the user and getting speed of  the merge process or go to the create new patient registration without loading entier dataset, we decided to change those buttons position.

Merging Window - Initial - Short View(1)

figure 1.3 Merging Window – Initial – Short View with changed buttons

  • Store the additional metadata in the mUzima Registration pairs table – The project will create new metadata about merging like encounter date, date synced to server, date the pairs resolved, provider, location, resolved by, resolution (merged or created), etc. Furthur implementation, evaluationr can be use those metadata for make evaluations about merging duties and accurarcy of the merge.

As first step of the project implemention, Simon gave advice to current module openmrs-module-muzimacore module. There are three separate sub modules,

  • API
  • JavaRosa
  • Omod

With the guidance of my mentors I have start loking integrate my implementation into currnet mUzima core module. As first step of the project, My mentors gave idea about searching enhancement of the current error search of the module. From that enhancement user can search error registration of the mUzima patinet registration can be search by typing error type. This implementation will be finish within next week.

by milankarunarathne at May 24, 2018 06:21 AM

May 22, 2018

Jude Niroshan

Google Summer of Code with NS-3

I’m so much excited to know that I was selected for Google Summer of Code for second time. Last year I worked with OpenMRS. It was a unique experience I’ve ever had thanks to OpenMRS and GSoC team. I was so much thrilled with all I gained from the GSoC program. I never through I’d be able to contribute for such a large open-source project. So, I decided to apply again in 2018 which is my last year as a GSoC student.

As this is my final year at college I have to work on my research project. I’m working on a routing protocol enhancement for Mobile Ad-hoc Networks. I used the open-source software called NS(Network Simulator)-3. Surprisingly NS-3 was also applied for GSoC 2018 and I didn’t want to miss this chance.

I proposed my research topic to NS-3 community. But they explained me my solution is too specific. Therefore, Tommaso has suggested me to make my solution as a generic framework which enables many NS-3 developers to take advantage out of it.

My project is Trust-based routing protocols framework. This project is aimed to write a new framework that facilitate for trust based routing protocols to be implemented and tested in NS-3. Trust based routing protocols are very popular among researchers who are seeking to improve the network security. There are large amount of research papers have been published in this area of study. So, there are so many people who seek to implement those variations into a network simulator and try out for results.

My mentor is Tommaso_Pecorella. He is an active contributor for ns-3. He has been working with NS-3 almost a decade. I’m so much excited to have him as my mentor.

by Jude Niroshan at May 22, 2018 05:14 PM

Dileka Weerasuriya

Google Summer of Code 2018

1st week of coding

The business end of the project started this week as me and my mentor got together and started creating the work plan to achieve the desired goals. My mentor Samuel Mbuga who is very methodical (😛) helped me a lot with identifying the project goals and skills needed in to achieve the goals.

As the first task of the project I was assigned to generate a report (provided by the mentor) using the existing reporting module. I was advised to create a html/text based output for the report. The following reveals information on how I approached the task.

The task required following skills

I first started getting hands dirty with JSP and then groovy which I had never tried before. Once I gained the confidence in these new technologies I started using the following links to understand how the specific template output is generated.

This link contains discussions on an issue I faced during accomplishment of this task, I hope it would be helpful for you 😃. Currently I have been working with the first task and hope to share more with you on how to create a html/text based output when we meet next week.

Thank you 😛

by Dileka Madushan at May 22, 2018 08:25 AM

Ridmal Liyanagamge

GSOC 2018 with OpenMRS — Week 01

So end of the week 1 , I got many knowledge form the project and my mentor. I experienced test driven development in first time because of this project and my mentor did a huge effort to put me on a right track .

Basically my first task is to develop a test case for a method ( which inside the AttchmentService ) which fetch the attachments ( Complex obs ) based on the encounter .So first half of the test case was finished when i start my development. So inside that test method i need to check following things.

  • Save in the same encounter: 2 obs, 2 non-Attachments managed complex obs and 2 Attachments-managed complex obs.
  • Verify that the method only returns the two Attachments-managed ones.
  • Edit the configuration and encompass one (or two) of the other complex obs to be also Attachments-managed.
  • Verify that the method returns the two original Attachments-managed ones plus the one (or two) that were encompassed through the configuration change.

So for creating the 2 non-Attachments managed complex obs i used XML based test data loading mentioned here.And end of the week 1 i was able to accomplish this task and send for the review.

by Ridmal Madushanka at May 22, 2018 07:51 AM

May 21, 2018

Jeyasumangala Rasanayagam

GSoC 2018 : Introduction to Built-in Reports module — week 1 [May 14,2018 — May 21, 2018]

Yes, We finished the 1st week of coding period. This is the time to share my progress what I had done in the 1st week of GSoC 2018. First, I like to give a small description of my project. I am working on the project built-in reports module for the Google Summer of Code under OpenMRS. This project was initiated by Jude Niroshan in last year GSoC (2017).

OpenMRS is an open source platform to develop software to support the health care in developing countries. In OpenMRS, information should be stored in an easy way to summarize and analyze that means to minimize the text and use the coded information at maximum level. The motto of OpenMRS “Write code Save lives” inspire me to work for OpenMRS in this summer through GSoC 2018.

I am working under the guidance of Rafal Korytkowski and Kaweesi Joseph. I have my first call with mentors on 11th of May. In the call, we discuss the basic things of the project and discuss the objectives too. That was an exciting moment for me.

In my 1st week of coding period, first I asked the openMRS helpdesk to create a JIRA project for this module. Then according to the Rafal’s advice, I skip the first objective about creating a new module for OpenMRS common styling in reactJS. So I started to work on the next objective, In List of Diagnosis report, once a table row is being clicked, it should redirect to a new view which shows the patients who were recorded as this disease was affected. It should also display the severity of this disease spread within the clinical environment. Compared to the other disease numbers.

I started to work on the Diagnosis report part. I have explored the existing changes done by Jude Niroshan in the reference meta-data module, reporting module, reporting rest module, and build-in-reports OWA. I worked on the Diagnosis report section to create a new report for Patient Report for a selected Diagnosis. I was able to create a new report as “Patient List for a Diagnosis” and I could get the view in built-in-reports OWA.

2nd Week of GSoC started! Stay tuned. I share my experience with GSoC 2018 every week through my blogs. !!

by Jeyasumangala Rasanayagam at May 21, 2018 06:04 PM

Suthagar Kailayapathy

Introduction to Location Based Access Control

Week 1 [May 14, 2018 — May 21, 2018]

OpenMRS is an open source platform which enables the design of a customized medical records system without any of the software development experience (although it required medical and system’s analysis knowledge to use the system). OpenMRS is also a community of people working to apply health information technologies to solve problems, primarily in resource-poor environments.

OpenMRS Core is the baseline of the OpenMRS development and other modules are allowed to integrate with OpenMRS Core to expand their services and features. There are multiple distributions around the world based on the OpenMRS platform.

I am very exited to work with OpenMRS once again through this year Google Summer of Code(GSoC) . Yes, I had a chance to work with OpenMRS last year also (GSoC 2017). I worked on a project called More Metadata Management in AdminUI1under the valuable guidance of @dkayiwa. So I loved to work with OpenMRS once again for this summer.

Location Based Access Control

Currently, OpenMRS has access control based on the user privileges. So the user needs to have the required privilege to access some of the OpenMRS service.

Anyway, OpenMRS doesn’t have any proper location control for their services. Even anyone from any location can access the metadata in the OpenMRS. Actually, still, they haven’t concerned about the location management inside the OpenMRS. But we should prepare the OpenMRS to support the access control based on the locations. It will add more value to the metadata security also.

What is the solution to restrict the services based on the locations?

OpenMRS has the privilege based access control implementations. Like that one, we need to implement a Location based Access control system. It will manage the access to the services based on the locations.

Some implementations want to register the users and patients (the persons also) in certain selected locations. Then access them based on the location that someone has logged in. That way, if someone is logged in a certain location, they should see only those encounters, observations, and patients registered in that location.

Anyway, the user who has multiple locations access (like Admin in our privilege based access control system) should be able to see patients in all locations. We can allocate multiple locations access to the System Developer or System administrator.

I have started the project. Actually we are busy with project design right now to come up with a proper design for the implementation.



by Kailayapathy Suthagar at May 21, 2018 03:58 PM

Isuranga Perera

GSoC @OpenMRS 1st week

I will be working on Bahmni — Notifications on patients events project at OpenMRS as a Google Summer of Code intern. According to the GSoC schedule, coding period started on 14th of May. Even before the community bonding period I started communicating with the project mentor Daniel Futerman to clarify some conflicts on project requirements and UI design.

In the first week of coding period I worked on the interface designing for Notifications subscription and management of event notifications module.

After having some discussions with the mentor we decided to use seperate module for frontend which will be developed using OWAs. In addition to that project involves developing backend for the module and more importantly a microservice which will be developed after implementing frontend.

For the frontend of the application my mentor Daniel Futerman came up with some UI mockups.

adding a new Notifications app to the Admin section in Bahmni

The app itself would consist of Subscription and Notification management sections.

In the Subscriptions management section, users can manage their notification subscriptions, and assign individual patients to each subscription:

The Notifications management section provides a central solution to view notifications and ‘mark as read’, supplemented by an in-app alert mechanism added to the UI header:

After setting up the openMRS development environment I created an OWA project for the frontend. You will find the project repository here

by Isuranga Perera at May 21, 2018 03:24 PM

Prabodh Kotasthane

GSoC 2018 – Week 1

The first week of GSoC 2018 was smooth for me. Started my week with a 2 hour long call with my mentor. I have set up my working environment as guided by Sanatt. We also discussed about a broad overview of how we will proceed for the project. We are looking forward to start for our first deliverable which is a major one, “The EHR Launch Flow Integration in OAuth module”.

This past week I focused on learning in detail about how does the OAuth2 module work. I have gone through the code several times. Now, I have a clear idea about the code as well as the functionality of the module. I have also got the idea about the database layer and the GUI layer of the module. As told by Sanatt, I also studied about how to write tests for the controllers and the other code in the module and I have started working on it.

For the coming week we are shortly going to discuss about how to start work on EHR launch flow. The first experience with my mentor was fabulous and I am looking forward to have a great week ahead. See you all next week!

Cheers! 🙂

by Prabodh Kotasthane at May 21, 2018 08:24 AM

Piyush Kundnani

GSoC with OpenMRS — Week 1 Coding Phase

The students were officially supposed to start working on their projects starting this week. In my case, My mentor helped me with setting up the cards on trello stating what needs to be done for this week. We basically divided the cards into three cateogareis namely backlog, working & done to help track the deadlines better. Since my project involves REST-ifying the existing module, I had to go through the REST conventions laid out by my community. I also had a look at other REST modules like idgen to get an idea of implementation and also had a look at the annotations needed for the project. Following this, it was time for me to finally build my own module. I first quickly set up my IDE (IntelliJ) with all the conventions relating to formatting etc. & then later on setup the OpenMRS-SDK. I used the sdk to create a new module and then added it to watch(sdk specific stuff, can be found on openmrs wiki) helping with faster development later. After this I tried adding all the dependencies in my pom as it is a maven project in my case followed by trying to run a hello world rest api inside the module which isn’t working at the moment for some reason, needs some debugging I guess. For the next week I plan to start wrting RestControllers after discussing it with my mentor.

Thanks for Reading!

GSoC with OpenMRS — Week 1 Coding Phase was originally published in piyush.kundnani on Medium, where people are continuing the conversation by highlighting and responding to this story.

by Piyush Kundnani at May 21, 2018 03:40 AM