# My OpenMRS Fellowship Journey 2024: Wikum Weerakutti

**URL:** <https://talk.openmrs.org/t/my-openmrs-fellowship-journey-2024-wikum-weerakutti/42093>\
**Category:** Community\
**Tags:** platform, fellowship\
**Created:** [March 18, 2024, 4:02pm UTC](https://talk.openmrs.org/t/my-openmrs-fellowship-journey-2024-wikum-weerakutti/42093 "2024-03-18T16:02:33Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![wikumc](https://talk.openmrs.org/user_avatar/talk.openmrs.org/wikumc/32/21813_2.png) [@wikumc](https://talk.openmrs.org/u/wikumc)\
**Post date:** [March 18, 2024, 4:02pm UTC](https://talk.openmrs.org/t/my-openmrs-fellowship-journey-2024-wikum-weerakutti/42093/1 "2024-03-18T16:02:33Z")

</div>

Hi everyone, I am Wikum Weerakutti from Sri Lanka. I’ve been contributing to the OpenMRS for almost two years now. What initially drew me to OpenMRS is its commitment to enhancing healthcare through technology and its diverse and supportive team.

Last year I had the privilege of participating in Google Summer of Code with the OpenMRS. During this, I dedicated my efforts to enhancing the OpenMRS SDK. This provided me with invaluable insights into the OpenMRS.

I am grateful to announce that I have been selected as an OpenMRS Backend Engineering Fellow. Throughout this fellowship, my primary objective will be to enhance the OpenMRS backend infrastructure, guided by the invaluable mentorship of @dkayiwa.

Over the past few weeks, Daniel and I have been exploring strategies to enhance the startup time of OpenMRS. Additionally, we had discussions on how to move forward with OpenMRS standalone and patientflag module GSOC projects.

I am sincerely grateful to OpenMRS for entrusting me with this incredible opportunity. I invite you all to join me on this journey by following along with the updates and discussions shared within this talk thread. Your feedback and insights are invaluable to me. Thank you for taking the time to read through this.

---

<div class="post-metadata">

**Author:** ![grace](https://talk.openmrs.org/user_avatar/talk.openmrs.org/grace/32/16942_2.png) [@grace](https://talk.openmrs.org/u/grace)\
**Post date:** [March 19, 2024, 4:14am UTC](https://talk.openmrs.org/t/my-openmrs-fellowship-journey-2024-wikum-weerakutti/42093/2 "2024-03-19T04:14:47Z")

</div>

A very well-deserved _congratulations_ to you Wikum!! Your hard work, clear communication, investment in docs, and thoughtful engineering really make you stand out 😃 👏

> [@wikumc](#):
>
> - strategies to enhance the startup time of OpenMRS.
> - how to move forward with Standalone GSOC project
> - how to move forward with patientflag module GSOC project

Awesome 😃

---

<div class="post-metadata">

**Author:** ![jayasanka](https://talk.openmrs.org/user_avatar/talk.openmrs.org/jayasanka/32/22204_2.png) [@jayasanka](https://talk.openmrs.org/u/jayasanka)\
**Post date:** [March 19, 2024, 6:09am UTC](https://talk.openmrs.org/t/my-openmrs-fellowship-journey-2024-wikum-weerakutti/42093/3 "2024-03-19T06:09:36Z")

</div>

Congratulations, Wikum! 🎉

---

<div class="post-metadata">

**Author:** ![thembo42](https://talk.openmrs.org/user_avatar/talk.openmrs.org/thembo42/32/21346_2.png) [@thembo42](https://talk.openmrs.org/u/thembo42)\
**Post date:** [March 19, 2024, 6:19am UTC](https://talk.openmrs.org/t/my-openmrs-fellowship-journey-2024-wikum-weerakutti/42093/4 "2024-03-19T06:19:12Z")

</div>

congrats Wikum 💥

---

<div class="post-metadata">

**Author:** ![lumuchris256](https://talk.openmrs.org/user_avatar/talk.openmrs.org/lumuchris256/32/18260_2.png) [@lumuchris256](https://talk.openmrs.org/u/lumuchris256)\
**Post date:** [March 19, 2024, 12:10pm UTC](https://talk.openmrs.org/t/my-openmrs-fellowship-journey-2024-wikum-weerakutti/42093/5 "2024-03-19T12:10:46Z")

</div>

Congratulations Wikum!

---

<div class="post-metadata">

**Author:** ![edison](https://talk.openmrs.org/user_avatar/talk.openmrs.org/edison/32/16083_2.png) [@edison](https://talk.openmrs.org/u/edison)\
**Post date:** [March 19, 2024, 1:23pm UTC](https://talk.openmrs.org/t/my-openmrs-fellowship-journey-2024-wikum-weerakutti/42093/6 "2024-03-19T13:23:31Z")

</div>

Congrats @wikumc well deserved 👍

---

<div class="post-metadata">

**Author:** ![piyushmishra1416](https://talk.openmrs.org/letter_avatar/piyushmishra1416/32/6_449c533f586939b6e5f246632a46421f.png) [@piyushmishra1416](https://talk.openmrs.org/u/piyushmishra1416)\
**Post date:** [March 20, 2024, 9:18am UTC](https://talk.openmrs.org/t/my-openmrs-fellowship-journey-2024-wikum-weerakutti/42093/7 "2024-03-20T09:18:53Z")

</div>

Congratulations, @wikumc! 👏

---

<div class="post-metadata">

**Author:** ![wodpachua](https://talk.openmrs.org/user_avatar/talk.openmrs.org/wodpachua/32/21682_2.png) [@wodpachua](https://talk.openmrs.org/u/wodpachua)\
**Post date:** [March 24, 2024, 6:20pm UTC](https://talk.openmrs.org/t/my-openmrs-fellowship-journey-2024-wikum-weerakutti/42093/8 "2024-03-24T18:20:38Z")

</div>

A big Congratulations @wikumc 👏

---

<div class="post-metadata">

**Author:** ![ayushmishra](https://talk.openmrs.org/user_avatar/talk.openmrs.org/ayushmishra/32/17973_2.png) [@ayushmishra](https://talk.openmrs.org/u/ayushmishra)\
**Post date:** [March 25, 2024, 11:24pm UTC](https://talk.openmrs.org/t/my-openmrs-fellowship-journey-2024-wikum-weerakutti/42093/9 "2024-03-25T23:24:40Z")

</div>

Congratulations @wikumc 🌟

---

<div class="post-metadata">

**Author:** ![madhumac](https://talk.openmrs.org/user_avatar/talk.openmrs.org/madhumac/32/19599_2.png) [@madhumac](https://talk.openmrs.org/u/madhumac)\
**Post date:** [March 26, 2024, 9:03pm UTC](https://talk.openmrs.org/t/my-openmrs-fellowship-journey-2024-wikum-weerakutti/42093/10 "2024-03-26T21:03:46Z")

</div>

congrats @wikumc

---

<div class="post-metadata">

**Author:** ![jonathan](https://talk.openmrs.org/user_avatar/talk.openmrs.org/jonathan/32/14972_2.png) [@jonathan](https://talk.openmrs.org/u/jonathan)\
**Post date:** [March 29, 2024, 8:03am UTC](https://talk.openmrs.org/t/my-openmrs-fellowship-journey-2024-wikum-weerakutti/42093/11 "2024-03-29T08:03:37Z")

</div>

Congs @wikumc a big experience awaits u 👏

---

<div class="post-metadata">

**Author:** ![wikumc](https://talk.openmrs.org/user_avatar/talk.openmrs.org/wikumc/32/21813_2.png) [@wikumc](https://talk.openmrs.org/u/wikumc)\
**Post date:** [April 20, 2024, 11:16am UTC](https://talk.openmrs.org/t/my-openmrs-fellowship-journey-2024-wikum-weerakutti/42093/12 "2024-04-20T11:16:42Z")

</div>

Hi everyone,

It has been a month since I last provided an update on my fellowship journey. Over the past few weeks, I was occupied with exams, which limited my availability for full-time work. Now that the exams are over, I am fully committed to contributing to OpenMRS. Here are some of the tasks I am currently focusing on:

**Adding Detailed Audit Logging to OpenMRS**

OpenMRS lacks a comprehensive audit system. which would enable admin users to track database changes effectively. My primary focus has been researching potential solutions for this issue. Currently, we are exploring the adoption of Hibernate Envers as it aligns well with our existing usage of Hibernate across various modules.

**Making Global properties access should be privileged**

The main objective of this is to restrict access to global properties to authorized users only. A major challenge of this is ensuring that OpenMRS can access essential global properties during startup before the user logs in. I’ve explored several methods for implementation and have created draft pull requests to solicit feedback from @dkayiwa and determine the most suitable approach.

**Reviewing GSOC contributor proposals**

This year I am mentoring the GSOC project for validating and re-working (updating) the OpenMRS PatientFlags module. We received five proposals for this project, and I dedicated time to thoroughly review each one. During the review process, we assessed factors such as the student’s previous contributions, their understanding of the project, and the quality of formatting and structure in their proposals. After careful consideration of all the proposals, we have selected the one that shows the most promise. Stay tuned for further updates!

I have also worked on a few other tasks too. My main focus at the moment is to complete the existing tickets and help with the OpenMRS platform roadmap. Thank you for reading, Until next time!

---

<div class="post-metadata">

**Author:** ![grace](https://talk.openmrs.org/user_avatar/talk.openmrs.org/grace/32/16942_2.png) [@grace](https://talk.openmrs.org/u/grace)\
**Post date:** [May 28, 2024, 9:15pm UTC](https://talk.openmrs.org/t/my-openmrs-fellowship-journey-2024-wikum-weerakutti/42093/13 "2024-05-28T21:15:13Z")

</div>

> [@wikumc](#):
>
> **Adding Detailed Audit Logging to OpenMRS**
> 
> OpenMRS lacks a comprehensive audit system. which would enable admin users to track database changes effectively. My primary focus has been researching potential solutions for this issue.

Looking forward to the next update on this 🙂 This detailed audit logging is an important need for OpenMRS and we’re so glad to have you working on this 🙂 (And Global Properties authorization too, of course!!)

---

<div class="post-metadata">

**Author:** ![wikumc](https://talk.openmrs.org/user_avatar/talk.openmrs.org/wikumc/32/21813_2.png) [@wikumc](https://talk.openmrs.org/u/wikumc)\
**Post date:** [June 8, 2024, 2:47pm UTC](https://talk.openmrs.org/t/my-openmrs-fellowship-journey-2024-wikum-weerakutti/42093/14 "2024-06-08T14:47:53Z")

</div>

Hi all,

I want to provide an update on what’s been happening over the past few weeks. During this time, my focus has primarily been on two tickets. Let’s take a closer look at each ticket and the progress made on them.

[**TRUNK-6203: Global property access should be privileged**](https://openmrs.atlassian.net/browse/TRUNK-6203)

This ticket has been a significant priority for OpenMRS, with plans to incorporate it into the platform version 2.7. Adding authorization for accessing global properties enhances system security. Once this authorization is implemented we have to ensure core functions and modules can access global properties during startup for smooth user login.

There are two methods to resolve this:

1. We could utilize the [addProxyPrivilege(String privilege)](https://github.com/openmrs/openmrs-core/blob/8f50e492bc5bf64f077f6386fbb5b431d39e17a7/api/src/main/java/org/openmrs/api/context/Context.java#L764) method to grant the privilege to the user when necessary.
2. Alternatively, we could introduce a new method that grants access to essential privileges to anonymous users.

After discussing with @dkayiwa, we have decided to proceed with the first method

I’ve created the following PRs for this ticket:

- Core: [PR #4601](https://github.com/openmrs/openmrs-core/pull/4601)
- SPA module: [PR #58](https://github.com/openmrs/openmrs-module-spa/pull/58)
- OWA module: [PR #78](https://github.com/openmrs/openmrs-module-owa/pull/78)
- Web Services REST: [PR #608](https://github.com/openmrs/openmrs-module-webservices.rest/pull/608)
- Legacy UI: [PR #190](https://github.com/openmrs/openmrs-module-legacyui/pull/190)

In addition, we might have to add support to a few other modules to ensure compatibility with both O2 and O3 distributions.

[**OMRS-131: Detailed Audit Logging**](https://openmrs.atlassian.net/jira/polaris/projects/OMRS/ideas/view/3970978?selectedIssue=OMRS-131)

We decided to use Hibernate Envers to audit changes in the OpenMRS database. This choice aligns well with our current use of Hibernate throughout OpenMRS. To fully enable audit logging, we need to complete the following steps:

- Enable Hibernate Envers in the OpenMRS core.
- Develop a separate module that allows users to view the logs.

I thought enabling Envers going to be a straightforward task because according to the [Hibernate Envers documentation](https://hibernate.org/orm/envers/), you just need to add the Hibernate Envers dependency to the project and use the @Auditied annotation to the entity you need to audit. However, I faced several issues, particularly with auto-generating audit tables for some entities. I won’t delve into the technical details here, but if you’re interested, please take a moment to read the comments in the following PRs.

- [OMRS-131: Detailed Audit Logging](https://github.com/openmrs/openmrs-core/pull/4620)
- [TRUNK-6240: Field Answer - Switching from Hibernate Mapping to JPA annotations](https://github.com/openmrs/openmrs-core/pull/4645)
- [TRUNK-6239: AlertRecipient - Switching from Hibernate Mapping to JPA annotations](https://github.com/openmrs/openmrs-core/pull/4646)
- [TRUNK-6238: Drug Ingredients - Switching from Hibernate Mapping to JPA annotations](https://github.com/openmrs/openmrs-core/pull/4644)

After several fixes, I have enabled auditing for all core tables except the `user_properties` table. I am currently investigating this issue and hope to resolve it without making significant code changes to the core.

[**GSOC-2024: Validating and re-working (updating) the OpenMRS PatientFlags module**](https://openmrs.atlassian.net/wiki/x/W-yQAQ)

We chose @manojll for this GSOC project due to his excellent proposal and significant prior contributions to OpenMRS. He is now hard at work on this project and has already made a few pull requests. You can find more details about the project’s progress by visiting the [wiki project page](https://openmrs.atlassian.net/wiki/x/W-yQAQ) and reading his blog posts. Both @dkayiwa and I are excited to mentor him on this project.

Thank you for taking the time to read this update. Your valuable feedback is always appreciated

cc: @grace

---

<div class="post-metadata">

**Author:** ![grace](https://talk.openmrs.org/user_avatar/talk.openmrs.org/grace/32/16942_2.png) [@grace](https://talk.openmrs.org/u/grace)\
**Post date:** [June 11, 2024, 3:11pm UTC](https://talk.openmrs.org/t/my-openmrs-fellowship-journey-2024-wikum-weerakutti/42093/15 "2024-06-11T15:11:29Z")

</div>

Wikum this is one of the best technical fellowship posts ever 🙂 Thank you for explaining all this so clearly!! Great updates and I can’t tell you how encouraging it is to hear about all this progress. Keep up the great work! 👏

---

<div class="post-metadata">

**Author:** ![wikumc](https://talk.openmrs.org/user_avatar/talk.openmrs.org/wikumc/32/21813_2.png) [@wikumc](https://talk.openmrs.org/u/wikumc)\
**Post date:** [June 12, 2024, 1:44am UTC](https://talk.openmrs.org/t/my-openmrs-fellowship-journey-2024-wikum-weerakutti/42093/16 "2024-06-12T01:44:57Z")

</div>

Thank you… ❤

---

<div class="post-metadata">

**Author:** ![wikumc](https://talk.openmrs.org/user_avatar/talk.openmrs.org/wikumc/32/21813_2.png) [@wikumc](https://talk.openmrs.org/u/wikumc)\
**Post date:** [July 14, 2024, 8:52am UTC](https://talk.openmrs.org/t/my-openmrs-fellowship-journey-2024-wikum-weerakutti/42093/17 "2024-07-14T08:52:56Z")

</div>

Hi all,

The primary work on both main tickets, which I’ve been focusing on since the beginning of my fellowship, is now finished, and I’ve had the opportunity to begin several new projects. Let’s delve deeper into these developments

[**TRUNK-6203: Global property access should be privileged**](https://openmrs.atlassian.net/browse/TRUNK-6203)

Implementing this feature was crucial for enhancing OpenMRS security. It restricts access to global properties for non-privileged users, while still allowing them access to essential tasks, such as reaching the login page.

After integrating this feature into the CORE, we reviewed each module in the 2.x/O3 reference applications to ensure they had access to global properties where necessary. For more details, please refer to my [previous post](https://talk.openmrs.org/t/my-openmrs-fellowship-journey-2024-wikum-weerakutti/42093/14).

[**OMRS-131: Detailed Audit Logging**](https://openmrs.atlassian.net/jira/polaris/projects/OMRS/ideas/view/3970978?selectedIssue=OMRS-131)

I have reached a significant milestone with this ticket by successfully implementing Hibernate Envers in the OpenMRS core. Now, OpenMRS can audit changes to almost all tables in its database. However, we had to exclude two tables from this implementation, as Envers was unable to auto-generate audit tables for them without requiring a lot of changes to our code base. These two tables are:

- [user\_property](https://github.com/openmrs/openmrs-core/blob/b4426232e5a97f7035c7e70f4b22f5e12e19680b/api/src/main/java/org/openmrs/User.java#L107-L113)
- [scheduler\_task\_config\_property](https://github.com/openmrs/openmrs-core/blob/b4426232e5a97f7035c7e70f4b22f5e12e19680b/api/src/main/resources/org/openmrs/scheduler/db/hibernate/TaskDefinition.hbm.xml#L89-L96)

I made a few commits to completely implement Envers. You can find them here

- OMRS-131: Detailed Audit Logging ([#4620](https://github.com/openmrs/openmrs-core/pull/4620))
- OMRS-131: Detailed Audit Logging ([#4665](https://github.com/openmrs/openmrs-core/pull/4665))
- OMRS-131: Detailed Audit Logging ([#4668](https://github.com/openmrs/openmrs-core/pull/4668))
- [TRUNK-6240: Field Answer - Switching from Hibernate Mapping to JPA annotations](https://github.com/openmrs/openmrs-core/pull/4645)
- [TRUNK-6239: AlertRecipient - Switching from Hibernate Mapping to JPA annotations](https://github.com/openmrs/openmrs-core/pull/4646)
- [TRUNK-6238: Drug Ingredients - Switching from Hibernate Mapping to JPA annotations](https://github.com/openmrs/openmrs-core/pull/4644)

We are keeping auditing disabled by default. You can find more details on how to use this feature on our [wiki page](https://openmrs.atlassian.net/wiki/spaces/docs/pages/113999876/Enabling+Hibernate+Envers+Audit+Logging+in+OpenMRS).

I am currently developing a backend module that users can utilize to access audit logs. The main goal of this module is to offer all the necessary endpoints and services for accessing audit data, as well as to provide a simple user interface for viewing audit logs.

You can track the progress of this module and join the discussion on my OpenMRS Talk post, or by visiting my GitHub repository:

- OpenMRS Talk: [New Audit Log System for OpenMRS: Seeking Feedback and Suggestions](https://talk.openmrs.org/t/new-audit-log-system-for-openmrs-seeking-feedback-and-suggestions/43137)
- GitHub Repository: [openmrs-module-auditlogui](https://github.com/wikumChamith/openmrs-module-auditlogui)

I am going to use this post to address some of the questions you might have about this implementation.

**1. Why do we implement this straight to the CORE rather than first trying this on a module?**

When Envers audits a table that includes fields referencing another table, it can only audit those fields if the referenced table is also audited. For example, we can only audit the `person_id` field in the `person_address` table if the `person` table itself is audited.

```auto
@Entity
@Table(name = "person_address")
public class PersonAddress extends BaseChangeableOpenmrsData implements java.io.Serializable, Cloneable, Comparable<PersonAddress>, Address {
	
	public static final long serialVersionUID = 343333L;
	
	// Fields
	@Id
	@Column(name = "person_address_id")
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer personAddressId;
	
	@ManyToOne
	@JoinColumn(name = "person_id")
	private Person person;

```

Due to this, starting the implementation in a module would be inefficient, as we would have to mark many of the module table fields as **Not Audited**.

**2. Can we audit database views using this feature?**

No, this feature only records changes made to the database, such as creations, modifications, and deletions. The primary goal is to audit changes to the database itself, not user actions. I explored the possibility of auditing views using Hibernate Interceptors, but we decided against it. Implementing such a system would record all database calls, potentially creating a large amount of unnecessary data and noise

**3. Can we select what tables to audit or ignore?**

Currently, our implementation does not support selective auditing. You can either enable or disable auditing entirely.

I hope this clears up any questions you might have. If you have more questions or want to share feedback, feel free to drop them on our Talk post: [New Audit Log System for OpenMRS: Seeking Feedback and Suggestions](https://talk.openmrs.org/t/new-audit-log-system-for-openmrs-seeking-feedback-and-suggestions/43137).

[**O3-3424: Better O3 Setup 2024**](https://openmrs.atlassian.net/browse/O3-3424)

The main goal of this epic is to enable better, easier O3 installing and configuring. I have been assigned some of the tickets related to this and I started working on one of the main tickets related to this epic.

- [**O3-3431: Distro Inheritance Tool**](https://openmrs.atlassian.net/browse/O3-3431)

This tool allows users to customize their version of the RefApp by using a simplified `distro.properties` file that includes just three key fields:

1. parent.artifact
2. parent.groupId
3. parent.version

Users can further tailor their servers by overriding default properties. You can find details on the [ticket page](https://openmrs.atlassian.net/browse/O3-3431). I have submitted a pull request on the SDK for this feature and am currently awaiting its review

Pull request: [O3-3424: Distro Inheritance Tool](https://github.com/openmrs/openmrs-sdk/pull/274)

[**GSOC-2024: Validating and re-working (updating) the OpenMRS PatientFlags module**](https://openmrs.atlassian.net/wiki/x/W-yQAQ)

For the past few weeks, @manojll was hard at work on this project. He has submitted pull requests for most of the project’s features and completed his mid-term evaluation last week. I am truly impressed by his passion and dedication. I would also like to thank @dkayiwa for the continuous support provided to both Manoj and myself throughout this project.

In addition to my main tasks, I’ve also been assisting community members where possible. A significant issue I addressed was a bug in the SDK that failed to add configurations for the O3 setup. You can view the commit that resolved this issue here: [Resolve the Configuration Extraction Error for O3](https://github.com/openmrs/openmrs-sdk/commit/407f816bed0eb34f2bc2e99f9282bb3f3204a6c7). Special thanks to @njiddasalifu for identifying and reporting this bug.

Thank you all for taking the time to read this update. Please feel free to share any feedback you might have.
