I try to make some points as well - less on the architecture as OP intended, but more on the general thing:
Making it secure from MitM is not too hard - https and keeping the logic on the server gets you pretty far. Now for some context what I'm about to say:
I live in Switzerland - and a couple days ago, a NetSec group tested our main Vaccination platform on security - unfortunately, they found quite large and critical holes. The platform currently is offline and the creators are being looked at legally (not sued yet, but officially investigated). If you are speaking german, security report in full is available here:
https://mezdanak.de/wp-content/uploads/2021/03/2021_03_21_Report_meineimpfungen-v1.1.pdf. Yes, those points are mainly due to the web interface, but some things in it are simply bad practice and a no go.
The crucial points they found on the platform that they found are:
- Vulnerability for Password reset: If a Doctor account isn't authenticated yet by the authority, a Password reset can still work and create access to the system
- Activation of doctor accounts without proper check: Doctors had to send their "Health Professional Card HPC"
(some kind of ID Card) and a Diploma in, so a human can verify their legitimacy. Needless to say that these can be forged, and that legally that this "validation" is not enough for this kind of data
-
Non-Web Issue: Every Doctor could access every patient: Iirc you wrote in your initial post that this would be a requirement for the app - the security researchers put that as critical risk - each doctor can access all private data of a patient (name, address....). The Thing is - if
one doctor account get compromised,
all patient data is at risk. That is not good.
-
Non-Web Issue: Generation of a patientID: Well, this one made me laugh for it's simplicity...the patient ID is simply the
UNIX timestamp when the person registered! So you would be able to crawl patient Data without any problems...usually you would create a hash or the like...
- Auth of doctors account without proper "trust niveau": For some reason, doctors who have registered via a different federated ID mechanism, aren't able to use 2 Factor Authentication - according to ISO/IUC 29115:2017 this has to be the case ("high trust niveau" which 2FA is)
- And there were some XSS vulnerabilities too.
Now, I know you were talking about distributing the software to doctors directly, and patients wouldn't have access, and there would not be a webinterface in the classic sense. But keep in mind what can happen - in case of a REST service, authentication is needed. Else, if somebody, be it by chance or targeted attack, finds the REST endpoints you use your database is compromised. Same goes for the Application you distribute - Authentication so nobody could get a hands on that software and scrape your database. Also keep an eye out for the ISO/IEC standards for "medical grade software". There could be regulatory requirements at your place - from proper IT security (where is your server? Have you hardened it, and how?) over Risk Management, Life Cycle etcetc. as far as I know, ISO 13485 is one of the ISO lizences/standards that you would have to follow. But I'm sure you will find the better ones for your specific use case.
So overall - If you are a software pro and have experience in creating Medical software and are just new to the Webservice aspect - find a NetSec firm or group to work together with for hardening and securing, and pay attention to your countries legal obligations with such interconnected systems. If you are a networking pro and simply have never dealt with medical software, then all the vulnerabilities above should have made you laugh and cry. Make sure to read through the ISO standards and the legal requirements to run software at a doctor.
If you not experienced in either - put your idea in a nice form, a nice proposal and maybe work together with a software company who has developer such software, and maybe you can make a deal with them that they develop it and give you some fair money in return for the idea (As a film/TV composer myself, I love royalties

)
I don't want to talk you out of it - but I want to make sure that you know what medical software entails and what can happen. It's not as straightforward as an application for a local SMB or an app for your own use.