The first big step towards untangling the gordian knot in my book is pivoting the industry to a capitated payment model, so compensation doesn’t require tying everything back to CPT & ICD codes, or tracking super-anal quality metrics for CMS. Once you make that jump, it’s pretty easy to imagine a lightweight note-taking + file-hosting platform that lets providers document summary data on a patient profile wiki-style, and attach notes to the profile in any arbitrary format using customizable templates. (I’m basically picturing a mashup of Google Drive + Wiki.js + Obsidian features.)
Handling meds, orders, and referrals in a cross-platform way is starting to become a solved problem with FHIR. Tack on modular plugins for each of the above to the patient profile page, and you’ve reinvented the functionality of an EMR in a way that sucks far less and lets users get shit done.
What is your concern re: random types popping up? SQLite springs to mind as a prime offender due to not enforcing column types OOTB, but most dialects have rather strong typing.
If we’re talking about mapping UUIDs and datetimes from their DB representations to types defined by the language stdlib, that’s usually the responsibility of the DB driver, no?