devsofttech_hms_ci4/middleware-gateway/setup-ubuntu.sh
DevSoftTech Server 0628f8f813 feat: ABDM OPD Queue + ABHA Register flow + patient ABHA search fix
ABDM OPD Queue (today):
- New EAtriaBridgeConnector: opdQueueFetch/opdTokenCreate/opdTokenUpdateStatus + patch() helper
- New AbdmOpdQueue controller: index/list/fetchQueue/createToken/updateTokenStatus/processScannedToken
  - fetchQueue syncs gateway tokens into abdm_opd_tokens (local DB) and enriches with HMS patient data
  - processScannedToken auto-finds/creates patient_master record from ABHA scan data, marks token CALLED
- New migration: abdm_opd_tokens table (gateway_token_id, source, status, patient_id, opd_id, processed_at)
- New view: abdm/opd_queue.php - reception screen with auto-refresh 30s, HMS Patient column (green row when OPD registered)
- Sidebar: ABDM OPD Queue nav link added
- Routes: AbdmOpdQueue with abdmPermFilter

ABHA Register tab (earlier this session):
- New Abha controller: initiate/verifyOtp/communication/verifyCommOtp/validateAbha/card + autoCreateOrFindPatient
- New views: abha/card.php, partials/abha_create_panel.php, partials/abha_otp_modal.php
- Patient_V.php: ABHA Register tab with 4-method wizard (ABHA number, QR scan, facility QR, mobile OTP)

Patient ABHA search fix:
- Patient::search() now detects ABHA column (abha_id/abha_no/abha/abha_address) and searches by it

ABDM Bridge infrastructure:
- EAtriaBridgeConnector: new connector for e-atria.in ABDM bridge gateway
- AbdmConnectorFactory/Interface updated
- AbdmGatewaySettings controller + view
- SNOMED/CSNOTK terminology service skeleton
- Finance payout OPD consult views
- Migration: AddAbdmPushFieldsToOpdAndPatient, CreateSnomedCoreTables
- Docs: abdm/ API specs, architecture, gateway guides
2026-05-16 04:21:31 +05:30

46 lines
1.2 KiB
Bash

#!/bin/bash
# ABDM Gateway Middleware Setup on Ubuntu
# Script to deploy abdm-bridge.e-atria.in gateway server
set -e
echo "🚀 ABDM Middleware Gateway Setup for Ubuntu"
echo "==========================================="
# Check if running as root or sudo
if [[ $EUID -ne 0 ]]; then
echo "❌ This script must be run as root (use: sudo ./setup.sh)"
exit 1
fi
echo "📦 Updating system packages..."
apt-get update
apt-get upgrade -y
echo "📦 Installing Node.js and npm..."
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
apt-get install -y nodejs npm
echo "📦 Installing Docker and Docker Compose..."
apt-get install -y docker.io docker-compose curl wget
echo "🔧 Adding current user to docker group..."
usermod -aG docker $SUDO_USER
echo "📦 Installing Nginx..."
apt-get install -y nginx
echo "📦 Installing Certbot for SSL..."
apt-get install -y certbot python3-certbot-nginx
echo "✅ System dependencies installed!"
echo ""
echo "Next steps:"
echo "1. Copy middleware files to /opt/abdm-gateway/"
echo "2. Run: docker-compose up -d"
echo "3. Configure Nginx reverse proxy"
echo "4. Get SSL certificate with: certbot --nginx -d abdm-bridge.e-atria.in"
echo ""
echo "💡 See DEPLOYMENT_GUIDE.md for detailed instructions"