docs: modernize README.md with comprehensive installation guide, medical templates seeder, and Gitea repository links
This commit is contained in:
parent
79ae8efa9e
commit
2ae0ba5d6f
567
README.md
567
README.md
|
|
@ -1,410 +1,423 @@
|
||||||
# HMS — Hospital Management System (CI4)
|
# E-Atria HMS — Modern Hospital Management System
|
||||||
|
|
||||||
**Framework:** CodeIgniter 4.7 · **PHP:** 8.2+ · **DB:** MySQL 5.7+ / MariaDB 10.4+
|
[](https://codeigniter.com/)
|
||||||
|
[](https://www.php.net/)
|
||||||
|
[](https://www.mysql.com/)
|
||||||
|
[](LICENSE)
|
||||||
|
[](https://abdm.gov.in/)
|
||||||
|
|
||||||
A full-featured hospital management system covering OPD, IPD, Billing, Pathology Lab,
|
**E-Atria HMS** is a 100% free and open-source Hospital Management System built on the modern, high-performance **CodeIgniter 4** PHP framework. Designed for multispeciality hospitals, nursing homes, polyclinics, and diagnostic centres, E-Atria HMS provides end-to-end clinical workflow automation — from OPD registration, doctor e-prescriptions, and IPD bed management to NABH discharge summaries, digital radiology templates, automated pathology analyzers, pharmacy billing, and complete **Ayushman Bharat Digital Mission (ABDM M1, M2, M3)** milestone compliance.
|
||||||
Radiology, Finance, Pharmacy Stock, and more.
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Table of Contents
|
## 🌟 Key Features & Modules
|
||||||
|
|
||||||
|
- **OPD Management:** Token queue, biometric ABHA lookup, doctor clinical workspace, ICD-10 & SNOMED CT diagnoses, e-prescriptions, dynamic prescription print templates (A4/A5).
|
||||||
|
- **IPD Inpatient Care:** Bed management, nursing daily charts, vitals monitoring, OT scheduling, doctor rounds, bilingual legal consent forms (operative, high-risk, LAMA/DAMA).
|
||||||
|
- **NABH Discharge Summaries:** Speciality-wise clinical discharge templates (Medicine, Surgery, Cardiology, Ob/Gyn, Pediatrics, Orthopedics) with auto-calculated hospital stay and medication instructions.
|
||||||
|
- **Pathology Laboratory (LIS):** 37 clinical panels and 228 test parameters with LOINC codes, age/gender biological reference intervals, auto-differential calculation, and analyzer report printing.
|
||||||
|
- **Radiology & Imaging (RIS):** 59 master imaging templates across Ultrasound (USG: 27), 2D Echocardiography (ECHO: 9), Digital X-Ray (18), CT Scan (13), and MRI (14).
|
||||||
|
- **Pharmacy & Inventory:** Batch tracking, expiry alerts, GST invoices, vendor purchase orders, margin analysis, and Marg ERP item list compatibility.
|
||||||
|
- **Billing & Ayushman Bharat (PM-JAY):** 1,401 standardized Ayushman packages, corporate TPA claims, patient ledger, and detailed financial audits.
|
||||||
|
- **ABDM National Health Stack:** M1 (ABHA creation, Scan & Share), M2 (Care Context linking, OTP verification), and M3 (FHIR R4 clinical document bundle generation).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📋 Table of Contents
|
||||||
|
|
||||||
1. [Server Requirements](#1-server-requirements)
|
1. [Server Requirements](#1-server-requirements)
|
||||||
2. [Fresh Installation](#2-fresh-installation)
|
2. [Quick Installation: Method A (Automated 1-Command Script)](#2-quick-installation-method-a-automated-1-command-script)
|
||||||
3. [Web Server Configuration](#3-web-server-configuration)
|
3. [Manual Installation: Method B (Step-by-Step)](#3-manual-installation-method-b-step-by-step)
|
||||||
4. [Environment Configuration](#4-environment-configuration)
|
4. [Environment Configuration (.env)](#4-environment-configuration-env)
|
||||||
5. [Database Setup](#5-database-setup)
|
5. [Database Architecture & Starter Masters](#5-database-architecture--starter-masters)
|
||||||
6. [Seed Master Data](#6-seed-master-data)
|
6. [Comprehensive Medical Templates Library Seeding](#6-comprehensive-medical-templates-library-seeding)
|
||||||
7. [File Permissions](#7-file-permissions)
|
7. [Web Server & SSL Configuration (Apache / Nginx)](#7-web-server--ssl-configuration-apache--nginx)
|
||||||
8. [First Login](#8-first-login)
|
8. [File Permissions & Directory Hardening](#8-file-permissions--directory-hardening)
|
||||||
9. [Updating an Existing Installation](#9-updating-an-existing-installation)
|
9. [Automated Background Cron Jobs](#9-automated-background-cron-jobs)
|
||||||
10. [OEM / Multi-Site Deployment](#10-oem--multi-site-deployment)
|
10. [First Login & Hospital Customization](#10-first-login--hospital-customization)
|
||||||
11. [Lab Template Workflow](#11-lab-template-workflow)
|
11. [Updating an Existing Installation](#11-updating-an-existing-installation)
|
||||||
12. [Useful Spark Commands](#12-useful-spark-commands)
|
12. [Useful Spark CLI Commands](#12-useful-spark-cli-commands)
|
||||||
13. [Project Documents](#13-project-documents)
|
13. [Official Documentation & Support](#13-official-documentation--support)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 1. Server Requirements
|
## 1. Server Requirements
|
||||||
|
|
||||||
| Requirement | Minimum | Recommended |
|
| Component | Minimum | Recommended Production Spec |
|
||||||
|---|---|---|
|
| :--- | :--- | :--- |
|
||||||
| PHP | 8.2 | 8.3 |
|
| **Operating System** | Ubuntu 20.04 LTS / Debian 11 | **Ubuntu 24.04 LTS** or **Ubuntu 22.04 LTS** |
|
||||||
| MySQL | 5.7 | 8.0+ |
|
| **Hardware Resources** | 2 vCPU, 4 GB RAM, 25 GB SSD | **4 vCPU, 8 GB RAM, 80 GB NVMe SSD** (50+ clinical users) |
|
||||||
| MariaDB (alternative) | 10.4 | 10.11+ |
|
| **PHP Version** | PHP 8.2 | **PHP 8.3** (FPM or Apache mod-php) |
|
||||||
| Web server | Apache 2.4 / Nginx | Apache with `mod_rewrite` |
|
| **Database** | MySQL 5.7 / MariaDB 10.4 | **MySQL 8.0+** (UTF8MB4 charset, InnoDB) |
|
||||||
| Composer | 2.x | latest |
|
| **Web Server** | Apache 2.4 / Nginx 1.18+ | **Apache 2.4** with `mod_rewrite`, `mod_ssl`, `mod_headers`, `mod_deflate` |
|
||||||
|
| **Package Managers** | Composer 2.2+, Git 2.30+ | **Composer 2.7+**, **Git 2.34+** |
|
||||||
|
|
||||||
**Required PHP extensions:**
|
**Required PHP Extensions:**
|
||||||
|
```bash
|
||||||
```
|
php8.3-cli php8.3-fpm php8.3-mysql php8.3-curl php8.3-gd php8.3-mbstring php8.3-xml php8.3-intl php8.3-zip php8.3-bcmath
|
||||||
intl mbstring mysqlnd json curl gd zip fileinfo xml
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**Recommended `php.ini` settings:**
|
**Recommended `php.ini` Settings:**
|
||||||
|
|
||||||
```ini
|
```ini
|
||||||
memory_limit = 256M
|
memory_limit = 512M
|
||||||
upload_max_filesize = 20M
|
upload_max_filesize = 50M
|
||||||
post_max_size = 25M
|
post_max_size = 50M
|
||||||
max_execution_time = 120
|
max_execution_time = 300
|
||||||
|
max_input_vars = 5000
|
||||||
|
date.timezone = Asia/Kolkata
|
||||||
|
display_errors = Off
|
||||||
|
expose_php = Off
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 2. Fresh Installation
|
## 2. Quick Installation: Method A (Automated 1-Command Script)
|
||||||
|
|
||||||
|
For fresh Ubuntu servers (20.04, 22.04, or 24.04 LTS), the repository includes an automated installation script located at `scripts/install_ubuntu.sh`:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# 1. Clone the repository (public - no login required)
|
# 1. Clone repository to server
|
||||||
git clone https://git.e-atria.net/d_s_bisht/devsofttech_hms_ci4.git hms
|
sudo mkdir -p /var/www/html/eatria_client
|
||||||
cd hms
|
cd /var/www/html/eatria_client
|
||||||
|
sudo git clone https://git.e-atria.net/d_s_bisht/devsofttech_hms_ci4.git hospital
|
||||||
|
|
||||||
# 2. Install PHP dependencies
|
# 2. Run automated installation script
|
||||||
composer install --no-dev --optimize-autoloader
|
cd hospital
|
||||||
|
sudo bash scripts/install_ubuntu.sh <domain_name> <database_name> "<hospital_name>"
|
||||||
# 3. Copy environment file
|
|
||||||
cp env .env
|
|
||||||
|
|
||||||
# 4. Edit .env (see Section 4)
|
|
||||||
nano .env
|
|
||||||
|
|
||||||
# 5. Run database migrations
|
|
||||||
php spark migrate
|
|
||||||
|
|
||||||
# 6. Seed all master data (see Section 6)
|
|
||||||
php spark db:seed LabTemplateSeeder
|
|
||||||
php spark db:seed InvestigationMasterSeeder
|
|
||||||
php spark db:seed ClinicalTemplateWorkspaceSeeder
|
|
||||||
php spark db:seed ComplaintsMasterSeeder
|
|
||||||
```
|
```
|
||||||
|
|
||||||
> **Windows (WAMP/Laragon):** use `php spark` from the project root in Command Prompt or PowerShell.
|
**Real-World Example:**
|
||||||
|
```bash
|
||||||
|
sudo bash scripts/install_ubuntu.sh hospital.yourdomain.com hms_live_db "City Multispeciality Hospital"
|
||||||
|
```
|
||||||
|
|
||||||
|
*Interactive Prompt Mode:* Running `sudo bash scripts/install_ubuntu.sh` without arguments will prompt for domain, database, hospital name, and MySQL credentials.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 3. Web Server Configuration
|
## 3. Manual Installation: Method B (Step-by-Step)
|
||||||
|
|
||||||
### Apache
|
|
||||||
|
|
||||||
Point your virtual host `DocumentRoot` to the **`public/`** folder — **not** the project root.
|
|
||||||
|
|
||||||
```apache
|
|
||||||
<VirtualHost *:80>
|
|
||||||
ServerName hms.yourhospital.in
|
|
||||||
DocumentRoot /var/www/hms/public
|
|
||||||
|
|
||||||
<Directory /var/www/hms/public>
|
|
||||||
Options -Indexes +FollowSymLinks
|
|
||||||
AllowOverride All
|
|
||||||
Require all granted
|
|
||||||
</Directory>
|
|
||||||
</VirtualHost>
|
|
||||||
```
|
|
||||||
|
|
||||||
`mod_rewrite` must be enabled:
|
|
||||||
|
|
||||||
|
### Step 1: Install System Packages
|
||||||
```bash
|
```bash
|
||||||
sudo a2enmod rewrite
|
sudo apt update && sudo apt upgrade -y
|
||||||
|
sudo apt install -y apache2 mysql-server git unzip curl ca-certificates certbot python3-certbot-apache
|
||||||
|
|
||||||
|
# Install PHP 8.3 & extensions
|
||||||
|
sudo apt install -y \
|
||||||
|
php8.3 php8.3-cli php8.3-fpm php8.3-mysql php8.3-curl \
|
||||||
|
php8.3-gd php8.3-mbstring php8.3-xml php8.3-intl php8.3-zip php8.3-bcmath libapache2-mod-php8.3
|
||||||
|
|
||||||
|
# Enable Apache modules
|
||||||
|
sudo a2enmod rewrite ssl headers deflate
|
||||||
sudo systemctl restart apache2
|
sudo systemctl restart apache2
|
||||||
```
|
```
|
||||||
|
|
||||||
### Nginx
|
### Step 2: Clone Repository & Install Dependencies
|
||||||
|
```bash
|
||||||
|
sudo mkdir -p /var/www/html/eatria_client/hospital
|
||||||
|
sudo git clone https://git.e-atria.net/d_s_bisht/devsofttech_hms_ci4.git /var/www/html/eatria_client/hospital
|
||||||
|
|
||||||
```nginx
|
cd /var/www/html/eatria_client/hospital
|
||||||
server {
|
composer install --no-dev --optimize-autoloader
|
||||||
listen 80;
|
```
|
||||||
server_name hms.yourhospital.in;
|
|
||||||
root /var/www/hms/public;
|
|
||||||
index index.php index.html;
|
|
||||||
|
|
||||||
location / {
|
### Step 3: Create MySQL Database
|
||||||
try_files $uri $uri/ /index.php$is_args$args;
|
```sql
|
||||||
}
|
CREATE DATABASE IF NOT EXISTS `hms_hospital_db` CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
|
||||||
|
CREATE USER 'hms_user'@'localhost' IDENTIFIED BY 'YourStrongPassword123!';
|
||||||
|
GRANT ALL PRIVILEGES ON `hms_hospital_db`.* TO 'hms_user'@'localhost';
|
||||||
|
FLUSH PRIVILEGES;
|
||||||
|
```
|
||||||
|
|
||||||
location ~ \.php$ {
|
### Step 4: Configure Environment File (.env)
|
||||||
include snippets/fastcgi-php.conf;
|
```bash
|
||||||
fastcgi_pass unix:/run/php/php8.3-fpm.sock;
|
cp env .env
|
||||||
}
|
nano .env
|
||||||
}
|
# Edit database and app.baseURL (see Section 4)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Step 5: Initialize Schema & Superadmin User
|
||||||
|
Execute the built-in Spark CLI installer:
|
||||||
|
```bash
|
||||||
|
php spark hms:install \
|
||||||
|
--hospital-name="City Multispeciality Hospital" \
|
||||||
|
--admin-user="admin" \
|
||||||
|
--admin-email="admin@hospital.com" \
|
||||||
|
--admin-password="YourStrongPassword"
|
||||||
|
```
|
||||||
|
|
||||||
|
*Or import clean starter schema directly:*
|
||||||
|
```bash
|
||||||
|
mysql -u root -p hms_hospital_db < database/hms_starter_schema_and_masters.sql
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 4. Environment Configuration
|
## 4. Environment Configuration (.env)
|
||||||
|
|
||||||
Edit `.env` (copied from `env` in step 3):
|
Edit `.env` inside the project root:
|
||||||
|
|
||||||
```dotenv
|
```dotenv
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
# ENVIRONMENT
|
# ENVIRONMENT
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
CI_ENVIRONMENT = production # use "development" while installing
|
CI_ENVIRONMENT = production
|
||||||
|
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
# APP
|
# APPLICATION
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
app.baseURL = 'https://hms.yourhospital.in/'
|
app.baseURL = 'https://hospital.yourdomain.com/'
|
||||||
app.allowedHostnames = localhost,hms.yourhospital.in,100001.dhms.in
|
app.appTimezone = 'Asia/Kolkata'
|
||||||
# or JSON format:
|
|
||||||
# app.allowedHostnames = ["localhost","hms.yourhospital.in","100001.dhms.in"]
|
|
||||||
app.appTimezone = 'Asia/Kolkata' # adjust to your timezone
|
|
||||||
|
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
# DATABASE
|
# DATABASE
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
database.default.hostname = localhost
|
database.default.hostname = 127.0.0.1
|
||||||
database.default.database = hms_ci4
|
database.default.database = hms_hospital_db
|
||||||
database.default.username = hms_user
|
database.default.username = hms_user
|
||||||
database.default.password = StrongPassword123
|
database.default.password = YourStrongPassword123!
|
||||||
database.default.DBDriver = MySQLi
|
database.default.DBDriver = MySQLi
|
||||||
database.default.port = 3306
|
database.default.port = 3306
|
||||||
|
database.default.DBDebug = false
|
||||||
|
|
||||||
|
# Database Maintenance Key
|
||||||
|
setup.dbToolsKey = yourSecureKey2026
|
||||||
|
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
# ENCRYPTION KEY (generate once: php spark key:generate)
|
# SNOMED CT CSNOTK TERMINOLOGY SERVICE
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
# encryption.key = hex2bin:...
|
snomed.csnotk.baseUrl = https://csnotk.e-atria.in/csnoserv
|
||||||
|
snomed.csnotk.enabled = true
|
||||||
|
snomed.csnotk.timeoutSec = 10
|
||||||
|
|
||||||
|
#--------------------------------------------------------------------
|
||||||
|
# ABDM BRIDGE GATEWAY CONNECTOR
|
||||||
|
#--------------------------------------------------------------------
|
||||||
|
ABDM_BRIDGE_PUBLIC_URL = https://abdm-bridge.e-atria.in
|
||||||
|
abdm.connector = dreamsoft
|
||||||
|
abdm.directBaseUrl = https://dev.abdm.gov.in/api/v3
|
||||||
|
abdm.directTimeoutSec = 30
|
||||||
|
BRIDGE_SYNC_URL = https://csnotk.e-atria.in/api/bridge
|
||||||
|
ABDM_BRIDGE_URL = https://abdm-bridge.e-atria.in/api/v1/bridge
|
||||||
|
BRIDGE_SYNC_TIMEOUT = 20
|
||||||
|
BRIDGE_SYNC_PROVIDER = bridge
|
||||||
```
|
```
|
||||||
|
|
||||||
Generate encryption key:
|
Generate application encryption key:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
php spark key:generate
|
php spark key:generate
|
||||||
```
|
```
|
||||||
|
|
||||||
### ABDM via Eka.care (existing routes, provider switch)
|
---
|
||||||
|
|
||||||
This project keeps the same ABDM controller routes and queue events, and can switch
|
## 5. Database Architecture & Starter Masters
|
||||||
the queue dispatcher to Eka for ABDM/NHCX integrations.
|
|
||||||
|
|
||||||
Add these keys in `.env`:
|
The pre-built database (`database/hms_starter_schema_and_masters.sql`):
|
||||||
|
- **399 Total Tables:** Complete enterprise schema with relational constraints and composite indexes.
|
||||||
```dotenv
|
- **Zero-Patient Clean State:** All clinical and transactional tables start empty (`patient_master` = 0 rows, `opd_master` = 0 rows, `ipd_master` = 0 rows, `invoice_master` = 0 rows).
|
||||||
ABDM_SYNC_PROVIDER = eka
|
- **83,000+ Preloaded Master Records:**
|
||||||
EKA_BASE_URL = https://api.eka.care
|
- **Ayushman Packages:** 1,401 standardized PM-JAY packages (`ayushman_package_master`).
|
||||||
EKA_BEARER_TOKEN = your-token
|
- **Drug Timings & Frequencies:** `opd_dose_frequency`, `opd_dose_when`, `opd_dose_where`, `opd_dose_duration`.
|
||||||
# Optional alternatives
|
- **Charge Items & Departments:** `hc_department`, `hc_items`, `ipd_item_type`.
|
||||||
# EKA_API_KEY = your-api-key
|
- **Reference Catalogues:** `blood_group`, `color`, `india_state`, `med_company`, `med_formulation`.
|
||||||
# EKA_CLIENT_ID = your-client-id
|
- **Security & RBAC:** CodeIgniter Shield auth with Superadmin account pre-configured.
|
||||||
# EKA_EVENT_ENDPOINTS_JSON = {"abdm.abha.validate":"/your/path"}
|
|
||||||
# EKA_WEBHOOK_SECRET = shared-secret-for-callback-signature
|
|
||||||
```
|
|
||||||
|
|
||||||
Then process queue normally:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
php spark bridge:sync
|
|
||||||
```
|
|
||||||
|
|
||||||
If `EKA_WEBHOOK_SECRET` is set, callback endpoints require a valid HMAC-SHA256 signature
|
|
||||||
in `X-Eka-Signature`, `X-Signature`, or `X-Hub-Signature-256`.
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 5. Database Setup
|
## 6. Comprehensive Medical Templates Library Seeding
|
||||||
|
|
||||||
### Create database and user (MySQL)
|
E-Atria HMS includes a hospital-wide Medical Templates Library that populates out-of-the-box clinical templates:
|
||||||
|
|
||||||
```sql
|
|
||||||
CREATE DATABASE hms_ci4 CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
|
|
||||||
CREATE USER 'hms_user'@'localhost' IDENTIFIED BY 'StrongPassword123';
|
|
||||||
GRANT ALL PRIVILEGES ON hms_ci4.* TO 'hms_user'@'localhost';
|
|
||||||
FLUSH PRIVILEGES;
|
|
||||||
```
|
|
||||||
|
|
||||||
### Run migrations
|
|
||||||
|
|
||||||
Migrations create all application tables (billing, IPD, finance, stock, etc.):
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
php spark migrate
|
php spark db:seed MedicalTemplatesLibrarySeeder
|
||||||
```
|
```
|
||||||
|
|
||||||
> The legacy lab/radiology tables (`lab_repo`, `lab_rgroups`, `lab_tests`, etc.) are
|
> **🛡️ Insert-If-Not-Exists Safety Guarantee:**
|
||||||
> **not** managed by migrations — they are created automatically by the seeders in Step 6.
|
> The seeder runs in **Safe Mode**. It checks whether each template or test parameter already exists in your database. **If a record exists, it is NEVER overwritten or updated**, preserving all custom test rates, personalized normal reference intervals, and doctor notes. Only missing or newly added templates are inserted.
|
||||||
|
|
||||||
|
### What Gets Seeded Out-of-the-Box:
|
||||||
|
- 🩺 **37 Pathology Panels & 228 Test Parameters:** Complete Blood Count (CBC with ESR), LFT, KFT/RFT, Lipid Profile, Thyroid Profile (Total & Free), Urine Routine & Microscopic, HbA1c, Coagulation Profile (PT/INR/APTT), Semen Analysis, CSF Analysis, Dengue Serology, Sputum AFB, Widal, and Stool Routine. Includes standardized LOINC codes, adult male/female reference intervals, units, and HTML table formats.
|
||||||
|
- 🩻 **59 Radiology Master Templates across 5 Modalities:**
|
||||||
|
- **Ultrasound (USG - 27 templates):** Whole Abdomen & Pelvis, KUB, TVS, Obstetric (Early dating, Growth, Anomaly Level-II / TIFFA, Color Doppler), Scrotum, Thyroid, Breast, Musculoskeletal.
|
||||||
|
- **Echocardiography (ECHO - 9 templates):** 2D Echocardiography with Color Doppler, Stress Echo, Pediatric Congenital Echo.
|
||||||
|
- **Digital X-Ray (18 templates):** Chest PA/AP, KUB, Cervical Spine, Lumbar Spine, Skull, Pelvis with Hip, Extremities.
|
||||||
|
- **CT Scan (13 templates):** NCCT / CECT Brain, HRCT Chest, CT Abdomen & Pelvis, CT KUB, CT Angiography.
|
||||||
|
- **MRI (14 templates):** MRI Brain with DWI, MRI Cervical/Lumbar Spine, MRI Knee Joint, MRI Shoulder Joint, MRCP.
|
||||||
|
- 📄 **7 NABH/ABDM IPD Discharge Summaries:** General Medicine, General Surgery, Cardiology, Obstetrics & Gynaecology, Pediatrics & Neonatology, Orthopedics, and Day Care Surgeries.
|
||||||
|
- ✍️ **36 Master Clinical Narratives:** Pre-written standardized medical narratives for Diagnosis Remarks, Hospital Course, In-Hospital Treatment, and Post-Discharge Instructions.
|
||||||
|
- 📋 **13 Bilingual IPD Document Forms:** High-Risk Operative Consent, General Inpatient Admission Consent, LAMA/DAMA Refusal, Blood Transfusion Consent, Patient Property Handover, and Financial Clearance.
|
||||||
|
- 🩺 **29 OPD Doctor Clinical Templates:** Speciality-wise examination findings, provisional diagnoses, final diagnoses, prescriber remarks, and follow-up advice.
|
||||||
|
- 🖨️ **3 OPD Prescription Print Layouts:** Standard Header/Footer, Compact A5, and Pediatric specialized formats.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 6. Seed Master Data
|
## 7. Web Server & SSL Configuration (Apache / Nginx)
|
||||||
|
|
||||||
Run in this order:
|
Point your virtual host `DocumentRoot` strictly to the **`public/`** folder — **not** the project root.
|
||||||
|
|
||||||
```bash
|
### Apache Configuration (`/etc/apache2/sites-available/hospital.conf`):
|
||||||
# Lab & radiology report templates (creates tables too)
|
```apache
|
||||||
php spark db:seed LabTemplateSeeder
|
<VirtualHost *:80>
|
||||||
|
ServerName hospital.yourdomain.com
|
||||||
|
ServerAdmin webmaster@yourdomain.com
|
||||||
|
|
||||||
# Investigation/test master list for OPD order panel
|
DocumentRoot /var/www/html/eatria_client/hospital/public
|
||||||
php spark db:seed InvestigationMasterSeeder
|
|
||||||
|
|
||||||
# OPD clinical workspace templates (complaint, examination, advice templates)
|
<Directory /var/www/html/eatria_client/hospital/public>
|
||||||
php spark db:seed ClinicalTemplateWorkspaceSeeder
|
Options -Indexes +FollowSymLinks
|
||||||
|
AllowOverride All
|
||||||
|
Require all granted
|
||||||
|
DirectoryIndex index.php index.html
|
||||||
|
|
||||||
# Complaint master list
|
<IfModule mod_rewrite.c>
|
||||||
php spark db:seed ComplaintsMasterSeeder
|
RewriteEngine On
|
||||||
|
RewriteBase /
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !-f
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !-d
|
||||||
|
RewriteRule ^(.*)$ index.php/$1 [L]
|
||||||
|
</IfModule>
|
||||||
|
</Directory>
|
||||||
|
|
||||||
|
<IfModule mod_headers.c>
|
||||||
|
Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
|
||||||
|
Header always set X-Frame-Options "SAMEORIGIN"
|
||||||
|
Header always set X-Content-Type-Options "nosniff"
|
||||||
|
Header always set Referrer-Policy "strict-origin-when-cross-origin"
|
||||||
|
Header always set X-XSS-Protection "1; mode=block"
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
ErrorLog ${APACHE_LOG_DIR}/hospital_error.log
|
||||||
|
CustomLog ${APACHE_LOG_DIR}/hospital_access.log combined
|
||||||
|
</VirtualHost>
|
||||||
```
|
```
|
||||||
|
|
||||||
All seeders are **idempotent** — safe to re-run; they use `INSERT IGNORE`.
|
Enable site and install free SSL certificate:
|
||||||
|
|
||||||
### Optional: OPD demo data
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Loads all OPD master data at once (calls Clinical + Investigation seeders)
|
sudo a2ensite hospital.conf
|
||||||
php spark db:seed OpdDemoMasterSeeder
|
sudo apache2ctl configtest
|
||||||
|
sudo systemctl reload apache2
|
||||||
|
sudo certbot --apache -d hospital.yourdomain.com
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 7. File Permissions
|
## 8. File Permissions & Directory Hardening
|
||||||
|
|
||||||
The web server user (`www-data` on Ubuntu, `apache` on CentOS) must have write access
|
The web server user (`www-data`) must have write access only to `writable/` and `public/assets/images`:
|
||||||
to these directories:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Linux / CentOS / Ubuntu
|
cd /var/www/html/eatria_client/hospital
|
||||||
chmod -R 775 writable/
|
|
||||||
chmod -R 775 public/assets/uploads/
|
|
||||||
chmod -R 775 public/uploads/
|
|
||||||
|
|
||||||
chown -R www-data:www-data writable/ public/assets/uploads/ public/uploads/
|
# Ensure subdirectories exist
|
||||||
|
sudo mkdir -p \
|
||||||
|
writable/cache \
|
||||||
|
writable/logs \
|
||||||
|
writable/session \
|
||||||
|
writable/uploads \
|
||||||
|
writable/debugbar \
|
||||||
|
public/assets/images
|
||||||
|
|
||||||
|
# Assign ownership
|
||||||
|
sudo chown -R www-data:www-data /var/www/html/eatria_client/hospital
|
||||||
|
|
||||||
|
# Secure permissions
|
||||||
|
sudo chmod -R 755 /var/www/html/eatria_client/hospital
|
||||||
|
sudo chmod -R 775 writable public/assets/images
|
||||||
|
|
||||||
|
# Lock down .env file
|
||||||
|
sudo chmod 640 .env
|
||||||
|
sudo chown www-data:www-data .env
|
||||||
```
|
```
|
||||||
|
|
||||||
> On Windows (WAMP/Laragon) no permission changes are needed.
|
---
|
||||||
|
|
||||||
|
## 9. Automated Background Cron Jobs
|
||||||
|
|
||||||
|
Add the following background tasks using `sudo crontab -e`:
|
||||||
|
|
||||||
|
```cron
|
||||||
|
# Process ABDM Work Task Board Care Context Linking every 2 minutes
|
||||||
|
*/2 * * * * cd /var/www/html/eatria_client/hospital && php spark abdm:taskboard-sync > /dev/null 2>&1
|
||||||
|
|
||||||
|
# Push stored health records to ABDM Bridge every 5 minutes
|
||||||
|
*/5 * * * * cd /var/www/html/eatria_client/hospital && php spark abdm:push-sync > /dev/null 2>&1
|
||||||
|
|
||||||
|
# Prune old ABDM logs daily at 02:00 AM
|
||||||
|
0 2 * * * cd /var/www/html/eatria_client/hospital && php spark abdm:prune-logs > /dev/null 2>&1
|
||||||
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 8. First Login
|
## 10. First Login & Hospital Customization
|
||||||
|
|
||||||
1. Open `https://hms.yourhospital.in/` in your browser.
|
1. Open your browser: `https://hospital.yourdomain.com/login`
|
||||||
2. Register the **first user** — this account automatically becomes `superadmin`.
|
2. Sign in with your administrator credentials:
|
||||||
3. Go to **Setup → Hospital Info** and enter your hospital name, address, and logo.
|
- **Username / Email:** `admin` (or configured email)
|
||||||
4. Go to **Setup → Users** to create additional staff accounts and assign roles.
|
- **Password:** `Admin@12345` (or configured password)
|
||||||
|
- **CAPTCHA:** Enter the 4-digit code displayed on screen.
|
||||||
**Available roles:**
|
3. Once logged in:
|
||||||
|
- Go to **Setting → Hospital Profile** (`/setting/admin/hospital-profile`) to customize your Hospital Name, Address, Contact details, GSTIN, and upload your high-resolution Hospital Logo and branded Login Wallpaper.
|
||||||
| Role | Access |
|
- Go to **Setting → Medical Templates** (`/setting/template`) to review or customize your pre-loaded Pathology, Radiology, and Discharge layouts.
|
||||||
|---|---|
|
|
||||||
| `superadmin` | Full system access |
|
|
||||||
| `admin` | Day-to-day administration |
|
|
||||||
| `stock_manager` | Stock masters, approvals, procurement |
|
|
||||||
| `storekeeper` | Item issuance and stock receiving |
|
|
||||||
| `department_head` | Department stock indents |
|
|
||||||
| `user` | General / reception access |
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 9. Updating an Existing Installation
|
## 11. Updating an Existing Installation
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# 1. If your server was originally pulling from GitHub, switch to Gitea:
|
# 1. Navigate to project root
|
||||||
git remote set-url origin https://git.e-atria.net/d_s_bisht/devsofttech_hms_ci4.git
|
cd /var/www/html/eatria_client/hospital
|
||||||
|
|
||||||
# 2. Pull latest code (public repository — no password/token required)
|
# 2. Pull latest code from official repository
|
||||||
git pull origin main
|
git pull origin main
|
||||||
|
|
||||||
# 3. Install any new Composer packages (using PHP 8.3)
|
# 3. Update Composer packages
|
||||||
composer install --no-dev --optimize-autoloader
|
composer install --no-dev --optimize-autoloader
|
||||||
# If server has multiple PHP versions (e.g. CentOS/cPanel):
|
|
||||||
# php83 $(which composer) install --no-dev --optimize-autoloader
|
|
||||||
|
|
||||||
# 4. Run any new migrations
|
# 4. Run database migrations (safe - skips already applied migrations)
|
||||||
php spark migrate
|
php spark migrate
|
||||||
|
|
||||||
# 5. If lab templates were updated by the developer, re-seed them
|
# 5. Seed newly added clinical templates (preserves existing hospital data)
|
||||||
php spark db:seed LabTemplateSeeder
|
php spark db:seed MedicalTemplatesLibrarySeeder
|
||||||
```
|
|
||||||
|
|
||||||
> **Developer Note (Pushing Code):** Developers with SSH keys push via:
|
|
||||||
> `git remote set-url origin git@git.e-atria.net:d_s_bisht/devsofttech_hms_ci4.git`
|
|
||||||
> `git push origin main`
|
|
||||||
|
|
||||||
> Always run `php spark migrate` after every `git pull` — it is safe to run on an
|
|
||||||
> already-migrated database (it skips already-applied migrations).
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 10. OEM / Multi-Site Deployment
|
|
||||||
|
|
||||||
For deploying to multiple hospital sites from one codebase:
|
|
||||||
|
|
||||||
1. Follow Steps 2–8 on each server.
|
|
||||||
2. Each site gets its own `.env` with its own database credentials and `baseURL`.
|
|
||||||
3. When the main developer adds new features/templates, sites update with:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
git pull
|
|
||||||
php spark migrate
|
|
||||||
php spark db:seed LabTemplateSeeder # if lab templates were exported
|
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 11. Lab Template Workflow
|
## 12. Useful Spark CLI Commands
|
||||||
|
|
||||||
Lab and radiology report templates are stored in the database. When templates are
|
|
||||||
added or edited via the admin UI, the developer exports them so all OEM sites can
|
|
||||||
receive them via git:
|
|
||||||
|
|
||||||
**On the main/development server (after editing templates in UI):**
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
php spark oem:export-lab-templates
|
# Show all CLI commands
|
||||||
git add app/Database/Seeds/LabOemData/
|
|
||||||
git commit -m "OEM: update lab template seed data"
|
|
||||||
git push
|
|
||||||
```
|
|
||||||
|
|
||||||
**On each remote/OEM server:**
|
|
||||||
|
|
||||||
```bash
|
|
||||||
git pull
|
|
||||||
php spark db:seed LabTemplateSeeder
|
|
||||||
```
|
|
||||||
|
|
||||||
Tables covered by this workflow:
|
|
||||||
|
|
||||||
| Table | Description |
|
|
||||||
|---|---|
|
|
||||||
| `lab_rgroups` | Report group names (Haematology, BioChemistry …) |
|
|
||||||
| `hc_items` (itype 5,6) | Billing charge items linked to lab reports |
|
|
||||||
| `lab_repo` | Pathology report templates (with HTML layout) |
|
|
||||||
| `lab_tests` | Individual test / parameter definitions |
|
|
||||||
| `lab_tests_option` | Dropdown options for test parameters |
|
|
||||||
| `lab_repotests` | Report ↔ test assignments and sort order |
|
|
||||||
| `radiology_ultrasound_template` | US / MRI / CT / Xray / Echo templates |
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 12. Useful Spark Commands
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Show all available commands
|
|
||||||
php spark list
|
php spark list
|
||||||
|
|
||||||
# Run pending migrations
|
# Run interactive automated installer
|
||||||
|
php spark hms:install
|
||||||
|
|
||||||
|
# Seed Medical Templates Library (Safe Mode)
|
||||||
|
php spark db:seed MedicalTemplatesLibrarySeeder
|
||||||
|
|
||||||
|
# Run pending database migrations
|
||||||
php spark migrate
|
php spark migrate
|
||||||
|
|
||||||
# Rollback last migration batch
|
# Rollback last migration batch
|
||||||
php spark migrate:rollback
|
php spark migrate:rollback
|
||||||
|
|
||||||
# Seed a specific seeder
|
# Synchronize ABDM Care Contexts & Health Records
|
||||||
php spark db:seed LabTemplateSeeder
|
php spark abdm:taskboard-sync
|
||||||
|
php spark abdm:push-sync
|
||||||
|
|
||||||
# Export current lab templates to git-trackable SQL files
|
# Check database tables
|
||||||
php spark oem:export-lab-templates
|
php spark db:table hospital_setting
|
||||||
|
|
||||||
# Import Ayushman package master from Excel/CSV
|
|
||||||
php spark ayushman:import
|
|
||||||
|
|
||||||
# Generate a new encryption key (first install only)
|
|
||||||
php spark key:generate
|
|
||||||
|
|
||||||
# Built-in development server (local only)
|
# Built-in development server (local only)
|
||||||
php spark serve
|
php spark serve --host 0.0.0.0 --port 8080
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 13. Project Documents
|
## 13. Official Documentation & Support
|
||||||
|
|
||||||
- Full software help guide: [docs/HOSPITAL_STOCK_HELP.md](docs/HOSPITAL_STOCK_HELP.md)
|
- **Ubuntu Installation Guide:** [docs/UBUNTU_INSTALLATION_GUIDE.md](docs/UBUNTU_INSTALLATION_GUIDE.md)
|
||||||
- Software use license: [SOFTWARE_USE_LICENSE.md](SOFTWARE_USE_LICENSE.md)
|
- **ABDM Care Context & FHIR Standards:** [docs/abdm/CARE_CONTEXT_AND_FHIR_STANDARDS.md](docs/abdm/CARE_CONTEXT_AND_FHIR_STANDARDS.md)
|
||||||
- Open-source notice: [OPEN_SOURCE_NOTICE.md](OPEN_SOURCE_NOTICE.md)
|
- **Online Documentation Portal:** [https://www.e-atria.net/docs](https://www.e-atria.net/docs)
|
||||||
|
- **Website & Cloud Services:** [https://www.e-atria.net](https://www.e-atria.net)
|
||||||
|
- **Software License:** [SOFTWARE_USE_LICENSE.md](SOFTWARE_USE_LICENSE.md)
|
||||||
|
- **Technical Support & Turnkey Deployments:** [info@e-atria.net](mailto:info@e-atria.net)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user