mohd-faraz

_blogs

// blogs / 20260527.md

Dev Log: May 27 Wrap-up

2026-05-27
#refactoring#angular#java#api-integration

Overview

Today was all about untangling dependencies and keeping things dry. Spent the first half of the day refactoring some frontend decorator logic that was way too tightly coupled, and spent the rest of the day cleaning up redundant backend query code and making our integration tools a bit smarter.

What I Worked On

Untangling clinical template decorators

I spent some time on our clinical template decorator, and honestly, the inheritance hierarchy was bothering me. It was extending a heavy, specialized assessment parent class that it didn't actually need to be tied to.

I decoupled it completely by shifting its inheritance to our generic base decorator. This makes the component way more independent and lighter. While I was under the hood, I also added some logic to check the facility configuration to dynamically show or hide the document date-time field on the form. Now, if the facility configuration allows it, we show the picker and automatically handle setting the timestamps when duplicating or copying clinical notes.

Cleaning up duplicate EMR query logic

On the Java side, I needed to implement a new query to fetch medical record template data. When looking at the existing codebase, I noticed that an older integration query had almost identical template-processing logic.

Instead of copy-pasting code and adding to the technical debt, I did some spring cleaning. I refactored the shared template retrieval logic into a reusable helper method. Now, both the old integration query and the new template query call this unified helper. I also threw in some strict validation to make sure the template type isn't empty before we try to process anything, which should save us some debugging headaches down the line.

Adding dynamic search to our API helper

Lastly, I worked on our system's HTTP request tool—which we use to execute requests across our clinical modules. We needed a way to pass search terms dynamically during runtime, rather than relying on hardcoded static parameters.

I updated the Python utility to support a new optional dynamic search field. If it's provided, the code automatically merges it with any existing static search strings. To finish it off, I updated the corresponding configuration JSON schema so the new field actually shows up properly in our UI tool configuration form.

Wrapping Up

It feels good to leave the codebase a little cleaner than I found it today. Tomorrow, I'll probably spend some time testing these dynamic search queries to ensure the concatenated parameters don't break on edge-case inputs. Catch you then!