Thank you for your interest in contributing to the Hospital Management Information System (HMIS). This document provides comprehensive guidelines for safe contributions to this production system.
This is a live production system serving 40+ healthcare institutions. All changes must be:
- Thoroughly tested
- Non-destructive
- Backward compatible
- Approved by maintainers
- Always create a backup of any files you plan to modify
- Test in development environment first
- Follow the safe improvement plans in the documentation
- Never modify database schema without extensive planning
- Git installed on your system
- GitHub account
- Java 8+ and Maven for building (see INSTALL_GUIDE.md)
- Navigate to https://github.com/hmislk/hmis
- Click the "Fork" button in the top-right corner
- Select your GitHub account as the destination
- Wait for the fork to be created at
https://github.com/YOUR_USERNAME/hmis
# Clone your fork (replace YOUR_USERNAME with your GitHub username)
git clone https://github.com/YOUR_USERNAME/hmis.git
cd hmis
# Add the main repository as upstream
git remote add upstream https://github.com/hmislk/hmis.git
# Verify your remote configuration
git remote -v
# Should show:
# origin https://github.com/YOUR_USERNAME/hmis.git (fetch)
# origin https://github.com/YOUR_USERNAME/hmis.git (push)
# upstream https://github.com/hmislk/hmis.git (fetch)
# upstream https://github.com/hmislk/hmis.git (push)# Fetch all branches from upstream
git fetch upstream
# Switch to development branch (the main development branch)
git checkout development
# Set up tracking to upstream development
git branch --set-upstream-to=upstream/development development
# Sync with latest upstream changes
git merge upstream/development
# Push synced changes to your fork
git push origin development# Always start from the latest upstream development
git fetch upstream
git checkout development
git merge upstream/development
# Create a feature branch (use descriptive names)
git checkout -b feature/your-improvement-name
# or for issue-based work:
git checkout -b 12345-brief-description-of-issue- Follow the guidelines in existing documentation
- Use the safe-dependency-update.bat script for dependency updates
- Add tests for any new functionality
- Document your changes thoroughly
# Stage your changes
git add .
# Commit with proper message format
git commit -m "Brief description of changes
Detailed explanation of:
- What was changed
- Why it was changed
- How it was tested
- Any risks or considerations
Closes #issue_number (if applicable)
Signed-off-by: Your Name <your.email@example.com>"# Push your feature branch to your fork
git push origin feature/your-improvement-name
# Then create a pull request via GitHub web interface:
# 1. Go to your fork on GitHub
# 2. Click "Compare & pull request"
# 3. Set target: hmislk/hmis:development ← your-fork:feature-branch
# 4. Fill out the PR template with detailed description- Documentation improvements
- Adding utility methods (without modifying existing ones)
- Adding comments and JavaDoc
- Creating test cases
- Security analysis and recommendations
- Performance analysis
- Dependency updates (follow DEPENDENCY_UPDATE_PLAN.md)
- Adding validation to existing methods
- Improving error handling
- Adding logging
- Modifying core business logic
- Changing database queries
- Removing or modifying existing methods
- Changing configuration files
- Refactoring large classes
Cause: Your local repository is pointing to the main repository instead of your fork. Solution:
# Check your current remote configuration
git remote -v
# If origin points to hmislk/hmis, reconfigure it:
git remote set-url origin https://github.com/YOUR_USERNAME/hmis.git
git remote add upstream https://github.com/hmislk/hmis.gitCause: Your fork is not synchronized with the latest upstream changes. Solution:
# Sync your fork with upstream
git fetch upstream
git checkout development
git merge upstream/development
git push origin developmentCause: Your local repository and fork have diverged significantly. Solution:
# Force sync (use with caution)
git fetch upstream
git checkout development
git reset --hard upstream/development
git push origin development --forceCause: Either no fork exists or branches are not properly configured. Solution:
- Ensure you have forked the repository on GitHub
- Verify your remote configuration with
git remote -v - Make sure you're pushing to your fork:
git push origin feature-branch-name
Run these commands to verify your repository is properly configured:
# Check remote configuration
git remote -v
# Check current branch and tracking
git branch -vv
# Check if you're up to date with upstream
git fetch upstream
git status- Follow existing code formatting
- Add JavaDoc for public methods
- Use meaningful variable names
- Handle exceptions appropriately
- Avoid hardcoded values
- Always use parameterized queries
- Never use string concatenation for SQL
- Test queries with various inputs
- Consider performance impact
- Validate all inputs
- Use parameterized queries
- Don't log sensitive information
- Follow OWASP guidelines
- Review SECURITY_ANALYSIS.md (if available)
- Test new methods thoroughly
- Mock external dependencies
- Test edge cases and error conditions
- Maintain or improve code coverage
- Test database interactions
- Test web service endpoints
- Verify business workflows
- Test with realistic data volumes
- Test in browser (all supported browsers)
- Test key user workflows
- Verify reports generate correctly
- Test with different user roles
- Ensure your branch is up to date with upstream/development
- Run all tests locally
- Test your changes thoroughly
- Update documentation if needed
- Clear description of changes made
- Reason for the changes
- Testing performed
- Any breaking changes
- Screenshots (for UI changes)
- Related issue numbers
- PRs are reviewed by core maintainers
- Address feedback promptly
- Be prepared to make revisions
- Maintain professional communication
- Read existing documentation
- Check issue tracker for similar problems
- Review code comments and JavaDoc
- Consult project documentation files
- Create GitHub issues for questions
- Tag maintainers for urgent issues
- Use discussions for general questions
Contributors will be acknowledged in:
- Project documentation
- Release notes
- Commit history
Thank you for helping improve HMIS while maintaining system stability and security!