<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Bawantha Rathnayaka on Medium]]></title>
        <description><![CDATA[Stories by Bawantha Rathnayaka on Medium]]></description>
        <link>https://medium.com/@bawantharathnayaka?source=rss-615355f767c3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*XIoGEEkggCZRTjlsezW5Ww.png</url>
            <title>Stories by Bawantha Rathnayaka on Medium</title>
            <link>https://medium.com/@bawantharathnayaka?source=rss-615355f767c3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 04:09:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bawantharathnayaka/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[OpenMRS Fellowship Journey : Week 6]]></title>
            <link>https://bawantharathnayaka.medium.com/openmrs-fellowship-journey-week-6-1f0f0d929452?source=rss-615355f767c3------2</link>
            <guid isPermaLink="false">https://medium.com/p/1f0f0d929452</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[fellowship]]></category>
            <category><![CDATA[openmrs]]></category>
            <dc:creator><![CDATA[Bawantha Rathnayaka]]></dc:creator>
            <pubDate>Tue, 04 Aug 2026 07:52:42 GMT</pubDate>
            <atom:updated>2026-08-04T07:52:42.495Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QiKx36auOkePStsNGIUY_g.png" /></figure><p>Week 6 centered on one big PR by far the largest and longest reviewed one yet plus a lot more visibility into the project across the wider OpenMRS community, with updates shared on three separate calls this week.</p><h3>Merging the Metadata Sharing / Mapping Domain</h3><p><a href="https://github.com/openmrs/openmrs-module-metadataexport/pull/34"><strong>ME-30: Support Metadata sharing / mapping Domain</strong></a> finally merged this week, after roughly two weeks and 20 commits of back-and-forth review. It’s the most ambitious domain the module has taken on so far, adding four new exporters at once:</p><ul><li>MetadataSetDomainExporter / MetadataSetLineExporter — exports metadata sets.</li><li>MetadataSetMemberDomainExporter / MetadataSetMemberLineExporter — exports the members of those sets.</li><li>MetadataTermMappingDomainExporter / MetadataTermMappingLineExporter — exports term mappings (mapping code, mapping source, metadata class name, metadata UUID).</li><li>MetadataSharingDomainExporter — a different shape entirely: since metadata sharing packages don&#39;t have a CSV/XML row structure, this one copies already-published packages out as raw, UUID named zip files instead.</li></ul><p>This PR generated some of the most substantive review feedback the project has had, and it’s worth walking through because the findings will shape how future domains get built.</p><p><strong>A classloader bug with real consequences.</strong> The original code resolved metadata class names using Class.forName(), which only sees classes visible to this module&#39;s own classloader — its own jar plus whatever&#39;s declared in require_modules and aware_of_modules. That&#39;s fine for core OpenMRS types, but it silently breaks for classes owned by modules that aren&#39;t explicitly declared as dependencies — the concrete example raised was patientflags, which isn&#39;t in aware_of_modules even though Flag, Priority, and Tag are all legitimate metadata-mapping targets. A ClassNotFoundException was being swallowed and turned into null, meaning a metadata set member pointing at a flag would just quietly vanish from the export closure — no error, no log entry, just a missing row. The fix was switching to OpenmrsClassLoader.getInstance().loadClass(...), the same mechanism OpenMRS core itself uses when resolving class names that come out of the database, since it checks every started module&#39;s classloader rather than just this module&#39;s own dependency graph.</p><p><strong>The retired-discriminator pattern showed up three more times.</strong> This is becoming a recurring theme across the project: several of Initializer’s line processors read certain columns as <em>required</em> even on retired rows, and if a domain exporter only writes UUID + retire flag for retired entities (the “obvious” minimal approach), those rows fail to re-import. This PR hit it in MetadataTermMappingLineExporter (needed mapping code, mapping source, metadata class name, and metadata UUID all present, not just code and source), in MetadataSetMemberLineExporter (needed metadata set, metadata class, and metadata UUID on retired rows too), and — in a nice piece of cross-checking — the reviewer also went back and found the <em>already-merged</em> ProgramWorkflowLineExporter and ProgramWorkflowStateLineExporter had the same gap (missing workflow concept, and missing Initial/Terminal respectively, on their retired paths). All of these got fixed in this PR as follow-up commits, closing out a pattern that had been quietly present since a couple of the very first domains.</p><p><strong>Missing test coverage on the one class with real logic.</strong> MetadataSharingDomainExporter was the only one of the seven new production classes without a test, and it&#39;s also the one with logic that isn&#39;t just a field copy — it hand-builds the output directory, names files by UUID, and has a skip branch for null serialized content. A plain unit test couldn&#39;t reach it (the underlying Package class pulls in machinery that Mockito&#39;s mock maker can&#39;t instrument), so the fix was a BaseModuleContextSensitiveTest with a small stub ExportedPackage subclass, asserting the zip lands at the right path with the right bytes, and that a null-content package leaves nothing behind.</p><p>It was a genuinely demanding review cycle, but the module is meaningfully more robust for it — both in this domain and retroactively in two domains that had already shipped.</p><h3>Looking Ahead: Third Party Domains</h3><p>With the core OpenMRS metadata domains now largely covered, the next phase of the project is shifting toward <strong>supporting third party/add-on module domains</strong> metadata owned by modules outside OpenMRS core rather than the platform itself. This is a natural next step given what came up in the Metadata Sharing PR itself: the classloader fix that now lets the exporter correctly resolve types from modules like patientflags is exactly the kind of infrastructure this next phase depends on. I&#39;ll be sharing the specific domain list and priority order as that planning firms up.</p><h3>Three Community Calls This Week</h3><p>This was also a busy week for visibility across OpenMRS’s broader community structure I joined and gave updates on three separate calls:</p><ul><li><strong>The Platform call</strong>, where I gave the wider platform team a progress update on domain coverage to date and flagged the upcoming shift toward third-party domain support.</li><li><strong>The Squad call</strong>, our regular team level sync, where I walked through the Metadata Sharing PR in more detail, including the retired discriminator pattern that turned up again and the plan to keep an eye out for it in future domains.</li></ul><p>Getting the project in front of these different groups was useful beyond just visibility it surfaced a few questions I hadn’t fully thought through yet (particularly around how third-party domain support should be scoped), which will feed directly into next week’s planning.</p><h3>Looking Ahead</h3><p>With Metadata Sharing merged and the retired-discriminator issue now fixed across four domains instead of one, next week’s focus shifts to scoping the third-party domain work, following up on any threads that came out of this week’s calls, and continuing to keep the wiki and community thread current.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1f0f0d929452" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OpenMRS Fellowship Journey: Week 5]]></title>
            <link>https://bawantharathnayaka.medium.com/openmrs-fellowship-journey-week-5-5eb6a5f0cca0?source=rss-615355f767c3------2</link>
            <guid isPermaLink="false">https://medium.com/p/5eb6a5f0cca0</guid>
            <category><![CDATA[opensorce]]></category>
            <category><![CDATA[fellowship]]></category>
            <category><![CDATA[openmrs]]></category>
            <dc:creator><![CDATA[Bawantha Rathnayaka]]></dc:creator>
            <pubDate>Tue, 28 Jul 2026 13:22:46 GMT</pubDate>
            <atom:updated>2026-08-04T07:51:06.483Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MDBZ1iNAHgSFG7FcnGI4JQ.png" /></figure><p>Week 5 was the most productive week yet on domain coverage four PRs merged, taking the module through Order Frequencies, Programs, Program Workflows, and Program States. It also came with a good reminder that review doesn’t stop just because something’s already merged.</p><h3>Order Frequency Domain</h3><p><a href="https://github.com/openmrs/openmrs-module-metadataexport/pull/25"><strong>ME-20: Support Order Frequency Domain</strong></a> added OrderFrequencyDomainExporter and OrderFrequencyLineExporter, exporting order frequencies to CSV, plus a README update to document the Flags, Order Types, and Order Frequencies domains together. This one went through review cleanly and merged without any follow up work needed.</p><h3>Programs Domain</h3><p><a href="https://github.com/openmrs/openmrs-module-metadataexport/pull/26"><strong>ME-22: Support Programs Domain</strong></a> added ProgramDomainExporter and ProgramLineExporter, writing out each program&#39;s concept and outcomes concept by UUID along with name and description columns.</p><p>Review caught a small but important header-casing issue: the Program concept and Outcomes concept headers I&#39;d used were title-cased, but Initializer&#39;s ProgramLineProcessor defines them in lowercase. I updated the headers to match. It&#39;s a minor thing on its own, but it&#39;s part of a pattern I&#39;m getting more careful about always checking the exact header strings Initializer expects rather than assuming a &quot;readable&quot; version will work.</p><h3>Program Workflow Domain</h3><p><a href="https://github.com/openmrs/openmrs-module-metadataexport/pull/27"><strong>ME-23: Support Programs Workflow Domain</strong></a> added ProgramWorkflowDomainExporter and ProgramWorkflowLineExporter, exporting program workflow types to programworkflows.csv (renamed from an initial workflows.csv during review, to stay consistent with the module&#39;s existing file-naming pattern).</p><p>Review also flagged something worth calling out: the exporter correctly pulls in <em>retired</em> workflows by using getAllPrograms(true) and getAllWorkflows() rather than the non-retired variants — but no test actually pinned that choice down. If either accessor were ever &quot;simplified&quot; later, retired workflows would silently disappear from exports with every existing test still green. That&#39;s now on my radar as a gap worth closing with a dedicated regression test, even though it didn&#39;t block this merge.</p><h3>Program State Domain and a Bug Caught After Merge</h3><p><a href="https://github.com/openmrs/openmrs-module-metadataexport/pull/29"><strong>ME-24: Support Program State Domain</strong></a> added ProgramWorkflowStateDomainExporter and ProgramWorkflowStateLineExporter, exporting each state&#39;s workflow, state concept, and initial/terminal flags to programworkflowstates.csv. This PR got merged a little ahead of a full review pass, which turned into a useful lesson.</p><p>The Initial and Terminal columns were only being written when the flag was actually true — meaning a CSV export with no terminal states in it would omit the Terminal column entirely. On import, Initializer&#39;s ProgramWorkflowStateLineProcessor reads both columns in a mode that <em>throws</em> if the column is missing, so a perfectly valid-looking export could fail to re-import, per line, with no obvious error. It&#39;s the same category of bug as the retired-attribute-type issue from a couple weeks ago: a column that&#39;s conditionally written looks fine until the specific condition that omits it lines up with a strict reader on the other end.</p><p>There was also a good side-conversation about header casing I’d used Title Case (Workflow, State concept, Initial, Terminal) rather than the lowercase style used elsewhere in the module. It turned out my version actually matched the real-world demo CSVs OpenMRS ships (programworkflowstates_demo-package-core_demo.csv), so we kept it as-is a nice reminder that consistency with what&#39;s actually deployed in the wild matters more than internal-module consistency. The initial/terminal column omission, though, is a real fix, and I&#39;m sending a follow-up PR to always write both columns (using &quot;false&quot; rather than omitting the key) so the file round-trips reliably regardless of which states happen to be in the export.</p><h3>Looking Back</h3><p>Four domains in one week Order Frequencies, Programs, Program Workflows, and Program States brings the module a lot closer to full Tier 3 coverage, and the post-merge fix on Program States is a good reminder that review value doesn’t end at the merge button. Next week’s focus is the continuing down the remaining domain list, and starting to sketch out what the API endpoint will look like.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5eb6a5f0cca0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OpenMRS Fellowship Journey: Week 4]]></title>
            <link>https://bawantharathnayaka.medium.com/openmrs-fellowship-journey-week-4-7778f25a1503?source=rss-615355f767c3------2</link>
            <guid isPermaLink="false">https://medium.com/p/7778f25a1503</guid>
            <dc:creator><![CDATA[Bawantha Rathnayaka]]></dc:creator>
            <pubDate>Sat, 18 Jul 2026 14:12:59 GMT</pubDate>
            <atom:updated>2026-07-19T03:38:55.462Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*44FrjjZfSN6g7kkiT7B3Lg.png" /></figure><p>Week 4 was a busy one for the Metadata Extraction Tool two more domains landed, the CI pipeline got an upgrade, and review caught two separate correctness bugs before they could quietly break round trip imports. My colleague Wikum also picked up a domain of his own this week, which made for a nice milestone: this is no longer a one-person effort.</p><h3>Support for the Flag Domain</h3><p><a href="https://github.com/openmrs/openmrs-module-metadataexport/pull/20"><strong>ME-16: Support Flag Domain</strong></a> adds FlagDomainExporter and FlagLineExporter, exporting all patient flags name, criteria, evaluator, message, priority, enabled state, tags, and description into flags.csv.</p><p>This one turned into a good lesson about dependency closures. My first version wrote a flag’s tags and priority columns as bare names, but never actually exported the underlying Tag and Priority objects those names point to, and getDependencies() returned an empty list meaning the export closure never pulled them in at all. On review, it came out that Initializer expects these as their own domains (FLAG_TAGS and FLAG_PRIORITIES), and if a referenced tag doesn&#39;t already exist on the target system, the import fails hard on that row; if the priority doesn&#39;t resolve, it fails silently by just dropping the value. Either way, a flag that looked fully exported wouldn&#39;t actually import correctly.</p><p>The fix was to add FlagTagDomainExporter and FlagPriorityDomainExporter — mirroring how LocationTagDomainExporter already handles the equivalent situation for Locations — and wire both into getDependencies() so the closure walk pulls them in automatically. It&#39;s the same underlying lesson from the Attribute Type domain a couple weeks back: a domain exporter isn&#39;t just &quot;read the object, write the columns&quot; you have to trace every reference column through to how Initializer actually resolves it on import, because a clean-looking CSV can still fail (or silently degrade) on the other end.</p><h3>Support for the Order Type Domain</h3><p><a href="https://github.com/openmrs/openmrs-module-metadataexport/pull/23"><strong>ME-21: Support OrderType Domain</strong></a><strong> </strong>this one was implemented by my colleague Wikum, which was great to see. It adds OrderTypeDomainExporter and OrderTypeLineExporter, covering order type–specific fields including parent order type and associated concept classes.</p><p>Review surfaced two solid findings here too:</p><ul><li>The parent column, as currently written, only round-trips correctly for order types whose Java class is literally org.openmrs.Order — real order types almost always carry a concrete subclass like DrugOrder or TestOrder, and for those, Initializer&#39;s pinned version silently drops the parent value on import with no error. Rather than working around it locally, the team traced it back to a known TODO in the Initializer codebase itself and opened <a href="https://openmrs.atlassian.net/browse/O3-5820"><strong>O3-5820</strong></a> to fix it at the source including a note that the fix needs to handle row-ordering too, since parent rows aren&#39;t guaranteed to import before their children.</li><li>The concept classes column needed a .sorted() added before joining the UUIDs, since it&#39;s backed by an unordered Hibernate set without sorting, two exports of the same server could produce different-looking CSVs with no actual data change, creating noisy diffs once configuration lives in git.</li></ul><p>Both are exactly the kind of subtle-but-important catches that keep showing up as we add more domains reference resolution and export determinism aren’t things you get for free, they have to be checked domain by domain.</p><h3>CI Improvements</h3><p>Ian Bacher merged <a href="https://github.com/openmrs/openmrs-module-metadataexport/pull/22"><strong>Add Codecov job</strong></a>, keeping coverage reporting working ahead of an upstream change to OpenMRS’s shared GitHub Actions workflows. Small, but it keeps the safety net in place as the module grows.</p><h3>Housekeeping</h3><p><a href="https://github.com/openmrs/openmrs-module-metadataexport/pull/24"><strong>ME-17: Update README to reflect correct repository link for openmrs-module-initializer</strong></a> a quick fix to point the README at the correct Initializer repository. Small change, but accurate documentation matters more as more people start reading the README to understand which domains are supported.</p><h3>Looking Ahead</h3><p>With Flags and Order Types now merged, and a second contributor actively shipping domains, the project is starting to move faster than one person alone could take it. Next week’s focus is continuing down the domain list, following up on the Initializer ticket, and keeping the wiki and community thread current as the pace picks up.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7778f25a1503" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OpenMRS Fellowship Journey: Week 3]]></title>
            <link>https://bawantharathnayaka.medium.com/openmrs-fellowship-journey-week-3-6810ede95503?source=rss-615355f767c3------2</link>
            <guid isPermaLink="false">https://medium.com/p/6810ede95503</guid>
            <category><![CDATA[osss]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[openmrs]]></category>
            <dc:creator><![CDATA[Bawantha Rathnayaka]]></dc:creator>
            <pubDate>Thu, 09 Jul 2026 18:24:00 GMT</pubDate>
            <atom:updated>2026-07-09T18:24:00.195Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_GN1PP7Fn1olV153fo0JCA.png" /></figure><p>Week 3 was where the project started to feel like it had a rhythm a merged PR that pushed the exporter framework in a new direction, a real bug caught in review that would have silently broken data on re-import, and the first of what’s now a standing weekly sync with the GHSD project team.</p><h3>Shipping the Attribute Type Domain</h3><p>The main development milestone this week was <a href="https://github.com/openmrs/openmrs-module-metadataexport/pull/12"><strong>ME-11: Support Attribute Type Domain</strong></a>, which got merged after a solid round of review. This one was more involved than the earlier domains:</p><ul><li>AttributeTypeDomainExporter collects and exports all <strong>five OpenMRS attribute type kinds</strong> — Location, Visit, Provider, Concept, and Program — into a single attribute_types.csv, rather than one file per kind.</li><li>AttributeTypeLineExporter serializes each attribute type, deriving the Entity name column from the object&#39;s runtime type so a single exporter can handle all five kinds correctly.</li><li>Unit tests cover a full export, a null max-occurs value, retired types, and the entity-name mapping across all five kinds.</li></ul><p>This domain pushed the exporter framework further than Privileges or Visit Types did, since it’s the first one that has to disambiguate between multiple underlying entity types within a single output file.</p><h3>Weekly Sync with the GHSD Team</h3><p>This week marked the start of a <strong>standing weekly call with the GHSD project team</strong>, where I walk through current progress — merged PRs, what’s in review, and what’s next on the domain priority list. Having a recurring, predictable checkpoint (rather than one-off updates) makes it a lot easier to surface blockers early, like the retire-flag issue above, and to keep the domain implementation order aligned with what the broader program needs to see.</p><h3>Keeping the Wiki Page Current</h3><p>I also went back and <strong>updated the wiki page</strong> to reflect where the project actually stands now adding the Attribute Type domain, noting the retire-on-import lesson learned, and keeping the documentation in step with what’s merged rather than letting it drift out of date. Keeping the wiki current each week, rather than doing a big rewrite later, is turning out to be much easier to sustain.</p><h3>Looking Ahead</h3><p>With Privileges, Visit Types, and Attribute Types all merged, the framework has now been tested against a genuinely tricky multi entity domain and come out stronger for it. Next week I’ll continue working down the domain priority list, keep the wiki page in sync with each merge, and bring the latest status to the GHSD team’s weekly call.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6810ede95503" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OpenMRS Fellowship Journey — Week 2]]></title>
            <link>https://bawantharathnayaka.medium.com/openmrs-fellowship-journey-week-2-d6e21241e7e1?source=rss-615355f767c3------2</link>
            <guid isPermaLink="false">https://medium.com/p/d6e21241e7e1</guid>
            <category><![CDATA[fellowship]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[healthcare]]></category>
            <category><![CDATA[openmrs]]></category>
            <dc:creator><![CDATA[Bawantha Rathnayaka]]></dc:creator>
            <pubDate>Wed, 01 Jul 2026 18:42:22 GMT</pubDate>
            <atom:updated>2026-07-01T18:42:22.957Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*74AXBwGTud41rkmS1Wyt2Q.png" /></figure><p>Week 2 was all about turning last week’s planning into a working process deciding what to build first, setting up the places where the community can track and discuss the work, and shipping the first real domain exporters.</p><h3>Deciding What to Build First</h3><p>One of the first things my colleague [@wikumc] and I did this week was sit down and talk through implementation order. Since the Metadata Extraction Tool needs to eventually support many OpenMRS metadata domains (privileges, visit types, concept classes, locations, concepts, and more), we couldn’t just start anywhere — we needed a sequence that would let us validate the architecture early and catch design issues before they multiplied across domains.</p><p>We agreed to <strong>prioritize the core, structurally simple domains first</strong> — starting with things like Privileges and Visit Types. These domains are small and low-risk, which makes them ideal for proving out the base exporter framework (BaseLineExporter, MetadataLineExporter, CsvDomainExporter) before tackling more complex, highly-customizable domains like Concepts and Locations, where as Mike Seaton pointed out in the community discussion there often isn&#39;t a single &quot;correct&quot; way to model the export (e.g., should location tags be columns in the location domain, or live in a separate locationtagmaps domain?).</p><p>Starting simple also means that once we hit the trickier domains, the plumbing (UUID handling, retire-flag handling, CSV writing, folder conventions) is already solid and battle-tested.</p><h3>Setting Up the Jira Space</h3><p>To keep the work trackable and transparent for the community, I set up a <strong>dedicated Jira project space (ME)</strong> for the Metadata Extraction Tool. Every piece of work — from small chores like adding a PR template to full domain implementations — now has a corresponding ticket (ME-1, ME-2, ME-4, and more to come), so anyone following along can see exactly what’s in progress, what’s done, and what’s next.</p><p>Jira Space — <a href="https://openmrs.atlassian.net/browse/ME">https://openmrs.atlassian.net/browse/ME</a></p><h3>Drafting the Wiki Page</h3><p>Documentation is something I wanted to get right from the start rather than bolt on at the end, so I began drafting a <strong>wiki page</strong> for the project on the OpenMRS wiki. It’s still a work in progress, but it already outlines the project’s purpose, architecture, and how the domain exporters fit together. I shared the draft with mentors and reviewers early for feedback rather than waiting until it was “finished.”</p><h3>Opening the Community Discussion</h3><p>I created a <a href="https://talk.openmrs.org/t/metadata-extraction-tool/49697">community discussion thread</a> on OpenMRS Talk to serve as the central place for planning and tracking the project throughout the fellowship. This is where I’m sharing objectives, the development plan, Jira board updates, and the wiki draft so the wider community can follow along and weigh in.</p><p>The thread already generated some genuinely useful discussion. Mike Seaton shared a related effort from PIH a ConceptExporter they&#39;d built for a similar purpose along with a really important caution: many OpenMRS metadata domains are customizable enough that there&#39;s no one-size-fits-all export strategy. That feedback directly shaped how we&#39;re thinking about configurability for domains like Concepts and Locations further down the line.</p><h3>Shipping the First Domains</h3><p>On the code side, this week produced real, merged progress on the <a href="https://github.com/openmrs/openmrs-module-metadataexport">openmrs-module-metadataexport</a> repository:</p><ul><li><a href="https://github.com/openmrs/openmrs-module-metadataexport/pull/2"><strong>ME-2: Add pull request template</strong></a> — Set up a PR template (based on the one used in openmrs-core) so future contributions to the module follow a consistent format.</li><li><a href="https://github.com/openmrs/openmrs-module-metadataexport/pull/1"><strong>ME-1: Add privilege domain</strong></a> — Implemented PrivilegeLineExporter and PrivilegeDomainExporter, exporting UUID, name, description, and retire status for privileges into an Initializer-compatible privileges.csv. Wikum&#39;s review caught that the &quot;Privilege name&quot; header needed to be lowercase to match how the Initializer module expects it a good reminder to always cross check field naming against the consuming module, not just against what &quot;looks right.&quot;</li><li><a href="https://github.com/openmrs/openmrs-module-metadataexport/pull/6"><strong>ME-4: Support Visit Type Domain</strong></a> — Added VisitTypeLineExporter and VisitTypeDomainExporter, with unit tests covering a full export, a visit type with no description, and a retired visit type. This PR led to a good discussion with Daniel Kayiwa about CSV file-naming conventions it turns out the Initializer module scans for <em>any</em> .csv file in a domain&#39;s folder rather than requiring an exact filename, so visitTypes.csv (camelCase, matching multi-word domains like encounterTypes.csv) was the right and safe choice.</li></ul><h3>Meeting the GHSD Team</h3><p>This week also brought the <strong>first meeting with the GHSD team</strong>, where I shared the current state of the project the domain prioritization plan, the Jira board, the merged PRs, and the open community thread. It was a good checkpoint to make sure the direction we’re taking (start small, validate the framework, then scale to more complex domains) aligns with what the broader program expects.</p><h3>Looking Ahead</h3><p>With the core exporter framework now proven out across two domains, next week’s focus shifts to picking up the next domains in the priority list, continuing to refine the wiki documentation, and keeping the community thread updated as new PRs go up for review.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d6e21241e7e1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My OpenMRS Fellowship Journey Begins Week 1]]></title>
            <link>https://bawantharathnayaka.medium.com/my-openmrs-fellowship-journey-begins-week-1-a90ad3cf4b0f?source=rss-615355f767c3------2</link>
            <guid isPermaLink="false">https://medium.com/p/a90ad3cf4b0f</guid>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[openmrs]]></category>
            <category><![CDATA[open-source-software]]></category>
            <category><![CDATA[fellowship]]></category>
            <dc:creator><![CDATA[Bawantha Rathnayaka]]></dc:creator>
            <pubDate>Sat, 27 Jun 2026 03:03:50 GMT</pubDate>
            <atom:updated>2026-06-27T03:05:00.316Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qu5-3nT9VJd7J9-9zivxRA.png" /></figure><p>I’m excited to share that I’ve just started a two month paid Technical/Backend Fellowship with OpenMRS one of the world’s leading open source electronic medical record systems used across developing countries. This is my Week 1 update.</p><h3>How I Got Here</h3><p>I’ve been an active member of the OpenMRS community for over two years now. It didn’t start with a fellowship it started with just wanting to contribute to something meaningful.</p><p>Over the past two years I volunteered my time fixing bugs, contributing code, and mentoring students through Google Summer of Code (GSoC) projects within the OpenMRS ecosystem. Being part of GSoC as a mentor was especially rewarding watching students grow as developers while contributing to healthcare software used in real clinics around the world is something I’m really proud of.</p><p>Because of that ongoing involvement and contribution to the community, I was nominated for this fellowship. It means a lot to me because it came from trust the community placed in me not from a cold application. I’m grateful and I take that responsibility seriously.</p><h3>The Project — Metadata Extraction Tool</h3><p>My main task for this fellowship is to build a Metadata Extraction Tool — a Java-based utility that extracts configuration from a live OpenMRS instance and outputs it as Iniz compatible CSV files.</p><p>To put it simply: if you have a fully configured OpenMRS site and want to replicate that setup on a brand new instance, you’d normally have to do everything manually. My tool will automate that by pulling all the configuration (concepts, locations, encounter types, drugs, global properties, etc.) and exporting it in a format that the OpenMRS Initializer (Iniz) module can directly load.</p><p>The goal is to make bootstrapping new OpenMRS sites fast, reliable and repeatable.</p><h3>Week 1 — What I Actually Did</h3><p><em>My first week was all about understanding before building.</em></p><p>I started by connecting with the GHSD technical team on Slack and OpenMRS Talk. Even though I already knew the community well, this project has its own team and context so getting properly onboarded and aligned was the right first step.</p><p>Together with the technical team, we had initial discussions to define what “in scope” actually means for this tool. Not all configuration items need to be extracted. so we started narrowing down which domains matter most for the use case. This is an important step because building without a clear scope leads to wasted effort.</p><p>Even as a long-time OpenMRS contributor, the Initializer module was fairly new territory for me. I spent a significant part of the week reading through the Iniz module documentation on GitHub. so understanding these deeply was essential before writing a single line of code.</p><p>Key resources I went through:</p><ul><li>OpenMRS Initializer GitHub repo (mekomsolutions/openmrs-module-initializer)</li><li>CSV conventions documentation</li><li>O3 Docs : Initializer overview</li></ul><p>Next week I’ll be finalizing the agreed scope of extraction domains with my mentor, setting up my local OpenMRS development environment, and starting to design the Java class structure for the tool.</p><p>Stay tuned for Week 2</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a90ad3cf4b0f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Built a DIY Apple HomeKit Supported Light Strip]]></title>
            <link>https://bawantharathnayaka.medium.com/how-i-built-a-diy-apple-homekit-supported-light-strip-9872be565070?source=rss-615355f767c3------2</link>
            <guid isPermaLink="false">https://medium.com/p/9872be565070</guid>
            <category><![CDATA[diy-projects]]></category>
            <category><![CDATA[apple-homekit]]></category>
            <category><![CDATA[iot]]></category>
            <category><![CDATA[arduino]]></category>
            <category><![CDATA[esp32-programming]]></category>
            <dc:creator><![CDATA[Bawantha Rathnayaka]]></dc:creator>
            <pubDate>Wed, 01 Apr 2026 19:23:35 GMT</pubDate>
            <atom:updated>2026-04-02T03:18:27.664Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XNTPi2hFUbbRrsuoD5BYEg.png" /></figure><p>you need those items for testing</p><ul><li>breadboard</li><li>esp32 c6 board</li><li>jumper wires</li><li>Arduino ide</li><li>5v power adaptor</li><li>330Ω Resistor</li><li>WS2812 Addressable led strip (I use 1 meter with 60 led’s)</li></ul><h3>Why the ESP32-C6?</h3><p>The ESP32-C6 has native <strong>Matter support. </strong>Matter being the universal IoT protocol backed by Apple, Google, and Amazon. This means the same device can work with Apple HomeKit, Google Home, or Amazon Alexa without any extra bridges or hubs. It’s the right chip to build on if you want your project to be future-proof.</p><p>Before wiring anything, connect your ESP32-C6 to your PC via USB C and get the Arduino IDE ready</p><p><strong>Step 1 — Add the ESP32 Board Manager URL</strong></p><p>Go to <strong>File → Preferences</strong> and paste this URL into the “Additional Board Manager URLs” field:</p><p><a href="https://espressif.github.io/arduino-esp32/package_esp32_index.json">https://espressif.github.io/arduino-esp32/package_esp32_index.json</a></p><p><strong>Step 2 — Install the ESP32 Board Package</strong></p><p>Go to <strong>Tools → Board → Boards Manager</strong>, search for esp32, and install the package by <strong>Espressif Systems</strong>. This may take a minute or two.</p><p><strong>Step 3 — Select Your Board</strong></p><p>Go to <strong>Tools → Board → esp32</strong> and select your board. For a standard dev kit, choose <strong>“ESP32 Dev Module”</strong>.</p><p><strong>Step 4 — Select the Port</strong></p><p>Go to <strong>Tools → Port</strong> and select the COM port your ESP32 is connected to. On Windows it’ll appear as COM3, COM4, etc. On Mac/Linux look for /dev/ttyUSB0 or /dev/cu.SLAB_USBtoUART. If no port shows up, you may need to install the <strong>CP210x</strong> or <strong>CH340</strong> USB driver depending on your board.</p><p><strong>Step 5 — Install the Adafruit NeoPixel Library</strong></p><p>Go to <strong>Sketch → Include Library → Manage Libraries</strong>, search for NeoPixel, find <strong>&quot;Adafruit NeoPixel&quot;</strong> by Adafruit, and click Install.</p><h3>The Code (I asked Claude Code, it delivered, I took credit 😂)</h3><p>Paste the following sketch into Arduino IDE, update your Wi-Fi credentials, and flash it to the board.</p><pre>#include &quot;HomeSpan.h&quot;<br>#include &lt;Adafruit_NeoPixel.h&gt;<br><br>/////////////////////////////////<br>// LED CONFIG<br>/////////////////////////////////<br>#define DATA_PIN   4<br>#define NUM_LEDS   60   // change to your strip length<br><br>Adafruit_NeoPixel strip(NUM_LEDS, DATA_PIN, NEO_GRB + NEO_KHZ800);<br><br>/////////////////////////////////<br>// WIFI (HARDCODED)<br>/////////////////////////////////<br>const char* WIFI_SSID = &quot;your wifi ssid&quot;;<br>const char* WIFI_PASS = &quot;your wifi password&quot;;<br><br>/////////////////////////////////<br>// LED ACCESSORY (FULL CONTROL)<br>/////////////////////////////////<br>struct LEDStrip : Service::LightBulb {<br><br>  Characteristic::On power{0};<br>  Characteristic::Brightness brightness{100};<br>  Characteristic::Hue hue{0};<br>  Characteristic::Saturation saturation{0};<br><br>  LEDStrip() : Service::LightBulb() {}<br><br>  //////////////////////////////////<br>  // HSV → RGB conversion<br>  //////////////////////////////////<br>  void hsvToRgb(float h, float s, float v, int &amp;r, int &amp;g, int &amp;b) {<br>    float c = v * s;<br>    float x = c * (1 - abs(fmod(h / 60.0, 2) - 1));<br>    float m = v - c;<br><br>    float r1, g1, b1;<br><br>    if (h &lt; 60)       { r1 = c; g1 = x; b1 = 0; }<br>    else if (h &lt; 120) { r1 = x; g1 = c; b1 = 0; }<br>    else if (h &lt; 180) { r1 = 0; g1 = c; b1 = x; }<br>    else if (h &lt; 240) { r1 = 0; g1 = x; b1 = c; }<br>    else if (h &lt; 300) { r1 = x; g1 = 0; b1 = c; }<br>    else              { r1 = c; g1 = 0; b1 = x; }<br><br>    r = (r1 + m) * 255;<br>    g = (g1 + m) * 255;<br>    b = (b1 + m) * 255;<br>  }<br><br>  //////////////////////////////////<br>  // UPDATE (called from HomeKit)<br>  //////////////////////////////////<br>  boolean update() {<br><br>    if (!power.getNewVal()) {<br>      strip.clear();<br>      strip.show();<br>      return true;<br>    }<br><br>    float h = hue.getNewVal();           // 0–360<br>    float s = saturation.getNewVal() / 100.0; // 0–1<br>    float v = brightness.getNewVal() / 100.0; // 0–1<br><br>    int r, g, b;<br>    hsvToRgb(h, s, v, r, g, b);<br><br>    for (int i = 0; i &lt; NUM_LEDS; i++) {<br>      strip.setPixelColor(i, strip.Color(r, g, b));<br>    }<br><br>    strip.show();<br>    return true;<br>  }<br>};<br><br>/////////////////////////////////<br>// SETUP<br>/////////////////////////////////<br>void setup() {<br><br>  Serial.begin(115200);<br><br>  strip.begin();<br>  strip.clear();<br>  strip.show();<br><br>  // HomeSpan init<br>  homeSpan.setWifiCredentials(WIFI_SSID, WIFI_PASS);<br>  homeSpan.begin(Category::Lighting, &quot;ESP32-C6 RGB LED&quot;);<br><br>  // Accessory<br>  new SpanAccessory();<br>    new Service::AccessoryInformation();<br>      new Characteristic::Name(&quot;RGB LED Strip&quot;);<br>      new Characteristic::Manufacturer(&quot;DIY&quot;);<br>      new Characteristic::Model(&quot;ESP32-C6&quot;);<br>      new Characteristic::SerialNumber(&quot;001&quot;);<br><br>    new LEDStrip();<br>}<br><br>/////////////////////////////////<br>// LOOP<br>/////////////////////////////////<br>void loop() {<br>  homeSpan.poll();<br>}</pre><p>Hit the Upload button (→). If the onboard LED starts blinking, the flash was successful</p><h4>Wiring It Up</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WB6EcxR5FhJNOxDWU-VhJQ.png" /></figure><p><strong>Important note on the data pin:</strong> The circuit diagram shows the data line on pin 8, but pin 8 is already assigned to the onboard LED on the ESP32-C6. Make sure you connect the LED strip’s data line to <strong>pin 4</strong> as defined in the code.</p><p>Connect your 330Ω resistor in series on the data line this protects the first LED from signal reflections that can cause flickering or damage over time. Once wired, connect the strip to your 5V power supply (not the ESP32’s 3.3V pin the WS2812 strip needs a dedicated 5V source, especially at higher LED counts).</p><h3>Adding to Apple Home</h3><ol><li>Power everything up and open the <strong>Home app</strong> on your iPhone.</li><li>Tap <strong>+</strong> → <strong>Add Accessory</strong> → <strong>More Options</strong>.</li><li>You should see <strong>“ESP32-C6 RGB LED”</strong> appear. tap it.</li><li>Enter the pairing PIN: <strong>466-37-726</strong></li><li>Follow the prompts to assign it to a room.</li></ol><p>Once added, you’ll get full control on/off, brightness, and color right from the Home app or Siri</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dLrs6PHQE5-kCv2jWLVGCw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YMFinLc7b7zrCfb35rCg1A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VmMUrgmxxxmZtOURT-D1TQ.png" /></figure><p>after added you can see like this menu and you can change brightness and colors in your led strip.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KggByKEydXxJKFovR1NEAA.png" /></figure><p>Happy building :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9872be565070" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Code to Connection: My Experience at the GSoC Mentor Summit 2025 in Munich ]]></title>
            <link>https://bawantharathnayaka.medium.com/from-code-to-connection-my-experience-at-the-gsoc-mentor-summit-2025-in-munich-9c1fed1f1ef5?source=rss-615355f767c3------2</link>
            <guid isPermaLink="false">https://medium.com/p/9c1fed1f1ef5</guid>
            <category><![CDATA[gsoc]]></category>
            <category><![CDATA[open-source-contribution]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[open-source-software]]></category>
            <category><![CDATA[google-summer-of-code]]></category>
            <dc:creator><![CDATA[Bawantha Rathnayaka]]></dc:creator>
            <pubDate>Sun, 02 Nov 2025 16:11:05 GMT</pubDate>
            <atom:updated>2025-11-03T18:05:48.631Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i-oRFi-ji1Zc_7eDwUVa2A.png" /></figure><p>The Google Summer of Code (GSoC) Mentor Summit 2025 had 130+ various open source organizations come together at the Marriott Hotel Munich , Germany. Representing the OpenMRS, this was my inaugural participation in the summit, held from October 23rd to 25th. With more than 150 attendees representing diverse organizations, this summit is not a usual conference, its an unconference. event was a great way to network, share ideas, and learn from others. Unlike a regular conference where the sessions are already planned, the participants had the opportunity to pitch their own sessions, attend whichever they liked, and had plenty of options to choose from. Hence the unconference.</p><h3>Icebreaker</h3><p>The Icebreaker session was one of the most enjoyable parts of the summit. It was designed as a fun activity to help mentors relax, connect, and overcome any initial shyness. The room was filled with laughter, small challenges, and collaborative games that encouraged everyone to mingle and interact.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EfHlFtTRr97zYIZvZMUpqA.jpeg" /></figure><p>Google also surprised the top 10 winners with small gifts. but honestly, the real reward was the experience itself. This session helped me step out of my comfort zone, talk to other mentors, and share our stories and challenges. It truly set a positive tone for the rest of the summit and made it much easier to connect with people afterward.</p><h3><strong>Lightning Talks</strong></h3><p>The lightning talks were short 3 minute presentations where mentors introduced their projects and organizations. It was fast, fun, and full of great ideas from people all around the world.</p><p>I also got a chance to talk about my mentor project in <strong>OpenMRS</strong>. Sharing our work in such a short time was a bit challenging but really exciting. It felt great to represent our community and see how others are contributing to open source in different ways.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IMfypl0mcdiiUNDGiPv0Ww.jpeg" /><figcaption>Photo by my OpenMRS teammates (Jayasanka , Beryl)</figcaption></figure><p>This experience gave me more confidence and helped me connect with other mentors who were working on similar challenges.</p><h3>Chocolate / Sticker Table</h3><p>There were two special tables at the event that perfectly captured the diversity and spirit of the summit. one filled with stickers from all the participating open-source organizations, and another packed with chocolates brought by mentors from around the world.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ur-W0Xj2scYP4N4049hVYQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y5ETr3l3FP_0qWNYYXNrIA.jpeg" /></figure><p>It was a simple but wonderful idea that brought everyone together sharing chocolates, collecting stickers, and connecting over stories from different communities and countries.</p><h3>Collaboration on White Board</h3><p>On the second day, introduced us to a unique and creative way of planning sessions. Large whiteboards and colorful sticky notes were set up for everyone to propose topics, discussions, or ideas they wanted to explore. This format, known as an <strong><em>unconference</em></strong>, allows participants to decide what sessions they’d like to have making the entire event more open, flexible, and collaborative.</p><p>Each session lasted about an hour, with several running in parallel. It was always exciting to return to the board, see new ideas pop up, and plan where to go next.</p><p>The best part was the freedom you could join any session that interested you, host your own discussion, or even continue a great conversation in the hallway. It truly reflected the open-source spirit of sharing and collaboration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KYSA_sJ5H8FLhN0wawnziw.jpeg" /></figure><h3><strong>Community Moments &amp; Connections</strong></h3><p>One of the most memorable parts of the summit was the time spent connecting with other mentors. Between sessions, coffee breaks, and group activities, there were countless moments of laughter, sharing ideas, and exchanging experiences from different open-source communities.</p><p>I also took a few selfies with mentors I met each picture capturing a story, a new friendship, and a shared passion for open source. These small moments reminded me that beyond the code, the true strength of open source lies in its people kind, curious, and always ready to help each other grow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*prtk3TT78CKi9Icss_nZyg.png" /></figure><p>The summit wasn’t just about projects or talks. it was about building lasting connections that continue long after the event ends.</p><h3>Thank Youuuuuuuuu</h3><p>I’m deeply thankful to <strong>Google</strong> and <strong>OpenMRS</strong> for giving me this incredible opportunity to attend the GSoC Mentor Summit 2025. It was an experience full of learning, inspiration, and meaningful connections.</p><p>A special thanks to my fellow OpenMRS attendees, <strong>Jayasanka</strong> and <strong>Beryl</strong>, for sharing this amazing journey your energy and support made the summit even more memorable.</p><p>I also want to thank my GSoC student, <strong>Ganesh Devisetti</strong> for being such a proactive and dedicated contributor. Seeing your growth and enthusiasm makes this journey as a mentor truly rewarding.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6C-Yn_4N0e-rI7Tc9xZPkg.jpeg" /><figcaption>OpenMRS Team</figcaption></figure><p>Wherever I am, I’ll always be cheering for everyone I met in Europe. may your work continue to thrive and your days be filled with joy.</p><h3>Resources</h3><ul><li>GSoC Mentor Summit 2025 official page:</li></ul><p><a href="https://sites.google.com/view/2025mentorsummit/home?authuser=0&amp;source=post_page-----d2a953842ba3---------------------------------------">2025 Mentor Summit</a></p><ul><li><a href="https://docs.google.com/presentation/d/e/2PACX-1vT9NHy2xSJAfGoRvkhYSFRtET9-o0rtJlB8KzipTBgyQ09Tb36LHlo2IPK9oadYdZAxn18h4GJqK3fQ/pub?start=false&amp;loop=false&amp;delayms=3000">Slides</a></li><li><a href="https://www.youtube.com/playlist?list=PL5jj7JoBifSnOxEHSRJOnfcGlauX-t5Zx">OpenMRS GSoC Video Podcast Series</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c1fed1f1ef5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Configured Code Formatting in the OpenMRS Performance Testing Maven Repository]]></title>
            <link>https://bawantharathnayaka.medium.com/how-i-configured-code-formatting-in-the-openmrs-performance-testing-maven-repository-da56d684ffa3?source=rss-615355f767c3------2</link>
            <guid isPermaLink="false">https://medium.com/p/da56d684ffa3</guid>
            <category><![CDATA[gsoc25]]></category>
            <category><![CDATA[gsoc]]></category>
            <category><![CDATA[openmrs]]></category>
            <category><![CDATA[maven]]></category>
            <category><![CDATA[codeformatter]]></category>
            <dc:creator><![CDATA[Bawantha Rathnayaka]]></dc:creator>
            <pubDate>Thu, 27 Mar 2025 05:29:10 GMT</pubDate>
            <atom:updated>2025-03-27T05:30:18.236Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ycpwgtHK_MgPe4zWdbZHGg.png" /></figure><p>Hi everyone,</p><p>I am excited to share that I have been selected as a mentor for Google Summer of Code (GSoC) 2025, contributing to the <strong>OpenMRS</strong> project. The project I will be mentoring focuses on <strong>Performance Testing Enhancement</strong>.</p><p>This project was initially started by <a href="https://medium.com/u/cd6875870f78">Jayasanka Weerasinghe</a>, but we have encountered some challenges, particularly during <strong>pull request (PR) reviews</strong>. Many students submitting PRs often face <strong>code formatting issues</strong>, which require additional time and effort to review.</p><p>Currently, OpenMRS has a <strong>styling configuration file</strong> in place. However, the OpenMRS core repository still relies on an outdated code formatting tool: <strong>Google Code Maven Java Formatter Plugin</strong>. Unfortunately, this package is no longer maintained, with its last update dating back to <strong>2013</strong>, and it does not function properly.</p><p>To resolve this, we have identified a more modern alternative: <strong>net.revelc.code.formatter</strong>. This package offers better support for code formatting and aligns with the latest development practices.</p><h3><strong>Implementation Details</strong></h3><p>To integrate the <a href="https://code.revelc.net/formatter-maven-plugin/"><strong>net.revelc.code.formatter</strong></a> into the OpenMRS project and ensure proper code formatting, I made the following updates to the <strong>pom.xml</strong> file.</p><h4>Upgrading Compiler Version</h4><p>The previous compiler version was <strong>15</strong>, but since the new formatter package requires <strong>Java 17 or above</strong>, I updated the compiler settings:</p><pre>&lt;maven.compiler.source&gt;17&lt;/maven.compiler.source&gt;<br>&lt;maven.compiler.target&gt;17&lt;/maven.compiler.target&gt;<br>&lt;maven.compiler.release&gt;17&lt;/maven.compiler.release&gt;</pre><h4>Adding the Formatter Maven Plugin</h4><p>I integrated the <strong>formatter-maven-plugin</strong> to automate code formatting:</p><pre>&lt;plugin&gt;<br>    &lt;groupId&gt;net.revelc.code.formatter&lt;/groupId&gt;<br>    &lt;artifactId&gt;formatter-maven-plugin&lt;/artifactId&gt;<br>    &lt;version&gt;2.26.0&lt;/version&gt;<br>    &lt;executions&gt;<br>        &lt;execution&gt;<br>            &lt;goals&gt;<br>                &lt;goal&gt;format&lt;/goal&gt;<br>            &lt;/goals&gt;<br>        &lt;/execution&gt;<br>    &lt;/executions&gt;<br>    &lt;configuration&gt;<br>        &lt;configFile&gt;eclipse/OpenMRSFormatter.xml&lt;/configFile&gt;<br>        &lt;compilerSource&gt;${maven.compiler.source}&lt;/compilerSource&gt;<br>        &lt;compilerCompliance&gt;${maven.compiler.source}&lt;/compilerCompliance&gt;<br>        &lt;compilerTargetPlatform&gt;${maven.compiler.target}&lt;/compilerTargetPlatform&gt;<br>    &lt;/configuration&gt;<br>    &lt;dependencies&gt;<br>        &lt;dependency&gt;<br>            &lt;groupId&gt;org.openmrs.tools&lt;/groupId&gt;<br>            &lt;artifactId&gt;openmrs-tools&lt;/artifactId&gt;<br>            &lt;version&gt;2.7.3&lt;/version&gt;<br>        &lt;/dependency&gt;<br>    &lt;/dependencies&gt;<br>&lt;/plugin&gt;</pre><h4>Updating Repositories</h4><p>I also ensured that OpenMRS dependencies are correctly fetched by adding the following repositories to the <strong>pom.xml</strong>:</p><pre>&lt;repositories&gt;<br>    &lt;repository&gt;<br>        &lt;id&gt;openmrs-repo&lt;/id&gt;<br>        &lt;name&gt;OpenMRS Nexus Repository&lt;/name&gt;<br>        &lt;url&gt;https://mavenrepo.openmrs.org/nexus/content/repositories/public&lt;/url&gt;<br>    &lt;/repository&gt;<br>&lt;/repositories&gt;<br><br>&lt;pluginRepositories&gt;<br>    &lt;pluginRepository&gt;<br>        &lt;id&gt;openmrs-repo&lt;/id&gt;<br>        &lt;name&gt;OpenMRS Nexus Repository&lt;/name&gt;<br>        &lt;url&gt;https://mavenrepo.openmrs.org/nexus/content/repositories/public&lt;/url&gt;<br>        &lt;snapshots&gt;<br>            &lt;enabled&gt;false&lt;/enabled&gt;<br>        &lt;/snapshots&gt;<br>    &lt;/pluginRepository&gt;<br>&lt;/pluginRepositories&gt;</pre><h4>Manual Code Formatting</h4><p>With the above configurations, code formatting can be executed manually using the following Maven command:</p><pre>mvn formatter:format</pre><h4>Automating Code Formatting with a Git Hook</h4><p>To ensure that code is automatically formatted before each commit, I added a Git pre-commit hook. This hook runs the formatter, preventing commits that don’t adhere to the project’s code style.</p><p><strong>Steps to Implement the Pre-Commit Hook:</strong></p><p><strong>Create the Pre-Commit Hook Script:</strong></p><p>In the project’s .git/hooks/ directory, create a file named pre-commit with the following content:</p><pre>#!/bin/bash<br><br>echo &quot;🔄 Running Maven Formatter...&quot;<br><br># Run the Maven formatter plugin<br>./mvnw formatter:format<br>FORMAT_STATUS=$?<br><br><br>if [ $FORMAT_STATUS -ne 0 ]; then<br>    echo &quot;❌ Code formatting issues detected. Please fix them before committing.&quot;<br>    exit 1<br>fi<br><br>echo &quot;✅ Code formatting passed. Proceeding with commit.&quot;<br>exit 0</pre><p>This script formats the code and stages the changes before committing.</p><p><strong>Set Up the Git Hook Path:</strong></p><p>To automatically format code before committing, configure Git to use the hooks directory:</p><pre>git config core.hooksPath .githooks</pre><p>After cloning this project, students can run this command to automatically configure the Git hook.</p><h3>Outcome and Benefits</h3><p>With these improvements, OpenMRS now has a <strong>modern, automated code formatting system</strong>, ensuring that all contributions adhere to a consistent style. The key benefits of this implementation include:</p><ul><li><strong>Automated Code Formatting</strong>: The Git hook ensures that all code is formatted correctly before each commit, reducing manual formatting errors.</li><li><strong>Streamlined PR Reviews</strong>: Reviewers no longer need to spend extra time pointing out formatting issues, allowing them to focus on the actual code logic.</li><li><strong>Better Developer Experience</strong>: Contributors can now write code without worrying about formatting, as it is handled automatically.</li></ul><h3>Final Thoughts</h3><p>This enhancement significantly improves the OpenMRS development workflow, making contributions smoother and more efficient. If you’re interested in working on this project as part of <strong>Google Summer of Code 2025</strong>, make sure to check out the project page for more details:</p><p>🔗 <a href="https://openmrs.atlassian.net/wiki/spaces/projects/pages/368967702/Performance+Testing+Enhancement+Project+GSoC+2025"><strong>Performance Testing Enhancement Project — GSoC 2025</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=da56d684ffa3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Enhancing OpenMRS Performance Testing: My Contribution to Workflow Automation and Load Testing.]]></title>
            <link>https://bawantharathnayaka.medium.com/enhancing-openmrs-performance-testing-my-contribution-to-workflow-automation-and-load-testing-0d1b95fd2560?source=rss-615355f767c3------2</link>
            <guid isPermaLink="false">https://medium.com/p/0d1b95fd2560</guid>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[openmrs]]></category>
            <category><![CDATA[loadtest]]></category>
            <category><![CDATA[opensorce]]></category>
            <dc:creator><![CDATA[Bawantha Rathnayaka]]></dc:creator>
            <pubDate>Tue, 28 Jan 2025 18:57:07 GMT</pubDate>
            <atom:updated>2025-01-28T18:57:07.317Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xI7kROwiROBk16TzmmRqyw.png" /></figure><p>I’m thrilled to share my recent contributions to the OpenMRS project, particularly focusing on performance testing. OpenMRS, an open-source software platform that provides a customizable, scalable electronic medical record system, has been a significant player in healthcare technology. My recent contributions aim to improve the reliability of performance testing workflows and enhance load testing coverage.</p><p>In this article, I’ll walk you through the two pull requests (PRs) I recently merged into the OpenMRS performance test repository: one related to the automation of test report generation and the other focused on improving test coverage for allergy recording during patient visits.</p><h3><strong>PR 1: Enhancing Load Test Coverage — “Add Allergy Recording to Patient Visit Scenario (load test coverage)”</strong></h3><p>Load testing is a critical part of ensuring that an application can scale under heavy usage and maintain consistent performance. In this second PR, I focused on adding load test coverage for a user scenario in OpenMRS: allergy recording during a patient visit. This is a key function in the patient management flow, and ensuring it works under stress is essential for delivering a reliable product.</p><p>The objective was to simulate the load of multiple users simultaneously recording allergies for patients and verify that the system could handle this scenario without significant degradation in performance. Here’s the link to the PR: <a href="https://github.com/openmrs/openmrs-contrib-performance-test/pull/58">PR #58</a>.</p><h4>What I Changed:</h4><ul><li>Created and added a new load test scenario that simulates the process of recording allergies during patient visits.</li><li>Incorporated parameters such as the number of simultaneous users and the frequency of actions to stress-test the system under realistic conditions.</li></ul><h4>Why It Matters:</h4><ul><li><strong>Comprehensive Load Testing</strong>: By including the allergy recording scenario, I expanded the test coverage to include a key patient interaction that is likely to experience significant usage in real-world conditions.</li><li><strong>Better Scalability Insights</strong>: With this added test, the team now has a clearer picture of how the system behaves when handling multiple patients’ allergy records, providing actionable insights into areas that might need optimization.</li></ul><p>This enhancement not only strengthens the test suite but also provides the team with more data to fine-tune performance and improve scalability.</p><h3>PR 2: Automating Performance Test Reports — “Update scheduled performance test workflow to push reports regardless of test failures”</h3><p>In the realm of continuous integration (CI) and testing, automation plays a key role in ensuring reliability and efficiency. One of the challenges I encountered while working with OpenMRS’s performance testing workflows was the lack of automated reporting when a test failed. Test reports weren’t being pushed if the test itself encountered an issue, making it difficult to track and analyze performance metrics.</p><p>To address this, I proposed and implemented a fix to the GitHub Actions workflow to ensure that performance test reports are pushed, regardless of whether the tests pass or fail. The main objective was to ensure that valuable test data is always made available for review and further investigation, even in the case of test failures. Here’s a link to the PR: <a href="https://github.com/openmrs/openmrs-contrib-performance-test/pull/54">PR #54</a>.</p><h4>What I Changed:</h4><ul><li>Modified the existing GitHub Actions workflow to include a conditional step that pushes test reports even when a failure occurs.</li><li>Ensured that the reports are uploaded to the designated repository or storage, allowing the team to review results promptly.</li></ul><h4>Why It Matters:</h4><ul><li><strong>Improved Transparency</strong>: With test reports being pushed after each run (whether successful or not), the team can always track the performance status of the system.</li><li><strong>Better Debugging</strong>: When a test fails, it becomes easier to pinpoint the issue by reviewing the report and making adjustments accordingly.</li></ul><p>By automating this step, I was able to streamline the workflow and make performance tracking a more reliable and straightforward process.</p><h3>Key Takeaways</h3><p>These two contributions mark an important step forward in OpenMRS’s performance testing efforts. By automating report generation and expanding the test coverage to include critical use cases, I helped improve the overall efficiency and reliability of the testing process. Here are some key lessons I learned from the experience:</p><ul><li><strong>Continuous Improvement</strong>: Even small changes, such as automating reporting, can have a significant impact on the workflow and development speed.</li><li><strong>Load Testing is Crucial</strong>: Load testing helps ensure that the system can handle real-world usage, especially for critical patient management tasks.</li><li><strong>Collaboration and Contribution</strong>: Contributing to open-source projects like OpenMRS not only improves the software but also fosters a sense of community and collaboration among developers and contributors.</li></ul><h3>Performance Testing Results</h3><p>If you’re interested in seeing how these performance tests work and what the results look like, you can explore the ongoing performance tests for OpenMRS at this link: <a href="https://o3-performance.openmrs.org/">OpenMRS Performance Testing</a>.</p><h3>Conclusion</h3><p>Contributing to open-source projects like OpenMRS has been an incredibly rewarding experience. Through these two pull requests, I’ve gained deeper insights into CI/CD, load testing, and the importance of comprehensive test coverage. I’m excited to see how these changes will help the OpenMRS community and encourage others to dive into the world of open-source contribution.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0d1b95fd2560" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>