From 77115a7fc98b4e8a5dd073778d589045f4c752c3 Mon Sep 17 00:00:00 2001 From: Test User Date: Tue, 21 Jul 2026 16:00:29 +0400 Subject: [PATCH 1/2] Add HMS project structure, README, docs, and placeholders in fromabdullahalhadabi - database/: schema, sample_data, views_triggers, reports, audit dirs - apex/: APEX application export placeholder - docs/: DEPLOYMENT.md - .github/: pull_request_template.md - screenshots/: placeholder dir - HMS-README.md: project overview and setup guide - hms.gitignore: Oracle/APEX specific ignore rules --- .../.github/pull_request_template.md | 27 ++++ .../fromabdullahalhadabi/HMS-README.md | 95 +++++++++++ ...tal_Management_System_APEX_Application.sql | 15 ++ .../Hospital_Management_System_Schema.sql | 27 ++++ ...Hospital_Management_System_Sample_Data.sql | 21 +++ ...pital_Management_System_Views_Triggers.sql | 33 ++++ ...pital_Management_System_Report_Queries.sql | 25 +++ .../Hospital_Management_System_Audit.sql | 12 ++ .../fromabdullahalhadabi/docs/DEPLOYMENT.md | 147 ++++++++++++++++++ .../fromabdullahalhadabi/hms.gitignore | 49 ++++++ .../fromabdullahalhadabi/screenshots/.gitkeep | 2 + 11 files changed, 453 insertions(+) create mode 100644 src/main/java/org/example/fromabdullahalhadabi/.github/pull_request_template.md create mode 100644 src/main/java/org/example/fromabdullahalhadabi/HMS-README.md create mode 100644 src/main/java/org/example/fromabdullahalhadabi/apex/Hospital_Management_System_APEX_Application.sql create mode 100644 src/main/java/org/example/fromabdullahalhadabi/database/01_schema/Hospital_Management_System_Schema.sql create mode 100644 src/main/java/org/example/fromabdullahalhadabi/database/02_sample_data/Hospital_Management_System_Sample_Data.sql create mode 100644 src/main/java/org/example/fromabdullahalhadabi/database/03_views_triggers/Hospital_Management_System_Views_Triggers.sql create mode 100644 src/main/java/org/example/fromabdullahalhadabi/database/04_reports/Hospital_Management_System_Report_Queries.sql create mode 100644 src/main/java/org/example/fromabdullahalhadabi/database/05_audit/Hospital_Management_System_Audit.sql create mode 100644 src/main/java/org/example/fromabdullahalhadabi/docs/DEPLOYMENT.md create mode 100644 src/main/java/org/example/fromabdullahalhadabi/hms.gitignore create mode 100644 src/main/java/org/example/fromabdullahalhadabi/screenshots/.gitkeep diff --git a/src/main/java/org/example/fromabdullahalhadabi/.github/pull_request_template.md b/src/main/java/org/example/fromabdullahalhadabi/.github/pull_request_template.md new file mode 100644 index 00000000..dbb6a5ab --- /dev/null +++ b/src/main/java/org/example/fromabdullahalhadabi/.github/pull_request_template.md @@ -0,0 +1,27 @@ +## Description + + +## Type of Change +- [ ] Database schema change +- [ ] APEX application update +- [ ] Documentation update +- [ ] Bug fix +- [ ] New feature + +## Related Issue + + +## Testing +- [ ] Schema changes tested in dev environment +- [ ] APEX application tested +- [ ] Sample data verified +- [ ] Views and triggers tested + +## Screenshots + + +## Checklist +- [ ] Code follows project conventions +- [ ] No secrets or credentials in code +- [ ] Documentation updated if needed +- [ ] Tested on Oracle Database 19c+ diff --git a/src/main/java/org/example/fromabdullahalhadabi/HMS-README.md b/src/main/java/org/example/fromabdullahalhadabi/HMS-README.md new file mode 100644 index 00000000..c38547b1 --- /dev/null +++ b/src/main/java/org/example/fromabdullahalhadabi/HMS-README.md @@ -0,0 +1,95 @@ +# Oracle APEX Hospital Management System + +## Project Overview +A comprehensive Hospital Management System built with Oracle APEX and Oracle Database. The system manages patients, doctors, appointments, admissions, prescriptions, medicines, and room allocations with full reporting and dashboard capabilities. + +**APEX Application ID:** 153222 +**Workspace:** WKSP_ALNOORHOSPITALOMAN +**Author:** Abdullah Alhadabi + +--- + +## Project Structure + +``` +fromabdullahalhadabi/ +├── database/ +│ ├── 01_schema/ # Table DDL, sequences, constraints +│ ├── 02_sample_data/ # Seed data for testing +│ ├── 03_views_triggers/ # Database views and triggers +│ ├── 04_reports/ # Report queries +│ └── 05_audit/ # Audit and security +├── apex/ +│ └── f153222.sql # Full APEX application export +├── docs/ +│ ├── DEPLOYMENT.md # Deployment guide +│ └── *.pdf # Application documentation +├── screenshots/ # Application screenshots +└── *.java # Supporting Java files +``` + +--- + +## Database Schema + +| Table | Description | +|-------|-------------| +| DEPARTMENTS | Hospital departments | +| DOCTOR_SPECIALTIES | Doctor specialty mappings | +| MEDICINE_CATEGORIES | Medicine分类 | +| APPOINTMENT_STATUSES | Appointment status codes | +| PATIENTS | Patient records | +| DOCTORS | Doctor records | +| ROOMS | Room allocations | +| MEDICINES | Medicine inventory | +| APPOINTMENTS | Patient appointments | +| ADMISSIONS | Patient admissions | +| PATIENT_VISITS | Visit records | +| PRESCRIPTIONS | Prescription headers | +| PRESCRIPTION_ITEMS | Prescription line items | + +--- + +## Dashboard Views + +- `VW_DASH_APPTS_BY_DEPT` - Appointments by department +- `VW_DASH_PATIENTS_BY_GENDER` - Patient distribution by gender +- `VW_DASH_MEDICINE_STOCK` - Medicine stock levels +- `VW_DASH_ROOM_STATUS` - Room availability status +- `VW_HMS_KPI_CARDS` - Key performance indicators + +--- + +## Setup Instructions + +### Prerequisites +- Oracle Database 19c or later +- Oracle APEX 22.x or later +- SQL*Plus or SQL Developer + +### Database Setup +```sql +-- 1. Create schema objects +@database/01_schema/Hospital_Management_System_Schema.sql + +-- 2. Load sample data +@database/02_sample_data/Hospital_Management_System_Sample_Data.sql + +-- 3. Create views and triggers +@database/03_views_triggers/Hospital_Management_System_Views_Triggers.sql +``` + +### APEX Application Import +1. Navigate to Oracle APEX Workshop +2. Import `apex/f153222.sql` +3. Run the application + +--- + +## Deployment +See [DEPLOYMENT.md](docs/DEPLOYMENT.md) for detailed deployment instructions. + +--- + +## License +Academic project - AlNoor Hospital Management System diff --git a/src/main/java/org/example/fromabdullahalhadabi/apex/Hospital_Management_System_APEX_Application.sql b/src/main/java/org/example/fromabdullahalhadabi/apex/Hospital_Management_System_APEX_Application.sql new file mode 100644 index 00000000..4aba986b --- /dev/null +++ b/src/main/java/org/example/fromabdullahalhadabi/apex/Hospital_Management_System_APEX_Application.sql @@ -0,0 +1,15 @@ +-- ============================================================ +-- Hospital Management System - Oracle APEX Application Export +-- Application ID: 153222 +-- Workspace: WKSP_ALNOORHOSPITALOMAN +-- Author: Abdullah Alhadabi +-- ============================================================ + +-- TODO: Paste the full APEX application export (f153222.sql) here +-- This is the complete application definition including: +-- - Pages 0-36 + 9999, 38 pages total +-- - 106 items +-- - 43 processes +-- - 76 regions +-- - 66 buttons +-- - 16 dynamic actions diff --git a/src/main/java/org/example/fromabdullahalhadabi/database/01_schema/Hospital_Management_System_Schema.sql b/src/main/java/org/example/fromabdullahalhadabi/database/01_schema/Hospital_Management_System_Schema.sql new file mode 100644 index 00000000..0911e075 --- /dev/null +++ b/src/main/java/org/example/fromabdullahalhadabi/database/01_schema/Hospital_Management_System_Schema.sql @@ -0,0 +1,27 @@ +-- ============================================================ +-- Hospital Management System - Schema DDL +-- Author: Abdullah Alhadabi +-- APEX App ID: 153222 +-- ============================================================ + +-- TODO: Paste the schema SQL content here +-- This file should contain: +-- - CREATE TABLE statements for all 13 tables +-- - Sequences +-- - Constraints (PK, FK, CHECK, UNIQUE) +-- - Comments + +-- Tables to include: +-- 1. DEPARTMENTS +-- 2. DOCTOR_SPECIALTIES +-- 3. MEDICINE_CATEGORIES +-- 4. APPOINTMENT_STATUSES +-- 5. PATIENTS +-- 6. DOCTORS +-- 7. ROOMS +-- 8. MEDICINES +-- 9. APPOINTMENTS +-- 10. ADMISSIONS +-- 11. PATIENT_VISITS +-- 12. PRESCRIPTIONS +-- 13. PRESCRIPTION_ITEMS diff --git a/src/main/java/org/example/fromabdullahalhadabi/database/02_sample_data/Hospital_Management_System_Sample_Data.sql b/src/main/java/org/example/fromabdullahalhadabi/database/02_sample_data/Hospital_Management_System_Sample_Data.sql new file mode 100644 index 00000000..f0cf64bf --- /dev/null +++ b/src/main/java/org/example/fromabdullahalhadabi/database/02_sample_data/Hospital_Management_System_Sample_Data.sql @@ -0,0 +1,21 @@ +-- ============================================================ +-- Hospital Management System - Sample Data +-- Author: Abdullah Alhadabi +-- APEX App ID: 153222 +-- ============================================================ + +-- TODO: Paste the sample data SQL content here +-- This file should contain INSERT statements for: +-- - DEPARTMENTS +-- - DOCTOR_SPECIALTIES +-- - MEDICINE_CATEGORIES +-- - APPOINTMENT_STATUSES +-- - PATIENTS +-- - DOCTORS +-- - ROOMS +-- - MEDICINES +-- - APPOINTMENTS +-- - ADMISSIONS +-- - PATIENT_VISITS +-- - PRESCRIPTIONS +-- - PRESCRIPTION_ITEMS diff --git a/src/main/java/org/example/fromabdullahalhadabi/database/03_views_triggers/Hospital_Management_System_Views_Triggers.sql b/src/main/java/org/example/fromabdullahalhadabi/database/03_views_triggers/Hospital_Management_System_Views_Triggers.sql new file mode 100644 index 00000000..414433e6 --- /dev/null +++ b/src/main/java/org/example/fromabdullahalhadabi/database/03_views_triggers/Hospital_Management_System_Views_Triggers.sql @@ -0,0 +1,33 @@ +-- ============================================================ +-- Hospital Management System - Views and Triggers +-- Author: Abdullah Alhadabi +-- APEX App ID: 153222 +-- ============================================================ + +-- TODO: Paste the views and triggers SQL content here + +-- Views to include: +-- 1. HMS_ADMISSION_REPORT_V +-- 2. HMS_APPOINTMENT_REPORT_V +-- 3. HMS_CLINICAL_WORKSPACE_V +-- 4. HMS_MEDICINE_STOCK_REPORT_V +-- 5. HMS_PATIENT_ADMISSION_HISTORY_V +-- 6. HMS_PATIENT_APPOINTMENT_HISTORY_V +-- 7. HMS_PATIENT_PREVIOUS_VISITS_V +-- 8. HMS_PATIENT_PROFILE_V +-- 9. HMS_PATIENT_VISIT_REPORT_V +-- 10. HMS_PHARMACY_PRESCRIPTION_V +-- 11. HMS_VISIT_PRESCRIPTION_V +-- 12. VW_DASH_APPTS_BY_DEPT +-- 13. VW_DASH_PATIENTS_BY_GENDER +-- 14. VW_DASH_MEDICINE_STOCK +-- 15. VW_DASH_ROOM_STATUS +-- 16. VW_HMS_KPI_CARDS + +-- Triggers to include: +-- 1. HMS_ADMISSIONS_AIU_ROOM_TRG +-- 2. HMS_ADMISSIONS_BIU_VAL_TRG +-- 3. HMS_APPOINTMENTS_BIU_TRG +-- 4. HMS_PATIENT_VISITS_BIU_TRG +-- 5. HMS_PRESCRIPTIONS_BIU_TRG +-- 6. TRG_ADMISSIONS_ROOM_STATUS diff --git a/src/main/java/org/example/fromabdullahalhadabi/database/04_reports/Hospital_Management_System_Report_Queries.sql b/src/main/java/org/example/fromabdullahalhadabi/database/04_reports/Hospital_Management_System_Report_Queries.sql new file mode 100644 index 00000000..7c2abe89 --- /dev/null +++ b/src/main/java/org/example/fromabdullahalhadabi/database/04_reports/Hospital_Management_System_Report_Queries.sql @@ -0,0 +1,25 @@ +-- ============================================================ +-- Hospital Management System - Report Queries +-- Author: Abdullah Alhadabi +-- APEX App ID: 153222 +-- ============================================================ + +-- TODO: Add report-specific queries here +-- These queries are used by APEX report regions + +-- Example report queries: + +-- Admission Report +-- SELECT * FROM HMS_ADMISSION_REPORT_V; + +-- Appointment Report +-- SELECT * FROM HMS_APPOINTMENT_REPORT_V; + +-- Patient Visit Report +-- SELECT * FROM HMS_PATIENT_VISIT_REPORT_V; + +-- Medicine Stock Report +-- SELECT * FROM HMS_MEDICINE_STOCK_REPORT_V; + +-- Pharmacy Prescription Report +-- SELECT * FROM HMS_PHARMACY_PRESCRIPTION_V; diff --git a/src/main/java/org/example/fromabdullahalhadabi/database/05_audit/Hospital_Management_System_Audit.sql b/src/main/java/org/example/fromabdullahalhadabi/database/05_audit/Hospital_Management_System_Audit.sql new file mode 100644 index 00000000..5f620148 --- /dev/null +++ b/src/main/java/org/example/fromabdullahalhadabi/database/05_audit/Hospital_Management_System_Audit.sql @@ -0,0 +1,12 @@ +-- ============================================================ +-- Hospital Management System - Audit and Security +-- Author: Abdullah Alhadabi +-- APEX App ID: 153222 +-- ============================================================ + +-- TODO: Add audit-related SQL here + +-- Audit trail tables +-- Audit triggers +-- Security policies +-- Row-Level Security (RLS) policies if applicable diff --git a/src/main/java/org/example/fromabdullahalhadabi/docs/DEPLOYMENT.md b/src/main/java/org/example/fromabdullahalhadabi/docs/DEPLOYMENT.md new file mode 100644 index 00000000..ac5955ed --- /dev/null +++ b/src/main/java/org/example/fromabdullahalhadabi/docs/DEPLOYMENT.md @@ -0,0 +1,147 @@ +# Hospital Management System - Deployment Guide + +## Overview +This guide covers deploying the Oracle APEX Hospital Management System. + +## Prerequisites + +### Software Requirements +- Oracle Database 19c or later +- Oracle APEX 22.x or later +- SQL*Plus or SQL Developer +- Oracle REST Data Services (ORDS) for web access + +### Hardware Requirements +- Minimum 4GB RAM for database +- 2 CPU cores recommended +- 20GB disk space + +--- + +## Step 1: Database Setup + +### 1.1 Create Tablespace (Optional) +```sql +CREATE TABLESPACE hms_data +DATAFILE 'hms_data01.dbf' SIZE 100M +AUTOEXTEND ON NEXT 10M +MAXSIZE UNLIMITED; +``` + +### 1.2 Create User +```sql +CREATE USER hms_admin IDENTIFIED BY +DEFAULT TABLESPACE hms_data +QUOTA UNLIMITED ON hms_data; + +GRANT CONNECT, RESOURCE TO hms_admin; +GRANT CREATE VIEW, CREATE TRIGGER, CREATE PROCEDURE TO hms_admin; +``` + +### 1.3 Run Schema Scripts +```sql +-- Connect as hms_admin or SYSDBA +@database/01_schema/Hospital_Management_System_Schema.sql +@database/02_sample_data/Hospital_Management_System_Sample_Data.sql +@database/03_views_triggers/Hospital_Management_System_Views_Triggers.sql +``` + +--- + +## Step 2: APEX Application Setup + +### 2.1 Import Application +1. Log in to Oracle APEX Workshop +2. Navigate to **App Builder** > **Import** +3. Select `apex/f153222.sql` +4. Follow the import wizard +5. Set the application alias as needed + +### 2.2 Configure Application +1. Open the imported application +2. Navigate to **Shared Components** > **Application Processing** +3. Verify all processes are enabled +4. Test each page functionality + +### 2.3 Set Up Authentication +1. Navigate to **Shared Components** > **Authentication Schemes** +2. Configure the default authentication scheme +3. Set up user accounts if needed + +--- + +## Step 3: Post-Deployment Verification + +### 3.1 Verify Database Objects +```sql +-- Check tables +SELECT table_name FROM user_tables ORDER BY table_name; + +-- Check views +SELECT view_name FROM user_views ORDER BY view_name; + +-- Check triggers +SELECT trigger_name FROM user_triggers ORDER BY trigger_name; +``` + +### 3.2 Verify Sample Data +```sql +-- Check record counts +SELECT 'PATIENTS' as tbl, COUNT(*) as cnt FROM patients +UNION ALL +SELECT 'DOCTORS', COUNT(*) FROM doctors +UNION ALL +SELECT 'APPOINTMENTS', COUNT(*) FROM appointments +UNION ALL +SELECT 'MEDICINES', COUNT(*) FROM medicines; +``` + +### 3.3 Test APEX Application +1. Run the application from App Builder +2. Test login functionality +3. Navigate through all pages +4. Verify dashboard displays correctly +5. Test CRUD operations on all forms + +--- + +## Step 4: Security Checklist + +- [ ] No hardcoded passwords in SQL files +- [ ] APEX application uses authentication scheme +- [ ] Database user has minimum required privileges +- [ ] Sensitive data is not exposed in URLs +- [ ] Session timeout is configured appropriately + +--- + +## Troubleshooting + +### Common Issues + +**Issue: ORA-00942: table or view does not exist** +- Solution: Ensure schema scripts were run in correct order + +**Issue: APEX application shows blank pages** +- Solution: Verify database views exist and have correct permissions + +**Issue: Triggers not firing** +- Solution: Check trigger status with `SELECT status FROM user_triggers` + +--- + +## Rollback Procedure + +If issues occur after deployment: +1. Drop application in APEX App Builder +2. Drop schema objects in reverse order: + ```sql + DROP TRIGGER ; + DROP VIEW ; + DROP TABLE CASCADE CONSTRAINTS; + ``` +3. Restore from backup if available + +--- + +*Deployment Guide - AlNoor Hospital Management System* diff --git a/src/main/java/org/example/fromabdullahalhadabi/hms.gitignore b/src/main/java/org/example/fromabdullahalhadabi/hms.gitignore new file mode 100644 index 00000000..065c3b1d --- /dev/null +++ b/src/main/java/org/example/fromabdullahalhadabi/hms.gitignore @@ -0,0 +1,49 @@ +# Oracle APEX HMS - Git Ignore + +# IDE files +.idea/ +*.iml +.vscode/ +*.swp +*.swo + +# Build outputs +target/ +build/ +dist/ + +# OS files +.DS_Store +Thumbs.db +Desktop.ini + +# Logs +*.log +logs/ + +# Temporary files +*.tmp +*.temp +*.bak + +# Environment files +.env +.env.local +.env.production + +# Database backup files +*.dmp +*.exp + +# Compiled Java files +*.class +*.jar +*.war + +# Node modules (if used for tooling) +node_modules/ + +# Secrets - NEVER commit these +*secret* +*password* +*credential* diff --git a/src/main/java/org/example/fromabdullahalhadabi/screenshots/.gitkeep b/src/main/java/org/example/fromabdullahalhadabi/screenshots/.gitkeep new file mode 100644 index 00000000..b13158da --- /dev/null +++ b/src/main/java/org/example/fromabdullahalhadabi/screenshots/.gitkeep @@ -0,0 +1,2 @@ +# Screenshots +Place application screenshots here. From e69919fd1a9194bd896682c64e441292595ec4c1 Mon Sep 17 00:00:00 2001 From: Test User Date: Tue, 21 Jul 2026 16:12:22 +0400 Subject: [PATCH 2/2] Remove .github and screenshots/.gitkeep from fromabdullahalhadabi --- .../.github/pull_request_template.md | 27 ------------------- .../fromabdullahalhadabi/screenshots/.gitkeep | 2 -- 2 files changed, 29 deletions(-) delete mode 100644 src/main/java/org/example/fromabdullahalhadabi/.github/pull_request_template.md delete mode 100644 src/main/java/org/example/fromabdullahalhadabi/screenshots/.gitkeep diff --git a/src/main/java/org/example/fromabdullahalhadabi/.github/pull_request_template.md b/src/main/java/org/example/fromabdullahalhadabi/.github/pull_request_template.md deleted file mode 100644 index dbb6a5ab..00000000 --- a/src/main/java/org/example/fromabdullahalhadabi/.github/pull_request_template.md +++ /dev/null @@ -1,27 +0,0 @@ -## Description - - -## Type of Change -- [ ] Database schema change -- [ ] APEX application update -- [ ] Documentation update -- [ ] Bug fix -- [ ] New feature - -## Related Issue - - -## Testing -- [ ] Schema changes tested in dev environment -- [ ] APEX application tested -- [ ] Sample data verified -- [ ] Views and triggers tested - -## Screenshots - - -## Checklist -- [ ] Code follows project conventions -- [ ] No secrets or credentials in code -- [ ] Documentation updated if needed -- [ ] Tested on Oracle Database 19c+ diff --git a/src/main/java/org/example/fromabdullahalhadabi/screenshots/.gitkeep b/src/main/java/org/example/fromabdullahalhadabi/screenshots/.gitkeep deleted file mode 100644 index b13158da..00000000 --- a/src/main/java/org/example/fromabdullahalhadabi/screenshots/.gitkeep +++ /dev/null @@ -1,2 +0,0 @@ -# Screenshots -Place application screenshots here.