Why I learned to code

Navigating the bureaucratic intricacies of Brazil’s Unified Health System (SUS) profoundly impacted my daily routine as a doctor. The SUS extends universal coverage to over 190 million citizens and includes vital programs like the “High Cost Pharmacies.” These pharmacies are essential for dispensing medications for chronic conditions, often not covered by private insurance, making them indispensable for many as the costs of these medications can be prohibitive, consuming more than 15% of a person’s monthly income.

However, the procedural demands for prescribing these medications introduced a significant burden. The system mandates a comprehensive array of printed documents for each prescription. In some cases, this could mean managing over 15 different forms per treatment, a daunting task compounded by the high patient volumes.

The time and effort required to meticulously fill out each form, ensuring no minor errors like a misrecorded ICD code—which could lead to the denial of medication dispensation—were substantial. Such errors necessitated a new appointment and the repetition of the entire paperwork process, further delaying patient care. This not only added to the workload but also created a constant risk of administrative errors that could have significant consequences for patient treatment timelines.

This level of bureaucracy was not only a challenge in terms of time management and workload but also posed a deterrent to prescribing necessary treatments. The complexity and redundancy of the paperwork, much of which lacked direct clinical relevance, discouraged prescriptions, impacting patient care quality.

The need for automation to streamline these processes and reduce unnecessary paperwork was evident. So, in the next posts, I will talk about:

  1. The solutions I have developed over the years;
  2. The complete rewrite of my application that is currently underway;
  3. A mini-automation project I developed to collect data;
  4. How I used Nix to create a reproducible environment for my software;
  5. Examples of code refactoring aiming increased security and ease of maintenance.

comments powered by Disqus