The Electronic Patient Record (EPK) is a C#-based application integrating an SQL database with a Windows Forms user interface for efficient patient data management. The system offers extensive security features and allows automatic generation and dispatch of login credentials for remote access to the SQL cloud database.
- Patient Management:
- Add, edit, and delete patient records
- Automatic generation and dispatch of login credentials (username and password) and sent them per E-mail
- Security Features:
- Password hashing using Bcrypt
- SMTP-based Two-Factor Authentication (2FA) with Gmail
- PDF Export:
- Export patient records as PDF
- Automatic integration of doctor information
- User Management:
- Login form with password concealment
- User roles and permissions
- Database Integration:
- MySQL triggers for automatic record saving
- Synchronization between frontend and SQL cloud
.
├── Forms
│ ├── AddPatientForm.cs
│ ├── Dashboard.cs
│ ├── LoginForm.cs
│ ├── PatientRecordDoctorForm.cs
│ ├── PatientRecordPatientForm.cs
│ └── *.Designer.cs, *.resx
├── BusinessLogic
│ ├── ApplicationLogic.cs
│ ├── Authentication.cs
│ ├── SecurityManager.cs
│ ├── EmailNotification.cs
│ ├── AccessDataGenerator.cs
├── Data
│ ├── Database.cs
│ ├── Doctor.cs
│ ├── Patient.cs
│ ├── Note.cs
│ ├── User.cs
├── Utilities
│ ├── PDFExport.cs
│ ├── Program.cs
│ ├── App.config
└── EPK.csproj
-
Clone the repository
git clone https://github.com/svndin/ElectronicPatientRecord.git cd ElectronicPatientRecord/EPK-Software/ -
Install .NET dependencies
dotnet add package BCrypt.Net-Next dotnet add package MySql.Data
-
Build the project
dotnet build
-
Download and install MySQL Workbench 8.0.41 if not already installed.
-
Open MySQL Workbench and create a new connection by clicking the "+" button.
-
Enter your hostname, username, and password, then test and save the connection.
-
Ensure the patient_management.sql file is in your repository.
-
Open MySQL Workbench, connect to your database, and go to "File > Open SQL Script...".
-
Verify that the tables User, Doctor, Patient, PatientRecord, and Note have been created.
-
In the Database.cs class, update the connection string with your MySQL Hostname, Database Name, User ID, and Password:
private static readonly Lazy<Database> _instance = new Lazy<Database>(() => new Database()); private readonly string _connectionString = "Server=<Your-MySQL-Hostname>;Database=<Your-Database-Name>;User Id=<Your-User-ID>;Password=<Your-Password>;SslMode=Preferred;"; internal MySqlConnection Connection { get; set; }
Your database is now ready to use! 🚀
- All passwords are hashed using Bcrypt
- 2FA via Gmail secures the login process
- Only authorized users can access sensitive patient data
-
Download the Gmail app (if not already installed).
-
Log in using your gmail.
-
Enable 2FA in your Google account settings. Choose to receive verification codes via SMS, Google Authenticator, or another verification method.
-
Go to Google Account settings → Security → App Passwords.
-
Generate an app password by selecting 'Mail' as the app and 'Windows Computer' as the device.
-
Copy the generated app password and save it in AccessDataGenerator.cs under
senderPassword:public AccessDataGenerator(SecurityManager securityManager) { _securityManager = securityManager ?? throw new ArgumentNullException(nameof(securityManager)); _emailNotification = new EmailNotification( senderEmail: "<your-gmail-here>", **senderPassword:** "<your-app-password-here>", // Use the generated app password from Google. smtpHost: "smtp.gmail.com", smtpPort: 587 ); }
-
Option 1: Open the project in Visual Studio and execute Double-click on the EPK.sln file
-
Option 2: Run it from the command line
dotnet run
- Role (Doctor): Start the application and log in via the login form Username: admin PassWort: admin Displays a dashboard where the patients are shown in a table. The User search for patients, add new ones, edit, and delete existing patients.
- Manage Patient(search,add,edit,delet) When adding a patient, an Add Patient Form is displayed where patient information can be entered. The patient is saved and displayed in the table. The patient receives login credentials via their entered email. When editing, the patient's information is updated. When deleting, the patient and his user will be deleted.
- Manage patient records (create, edit) The file is already created after the patient is saved. On double-clicking a specific patient, their file opens. The User save or edit notes within the file. On clicking "Back" the user is redirected back to the dashboard.
- On logout, the user is logged out and redirected back to the login form.
- Role (Patient): Start the application and log in via the login form Username: Their own username PassWort: Their own username Displays their file where they can view the notes created by the doctor.
- Manage patient records (export) With a PDF export option, the user can export their file as a PDF.
- On logout, the user is logged out and redirected back to the login form.
This project is licensed under the MIT License.
Thank you for using our EPK system!