DevSoftTech HMS E-Atria ABDM https://www.e-atria.net
Go to file
2026-10-27 02:00:43 +05:30
.agents feat(abdm & schema): drop patient_master.p_lname and add abha address selector to M1 verify flow 2026-10-24 12:56:13 +05:30
.cursor feat(abdm): configure official ABDM toolkit skills and achieve 100% NRCES 6.5.0 FHIR conformance 2026-10-06 12:25:48 +05:30
.github/agents Add Ayushman package import, billing claim sheet, and reporting dashboards 2026-03-26 15:42:40 +05:30
ABDM_FHIR feat(abdm): proper FHIR bundles for lab reports and IPD discharge 2026-05-23 04:41:59 +05:30
android_opd_queue_tv feat(medical-store): ABDM-compatible multi-building pharmacy, POS desktop keyboard workflow, unit dispensing, and split payments 2026-09-08 02:19:11 +05:30
app fix(pharmacy): handle unique item_name collision and auto-expand column in abdm drug sync 2026-10-27 02:00:43 +05:30
build_artifacts feat: ABDM OPD Queue + ABHA Register flow + patient ABHA search fix 2026-05-16 04:21:31 +05:30
docs docs(abdm): add care context and FHIR standards documentation and agent rules 2026-10-23 09:53:56 +05:30
middleware-gateway feat: commit all pending page and ABDM gateway updates 2026-05-26 06:04:34 +05:30
old_code_ci3 chore: untrack local dev debug scripts and internal notes from repository, update .gitignore 2026-10-21 01:57:44 +05:30
postmn_abdm feat: ABDM OPD Queue + ABHA Register flow + patient ABHA search fix 2026-05-16 04:21:31 +05:30
public fix(layout): pin copyright footer to bottom on blank pages and all screen sizes 2026-10-26 23:19:38 +05:30
scratch feat(abdm): expand WellnessRecord to full comprehensive suite (Option B) with segmented tabs and labs 2026-10-07 10:15:42 +05:30
scripts Fix WASA security observations: security headers, CSP hardening, JS library updates, API authentication, and data scrubbing 2026-10-19 16:27:17 +05:30
tests feat(abdm & schema): drop patient_master.p_lname and add abha address selector to M1 verify flow 2026-10-24 12:56:13 +05:30
writable fix(security): implement WASA compliance hardening and vulnerability remediation 2026-10-14 10:27:32 +05:30
.copilot-instructions feat: ABDM OPD Queue + ABHA Register flow + patient ABHA search fix 2026-05-16 04:21:31 +05:30
.gitignore chore: add dev/ directory to .gitignore for local development tools and notes 2026-10-21 02:00:59 +05:30
AGENTS.md feat(abdm & schema): drop patient_master.p_lname and add abha address selector to M1 verify flow 2026-10-24 12:56:13 +05:30
builds Implement OPD template builder, doctor template selection, and OPD print integration fixes 2026-02-27 19:44:36 +05:30
composer.json Implement OPD template builder, doctor template selection, and OPD print integration fixes 2026-02-27 19:44:36 +05:30
composer.lock fix(security): implement WASA compliance hardening and vulnerability remediation 2026-10-14 10:27:32 +05:30
deploy.sh feat(security): implement WASA audit mitigations, mobile anti-enumeration & device authorization, and user management fixes 2026-10-15 17:47:51 +05:30
env feat: completely remove HealthPlix integration, controllers, views, and database columns 2026-10-21 01:33:13 +05:30
HMS_FEATURES_PRESENTATION.html feat: completely remove HealthPlix integration, controllers, views, and database columns 2026-10-21 01:33:13 +05:30
HMS_FEATURES_PRESENTATION.md feat: completely remove HealthPlix integration, controllers, views, and database columns 2026-10-21 01:33:13 +05:30
LICENSE Implement OPD template builder, doctor template selection, and OPD print integration fixes 2026-02-27 19:44:36 +05:30
OPEN_SOURCE_NOTICE.md chore(ui-docs): add help/license links, favicon, and branding asset tracking 2026-04-02 12:23:22 +05:30
phpunit.xml.dist feat(abdm): configure official ABDM toolkit skills and achieve 100% NRCES 6.5.0 FHIR conformance 2026-10-06 12:25:48 +05:30
preload.php Implement OPD template builder, doctor template selection, and OPD print integration fixes 2026-02-27 19:44:36 +05:30
README.md feat: completely remove HealthPlix integration, controllers, views, and database columns 2026-10-21 01:33:13 +05:30
SOFTWARE_USE_LICENSE.md Clarify open source use and paid services 2026-08-12 21:28:43 +05:30
spark Add report panel updates and related billing/discharge enhancements 2026-03-10 02:43:35 +05:30

HMS — Hospital Management System (CI4)

Framework: CodeIgniter 4.7 · PHP: 8.2+ · DB: MySQL 5.7+ / MariaDB 10.4+

A full-featured hospital management system covering OPD, IPD, Billing, Pathology Lab, Radiology, Finance, Pharmacy Stock, and more.


Table of Contents

  1. Server Requirements
  2. Fresh Installation
  3. Web Server Configuration
  4. Environment Configuration
  5. Database Setup
  6. Seed Master Data
  7. File Permissions
  8. First Login
  9. Updating an Existing Installation
  10. OEM / Multi-Site Deployment
  11. Lab Template Workflow
  12. Useful Spark Commands
  13. Project Documents

1. Server Requirements

Requirement Minimum Recommended
PHP 8.2 8.3
MySQL 5.7 8.0+
MariaDB (alternative) 10.4 10.11+
Web server Apache 2.4 / Nginx Apache with mod_rewrite
Composer 2.x latest

Required PHP extensions:

intl  mbstring  mysqlnd  json  curl  gd  zip  fileinfo  xml

Recommended php.ini settings:

memory_limit       = 256M
upload_max_filesize = 20M
post_max_size       = 25M
max_execution_time  = 120

2. Fresh Installation

# 1. Clone the repository (public - no login required)
git clone https://git.e-atria.net/d_s_bisht/devsofttech_hms_ci4.git hms
cd hms

# 2. Install PHP dependencies
composer install --no-dev --optimize-autoloader

# 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.


3. Web Server Configuration

Apache

Point your virtual host DocumentRoot to the public/ folder — not the project root.

<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:

sudo a2enmod rewrite
sudo systemctl restart apache2

Nginx

server {
    listen 80;
    server_name hms.yourhospital.in;
    root /var/www/hms/public;
    index index.php index.html;

    location / {
        try_files $uri $uri/ /index.php$is_args$args;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php8.3-fpm.sock;
    }
}

4. Environment Configuration

Edit .env (copied from env in step 3):

#--------------------------------------------------------------------
# ENVIRONMENT
#--------------------------------------------------------------------
CI_ENVIRONMENT = production          # use "development" while installing

#--------------------------------------------------------------------
# APP
#--------------------------------------------------------------------
app.baseURL = 'https://hms.yourhospital.in/'
app.allowedHostnames = localhost,hms.yourhospital.in,100001.dhms.in
# or JSON format:
# app.allowedHostnames = ["localhost","hms.yourhospital.in","100001.dhms.in"]
app.appTimezone = 'Asia/Kolkata'     # adjust to your timezone

#--------------------------------------------------------------------
# DATABASE
#--------------------------------------------------------------------
database.default.hostname = localhost
database.default.database = hms_ci4
database.default.username = hms_user
database.default.password = StrongPassword123
database.default.DBDriver = MySQLi
database.default.port     = 3306

#--------------------------------------------------------------------
# ENCRYPTION KEY (generate once: php spark key:generate)
#--------------------------------------------------------------------
# encryption.key = hex2bin:...

Generate encryption key:

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 the queue dispatcher to Eka for ABDM/NHCX integrations.

Add these keys in .env:

ABDM_SYNC_PROVIDER = eka
EKA_BASE_URL = https://api.eka.care
EKA_BEARER_TOKEN = your-token
# Optional alternatives
# EKA_API_KEY = your-api-key
# EKA_CLIENT_ID = your-client-id
# EKA_EVENT_ENDPOINTS_JSON = {"abdm.abha.validate":"/your/path"}
# EKA_WEBHOOK_SECRET = shared-secret-for-callback-signature

Then process queue normally:

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

Create database and user (MySQL)

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.):

php spark migrate

The legacy lab/radiology tables (lab_repo, lab_rgroups, lab_tests, etc.) are not managed by migrations — they are created automatically by the seeders in Step 6.


6. Seed Master Data

Run in this order:

# Lab & radiology report templates (creates tables too)
php spark db:seed LabTemplateSeeder

# Investigation/test master list for OPD order panel
php spark db:seed InvestigationMasterSeeder

# OPD clinical workspace templates (complaint, examination, advice templates)
php spark db:seed ClinicalTemplateWorkspaceSeeder

# Complaint master list
php spark db:seed ComplaintsMasterSeeder

All seeders are idempotent — safe to re-run; they use INSERT IGNORE.

Optional: OPD demo data

# Loads all OPD master data at once (calls Clinical + Investigation seeders)
php spark db:seed OpdDemoMasterSeeder

7. File Permissions

The web server user (www-data on Ubuntu, apache on CentOS) must have write access to these directories:

# Linux / CentOS / Ubuntu
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/

On Windows (WAMP/Laragon) no permission changes are needed.


8. First Login

  1. Open https://hms.yourhospital.in/ in your browser.
  2. Register the first user — this account automatically becomes superadmin.
  3. Go to Setup → Hospital Info and enter your hospital name, address, and logo.
  4. Go to Setup → Users to create additional staff accounts and assign roles.

Available roles:

Role Access
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

# 1. If your server was originally pulling from GitHub, switch to Gitea:
git remote set-url origin https://git.e-atria.net/d_s_bisht/devsofttech_hms_ci4.git

# 2. Pull latest code (public repository — no password/token required)
git pull origin main

# 3. Install any new Composer packages (using PHP 8.3)
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
php spark migrate

# 5. If lab templates were updated by the developer, re-seed them
php spark db:seed LabTemplateSeeder

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:
git pull
php spark migrate
php spark db:seed LabTemplateSeeder    # if lab templates were exported

11. Lab Template Workflow

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):

php spark oem:export-lab-templates
git add app/Database/Seeds/LabOemData/
git commit -m "OEM: update lab template seed data"
git push

On each remote/OEM server:

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

# Show all available commands
php spark list

# Run pending migrations
php spark migrate

# Rollback last migration batch
php spark migrate:rollback

# Seed a specific seeder
php spark db:seed LabTemplateSeeder

# Export current lab templates to git-trackable SQL files
php spark oem:export-lab-templates

# 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)
php spark serve

13. Project Documents