CGHS Card Management System - End to End Flow Explanation
1. Purpose
This document explains the complete flow of the CGHS card delete and fetch functionality,
starting from the frontend JSP page, JavaScript logic, backend FormFlow framework,
properties mapping, stored procedure execution, and final response rendering on UI.
------------------------------------------------------
FULL FLOW DIAGRAM
------------------------------------------------------
User (JSP UI)
|
|-- Enter BenId + Click Search
|
JavaScript getBasicBenDetails()
|
|-- callService(configJson)
|
Framework JavaScript -> HTTP Request
|
V
FormFlowXACTION Servlet
|
[Link]()
|
Reads [Link]
|
Maps service to DB procedure
|
Executes getdetailsonbenid()
|
Database Executes Query
|
Returns RefCursor -> JSON
|
Browser Receives JSON
|
populateBasicBenDetails()
|
Table Updates & Shows Result
------------------------------------------------------
Frontend Layer
------------------------------------------------------
The UI exists in JSP pages like:
- [Link]
- [Link]
These pages contain:
- BenId Input Box
- Search Button
- Table to Display Beneficiary Details
When user clicks Search:
getBasicBenDetails() JavaScript executes.
------------------------------------------------------
JavaScript Layer
------------------------------------------------------
Function: getBasicBenDetails()
Steps:
1. Reads BenId from textbox
2. Validates input
3. Creates configJson
4. Calls callService(configJson)
Important Fields:
serviceName = /getData/getBasicBenDetails
primaryKeys = [BenId]
callback = populateBasicBenDetails()
callService sends data to backend servlet.
------------------------------------------------------
Backend Framework Layer
------------------------------------------------------
Servlet:
[Link]
Method:
callService()
Internal Engine:
[Link]()
What it does:
- Reads service name
- Searches mapping in properties file
- Finds stored procedure name
- Calls DB procedure
- Gets response
- Converts to JSON
- Sends back to UI
------------------------------------------------------
Properties Mapping Layer
------------------------------------------------------
File:
[Link]
Entry:
getBasicBenDetails = {
procedureType = query
procedureName = cardmgmt.pkg_cghs_card_services.getDetailsonbenid
}
Meaning:
Frontend service -> Database procedure binding
------------------------------------------------------
Database Procedure Layer
------------------------------------------------------
Procedure:
getdetailsonbenid
Input:
JSON containing BenId
Process:
- Parse JSON
- Extract BenId (pk0)
- Build SQL query
- Fetch beneficiary details
- Open RefCursor
- Return data
It returns:
BenId
Name
DOB
Gender
Relation
Photo
Card Type
Validity
Department
------------------------------------------------------
Response Layer
------------------------------------------------------
Backend converts refcursor -> JSON
Returns to frontend
JavaScript Callback Runs:
populateBasicBenDetails()
Role:
- Clears table
- Loops result data
- Inserts rows
- Applies status logic
- Shows buttons
- Displays table
------------------------------------------------------
Delete Sample Procedure Summary
------------------------------------------------------
Procedure:
sample_proc_update_patient
Role:
Soft Delete + Backup
Steps:
- Receive JSON
- Parse BenId, RelationId, Remarks
- Insert copy to backup table
- Update original record flag = 1
- Return success / failure / error
------------------------------------------------------
Final Understanding Summary
------------------------------------------------------
getBasicBenDetails -> Fetch Data
getdetailsonbenid -> DB Data Provider
sample_proc_update_patient -> Delete Logic
FormFlowXACTION -> Entry Gateway
FormFlowXUTIL -> Engine Brain
Properties File -> Mapping Book
RefCursor -> Data Transport
Callback JS -> UI Renderer
This completes the Zero to Hundred understanding of the system.