6.9 KiB
Qwen Code Context for HIS (Hospital Information System)
Project Overview
This is a comprehensive Hospital Information System (HIS) called OpenHIS, built with a Java Spring Boot backend and Vue 3 frontend. The system is designed to manage hospital operations including patient management, appointments, clinical workflows, billing, and administrative tasks.
Technology Stack
Backend:
- Java 17
- Spring Boot 2.5.15
- PostgreSQL (recommended v16.2)
- Redis
- MyBatis-Plus 3.5.5 for ORM
- Druid 1.2.27 for database connection pooling
- Flowable 6.8.0 for workflow management
- LiteFlow 2.12.4.1 for business rule orchestration
- Swagger 3.0.0 for API documentation
- JWT 0.9.1 for authentication
Frontend:
- Vue 3 with Composition API
- Vite 5.0.4 as build tool
- Element Plus 2.12.0 as UI component library
- Pinia 2.2.0 for state management
- Axios 0.27.2 for HTTP requests
- Sass for styling
Repository Structure
.
├── openhis-server-new/ # Backend multi-module Maven project
│ ├── openhis-application/ # Main application module with startup class
│ ├── openhis-domain/ # Business domain modules (administration, clinical, financial, etc.)
│ ├── openhis-common/ # Shared utilities and common code
│ ├── core-admin/ # Core administration module
│ ├── core-framework/ # Framework configuration and security
│ ├── core-system/ # System management module
│ ├── core-quartz/ # Scheduled tasks
│ ├── core-generator/ # Code generation utilities
│ ├── core-common/ # Core utilities
│ └── core-flowable/ # Workflow engine integration
├── openhis-ui-vue3/ # Vue 3 frontend
│ ├── src/
│ │ ├── api/ # API service layer
│ │ ├── components/ # Reusable components
│ │ ├── router/ # Vue Router configuration
│ │ ├── store/ # Pinia state management
│ │ ├── utils/ # Utility functions
│ │ └── views/ # Page components
│ └── vite/ # Vite plugins configuration
├── sql/ # Database scripts
├── 发版记录/ # Release records
└── 迁移记录-DB变更记录/ # Database migration records
Building and Running
Backend Setup
-
Prerequisites:
- JDK 17 (required)
- PostgreSQL v16.2 (required)
- Redis (stable version)
-
Database Setup:
- Import the database initialization script using Navicat 16 or later
- Script location:
sql/20251224init脚本(使用Navicat Premium 17导入).sql - Configure database connection in
application.ymlorapplication-dev.yml
-
Build and Run:
cd openhis-server-new mvn clean package -DskipTests cd openhis-application mvn spring-boot:runOr run directly from IDE by executing
OpenHisApplication.java
Frontend Setup
-
Prerequisites:
- Node.js v16.15 (recommended)
-
Installation and Run:
cd openhis-ui-vue3 npm install npm run dev -
Access the application:
- Frontend: http://localhost:81
- Backend API: http://localhost:18080/openhis
- Swagger UI: http://localhost:18080/openhis/swagger-ui/index.html
Development Conventions
Backend Architecture
The backend follows a multi-module Maven architecture with clear separation of concerns:
-
openhis-application: Entry point with
OpenHisApplication.java- Scans
com.coreandcom.openhispackages - Configured to run on port 18080 with context path
/openhis
- Scans
-
openhis-domain: Business domain modules organized by medical functionality:
administration: Administrative functionsappointmentmanage: Appointment managementcheck: Medical examination/checkupclinical: Clinical workflowscrosssystem: Cross-system integrationdocument: Document managementfinancial: Financial/billinglab: Laboratory operationsmedication: Medication managementtriageandqueuemanage: Patient triage and queue managementyb,ybcatalog,ybelep: Insurance (Yi Bao) integrationworkflow: Workflow management
-
Core Modules (com.core package):
core-system: User, role, menu, and permission managementcore-framework: Security, exception handling, and framework configurationscore-common: Shared utilities and base classescore-quartz: Scheduled task managementcore-generator: Code generation toolscore-flowable: Workflow engine integrationcore-admin: Administrative functions
Frontend Architecture
The frontend uses Vue 3 with composition API and modern tooling:
-
State Management: Pinia for global state with modules for app, dict, permission, settings, tagsView, and user
-
Routing: Vue Router 4.3.0 with public routes and dynamic permission-based routes
-
API Integration: Axios with request/response interceptors and API services organized by module
-
Component Architecture: Element Plus as UI framework with custom components in
src/components/
Key Configuration Files
Backend Configuration
- Main config:
openhis-server-new/openhis-application/src/main/resources/application.yml - Environment-specific:
application-dev.yml,application-test.yml,application-prd.yml - Database connection settings, Redis configuration, server settings, and MyBatis-Plus configuration
Frontend Configuration
- Environment files:
.env.*inopenhis-ui-vue3/ - Vite configuration:
vite.config.js - Main entry:
src/main.js - Router:
src/router/index.js
Common Development Tasks
Adding a New Backend Feature
- Create domain entity in appropriate module under
openhis-domain/[module]/domain/ - Create mapper interface in
openhis-domain/[module]/mapper/ - Create service interface and implementation in
openhis-domain/[module]/service/ - Create controller in
openhis-application/src/main/java/com/openhis/web/[module]/ - Test endpoints via Swagger UI
Adding a New Frontend Page
- Create Vue component in
openhis-ui-vue3/src/views/[module]/ - Add API service methods in
openhis-ui-vue3/src/api/ - Add route to
openhis-ui-vue3/src/router/index.js - Add Pinia store module if state management needed
Important Notes
- The system uses logical deletion with a
validFlagfield (1 = active, 0 = deleted) - JWT tokens are stored in the
Authorizationheader - The system supports WebView environments with C# accessor integration
- File uploads are configured with max 10MB per file and 20MB total request size
- Password lockout occurs after 5 failed attempts with a 10-minute lock time
- The system includes a code generator accessible via
/tool/genroute - Printing functionality is implemented using the hiprint plugin