Hi @robertovasquez,
Thank you so much for putting thought into this. I believe there is a better path than the one that I started us down.
If it’s okay I’m going to just respond to your email asking how to get started in the backend modernization project here.
Basically, there are MANY things that need to be cleaned up in the codebase to follow a proper MVC style codebase. I would say that where you can start is by removing all of the SQL queries in the views and putting them in centralized services. For instance, I recently removed about 100 (mostly copy/pasted) SQL queries in the views surrounding “Facilities” and I put them into a “FacilityService” that the views call out to. This is not only good from a code quality perspective, but it will help us in the future because the UI and the business logic are not tangled together (will help with making a REST API or a FHIR API).
The current services use Doctrine (except for the FacilityService, which is straight SQL). It appears that Doctrine may have too high of a learning curve for the greater community and we may want to just stick with straight SQL.
With this said, here are some tasks you can jump on:
- look into building services with straight SQL or something like GitHub - nilportugues/php-sql-query-builder: An elegant lightweight and efficient SQL Query Builder with fluid interface SQL syntax supporting bindings and complicated query generation.
- Study all “Drugs” related tables and create a DrugService that the views/controllers call out to
-m