This project is a Python implementation of a Hospital Management System. The system includes functionality to manage hospital employees and ensure data integrity by checking for unique usernames and validating input data.
hospital.py
: Contains theHospital
class definition.employee.py
: Contains theEmployee
class definition.
- Add and manage hospital employees.
- Validate employee data to ensure no fields are empty.
- Check for unique usernames within the hospital system.
- Update employee details with proper validation.
- Python 3.6 or higher
-
Clone the repository:
git clone https://github.com/yourusername/hospital-management-system.git
-
Navigate to the project directory:
cd hospital-management-system
-
Ensure you have the necessary files:
hospital.py
employee.py
-
Create a script (e.g.,
main.py
) to utilize the classes:from hospital import Hospital from employee import Employee # Initialize the hospital hospital = Hospital() # Add a new employee employee = Employee("John", "Doe", "12345678901", "johndoe", "password123") hospital.users[employee.username] = employee # Update employee details try: employee.update("Jane", "Doe", "10987654321", "janedoe", "newpassword123", hospital) except ValueError as e: print(e) # Print updated employee details print(vars(employee))
-
Run your script:
python main.py
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/YourFeature
). - Commit your changes (
git commit -m 'Add some feature'
). - Push to the branch (
git push origin feature/YourFeature
). - Open a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.