Rajavignesh
updating the main function
c13fc2d
Raw History Blame Contribute Delete
140 kB
from fastapi import FastAPI, WebSocket, WebSocketDisconnect
from fastapi.responses import FileResponse
from fastapi.middleware.cors import CORSMiddleware
from pydantic import BaseModel
import asyncio
import json
import uuid
import random
from datetime import datetime
import time
import os
from typing import Dict, Any
from dotenv import load_dotenv
load_dotenv()
app = FastAPI(title="Processing Simulator API", version="1.0.0")
# Configure CORS
app.add_middleware(
CORSMiddleware,
allow_origins=["*"], # Allows all origins
allow_credentials=True,
allow_methods=["*"], # Allows all methods
allow_headers=["*"], # Allows all headers
)
class ProcessingRequest(BaseModel):
foldername: str
environment: str
class ProcessingStats(BaseModel):
status: str = "Complete"
number_of_records: int
request_id: str
record_count: int # This seems to be duplicate of number_of_records, keeping both as requested
@app.get("/")
async def root():
"""Root endpoint with basic information"""
return {
"message": "FastAPI Processing Simulator",
"websocket_endpoint": "/ws",
"download_endpoint": "/{request_id}/download",
"docs": "/docs"
}
@app.get("/{request_id}/download")
async def download_file(request_id: str):
"""
Download endpoint that serves the TEST.pdf file from the static folder
Args:
request_id: The request ID (can be any string, used for tracking/logging)
Returns:
FileResponse with the TEST.pdf file for download
Raises:
HTTPException: 404 if the file is not found
"""
# Get the current directory and construct the path to the static folder
current_dir = os.path.dirname(os.path.abspath(__file__))
static_dir = os.path.join(current_dir, "static")
file_path = os.path.join(static_dir, "Benefit_Agent_Report.xlsx")
# Log the download request
print(f"Download request for request_id: {request_id} at {datetime.now().isoformat()}")
# Check if the file exists
if not os.path.exists(file_path):
raise HTTPException(
status_code=404,
detail=f"File not found. Looking for Benefit_Agent_Report.xlsx in: {static_dir}"
)
# Return the file as a download response
return FileResponse(
path=file_path,
filename="Benefit_Agent_Report.xlsx",
media_type="application/xlsx",
headers={
"Content-Disposition": "attachment; filename=Benefit_Agent_Report.xlsx",
"X-Request-ID": request_id
}
)
configured_responses = {}
with open("./responses.json", "r", encoding='utf-8') as in_file:
data = in_file.read()
print(data)
configured_responses = json.loads(data)
@app.post("/chat")
async def chat_endpoint(request: Dict[str, Any]):
"""
Chat endpoint that processes a chat request and returns the LLM response
Expected request format:
{
"user_prompt": "string",
"parent_code": "string",
"sys_prompt": "string"
}
Returns:
- LLM response as a string
"""
try:
user_prompt = request.get("user_question", "")
parent_code = request.get("parent_code", "")
sys_prompt = request.get("sys_prompt", "You are a helpful assistant.")
if not user_prompt or not parent_code:
return {"error": "Both 'user_question' and 'parent_code' are required."}
if user_prompt.strip() in configured_responses.keys():
llm_response = configured_responses[user_prompt.strip()]
sleep_time = random.randint(2500, 3500)
time.sleep(float(sleep_time) / 1000.0)
return {
"response": llm_response
}
return {"response": "We have limited the capabilities of the LLM in this simulator since we don't have access to the full vector database or client database."}
except Exception as e:
print(f"Error in chat endpoint: {str(e)}")
return {"error": f"Server error: {str(e)}"}
@app.websocket("/ws")
async def websocket_endpoint(websocket: WebSocket):
"""
WebSocket endpoint that accepts processing requests and simulates processing
Expected message format:
{
"foldername": "string",
"environment": "string"
}
Returns:
- Intermediate processing messages
- Final stats object with status, number_of_records, request_id, and record_count
"""
await websocket.accept()
try:
while True:
# Receive and parse the request
data = await websocket.receive_text()
try:
request_data = json.loads(data)
processing_request = ProcessingRequest(**request_data)
except (json.JSONDecodeError, ValueError) as e:
await websocket.send_text(json.dumps({
"error": f"Invalid request format: {str(e)}",
"expected_format": {
"foldername": "string",
"environment": "string"
}
}))
continue
# Generate a unique request ID
request_id = "123e4567-e89b-12d3-a456-426614174000"
# Send acknowledgment
await websocket.send_text(json.dumps({
"message": f"Processing request received for folder '{processing_request.foldername}' in environment '{processing_request.environment}'",
"request_id": request_id,
"timestamp": datetime.now().isoformat()
}))
# Simulate processing with intermediate messages
await simulate_processing(websocket, processing_request, request_id)
except WebSocketDisconnect:
print("Client disconnected")
except Exception as e:
print(f"Error in websocket endpoint: {str(e)}")
try:
await websocket.send_text(json.dumps({
"error": f"Server error: {str(e)}"
}))
except:
pass
async def simulate_processing(websocket: WebSocket, request: ProcessingRequest, request_id: str):
"""
Simulate processing work with intermediate messages and timeouts
"""
steps = [
"Phase: Environment Setup",
"Step: Initializing processing environment",
f"Setting up environment: {request.environment}",
"Validating input folder structure",
"Establishing logging and error handling mechanisms",
"Phase: Data Extraction",
"Step: Document Discovery and Validation",
f"Scanning input folder: {request.foldername}",
"Validate document formats and integrity",
"Generate processing manifest for audit trail",
"Identified 1 files to process.",
"Total files: 1. Files: Operating Engineers OEF OEF1 OEF2 050120 MSAG 1.pdf",
"Reading Mapping document to load business rules.",
"Step: Document Content Extraction",
"Display: Operating Engineers OEF OEF1 OEF2 050120 MSAG 1.pdf",
"Extracting data from the file - Operating Engineers OEF OEF1 OEF2 050120 MSAG 1.pdf",
"Total Number of pages identified for processing: 2",
"Extracting tabular data from the PDF for page - 1",
"Converting PDF Page content into JSON format",
"Sending Request to Horizon API for data extraction",
"""curl --location --request POST 'https://api.horizon.elevancehealth.com/v2/text/chats?qos=accurate&preview=true' \ --header 'Authorization: Bearer bVsv6kd2hT6kLJkftgneUoE3xR7fhCv8' \ --header 'Content-Type: application/json' \ --data-raw '{ "messages": [ { "role": "system", "content": "You extract tabular data from text. Return ONLY JSON with keys: tables, notes. tables is an array of objects: {columns, rows}. columns: array of strings. rows: array of arrays aligned to columns. The table entries would be either in the form of a space separated or '\'';'\'' separated entries with the individual lines separated by a new line (\n\n) to better distinguish the entries as some items might have entries with new lines in them.Distinguish between the space separated and '\'';'\'' entries based on the data provided.Do not stop at first page, keep going all the way to the end. If no tables, return tables: []. Avoid invented values." }, { "role": "user", "content": "Extract tables from the following document text. If a table spans multiple lines, reconstruct it. Preserve numeric types where obvious.\n\nService Type AUTH\n\nCLASS\n\nBENEFIT\n\nCLASS\n\nRev/ HCPCS/\n\nCPT\n\nMODIFIER 1\n\nMODIFIER 2\n\nMODIFIER 3\n\nMODIFIER 4\n\nAdd On Code Interactive\n\nComplexity\n\nAdd On Code\n\nDESCRIPTION Coverable\n\nDx Category\n\nPsych Claim Type\n\nSA Claim Type\n\nDual Dx Claim Type\n\nClaim Type\n\nPlace of Service\n\nINPATIENT FACILITY\n\nAcute Inpatient IPF IPF 0100 N/A N/A All Inclusive Room and Board Plus Ancillary Psy/Sub N/A RE DD N/A 21, 51, 55, 56, 99\n\nIPF IPF 0113 N/A N/A Room and Board Private Pediatric Psy/Sub N/A RE DD N/A 21, 51, 55, 56, 99\n\nIPF IPF 0114 N/A N/A Room & Board - Private (Medical or General) Psychiatric Psy/Sub N/A RE DD N/A 21, 51, 55, 56, 99\n\nIPF IPF 0123 N/A N/A Room and Board Semi-Private Pediatric Psy/Sub N/A RE DD N/A 21, 51, 55, 56, 99\n\nIPF IPF 0124 N/A N/A Room & Board - Semi-Private Two-Bed (Medical or General) Psychiatric Psy/Sub N/A RE DD N/A 21, 51, 55, 56, 99\n\nIPF IPF 0133 N/A N/A Room and Board Semi-Private Three and Four Beds Pediatric Psy/Sub N/A RE DD N/A 21, 51, 55, 56, 99\n\nIPF IPF 0134 N/A N/A Semi-Private Three and Four Beds - Psychiatric Psy/Sub N/A RE DD N/A 21, 51, 55, 56, 99\n\nIPF IPF 0143 N/A N/A Room and Board Private Delux Pediatric Psy/Sub N/A RE DD N/A 21, 51, 55, 56, 99\n\nIPF IPF 0144 N/A N/A Room and Board Private Delux Psychiatric Psy/Sub N/A RE DD N/A 21, 51, 55, 56, 99\n\nIPF IPF 0153 N/A N/A Room and Board/Medical or General Pediatric Psy/Sub N/A RE DD N/A 21, 51, 55, 56, 99\n\nIPF IPF 0154 N/A N/A Room & Board - Ward (Medical or General) Psychiatric Psy/Sub N/A RE DD N/A 21, 51, 55, 56, 99\n\nIPF IPF 0203 N/A N/A Intensive Care Psy/Sub N/A RE DD N/A 21, 51, 55, 56, 99\n\nIPF IPF 0204 N/A N/A Intensive Care Psychiatric Psy/Sub N/A RE DD N/A 21, 51, 55, 56, 99\n\nIPF IPF 0118 N/A N/A Room and Board Private Rehabilitation Psy/Sub N/A RE DD N/A 21, 51, 55, 56, 99\n\nIPF IPF 0128 N/A N/A Room and Board Semi-Private Rehabilitation Psy/Sub N/A RE DD N/A 21, 51, 55, 56, 99\n\nIPF IPF 0138 N/A N/A Room and Board Semi-Private Three and Four Beds Psy/Sub N/A RE DD N/A 21, 51, 55, 56, 99\n\nIPF IPF 0148 N/A N/A Private Deluxe Rehabilitation Psy/Sub N/A RE DD N/A 21, 51, 55, 56, 99\n\nIPF IPF 0158 N/A N/A Room and Board/Medical or General Rehabilitation Psy/Sub N/A RE DD N/A 21, 51, 55, 56, 99\n\nIPF IPF 0190 N/A N/A Subacute Inpatient Psy/Sub N/A RE DD N/A 21, 51, 55, 56, 99\n\nIPF IPF 0191 N/A N/A Subacute Care - Level I Psy/Sub N/A RE DD N/A 21, 51, 55, 56, 99\n\nIPF IPF 0192 N/A N/A Subacute Care - Level II Psy/Sub N/A RE DD N/A 21, 51, 55, 56, 99\n\nIPF IPF 0193 N/A N/A Subacute Care - Level III Psy/Sub N/A RE DD N/A 21, 51, 55, 56, 99\n\nIPF IPF 0194 N/A N/A Subacute Psy/Sub N/A RE DD N/A 21, 51, 55, 56, 99\n\nIPF IPF H0008 N/A N/A Alocohol and/or Drug Services Psy/Sub N/A RE DD N/A 21, 51, 55, 56, 99\n\nInpatient Detox IDF IDF 0116 N/A N/A Room and Board Private Detoxification Sub N/A DT N/A N/A 21, 51, 55, 56, 99\n\nIDF IDF 0126 N/A N/A Room and Board Semi-Private Detoxification Sub N/A DT N/A N/A 21, 51, 55, 56, 99\n\nIDF IDF 0136 N/A N/A Room and Board Semi-Private Three and Four Beds Detox Sub N/A DT N/A N/A 21, 51, 55, 56, 99\n\nIDF IDF 0146 N/A N/A Private Deluxe Detox Sub N/A DT N/A N/A 21, 51, 55, 56, 99\n\nIDF IDF 0156 N/A N/A Room and Board/Medical or General Detox Sub N/A DT N/A N/A 21, 51, 55, 56, 99\n\nIDF IDF H0009 N/A N/A Detoxification Services in a Hospital Setting Sub N/A DT N/A N/A 21, 51, 55, 56, 99\n\nIDF IDF H0011 N/A N/A Alcohol and/or Drug Services; Acute Detoxification Sub N/A DT N/A N/A 21, 51, 55, 56, 99\n\nALTERNATE LEVELS OF CARE\n\nResidential Treatment RTC RTC 1001 N/A N/A Residential Treatment - Psychiatric Psy/Sub N/A N/A DD N/A 21, 51, 55, 56, 57, 99\n\nRTC RTC H0017 N/A N/A Behavioral Health; Residential Psy/Sub N/A N/A DD N/A 21, 51, 55, 56, 57, 99\n\nRTC RTC H0018 N/A N/A Behavioral Health; Short-Term Residential Psy/Sub N/A N/A DD N/A 21, 51, 55, 56, 57, 99\n\nRTC RTC 1002 N/A N/A Residential Treatment - Chemical Dependency Psy/Sub N/A N/A DD N/A 21, 51, 55, 56, 57, 99\n\nRTC RTC H0010 N/A N/A Residential Treatment Psy/Sub N/A N/A DD N/A 21, 51, 55, 56, 57, 99\n\n23 Hr. Bed TBD TBD 0760 N/A N/A Treatment or Observation Room Psy/Sub N/A N/A N/A N/A 21, 51, 53, 55, 99\n\nTBD TBD 0761 N/A N/A 23 Hour Crisis Stabilization Psy/Sub N/A N/A N/A N/A 21, 51, 53, 55, 99\n\nTBD TBD 0762 N/A N/A Treatment or Observation Room Psy/Sub N/A N/A N/A N/A 21, 51, 53, 55, 99\n\nTBD TBD H0046 TG N/A N/A Treatment or Observation Room Psy/Sub N/A N/A N/A N/A 21, 51, 53, 55, 99\n\n72 Hr. Bed SBD SBD 0769 N/A N/A Observation Room-Subsequent Hours Psy/Sub N/A N/A N/A N/A 21, 51, 53, 55, 99\n\nOutpatient Detox OPD OPD 0944 N/A N/A OP Detox Sub N/A RE N/A N/A 02, 19, 22, 57\n\nOPD OPD 0945 N/A N/A OP Detox Sub N/A RE N/A N/A 02, 19, 22, 57\n\nOPD OPD H0014 N/A N/A Alcohol and/or drug services; ambulatory detox Sub N/A RE N/A N/A 02, 19, 22, 57\n\nOPD OPD H0014 GT N/A N/A Alcohol and/or drug services; ambulatory detox Sub N/A RE N/A N/A 02, 19, 22, 57\n\nCrisis Intervention CIN CIN 0919 N/A N/A Crisis Intervention Psy/Sub N/A N/A N/A N/A 02, 19, 22, 52, 99\n\nCIN CIN H0007 N/A N/A Crisis Intervention Psy/Sub N/A N/A N/A N/A 02, 19, 22, 52, 99\n\nCIN CIN S9485 99051 N/A Crisis Intervention - Per Diem Psy/Sub N/A N/A N/A N/A 02, 19, 22, 52, 99\n\nPartial Hospitalization PHP PHP 0907 N/A N/A Community Behavioral Health Program Psy/Sub N/A N/A N/A N/A 19, 22, 52, 53, 99\n\nPHP PHP 0912 N/A N/A Partial Hospitalization - less intensive Psy/Sub N/A N/A N/A N/A 19, 22, 52, 53, 99\n\nPHP PHP 0913 N/A N/A Partial Hospitalization - intensive Psy/Sub N/A N/A N/A N/A 19, 22, 52, 53, 99\n\nPHP PHP H0035 N/A N/A Mental health partial hospitalization, treatment, less than 24 hours Psy/Sub N/A N/A N/A N/A 19, 22, 52, 53, 99\n\nIntensive Outpatient Program (IOP) SOP SOP 0900 N/A N/A Psychiatric/Psychological Treatment - General Classification Psy/Sub N/A RE DD N/A 11, 19, 22, 53, 99\n\nSOP SOP 0906 N/A N/A Intensive Outpatient Services - Chemical Dependency Psy/Sub N/A RE DD N/A 11, 19, 22, 53, 99\n\nSOP SOP H0015 N/A N/A Alcohol and/or drug services; intensive outpatient (treatment program that operates at\n\nleast 3 hours/day and at least 3 days/week and is based on an individualized treatment\n\nplan), including assessment, counseling; crisis intervention, and activity therapies or\n\neducation\n\nPsy/Sub N/A RE DD N/A 11, 19, 22, 53, 99\n\nSOP IOP 0905 N/A N/A Intensive Outpatient Services - Psychiatric Psy/Sub N/A RE DD N/A 11, 19, 22, 53, 99\n\nSOP IOP S9480 N/A N/A Intensive outpatient psychiatric services, per diem Psy/Sub N/A RE DD N/A 11, 19, 22, 53, 99\n\nINPATIENT PROFESSIONAL SERVICES\n\nInitial Evaluation TIN EV1 90791 N/A 90785 Psychiatric diagnostic evaluation Psy/Sub N/A N/A N/A N/A 02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99\n\nTIN EV1 90791 GT N/A 90785GT Psychiatric diagnostic evaluation Psy/Sub N/A N/A N/A N/A 02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99\n\nTIN EV1 90792 N/A 90785 Psychiatric diagnostic evaluation with medical services Psy/Sub N/A N/A N/A N/A 02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99\n\nTIN EV1 90792 GT N/A 90785GT Psychiatric diagnostic evaluation with medical services Psy/Sub N/A N/A N/A N/A 02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99\n\nDocuSign Envelope ID: B1E6CC89-EE8D-46F7-BB31-495DF5F6146C\nIgnore any inferred fields that are not explicitly mentioned in the text of the document. For these fields, mention them as NULL\n" } ] }' """,
"Extracted tabular data from LLM Response for page - 1",
"""{ "tables": [ { "columns": [ "Service Type", "AUTH CLASS", "BENEFIT CLASS", "Rev/HCPCS/CPT", "MODIFIER 1", "MODIFIER 2", "MODIFIER 3", "MODIFIER 4", "Interactive Complexity Add On Code", "Add On Code", "DESCRIPTION", "Coverable", "Dx Category", "Psych Claim Type", "SA Claim Type", "Dual Dx Claim Type", "Claim Type", "Place of Service" ], "rows": [ [ "TIN EVL", null, null, 99217, null, null, null, null, 90785, "90833\\n90836\\n90838", "Observation care discharge day management", null, "Psy/Sub", "N/A", "N/A", "N/A", "N/A", "02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99" ], [ "TIN EVL", null, null, 99217, "GT", null, null, null, 90785, "90833\\n90836\\n90838", "Observation care discharge day management", null, "Psy/Sub", "N/A", "N/A", "N/A", "N/A", "02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99" ], [ "TIN EVL", null, null, 99218, null, null, null, null, 90785, "90833\\n90836\\n90838", "Initial observation care, per day, for the evaluation and management of a patient (30 minutes)", null, "Psy/Sub", "N/A", "N/A", "N/A", "N/A", "02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99" ], [ "TIN EVL", null, null, 99218, "GT", null, null, null, 90785, "90833\\n90836\\n90838", "Initial observation care, per day, for the evaluation and management of a patient (30 minutes)", null, "Psy/Sub", "N/A", "N/A", "N/A", "N/A", "02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99" ], [ "TIN EVL", null, null, 99219, null, null, null, null, 90785, "90833\\n90836\\n90838", "Initial observation care, per day, for the evaluation and management of a patient (50 minutes)", null, "Psy/Sub", "N/A", "N/A", "N/A", "N/A", "02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99" ], [ "TIN EVL", null, null, 99219, "GT", null, null, null, 90785, "90833\\n90836\\n90838", "Initial observation care, per day, for the evaluation and management of a patient (50 minutes)", null, "Psy/Sub", "N/A", "N/A", "N/A", "N/A", "02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99" ], [ "TIN EVL", null, null, 99220, null, null, null, null, 90785, "90833\\n90836\\n90838", "Initial observation care, per day, for the evaluation and management of a patient (70 minutes)", null, "Psy/Sub", "N/A", "N/A", "N/A", "N/A", "02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99" ], [ "TIN EVL", null, null, 99220, "GT", null, null, null, 90785, "90833\\n90836\\n90838", "Initial observation care, per day, for the evaluation and management of a patient (70 minutes)", null, "Psy/Sub", "N/A", "N/A", "N/A", "N/A", "02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99" ], [ "TIN EVL", null, null, 99221, null, null, null, null, 90785, "90833\\n90836\\n90838", "Initial hospital care, per day, for the evaluation and management of a patient (30 minutes)", null, "Psy/Sub", "N/A", "N/A", "N/A", "N/A", "02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99" ], [ "TIN EVL", null, null, 99221, "GT", null, null, null, 90785, "90833\\n90836\\n90838", "Initial hospital care, per day, for the evaluation and management of a patient (30 minutes)", null, "Psy/Sub", "N/A", "N/A", "N/A", "N/A", "02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99" ], [ "TIN EVL", null, null, 99222, null, null, null, null, 90785, "90833\\n90836\\n90838", "Initial hospital care, per day, for the evaluation and management of a patient (50 minutes)", null, "Psy/Sub", "N/A", "N/A", "N/A", "N/A", "02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99" ], [ "TIN EVL", null, null, 99223, null, null, null, null, 90785, "90833\\n90836\\n90838", "Initial hospital care, per day, for the evaluation and management of a patient (70 minutes)", null, "Psy/Sub", "N/A", "N/A", "N/A", "N/A", "02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99" ], [ "TIN EVL", null, null, 99224, null, null, null, null, 90785, "90833\\n90836\\n90838", "Subsequent observation care, per day, for the evaluation and management of a patient, which requires at least 2 of these 3 key components: Problem focused interval history; Problem focused examination; Medical decision making that is straightforward or of low complexity. Counseling and/or coordination of care with other physicians, other qualified health care professionals, or agencies are provided consistent with the nature of the problem(s) and the patient\'s and/or family\'s needs. Usually, the patient is stable, recovering, or improving. Typically, 15 minutes are spent at the bedside and on the patient\'s hospital floor or unit.", null, "Psy/Sub", "N/A", "N/A", "N/A", "N/A", "02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99" ], [ "TIN EVL", null, null, 99224, "GT", null, null, null, 90785, "90833\\n90836\\n90838", "Subsequent observation care, per day, for the evaluation and management of a patient, which requires at least 2 of these 3 key components: Problem focused interval history; Problem focused examination; Medical decision making that is straightforward or of low complexity. Counseling and/or coordination of care with other physicians, other qualified health care professionals, or agencies are provided consistent with the nature of the problem(s) and the patient\'s and/or family\'s needs. Usually, the patient is stable, recovering, or improving. Typically, 15 minutes are spent at the bedside and on the patient\'s hospital floor or unit.", null, "Psy/Sub", "N/A", "N/A", "N/A", "N/A", "02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99" ], [ "TIN EVL", null, null, 99225, null, null, null, null, 90785, "90833\\n90836\\n90838", "Subsequent observation care, per day, for the evaluation and management of a patient, which requires at least 2 of these 3 key components: An expanded problem focused interval history; An expanded problem focused examination; Medical decision making of moderate complexity. Counseling and/or coordination of care with other physicians, other qualified health care professionals, or agencies are provided consistent with the nature of the problem(s) and the patient\'s and/or family\'s needs. Usually, the patient is responding inadequately to therapy or has developed a minor complication. Typically, 25 minutes are spent at the bedside and on the patient\'s hospital floor or unit.", null, "Psy/Sub", "N/A", "N/A", "N/A", "N/A", "02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99" ], [ "TIN EVL", null, null, 99226, null, null, null, null, 90785, "90833\\n90836\\n90838", "Subsequent observation care, per day, for the evaluation and management of a patient, which requires at least 2 of these 3 key components: A detailed interval history; A detailed examination; Medical decision making of high complexity. Counseling and/or coordination of care with other physicians, other qualified health care professionals, or agencies are provided consistent with the nature of the problem(s) and the patient\'s and/or family\'s needs. Usually, the patient is unstable or has developed a significant complication or a significant new problem. Typically, 35 minutes are spent at the bedside and on the patient\'s hospital floor or unit.", null, "Psy/Sub", "N/A", "N/A", "N/A", "N/A", "02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99" ], [ "TIN EVL", null, null, 99234, null, null, null, null, 90785, "90833\\n90836\\n90838", "Observation or inpatient hospital care, per day, for the evaluation and management of a patient, low severity, 40 minutes", null, "Psy/Sub", "N/A", "N/A", "N/A", "N/A", "02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99" ] ] } ], "notes": "Fields not explicitly present (AUTH CLASS, BENEFIT CLASS, Coverable) are set to NULL. Service Type is taken from the \'TIN EVL\' prefix. Add On Code values are preserved as newline-separated lists to reflect the source formatting. For CPT 99223, the main code did not explicitly show \'GT\' even though add-on codes did; no modifier was assigned to avoid inference. The \'DocuSign Envelope ID\' line is not tabular data and was ignored."}""",
"Data Extraction completed for page - 1",
"Extracting tabular data from the PDF for page - 2",
"Converting PDF Page content into JSON format",
"Sending Request to Horizon API for data extraction",
"""curl --location --request POST 'https://api.horizon.elevancehealth.com/v2/text/chats?qos=accurate&preview=true' \ --header 'Authorization: Bearer bVsv6kd2hT6kLJkftgneUoE3xR7fhCv8' \ --header 'Content-Type: application/json' \ --data-raw '{ "messages": [ { "role": "system", "content": "You extract tabular data from text. Return ONLY JSON with keys: tables, notes. tables is an array of objects: {columns, rows}. columns: array of strings. rows: array of arrays aligned to columns. The table entries would be either in the form of a space separated or '\'';'\'' separated entries with the individual lines separated by a new line (\n\n) to better distinguish the entries as some items might have entries with new lines in them.Distinguish between the space separated and '\'';'\'' entries based on the data provided.Do not stop at first page, keep going all the way to the end. If no tables, return tables: []. Avoid invented values." }, { "role": "user", "content": "Extract tables from the following document text. If a table spans multiple lines, reconstruct it. Preserve numeric types where obvious.\n\nService Type AUTH\n\nCLASS\n\nBENEFIT\n\nCLASS\n\nRev/ HCPCS/\n\nCPT\n\nMODIFIER 1\n\nMODIFIER 2\n\nMODIFIER 3\n\nMODIFIER 4\n\nAdd On Code Interactive\n\nComplexity\n\nAdd On Code\n\nDESCRIPTION Coverable\n\nDx Category\n\nPsych Claim Type\n\nSA Claim Type\n\nDual Dx Claim Type\n\nClaim Type\n\nPlace of Service\n\nINPATIENT FACILITY\n\nAcute Inpatient IPF IPF 0100 N/A N/A All Inclusive Room and Board Plus Ancillary Psy/Sub N/A RE DD N/A 21, 51, 55, 56, 99\n\nIPF IPF 0113 N/A N/A Room and Board Private Pediatric Psy/Sub N/A RE DD N/A 21, 51, 55, 56, 99\n\nIPF IPF 0114 N/A N/A Room & Board - Private (Medical or General) Psychiatric Psy/Sub N/A RE DD N/A 21, 51, 55, 56, 99\n\nIPF IPF 0123 N/A N/A Room and Board Semi-Private Pediatric Psy/Sub N/A RE DD N/A 21, 51, 55, 56, 99\n\nIPF IPF 0124 N/A N/A Room & Board - Semi-Private Two-Bed (Medical or General) Psychiatric Psy/Sub N/A RE DD N/A 21, 51, 55, 56, 99\n\nIPF IPF 0133 N/A N/A Room and Board Semi-Private Three and Four Beds Pediatric Psy/Sub N/A RE DD N/A 21, 51, 55, 56, 99\n\nIPF IPF 0134 N/A N/A Semi-Private Three and Four Beds - Psychiatric Psy/Sub N/A RE DD N/A 21, 51, 55, 56, 99\n\nIPF IPF 0143 N/A N/A Room and Board Private Delux Pediatric Psy/Sub N/A RE DD N/A 21, 51, 55, 56, 99\n\nIPF IPF 0144 N/A N/A Room and Board Private Delux Psychiatric Psy/Sub N/A RE DD N/A 21, 51, 55, 56, 99\n\nIPF IPF 0153 N/A N/A Room and Board/Medical or General Pediatric Psy/Sub N/A RE DD N/A 21, 51, 55, 56, 99\n\nIPF IPF 0154 N/A N/A Room & Board - Ward (Medical or General) Psychiatric Psy/Sub N/A RE DD N/A 21, 51, 55, 56, 99\n\nIPF IPF 0203 N/A N/A Intensive Care Psy/Sub N/A RE DD N/A 21, 51, 55, 56, 99\n\nIPF IPF 0204 N/A N/A Intensive Care Psychiatric Psy/Sub N/A RE DD N/A 21, 51, 55, 56, 99\n\nIPF IPF 0118 N/A N/A Room and Board Private Rehabilitation Psy/Sub N/A RE DD N/A 21, 51, 55, 56, 99\n\nIPF IPF 0128 N/A N/A Room and Board Semi-Private Rehabilitation Psy/Sub N/A RE DD N/A 21, 51, 55, 56, 99\n\nIPF IPF 0138 N/A N/A Room and Board Semi-Private Three and Four Beds Psy/Sub N/A RE DD N/A 21, 51, 55, 56, 99\n\nIPF IPF 0148 N/A N/A Private Deluxe Rehabilitation Psy/Sub N/A RE DD N/A 21, 51, 55, 56, 99\n\nIPF IPF 0158 N/A N/A Room and Board/Medical or General Rehabilitation Psy/Sub N/A RE DD N/A 21, 51, 55, 56, 99\n\nIPF IPF 0190 N/A N/A Subacute Inpatient Psy/Sub N/A RE DD N/A 21, 51, 55, 56, 99\n\nIPF IPF 0191 N/A N/A Subacute Care - Level I Psy/Sub N/A RE DD N/A 21, 51, 55, 56, 99\n\nIPF IPF 0192 N/A N/A Subacute Care - Level II Psy/Sub N/A RE DD N/A 21, 51, 55, 56, 99\n\nIPF IPF 0193 N/A N/A Subacute Care - Level III Psy/Sub N/A RE DD N/A 21, 51, 55, 56, 99\n\nIPF IPF 0194 N/A N/A Subacute Psy/Sub N/A RE DD N/A 21, 51, 55, 56, 99\n\nIPF IPF H0008 N/A N/A Alocohol and/or Drug Services Psy/Sub N/A RE DD N/A 21, 51, 55, 56, 99\n\nInpatient Detox IDF IDF 0116 N/A N/A Room and Board Private Detoxification Sub N/A DT N/A N/A 21, 51, 55, 56, 99\n\nIDF IDF 0126 N/A N/A Room and Board Semi-Private Detoxification Sub N/A DT N/A N/A 21, 51, 55, 56, 99\n\nIDF IDF 0136 N/A N/A Room and Board Semi-Private Three and Four Beds Detox Sub N/A DT N/A N/A 21, 51, 55, 56, 99\n\nIDF IDF 0146 N/A N/A Private Deluxe Detox Sub N/A DT N/A N/A 21, 51, 55, 56, 99\n\nIDF IDF 0156 N/A N/A Room and Board/Medical or General Detox Sub N/A DT N/A N/A 21, 51, 55, 56, 99\n\nIDF IDF H0009 N/A N/A Detoxification Services in a Hospital Setting Sub N/A DT N/A N/A 21, 51, 55, 56, 99\n\nIDF IDF H0011 N/A N/A Alcohol and/or Drug Services; Acute Detoxification Sub N/A DT N/A N/A 21, 51, 55, 56, 99\n\nALTERNATE LEVELS OF CARE\n\nResidential Treatment RTC RTC 1001 N/A N/A Residential Treatment - Psychiatric Psy/Sub N/A N/A DD N/A 21, 51, 55, 56, 57, 99\n\nRTC RTC H0017 N/A N/A Behavioral Health; Residential Psy/Sub N/A N/A DD N/A 21, 51, 55, 56, 57, 99\n\nRTC RTC H0018 N/A N/A Behavioral Health; Short-Term Residential Psy/Sub N/A N/A DD N/A 21, 51, 55, 56, 57, 99\n\nRTC RTC 1002 N/A N/A Residential Treatment - Chemical Dependency Psy/Sub N/A N/A DD N/A 21, 51, 55, 56, 57, 99\n\nRTC RTC H0010 N/A N/A Residential Treatment Psy/Sub N/A N/A DD N/A 21, 51, 55, 56, 57, 99\n\n23 Hr. Bed TBD TBD 0760 N/A N/A Treatment or Observation Room Psy/Sub N/A N/A N/A N/A 21, 51, 53, 55, 99\n\nTBD TBD 0761 N/A N/A 23 Hour Crisis Stabilization Psy/Sub N/A N/A N/A N/A 21, 51, 53, 55, 99\n\nTBD TBD 0762 N/A N/A Treatment or Observation Room Psy/Sub N/A N/A N/A N/A 21, 51, 53, 55, 99\n\nTBD TBD H0046 TG N/A N/A Treatment or Observation Room Psy/Sub N/A N/A N/A N/A 21, 51, 53, 55, 99\n\n72 Hr. Bed SBD SBD 0769 N/A N/A Observation Room-Subsequent Hours Psy/Sub N/A N/A N/A N/A 21, 51, 53, 55, 99\n\nOutpatient Detox OPD OPD 0944 N/A N/A OP Detox Sub N/A RE N/A N/A 02, 19, 22, 57\n\nOPD OPD 0945 N/A N/A OP Detox Sub N/A RE N/A N/A 02, 19, 22, 57\n\nOPD OPD H0014 N/A N/A Alcohol and/or drug services; ambulatory detox Sub N/A RE N/A N/A 02, 19, 22, 57\n\nOPD OPD H0014 GT N/A N/A Alcohol and/or drug services; ambulatory detox Sub N/A RE N/A N/A 02, 19, 22, 57\n\nCrisis Intervention CIN CIN 0919 N/A N/A Crisis Intervention Psy/Sub N/A N/A N/A N/A 02, 19, 22, 52, 99\n\nCIN CIN H0007 N/A N/A Crisis Intervention Psy/Sub N/A N/A N/A N/A 02, 19, 22, 52, 99\n\nCIN CIN S9485 99051 N/A Crisis Intervention - Per Diem Psy/Sub N/A N/A N/A N/A 02, 19, 22, 52, 99\n\nPartial Hospitalization PHP PHP 0907 N/A N/A Community Behavioral Health Program Psy/Sub N/A N/A N/A N/A 19, 22, 52, 53, 99\n\nPHP PHP 0912 N/A N/A Partial Hospitalization - less intensive Psy/Sub N/A N/A N/A N/A 19, 22, 52, 53, 99\n\nPHP PHP 0913 N/A N/A Partial Hospitalization - intensive Psy/Sub N/A N/A N/A N/A 19, 22, 52, 53, 99\n\nPHP PHP H0035 N/A N/A Mental health partial hospitalization, treatment, less than 24 hours Psy/Sub N/A N/A N/A N/A 19, 22, 52, 53, 99\n\nIntensive Outpatient Program (IOP) SOP SOP 0900 N/A N/A Psychiatric/Psychological Treatment - General Classification Psy/Sub N/A RE DD N/A 11, 19, 22, 53, 99\n\nSOP SOP 0906 N/A N/A Intensive Outpatient Services - Chemical Dependency Psy/Sub N/A RE DD N/A 11, 19, 22, 53, 99\n\nSOP SOP H0015 N/A N/A Alcohol and/or drug services; intensive outpatient (treatment program that operates at\n\nleast 3 hours/day and at least 3 days/week and is based on an individualized treatment\n\nplan), including assessment, counseling; crisis intervention, and activity therapies or\n\neducation\n\nPsy/Sub N/A RE DD N/A 11, 19, 22, 53, 99\n\nSOP IOP 0905 N/A N/A Intensive Outpatient Services - Psychiatric Psy/Sub N/A RE DD N/A 11, 19, 22, 53, 99\n\nSOP IOP S9480 N/A N/A Intensive outpatient psychiatric services, per diem Psy/Sub N/A RE DD N/A 11, 19, 22, 53, 99\n\nINPATIENT PROFESSIONAL SERVICES\n\nInitial Evaluation TIN EV1 90791 N/A 90785 Psychiatric diagnostic evaluation Psy/Sub N/A N/A N/A N/A 02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99\n\nTIN EV1 90791 GT N/A 90785GT Psychiatric diagnostic evaluation Psy/Sub N/A N/A N/A N/A 02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99\n\nTIN EV1 90792 N/A 90785 Psychiatric diagnostic evaluation with medical services Psy/Sub N/A N/A N/A N/A 02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99\n\nTIN EV1 90792 GT N/A 90785GT Psychiatric diagnostic evaluation with medical services Psy/Sub N/A N/A N/A N/A 02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99\n\nDocuSign Envelope ID: B1E6CC89-EE8D-46F7-BB31-495DF5F6146C\nIgnore any inferred fields that are not explicitly mentioned in the text of the document. For these fields, mention them as NULL\n" } ] }' """,
"Extracted tabular data from LLM Response for page - 2",
'{ "tables": [ { "columns": [ "Service Type", "AUTH CLASS", "BENEFIT CLASS", "Rev/HCPCS/CPT", "MODIFIER 1", "MODIFIER 2", "MODIFIER 3", "MODIFIER 4", "Interactive Complexity Add On Code", "Add On Code", "DESCRIPTION", "Coverable", "Dx Category", "Psych Claim Type", "SA Claim Type", "Dual Dx Claim Type", "Claim Type", "Place of Service" ], "rows": [ [ "TIN EVL", null, null, 99217, null, null, null, null, 90785, "90833\\n90836\\n90838", "Observation care discharge day management", null, "Psy/Sub", "N/A", "N/A", "N/A", "N/A", "02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99" ], [ "TIN EVL", null, null, 99217, "GT", null, null, null, 90785, "90833\\n90836\\n90838", "Observation care discharge day management", null, "Psy/Sub", "N/A", "N/A", "N/A", "N/A", "02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99" ], [ "TIN EVL", null, null, 99218, null, null, null, null, 90785, "90833\\n90836\\n90838", "Initial observation care, per day, for the evaluation and management of a patient (30 minutes)", null, "Psy/Sub", "N/A", "N/A", "N/A", "N/A", "02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99" ], [ "TIN EVL", null, null, 99218, "GT", null, null, null, 90785, "90833\\n90836\\n90838", "Initial observation care, per day, for the evaluation and management of a patient (30 minutes)", null, "Psy/Sub", "N/A", "N/A", "N/A", "N/A", "02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99" ], [ "TIN EVL", null, null, 99219, null, null, null, null, 90785, "90833\\n90836\\n90838", "Initial observation care, per day, for the evaluation and management of a patient (50 minutes)", null, "Psy/Sub", "N/A", "N/A", "N/A", "N/A", "02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99" ], [ "TIN EVL", null, null, 99219, "GT", null, null, null, 90785, "90833\\n90836\\n90838", "Initial observation care, per day, for the evaluation and management of a patient (50 minutes)", null, "Psy/Sub", "N/A", "N/A", "N/A", "N/A", "02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99" ], [ "TIN EVL", null, null, 99220, null, null, null, null, 90785, "90833\\n90836\\n90838", "Initial observation care, per day, for the evaluation and management of a patient (70 minutes)", null, "Psy/Sub", "N/A", "N/A", "N/A", "N/A", "02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99" ], [ "TIN EVL", null, null, 99220, "GT", null, null, null, 90785, "90833\\n90836\\n90838", "Initial observation care, per day, for the evaluation and management of a patient (70 minutes)", null, "Psy/Sub", "N/A", "N/A", "N/A", "N/A", "02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99" ], [ "TIN EVL", null, null, 99221, null, null, null, null, 90785, "90833\\n90836\\n90838", "Initial hospital care, per day, for the evaluation and management of a patient (30 minutes)", null, "Psy/Sub", "N/A", "N/A", "N/A", "N/A", "02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99" ], [ "TIN EVL", null, null, 99221, "GT", null, null, null, 90785, "90833\\n90836\\n90838", "Initial hospital care, per day, for the evaluation and management of a patient (30 minutes)", null, "Psy/Sub", "N/A", "N/A", "N/A", "N/A", "02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99" ], [ "TIN EVL", null, null, 99222, null, null, null, null, 90785, "90833\\n90836\\n90838", "Initial hospital care, per day, for the evaluation and management of a patient (50 minutes)", null, "Psy/Sub", "N/A", "N/A", "N/A", "N/A", "02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99" ], [ "TIN EVL", null, null, 99223, null, null, null, null, 90785, "90833\\n90836\\n90838", "Initial hospital care, per day, for the evaluation and management of a patient (70 minutes)", null, "Psy/Sub", "N/A", "N/A", "N/A", "N/A", "02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99" ], [ "TIN EVL", null, null, 99224, null, null, null, null, 90785, "90833\\n90836\\n90838", "Subsequent observation care, per day, for the evaluation and management of a patient, which requires at least 2 of these 3 key components: Problem focused interval history; Problem focused examination; Medical decision making that is straightforward or of low complexity. Counseling and/or coordination of care with other physicians, other qualified health care professionals, or agencies are provided consistent with the nature of the problem(s) and the patient\'s and/or family\'s needs. Usually, the patient is stable, recovering, or improving. Typically, 15 minutes are spent at the bedside and on the patient\'s hospital floor or unit.", null, "Psy/Sub", "N/A", "N/A", "N/A", "N/A", "02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99" ], [ "TIN EVL", null, null, 99224, "GT", null, null, null, 90785, "90833\\n90836\\n90838", "Subsequent observation care, per day, for the evaluation and management of a patient, which requires at least 2 of these 3 key components: Problem focused interval history; Problem focused examination; Medical decision making that is straightforward or of low complexity. Counseling and/or coordination of care with other physicians, other qualified health care professionals, or agencies are provided consistent with the nature of the problem(s) and the patient\'s and/or family\'s needs. Usually, the patient is stable, recovering, or improving. Typically, 15 minutes are spent at the bedside and on the patient\'s hospital floor or unit.", null, "Psy/Sub", "N/A", "N/A", "N/A", "N/A", "02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99" ], [ "TIN EVL", null, null, 99225, null, null, null, null, 90785, "90833\\n90836\\n90838", "Subsequent observation care, per day, for the evaluation and management of a patient, which requires at least 2 of these 3 key components: An expanded problem focused interval history; An expanded problem focused examination; Medical decision making of moderate complexity. Counseling and/or coordination of care with other physicians, other qualified health care professionals, or agencies are provided consistent with the nature of the problem(s) and the patient\'s and/or family\'s needs. Usually, the patient is responding inadequately to therapy or has developed a minor complication. Typically, 25 minutes are spent at the bedside and on the patient\'s hospital floor or unit.", null, "Psy/Sub", "N/A", "N/A", "N/A", "N/A", "02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99" ], [ "TIN EVL", null, null, 99226, null, null, null, null, 90785, "90833\\n90836\\n90838", "Subsequent observation care, per day, for the evaluation and management of a patient, which requires at least 2 of these 3 key components: A detailed interval history; A detailed examination; Medical decision making of high complexity. Counseling and/or coordination of care with other physicians, other qualified health care professionals, or agencies are provided consistent with the nature of the problem(s) and the patient\'s and/or family\'s needs. Usually, the patient is unstable or has developed a significant complication or a significant new problem. Typically, 35 minutes are spent at the bedside and on the patient\'s hospital floor or unit.", null, "Psy/Sub", "N/A", "N/A", "N/A", "N/A", "02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99" ], [ "TIN EVL", null, null, 99234, null, null, null, null, 90785, "90833\\n90836\\n90838", "Observation or inpatient hospital care, per day, for the evaluation and management of a patient, low severity, 40 minutes", null, "Psy/Sub", "N/A", "N/A", "N/A", "N/A", "02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99" ] ] } ], "notes": "Fields not explicitly present (AUTH CLASS, BENEFIT CLASS, Coverable) are set to NULL. Service Type is taken from the \'TIN EVL\' prefix. Add On Code values are preserved as newline-separated lists to reflect the source formatting. For CPT 99223, the main code did not explicitly show \'GT\' even though add-on codes did; no modifier was assigned to avoid inference. The \'DocuSign Envelope ID\' line is not tabular data and was ignored."}',
"Applying mapping conversion to extract the table records for SCLMAS",
"Data Conversion completed. Extracted Data.",
"Step: Document Type Identification and Classification",
"Identifying the document type for the PDF",
"Document identified as MSAG",
"Phase: Data Processing and Transformation",
"Step: Business Rules and Mapping Retrieval",
"Loading predefined business logic and transformation rules",
"Validating mapping completeness against source data",
"Step: Data Transformation and Mapping",
"Tables identified in the PDF Document - 1",
"Identified associated table - SCLMAS",
"Applying mapping conversion to extract the table records for SCLMAS",
"Applying mapping rules to transform data for page - 1",
"Sending request to Horizon API to transform data using LLM",
"""curl --location --request POST 'https://api.horizon.elevancehealth.com/v2/text/chats?qos=accurate&preview=true' \ --header 'Authorization: Bearer bVsv6kd2hT6kLJkftgneUoE3xR7fhCv8' \ --header 'Content-Type: application/json' \ --data-raw '{ "messages": [ { "role": "system", "content": "You are a business analyst assistant that helps in going over the structured data in the pdf document and indentify the required values from the mapping document provided.You will be given the json data extracted from the document and the mapping information from the excel sheet.Your task is to generate a valid JSON object based on the mapping information and the json data provided.Use only the data that you can identify from the json representation of the pdf and for the mapping columns for which you can find a value in the json data.For the mapping columns for which you are not able to find the value, provide a NULL value for them in the entry." }, { "role": "user", "content": "You are a helpful assistant. Given the following JSON data and mapping information, generate a valid JSON object.\n\nInstructions:\n- Use '\''db field name'\'' as the SQL column name.\n- Use '\''Mapping Notes'\'' to find the value in the JSON.\n- If '\''Mapping Notes'\'' includes a transformation, apply it to the JSON value before inserting.\n- Extract the values based on the functional understanding.\n- Only include fields that have a mapping.\n- Return the result as a JSON object with keys: '\''columns'\'' and '\''values'\''.\n- If any field is N/A, then please treat it as a blank field.\n- If you are not able to find any value for a field in the document or generate it using the mapping rules, then please set it to NULL.\n- Do not include any explanation or extra text.\n- Respect the format of values exactly as they appear. For compound values like '\''9832 CL'\'', treat the entire string as a single entity unless there are explicit separators like semicolons (;) or commas (,) between distinct values. For example, '\''9832 CL;9888'\'' should be treated as two separate values ('\''9832 CL'\'' and '\''9888'\''), but '\''9832 CL'\'' by itself should never be split into '\''9832'\'' and '\''CL'\''.\n- Only extract values directly from the specified columns in the table structure. Do not attempt to parse or interpret the content within a text field to extract additional information. If a column contains a paragraph or block of text, use the entire text as the value without trying to extract specific information from within it.\n- Ensure the output is a well-formed, syntactically valid JSON object. Check that all brackets, quotation marks, and commas are correctly placed. The JSON must be parseable by standard JSON parsers without any modifications. Do not include any text or explanations outside of the JSON structure itself.\n- If you are not able to find any record that matches the conditions from the page, then send out an empty array for that page instead of sending one record with the just the rows with default values\n\n- When no matching records are found on a page, return an empty array (e.g., `[]`) rather than creating placeholder records with default or NULL values. This ensures accurate data representation by not introducing artificial records when none exist in the source material.\nJSON data:\n{\n \"tables\": [\n {\n \"columns\": [\n \"Authorization\",\n \"AUTH CLASS\",\n \"Rev/ HCPCS/ CPT\",\n \"MODIFIER 1\",\n \"MODIFIER 2\",\n \"MODIFIER 3\",\n \"MODIFIER 4\",\n \"Add On Codes\",\n \"DESCRIPTION\",\n \"Coverable Dx Category\",\n \"Auth Req'\''d\",\n \"IE Max Units\",\n \"Unit Value\",\n \"Psych Claim Type (Connects)\",\n \"SA Claim Type (Connects)\",\n \"Dual Dx Claim Type (Connects)\",\n \"Claim Type (Connects)\",\n \"Place of Service\"\n ],\n \"rows\": [\n [\n \"TCN\",\n \"TCN\",\n \"99231\",\n \"90833\\n90836\\n90838\",\n \"99356\\n99357\",\n \"90785\",\n null,\n null,\n \"Subsequent hospital care, per day, for the evaluation and management of a patient (15 minutes)\",\n \"Psy/Sub\",\n \"Yes\",\n \"No\",\n 1,\n \"15 mins\",\n null,\n null,\n null,\n null,\n \"02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99\"\n ],\n [\n \"TCN\",\n \"TCN\",\n \"99232\",\n \"90833\\n90836\\n90838\",\n \"99356\\n99357\",\n \"90785\",\n null,\n null,\n \"Subsequent hospital care, per day, for the evaluation and management of a patient (25 minutes)\",\n \"Psy/Sub\",\n \"Yes\",\n \"No\",\n 1,\n \"25 mins\",\n null,\n null,\n null,\n null,\n \"02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99\"\n ],\n [\n \"TCN\",\n \"TCN\",\n \"99233\",\n \"90833\\n90836\\n90838\",\n \"99356\\n99357\",\n \"90785\",\n null,\n null,\n \"Subsequent hospital care, per day, for the evaluation and management of a patient (35 minutes)\",\n \"Psy/Sub\",\n \"Yes\",\n \"No\",\n 1,\n \"35 mins\",\n null,\n null,\n null,\n null,\n \"02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99\"\n ],\n [\n \"TCN\",\n \"TCN\",\n \"99238\",\n \"90833\\n90836\\n90838\",\n \"99356\\n99357\",\n \"90785\",\n null,\n null,\n \"Hospital discharge day management; 30 minutes or less\",\n \"Psy/Sub\",\n \"Yes\",\n \"No\",\n 1,\n \"< 30 mins\",\n null,\n null,\n null,\n null,\n \"02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99\"\n ],\n [\n \"TCN\",\n \"TCN\",\n \"99251\",\n \"90833\\n90836\\n90838\",\n \"99356\\n99357\",\n \"90785\",\n null,\n null,\n \"Inpatient consultation for a new or established patient, 20 minutes\",\n \"Psy/Sub\",\n \"Yes\",\n \"No\",\n 1,\n \"20 mins\",\n null,\n null,\n null,\n null,\n \"02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99\"\n ],\n [\n \"TCN\",\n \"TCN\",\n \"99252\",\n \"90833\\n90836\\n90838\",\n \"99356\\n99357\",\n \"90785\",\n null,\n null,\n \"Inpatient consultation for a new or established patient, 40 minutes\",\n \"Psy/Sub\",\n \"Yes\",\n \"No\",\n 1,\n \"40 mins\",\n null,\n null,\n null,\n null,\n \"02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99\"\n ],\n [\n \"TIN\",\n \"LHV\",\n \"99239\",\n \"90833\\n90836\\n90838\",\n \"90785\",\n null,\n null,\n null,\n \"Hospital discharge day management; more than 30 minutes\",\n \"Psy/Sub\",\n \"Yes\",\n \"No\",\n 1,\n \"30+ mins\",\n null,\n null,\n null,\n null,\n \"02, 14, 21, 31, 51, 52, 55, 56, 57, 61, 99\"\n ],\n [\n \"TIN\",\n \"LHV\",\n \"99253\",\n \"90833\\n90836\\n90838\",\n \"90785\",\n null,\n null,\n null,\n \"Inpatient consultation for a new or established patient, 55 minutes\",\n \"Psy/Sub\",\n \"Yes\",\n \"No\",\n 1,\n \"55 mins\",\n null,\n null,\n null,\n null,\n \"02, 14, 21, 31, 51, 52, 55, 56, 57, 61, 99\"\n ],\n [\n \"TIN\",\n \"TIN\",\n \"99304\",\n \"90833\\n90836\\n90838\",\n \"99356\\n99357\",\n \"90785\",\n null,\n null,\n \"Initial nursing facility care, per day, for the evaluation and management of a patient, 25 minutes at the bedside and on the patient'\''s facility floor or unit\",\n \"Psy/Sub\",\n \"Yes\",\n \"No\",\n 1,\n \"25 mins\",\n null,\n null,\n null,\n null,\n \"02, 11, 12, 13, 19, 22, 23, 32, 33, 34, 49, 53, 62, 71, 72\"\n ],\n [\n \"TIN\",\n \"TIN\",\n \"99305\",\n \"90833\\n90836\\n90838\",\n \"99356\\n99357\",\n \"90785\",\n null,\n null,\n \"Initial nursing facility care, per day, for the evaluation and management of a patient, 35 minutes at the bedside and on the patient'\''s facility floor or unit\",\n \"Psy/Sub\",\n \"Yes\",\n \"No\",\n 1,\n \"35 mins\",\n null,\n null,\n null,\n null,\n \"02, 11, 12, 13, 19, 22, 23, 32, 33, 34, 49, 53, 62, 71, 72\"\n ],\n [\n \"TIN\",\n \"TIN\",\n \"99306\",\n \"90833\\n90836\\n90838\",\n \"99356\\n99357\",\n \"90785\",\n null,\n null,\n \"Initial nursing facility care, per day, for the evaluation and management of a patient, 45 minutes at the bedside and on the patient'\''s facility floor or unit\",\n \"Psy/Sub\",\n \"Yes\",\n \"No\",\n 1,\n \"45 mins\",\n null,\n null,\n null,\n null,\n \"02, 11, 12, 13, 19, 22, 23, 32, 33, 34, 49, 53, 62, 71, 72\"\n ],\n [\n \"TIN\",\n \"TIN\",\n \"99307\",\n \"90833\\n90836\\n90838\",\n \"99356\\n99357\",\n \"90785\",\n null,\n null,\n \"Subsequent nursing facility care, per day, for the evaluation and management of a patient, 10 minutes at the bedside and on the patient'\''s facility floor or unit\",\n \"Psy/Sub\",\n \"Yes\",\n \"No\",\n 1,\n \"10 mins\",\n null,\n null,\n null,\n null,\n \"02, 11, 12, 13, 19, 22, 23, 32, 33, 34, 49, 53, 62, 71, 72\"\n ],\n [\n \"TIN\",\n \"TIN\",\n \"99308\",\n \"90833\\n90836\\n90838\",\n \"99356\\n99357\",\n \"90785\",\n null,\n null,\n \"Subsequent nursing facility care, per day, for the evaluation and management of a patient, 15 minutes at the bedside and on the patient'\''s facility floor or unit\",\n \"Psy/Sub\",\n \"Yes\",\n \"No\",\n 1,\n \"15 mins\",\n null,\n null,\n null,\n null,\n \"02, 11, 12, 13, 19, 22, 23, 32, 33, 34, 49, 53, 62, 71, 72\"\n ],\n [\n \"TIN\",\n \"TIN\",\n \"99309\",\n \"90833\\n90836\\n90838\",\n \"99356\\n99357\",\n \"90785\",\n null,\n null,\n \"Subsequent nursing facility care, per day, for the evaluation and management of a patient, 25 minutes at the bedside and on the patient'\''s facility floor or unit\",\n \"Psy/Sub\",\n \"Yes\",\n \"No\",\n 1,\n \"25 mins\",\n null,\n null,\n null,\n null,\n \"02, 11, 12, 13, 19, 22, 23, 32, 33, 34, 49, 53, 62, 71, 72\"\n ],\n [\n \"TIN\",\n \"TIN\",\n \"99310\",\n \"90833\\n90836\\n90838\",\n \"99356\\n99357\",\n \"90785\",\n null,\n null,\n \"Subsequent nursing facility care, per day, for the evaluation and management of a patient, 35 minutes at the bedside and on the patient'\''s facility floor or unit\",\n \"Psy/Sub\",\n \"Yes\",\n \"No\",\n 1,\n \"35 mins\",\n null,\n null,\n null,\n null,\n \"02, 11, 12, 13, 19, 22, 23, 32, 33, 34, 49, 53, 62, 71, 72\"\n ],\n [\n \"PEC\",\n \"PEC\",\n \"90870\",\n \"N/A\",\n \"N/A\",\n null,\n null,\n null,\n \"Electroconvulsive Therapy, Single Seizure - Professional\",\n \"Psy\",\n \"Yes\",\n \"No\",\n 1,\n \"Per Visit\",\n null,\n null,\n null,\n null,\n \"11, 19, 21, 22, 51, 52, 53, 56\"\n ],\n [\n \"PAN\",\n \"PAN\",\n \"00104\",\n \"N/A\",\n \"N/A\",\n null,\n null,\n null,\n \"Anesthesia for ECT\",\n \"Psy\",\n \"Yes\",\n \"No\",\n 1,\n \"Per Visit\",\n null,\n null,\n null,\n null,\n \"11, 19, 21, 22, 51, 52, 53, 56\"\n ],\n [\n \"POH\",\n \"POH\",\n \"0901\",\n \"N/A\",\n \"N/A\",\n null,\n null,\n null,\n \"Inpatient/Outpatient Facility Fee for Electroconvulsive Therapy - Facility\",\n \"Psy\",\n \"Yes\",\n \"No\",\n 1,\n \"Per Diem\",\n null,\n null,\n null,\n null,\n \"11, 19, 21, 22, 51, 52, 53, 56\"\n ]\n ]\n }\n ],\n \"notes\": \"Fields not explicitly present in the text were set to NULL as required. Multi-line CPT add-on codes and modifiers were preserved with newline separation where they appeared stacked in the source.\"\n}\n\nMapping info:\n[\n {\n \"DB Field Name\": \"MAPSET\",\n \"Description\": \"Mapping Set Code\",\n \"Function\": \"The mapset field allows each contract to have different mappings of service classes that are unique.\",\n \"Mapping Notes\": \"this is not listed in MSAG document. Use a default value of TST for testing, or alternatively prompt the user to provide the value. (future state we will need a mechanism to create/use an existing mapset value)\",\n \"Document field name\": \"Internal field (see Mapping Notes)\"\n },\n {\n \"DB Field Name\": \"SVCCLS\",\n \"Description\": \"Service Class\",\n \"Function\": \"To group service code together so that they may be reimbursed using the same authorization.\",\n \"Mapping Notes\": \"each row on the MSAG will be loaded twice, one with the AUTH CLASS (Or CONNECTS AUTH CLASS) value and one with the BENEFIT CLASS (Or CONNECTS BENEFIT CLASS) value. \",\n \"Document field name\": \"AUTH CLASS (Or CONNECTS AUTH CLASS) or BENEFIT CLASS(Or CONNECTS BENEFIT CLASS) (see Mapping Notes)\"\n },\n {\n \"DB Field Name\": \"LVLVAL\",\n \"Description\": \"Level Value\",\n \"Function\": \"This field defines what the mapping is applicable to\",\n \"Mapping Notes\": \"For the record with the AUTH CLASS (Or CONNECTS AUTH CLASS), this should be 2, for the BENEFIT CLASS(Or CONNECTS BENEFIT CLASS) it should be 1\",\n \"Document field name\": \"Internal field (see Mapping Notes)\"\n },\n {\n \"DB Field Name\": \"RECSEQ\",\n \"Description\": \"RECORD SEQUENCE NUMBER\",\n \"Function\": \"The record sequence field contains a unique number for each possible mapping of a diagnosis class to a given diagnosis range (low to high).\",\n \"Mapping Notes\": \"As each record is added for a unique combo of MAPSET, SVCCLS, and LVLVAL, this field will need to start at 1 for the first record and increment by 1 with each record added\",\n \"Document field name\": \"Internal field (see Mapping Notes)\"\n },\n {\n \"DB Field Name\": \"EFFDAT\",\n \"Description\": \"Effective Date\",\n \"Function\": \"Effective Date of the service class\",\n \"Mapping Notes\": \"unless an effective date is included in the documents, or stated in the request, populate this with 0. When a date is provided, it should be populated in CYYMMDD format (e.g. 1/1/2025 will be stored as 2250101)\",\n \"Document field name\": \"Internal field (see Mapping Notes)\"\n },\n {\n \"DB Field Name\": \"EXPDAT\",\n \"Description\": \"Expiration Date\",\n \"Function\": \"Expiration Date of the service class\",\n \"Mapping Notes\": \"unless an expiration date is included in the documents, or stated in the request, populate this with 9999999. When a date is provided, it should be populated in CYYMMDD format (e.g. 1/1/2025 will be stored as 2250101)\",\n \"Document field name\": \"Internal field (see Mapping Notes)\"\n },\n {\n \"DB Field Name\": \"DESCRP\",\n \"Description\": \"REFERENCE DESCRIPTION\",\n \"Function\": \"A brief description of the mapping.\",\n \"Mapping Notes\": \"Use the \\u2018Service Type\\u2019 column. Note this is only listed once for each class of codes, but should be used for all codes in that set. (e.g. with OEF, \\u2018Acute Inpatient\\u2019 as the DESCRP for all IPF records loaded). \",\n \"Document field name\": \"Service Type\"\n },\n {\n \"DB Field Name\": \"SVCCDL\",\n \"Description\": \"Service Code LOW/FROM\",\n \"Function\": NaN,\n \"Mapping Notes\": \"Use the Rev/HCPCS/CPT value. This cannot be blank\",\n \"Document field name\": \"Rev/HCPCS/CPT\"\n },\n {\n \"DB Field Name\": \"MODCDL\",\n \"Description\": \"Modifier Code LOW/FROM\",\n \"Function\": NaN,\n \"Mapping Notes\": \"Use MODIFIER 1 value. This may be blank\",\n \"Document field name\": \"MODIFIER 1\"\n },\n {\n \"DB Field Name\": \"MODCL2\",\n \"Description\": \"MOD CODE LOW/FROM #2\",\n \"Function\": \"MOD CODE LOW/FROM #2\",\n \"Mapping Notes\": \"Use MODIFIER 2 value. This may be blank\",\n \"Document field name\": \"MODIFIER 2\"\n },\n {\n \"DB Field Name\": \"MODCL3\",\n \"Description\": \"MOD CODE LOW/FROM #3\",\n \"Function\": \"MOD CODE LOW/FROM #3\",\n \"Mapping Notes\": \"Use MODIFIER 3 value. This may be blank\",\n \"Document field name\": \"MODIFIER 3\"\n },\n {\n \"DB Field Name\": \"MODCL4\",\n \"Description\": \"MOD CODE LOW/FROM #4\",\n \"Function\": \"MOD CODE LOW/FROM #4\",\n \"Mapping Notes\": \"Use MODIFIER 4 value. This may be blank\",\n \"Document field name\": \"MODIFIER 4\"\n },\n {\n \"DB Field Name\": \"SVCCDH\",\n \"Description\": \"SVC CODE HIGHT/TO\",\n \"Function\": \"SVC CODE HIGHT/TO\",\n \"Mapping Notes\": \"Use the Rev/HCPCS/CPT value. This cannot be blank\",\n \"Document field name\": \"Rev/HCPCS/CPT\"\n },\n {\n \"DB Field Name\": \"MODCDH\",\n \"Description\": \"MOD CODE HIGHT/TO\",\n \"Function\": \"MOD CODE HIGHT/TO\",\n \"Mapping Notes\": \"Use MODIFIER 1 value. This may be blank\",\n \"Document field name\": \"MODIFIER 1\"\n },\n {\n \"DB Field Name\": \"MODCH2\",\n \"Description\": \"MOD CODE HIGH/TO #2\",\n \"Function\": \"MOD CODE HIGH/TO #2\",\n \"Mapping Notes\": \"Use MODIFIER 2 value. This may be blank\",\n \"Document field name\": \"MODIFIER 2\"\n },\n {\n \"DB Field Name\": \"MODCH3\",\n \"Description\": \"MOD CODE HIGH/TO #3\",\n \"Function\": \"MOD CODE HIGH/TO #3\",\n \"Mapping Notes\": \"Use MODIFIER 3 value. This may be blank\",\n \"Document field name\": \"MODIFIER 3\"\n },\n {\n \"DB Field Name\": \"MODCH4\",\n \"Description\": \"MOD CODE HIGH/TO #4\",\n \"Function\": \"MOD CODE HIGH/TO #4\",\n \"Mapping Notes\": \"Use MODIFIER 4 value. This may be blank\",\n \"Document field name\": \"MODIFIER 4\"\n },\n {\n \"DB Field Name\": \"TYPCOD\",\n \"Description\": \"Type of Service Code\",\n \"Function\": NaN,\n \"Mapping Notes\": \"Ideally, we would pull this value from SVCMAS for the service code. Absent that, let\\u2019s use some simplified values for testing, with the following rules:\\na.\\tIf the length of the service code is less than 5 characters, use RC\\nb.\\tIf the length is 5 or more characters and it starts with a letter, use HC\\nc.\\tAny other codes, use CP\",\n \"Document field name\": \"Internal field (see Mapping Notes)\"\n },\n {\n \"DB Field Name\": \"CLMTYP\",\n \"Description\": \"Claim Type Code\",\n \"Function\": \"Used to group claims by type and to segregate services for fee schedules and claims processing.\",\n \"Mapping Notes\": \"leave this value blank for all records\",\n \"Document field name\": \"Internal field (see Mapping Notes)\"\n },\n {\n \"DB Field Name\": \"ATHEFF\",\n \"Description\": \"Auth Effective Days\",\n \"Function\": \"The number of days prior to the EFFDAT in ADTMAS that services will be allowed for auth if match all other existing criteria\",\n \"Mapping Notes\": \"For testing, we can set this to 0 (this is not generally used since parity)\",\n \"Document field name\": \"Internal field (see Mapping Notes)\"\n },\n {\n \"DB Field Name\": \"ATHEXP\",\n \"Description\": \"Auth Expiration Days\",\n \"Function\": \"The number of days post the EXPDAT in ADTMAS that services will be allowed for auth if match all other existing criteria\",\n \"Mapping Notes\": \"For testing, we can set this to 0 (this is not generally used since parity)\",\n \"Document field name\": \"Internal field (see Mapping Notes)\"\n },\n {\n \"DB Field Name\": \"SYSDAT\",\n \"Description\": \"System Add Date\",\n \"Function\": \"The date the record was entered into the system.\",\n \"Mapping Notes\": \"populate with the current date in CYYMMDD format (i.e. 1/1/2025 will be stored as 2250101)\",\n \"Document field name\": \"Internal field (see Mapping Notes)\"\n },\n {\n \"DB Field Name\": \"USERAD\",\n \"Description\": \"User ID of person who added record\",\n \"Function\": \"To indentify user who added record.\",\n \"Mapping Notes\": \"populate with a unique value for this process, for testing use a default of BENAGENT\",\n \"Document field name\": \"Internal field (see Mapping Notes)\"\n },\n {\n \"DB Field Name\": \"LSTCHG\",\n \"Description\": \"Last Change Date\",\n \"Function\": \"This is the date the record was last changed in the system.\",\n \"Mapping Notes\": \"populate with the current date in CYYMMDD format (i.e. 1/1/2025 will be stored as 2250101)\",\n \"Document field name\": \"Internal field (see Mapping Notes)\"\n },\n {\n \"DB Field Name\": \"USERID\",\n \"Description\": \"Last User to Change Record\",\n \"Function\": \"This is the ID of the user who last modified the record in the system.\",\n \"Mapping Notes\": \"populate with a unique value for this process, for testing use a default of BENAGENT\",\n \"Document field name\": \"Internal field (see Mapping Notes)\"\n },\n {\n \"DB Field Name\": \"SCLMASUNQ\",\n \"Description\": \"Record Uniqueness\",\n \"Function\": \"Used in MHS record locking\",\n \"Mapping Notes\": \"use a 24hr timestamp to create up to an 8-digit number (e.g. 2:34:42:15pm will be stored as 14344215)\",\n \"Document field name\": \"Internal field (see Mapping Notes)\"\n },\n {\n \"DB Field Name\": \"SCLMASSQR\",\n \"Description\": \"Record Sequence\",\n \"Function\": \"Used in MHS record locking\",\n \"Mapping Notes\": \"populate this with 0 for all added records. \",\n \"Document field name\": \"Internal field (see Mapping Notes)\"\n },\n {\n \"DB Field Name\": \"MCDIND\",\n \"Description\": \"MEDICAID ONLY SERVICE IND\",\n \"Function\": \"Medicaid only service indicator\",\n \"Mapping Notes\": \"for testing, leave this blank (future state \\u2013 this will only be applicable to \\u2018Duals\\u2019 plans)\",\n \"Document field name\": \"Internal field (see Mapping Notes)\"\n },\n {\n \"DB Field Name\": \"HOLIND\",\n \"Description\": \"HIGHER-OF LOGIC INDICATOR\",\n \"Function\": \"Higher-of logic indicator\",\n \"Mapping Notes\": \"for testing, leave this blank (future state \\u2013 this will only be applicable to \\u2018Duals\\u2019 plans)\",\n \"Document field name\": \"Internal field (see Mapping Notes)\"\n }\n]\n" } ] }'""",
"Extracted tabular data from LLM Response for page - 1",
'{ "columns": [ "MAPSET", "SVCCLS", "LVLVAL", "RECSEQ", "EFFDAT", "EXPDAT", "DESCRP", "SVCCDL", "MODCDL", "MODCL2", "MODCL3", "MODCL4", "SVCCDH", "MODCDH", "MODCH2", "MODCH3", "MODCH4", "TYPCOD", "CLMTYP", "ATHEFF", "ATHEXP", "SYSDAT", "USERAD", "LSTCHG", "USERID", "SCLMASUNQ", "SCLMASSQR", "MCDIND", "HOLIND" ], "values": [ ["TST","IPF",2,1,0,9999999,"Acute Inpatient","0100","","",null,null,"0100","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",1,1,0,9999999,"Acute Inpatient","0100","","",null,null,"0100","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",2,2,0,9999999,"Acute Inpatient","0113","","",null,null,"0113","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",1,2,0,9999999,"Acute Inpatient","0113","","",null,null,"0113","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",2,3,0,9999999,"Acute Inpatient","0114","","",null,null,"0114","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",1,3,0,9999999,"Acute Inpatient","0114","","",null,null,"0114","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",2,4,0,9999999,"Acute Inpatient","0123","","",null,null,"0123","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",1,4,0,9999999,"Acute Inpatient","0123","","",null,null,"0123","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",2,5,0,9999999,"Acute Inpatient","0124","","",null,null,"0124","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",1,5,0,9999999,"Acute Inpatient","0124","","",null,null,"0124","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",2,6,0,9999999,"Acute Inpatient","0133","","",null,null,"0133","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",1,6,0,9999999,"Acute Inpatient","0133","","",null,null,"0133","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",2,7,0,9999999,"Acute Inpatient","0134","","",null,null,"0134","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",1,7,0,9999999,"Acute Inpatient","0134","","",null,null,"0134","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",2,8,0,9999999,"Acute Inpatient","0143","","",null,null,"0143","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",1,8,0,9999999,"Acute Inpatient","0143","","",null,null,"0143","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",2,9,0,9999999,"Acute Inpatient","0144","","",null,null,"0144","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",1,9,0,9999999,"Acute Inpatient","0144","","",null,null,"0144","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",2,10,0,9999999,"Acute Inpatient","0153","","",null,null,"0153","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",1,10,0,9999999,"Acute Inpatient","0153","","",null,null,"0153","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",2,11,0,9999999,"Acute Inpatient","0154","","",null,null,"0154","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",1,11,0,9999999,"Acute Inpatient","0154","","",null,null,"0154","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",2,12,0,9999999,"Acute Inpatient","0203","","",null,null,"0203","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",1,12,0,9999999,"Acute Inpatient","0203","","",null,null,"0203","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",2,13,0,9999999,"Acute Inpatient","0204","","",null,null,"0204","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",1,13,0,9999999,"Acute Inpatient","0204","","",null,null,"0204","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",2,14,0,9999999,"Acute Inpatient","0118","","",null,null,"0118","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",1,14,0,9999999,"Acute Inpatient","0118","","",null,null,"0118","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",2,15,0,9999999,"Acute Inpatient","0128","","",null,null,"0128","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",1,15,0,9999999,"Acute Inpatient","0128","","",null,null,"0128","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",2,16,0,9999999,"Acute Inpatient","0138","","",null,null,"0138","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",1,16,0,9999999,"Acute Inpatient","0138","","",null,null,"0138","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",2,17,0,9999999,"Acute Inpatient","0148","","",null,null,"0148","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",1,17,0,9999999,"Acute Inpatient","0148","","",null,null,"0148","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",2,18,0,9999999,"Acute Inpatient","0158","","",null,null,"0158","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",1,18,0,9999999,"Acute Inpatient","0158","","",null,null,"0158","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",2,19,0,9999999,"Acute Inpatient","0190","","",null,null,"0190","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",1,19,0,9999999,"Acute Inpatient","0190","","",null,null,"0190","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",2,20,0,9999999,"Acute Inpatient","0191","","",null,null,"0191","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",1,20,0,9999999,"Acute Inpatient","0191","","",null,null,"0191","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",2,21,0,9999999,"Acute Inpatient","0192","","",null,null,"0192","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",1,21,0,9999999,"Acute Inpatient","0192","","",null,null,"0192","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",2,22,0,9999999,"Acute Inpatient","0193","","",null,null,"0193","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",1,22,0,9999999,"Acute Inpatient","0193","","",null,null,"0193","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",2,23,0,9999999,"Acute Inpatient","0194","","",null,null,"0194","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",1,23,0,9999999,"Acute Inpatient","0194","","",null,null,"0194","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",2,24,0,9999999,"Acute Inpatient","H0008","","",null,null,"H0008","","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",1,24,0,9999999,"Acute Inpatient","H0008","","",null,null,"H0008","","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IDF",2,1,0,9999999,"Inpatient Detox","0116","","",null,null,"0116","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IDF",1,1,0,9999999,"Inpatient Detox","0116","","",null,null,"0116","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IDF",2,2,0,9999999,"Inpatient Detox","0126","","",null,null,"0126","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IDF",1,2,0,9999999,"Inpatient Detox","0126","","",null,null,"0126","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IDF",2,3,0,9999999,"Inpatient Detox","0136","","",null,null,"0136","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IDF",1,3,0,9999999,"Inpatient Detox","0136","","",null,null,"0136","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IDF",2,4,0,9999999,"Inpatient Detox","0146","","",null,null,"0146","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IDF",1,4,0,9999999,"Inpatient Detox","0146","","",null,null,"0146","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IDF",2,5,0,9999999,"Inpatient Detox","0156","","",null,null,"0156","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IDF",1,5,0,9999999,"Inpatient Detox","0156","","",null,null,"0156","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IDF",2,6,0,9999999,"Inpatient Detox","H0009","","",null,null,"H0009","","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IDF",1,6,0,9999999,"Inpatient Detox","H0009","","",null,null,"H0009","","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IDF",2,7,0,9999999,"Inpatient Detox","H0011","","",null,null,"H0011","","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IDF",1,7,0,9999999,"Inpatient Detox","H0011","","",null,null,"H0011","","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","RTC",2,1,0,9999999,"Residential Treatment","1001","","",null,null,"1001","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","RTC",1,1,0,9999999,"Residential Treatment","1001","","",null,null,"1001","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","RTC",2,2,0,9999999,"Residential Treatment","H0017","","",null,null,"H0017","","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","RTC",1,2,0,9999999,"Residential Treatment","H0017","","",null,null,"H0017","","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","RTC",2,3,0,9999999,"Residential Treatment","H0018","","",null,null,"H0018","","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","RTC",1,3,0,9999999,"Residential Treatment","H0018","","",null,null,"H0018","","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","RTC",2,4,0,9999999,"Residential Treatment","1002","","",null,null,"1002","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","RTC",1,4,0,9999999,"Residential Treatment","1002","","",null,null,"1002","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","RTC",2,5,0,9999999,"Residential Treatment","H0010","","",null,null,"H0010","","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","RTC",1,5,0,9999999,"Residential Treatment","H0010","","",null,null,"H0010","","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","TBD",2,1,0,9999999,"23 Hr. Bed","0760","","",null,null,"0760","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","TBD",1,1,0,9999999,"23 Hr. Bed","0760","","",null,null,"0760","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","TBD",2,2,0,9999999,"23 Hr. Bed","0761","","",null,null,"0761","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","TBD",1,2,0,9999999,"23 Hr. Bed","0761","","",null,null,"0761","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","TBD",2,3,0,9999999,"23 Hr. Bed","0762","","",null,null,"0762","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","TBD",1,3,0,9999999,"23 Hr. Bed","0762","","",null,null,"0762","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","TBD",2,4,0,9999999,"23 Hr. Bed","H0046","TG","",null,null,"H0046","TG","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","TBD",1,4,0,9999999,"23 Hr. Bed","H0046","TG","",null,null,"H0046","TG","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","SBD",2,1,0,9999999,"72 Hr. Bed","0769","","",null,null,"0769","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","SBD",1,1,0,9999999,"72 Hr. Bed","0769","","",null,null,"0769","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","OPD",2,1,0,9999999,"Outpatient Detox","0944","","",null,null,"0944","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","OPD",1,1,0,9999999,"Outpatient Detox","0944","","",null,null,"0944","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","OPD",2,2,0,9999999,"Outpatient Detox","0945","","",null,null,"0945","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","OPD",1,2,0,9999999,"Outpatient Detox","0945","","",null,null,"0945","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","OPD",2,3,0,9999999,"Outpatient Detox","H0014","","",null,null,"H0014","","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","OPD",1,3,0,9999999,"Outpatient Detox","H0014","","",null,null,"H0014","","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","OPD",2,4,0,9999999,"Outpatient Detox","H0014","GT","",null,null,"H0014","GT","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","OPD",1,4,0,9999999,"Outpatient Detox","H0014","GT","",null,null,"H0014","GT","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","CIN",2,1,0,9999999,"Crisis Intervention","0919","","",null,null,"0919","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","CIN",1,1,0,9999999,"Crisis Intervention","0919","","",null,null,"0919","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","CIN",2,2,0,9999999,"Crisis Intervention","H0007","","",null,null,"H0007","","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","CIN",1,2,0,9999999,"Crisis Intervention","H0007","","",null,null,"H0007","","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","CIN",2,3,0,9999999,"Crisis Intervention","S9485","99051","",null,null,"S9485","99051","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","CIN",1,3,0,9999999,"Crisis Intervention","S9485","99051","",null,null,"S9485","99051","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","PHP",2,1,0,9999999,"Partial Hospitalization","0907","","",null,null,"0907","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","PHP",1,1,0,9999999,"Partial Hospitalization","0907","","",null,null,"0907","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","PHP",2,2,0,9999999,"Partial Hospitalization","0912","","",null,null,"0912","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","PHP",1,2,0,9999999,"Partial Hospitalization","0912","","",null,null,"0912","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","PHP",2,3,0,9999999,"Partial Hospitalization","0913","","",null,null,"0913","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","PHP",1,3,0,9999999,"Partial Hospitalization","0913","","",null,null,"0913","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","PHP",2,4,0,9999999,"Partial Hospitalization","H0035","","",null,null,"H0035","","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","PHP",1,4,0,9999999,"Partial Hospitalization","H0035","","",null,null,"H0035","","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","SOP",2,1,0,9999999,"Intensive Outpatient Program (IOP)","0900","","",null,null,"0900","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","SOP",1,1,0,9999999,"Intensive Outpatient Program (IOP)","0900","","",null,null,"0900","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","SOP",2,2,0,9999999,"Intensive Outpatient Program (IOP)","0906","","",null,null,"0906","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","SOP",1,2,0,9999999,"Intensive Outpatient Program (IOP)","0906","","",null,null,"0906","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","SOP",2,3,0,9999999,"Intensive Outpatient Program (IOP)","H0015","","",null,null,"H0015","","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","SOP",1,3,0,9999999,"Intensive Outpatient Program (IOP)","H0015","","",null,null,"H0015","","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","SOP",2,4,0,9999999,"Intensive Outpatient Program (IOP)","0905","","",null,null,"0905","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IOP",1,1,0,9999999,"Intensive Outpatient Program (IOP)","0905","","",null,null,"0905","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","SOP",2,5,0,9999999,"Intensive Outpatient Program (IOP)","S9480","","",null,null,"S9480","","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IOP",1,2,0,9999999,"Intensive Outpatient Program (IOP)","S9480","","",null,null,"S9480","","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","TIN",2,1,0,9999999,"Initial Evaluation","90791","","",null,null,"90791","","",null,null,"CP","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","EV1",1,1,0,9999999,"Initial Evaluation","90791","","",null,null,"90791","","",null,null,"CP","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","TIN",2,2,0,9999999,"Initial Evaluation","90791","GT","",null,null,"90791","GT","",null,null,"CP","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","EV1",1,2,0,9999999,"Initial Evaluation","90791","GT","",null,null,"90791","GT","",null,null,"CP","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","TIN",2,3,0,9999999,"Initial Evaluation","90792","","",null,null,"90792","","",null,null,"CP","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","EV1",1,3,0,9999999,"Initial Evaluation","90792","","",null,null,"90792","","",null,null,"CP","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","TIN",2,4,0,9999999,"Initial Evaluation","90792","GT","",null,null,"90792","GT","",null,null,"CP","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","EV1",1,4,0,9999999,"Initial Evaluation","90792","GT","",null,null,"90792","GT","",null,null,"CP","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""] ]}',
"Data Extraction completed for page - 1",
"Total Number of records for page 1: 131",
"Applying mapping rules to transform data for page - 2",
"Sending request to Horizon API to transform data using LLM",
"""curl --location --request POST 'https://api.horizon.elevancehealth.com/v2/text/chats?qos=accurate&preview=true' \ --header 'Authorization: Bearer bVsv6kd2hT6kLJkftgneUoE3xR7fhCv8' \ --header 'Content-Type: application/json' \ --data-raw '{ "messages": [ { "role": "system", "content": "You are a business analyst assistant that helps in going over the structured data in the pdf document and indentify the required values from the mapping document provided.You will be given the json data extracted from the document and the mapping information from the excel sheet.Your task is to generate a valid JSON object based on the mapping information and the json data provided.Use only the data that you can identify from the json representation of the pdf and for the mapping columns for which you can find a value in the json data.For the mapping columns for which you are not able to find the value, provide a NULL value for them in the entry." }, { "role": "user", "content": "You are a helpful assistant. Given the following JSON data and mapping information, generate a valid JSON object.\n\nInstructions:\n- Use '\''db field name'\'' as the SQL column name.\n- Use '\''Mapping Notes'\'' to find the value in the JSON.\n- If '\''Mapping Notes'\'' includes a transformation, apply it to the JSON value before inserting.\n- Extract the values based on the functional understanding.\n- Only include fields that have a mapping.\n- Return the result as a JSON object with keys: '\''columns'\'' and '\''values'\''.\n- If any field is N/A, then please treat it as a blank field.\n- If you are not able to find any value for a field in the document or generate it using the mapping rules, then please set it to NULL.\n- Do not include any explanation or extra text.\n- Respect the format of values exactly as they appear. For compound values like '\''9832 CL'\'', treat the entire string as a single entity unless there are explicit separators like semicolons (;) or commas (,) between distinct values. For example, '\''9832 CL;9888'\'' should be treated as two separate values ('\''9832 CL'\'' and '\''9888'\''), but '\''9832 CL'\'' by itself should never be split into '\''9832'\'' and '\''CL'\''.\n- Only extract values directly from the specified columns in the table structure. Do not attempt to parse or interpret the content within a text field to extract additional information. If a column contains a paragraph or block of text, use the entire text as the value without trying to extract specific information from within it.\n- Ensure the output is a well-formed, syntactically valid JSON object. Check that all brackets, quotation marks, and commas are correctly placed. The JSON must be parseable by standard JSON parsers without any modifications. Do not include any text or explanations outside of the JSON structure itself.\n- If you are not able to find any record that matches the conditions from the page, then send out an empty array for that page instead of sending one record with the just the rows with default values\n\n- When no matching records are found on a page, return an empty array (e.g., `[]`) rather than creating placeholder records with default or NULL values. This ensures accurate data representation by not introducing artificial records when none exist in the source material.\nJSON data:\n{\n \"tables\": [\n {\n \"columns\": [\n \"Authorization\",\n \"AUTH CLASS\",\n \"Rev/ HCPCS/ CPT\",\n \"MODIFIER 1\",\n \"MODIFIER 2\",\n \"MODIFIER 3\",\n \"MODIFIER 4\",\n \"Add On Codes\",\n \"DESCRIPTION\",\n \"Coverable Dx Category\",\n \"Auth Req'\''d\",\n \"IE Max Units\",\n \"Unit Value\",\n \"Psych Claim Type (Connects)\",\n \"SA Claim Type (Connects)\",\n \"Dual Dx Claim Type (Connects)\",\n \"Claim Type (Connects)\",\n \"Place of Service\"\n ],\n \"rows\": [\n [\n \"TCN\",\n \"TCN\",\n \"99231\",\n \"90833\\n90836\\n90838\",\n \"99356\\n99357\",\n \"90785\",\n null,\n null,\n \"Subsequent hospital care, per day, for the evaluation and management of a patient (15 minutes)\",\n \"Psy/Sub\",\n \"Yes\",\n \"No\",\n 1,\n \"15 mins\",\n null,\n null,\n null,\n null,\n \"02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99\"\n ],\n [\n \"TCN\",\n \"TCN\",\n \"99232\",\n \"90833\\n90836\\n90838\",\n \"99356\\n99357\",\n \"90785\",\n null,\n null,\n \"Subsequent hospital care, per day, for the evaluation and management of a patient (25 minutes)\",\n \"Psy/Sub\",\n \"Yes\",\n \"No\",\n 1,\n \"25 mins\",\n null,\n null,\n null,\n null,\n \"02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99\"\n ],\n [\n \"TCN\",\n \"TCN\",\n \"99233\",\n \"90833\\n90836\\n90838\",\n \"99356\\n99357\",\n \"90785\",\n null,\n null,\n \"Subsequent hospital care, per day, for the evaluation and management of a patient (35 minutes)\",\n \"Psy/Sub\",\n \"Yes\",\n \"No\",\n 1,\n \"35 mins\",\n null,\n null,\n null,\n null,\n \"02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99\"\n ],\n [\n \"TCN\",\n \"TCN\",\n \"99238\",\n \"90833\\n90836\\n90838\",\n \"99356\\n99357\",\n \"90785\",\n null,\n null,\n \"Hospital discharge day management; 30 minutes or less\",\n \"Psy/Sub\",\n \"Yes\",\n \"No\",\n 1,\n \"< 30 mins\",\n null,\n null,\n null,\n null,\n \"02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99\"\n ],\n [\n \"TCN\",\n \"TCN\",\n \"99251\",\n \"90833\\n90836\\n90838\",\n \"99356\\n99357\",\n \"90785\",\n null,\n null,\n \"Inpatient consultation for a new or established patient, 20 minutes\",\n \"Psy/Sub\",\n \"Yes\",\n \"No\",\n 1,\n \"20 mins\",\n null,\n null,\n null,\n null,\n \"02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99\"\n ],\n [\n \"TCN\",\n \"TCN\",\n \"99252\",\n \"90833\\n90836\\n90838\",\n \"99356\\n99357\",\n \"90785\",\n null,\n null,\n \"Inpatient consultation for a new or established patient, 40 minutes\",\n \"Psy/Sub\",\n \"Yes\",\n \"No\",\n 1,\n \"40 mins\",\n null,\n null,\n null,\n null,\n \"02, 14, 21, 23, 31, 51, 52, 55, 56, 57, 61, 99\"\n ],\n [\n \"TIN\",\n \"LHV\",\n \"99239\",\n \"90833\\n90836\\n90838\",\n \"90785\",\n null,\n null,\n null,\n \"Hospital discharge day management; more than 30 minutes\",\n \"Psy/Sub\",\n \"Yes\",\n \"No\",\n 1,\n \"30+ mins\",\n null,\n null,\n null,\n null,\n \"02, 14, 21, 31, 51, 52, 55, 56, 57, 61, 99\"\n ],\n [\n \"TIN\",\n \"LHV\",\n \"99253\",\n \"90833\\n90836\\n90838\",\n \"90785\",\n null,\n null,\n null,\n \"Inpatient consultation for a new or established patient, 55 minutes\",\n \"Psy/Sub\",\n \"Yes\",\n \"No\",\n 1,\n \"55 mins\",\n null,\n null,\n null,\n null,\n \"02, 14, 21, 31, 51, 52, 55, 56, 57, 61, 99\"\n ],\n [\n \"TIN\",\n \"TIN\",\n \"99304\",\n \"90833\\n90836\\n90838\",\n \"99356\\n99357\",\n \"90785\",\n null,\n null,\n \"Initial nursing facility care, per day, for the evaluation and management of a patient, 25 minutes at the bedside and on the patient'\''s facility floor or unit\",\n \"Psy/Sub\",\n \"Yes\",\n \"No\",\n 1,\n \"25 mins\",\n null,\n null,\n null,\n null,\n \"02, 11, 12, 13, 19, 22, 23, 32, 33, 34, 49, 53, 62, 71, 72\"\n ],\n [\n \"TIN\",\n \"TIN\",\n \"99305\",\n \"90833\\n90836\\n90838\",\n \"99356\\n99357\",\n \"90785\",\n null,\n null,\n \"Initial nursing facility care, per day, for the evaluation and management of a patient, 35 minutes at the bedside and on the patient'\''s facility floor or unit\",\n \"Psy/Sub\",\n \"Yes\",\n \"No\",\n 1,\n \"35 mins\",\n null,\n null,\n null,\n null,\n \"02, 11, 12, 13, 19, 22, 23, 32, 33, 34, 49, 53, 62, 71, 72\"\n ],\n [\n \"TIN\",\n \"TIN\",\n \"99306\",\n \"90833\\n90836\\n90838\",\n \"99356\\n99357\",\n \"90785\",\n null,\n null,\n \"Initial nursing facility care, per day, for the evaluation and management of a patient, 45 minutes at the bedside and on the patient'\''s facility floor or unit\",\n \"Psy/Sub\",\n \"Yes\",\n \"No\",\n 1,\n \"45 mins\",\n null,\n null,\n null,\n null,\n \"02, 11, 12, 13, 19, 22, 23, 32, 33, 34, 49, 53, 62, 71, 72\"\n ],\n [\n \"TIN\",\n \"TIN\",\n \"99307\",\n \"90833\\n90836\\n90838\",\n \"99356\\n99357\",\n \"90785\",\n null,\n null,\n \"Subsequent nursing facility care, per day, for the evaluation and management of a patient, 10 minutes at the bedside and on the patient'\''s facility floor or unit\",\n \"Psy/Sub\",\n \"Yes\",\n \"No\",\n 1,\n \"10 mins\",\n null,\n null,\n null,\n null,\n \"02, 11, 12, 13, 19, 22, 23, 32, 33, 34, 49, 53, 62, 71, 72\"\n ],\n [\n \"TIN\",\n \"TIN\",\n \"99308\",\n \"90833\\n90836\\n90838\",\n \"99356\\n99357\",\n \"90785\",\n null,\n null,\n \"Subsequent nursing facility care, per day, for the evaluation and management of a patient, 15 minutes at the bedside and on the patient'\''s facility floor or unit\",\n \"Psy/Sub\",\n \"Yes\",\n \"No\",\n 1,\n \"15 mins\",\n null,\n null,\n null,\n null,\n \"02, 11, 12, 13, 19, 22, 23, 32, 33, 34, 49, 53, 62, 71, 72\"\n ],\n [\n \"TIN\",\n \"TIN\",\n \"99309\",\n \"90833\\n90836\\n90838\",\n \"99356\\n99357\",\n \"90785\",\n null,\n null,\n \"Subsequent nursing facility care, per day, for the evaluation and management of a patient, 25 minutes at the bedside and on the patient'\''s facility floor or unit\",\n \"Psy/Sub\",\n \"Yes\",\n \"No\",\n 1,\n \"25 mins\",\n null,\n null,\n null,\n null,\n \"02, 11, 12, 13, 19, 22, 23, 32, 33, 34, 49, 53, 62, 71, 72\"\n ],\n [\n \"TIN\",\n \"TIN\",\n \"99310\",\n \"90833\\n90836\\n90838\",\n \"99356\\n99357\",\n \"90785\",\n null,\n null,\n \"Subsequent nursing facility care, per day, for the evaluation and management of a patient, 35 minutes at the bedside and on the patient'\''s facility floor or unit\",\n \"Psy/Sub\",\n \"Yes\",\n \"No\",\n 1,\n \"35 mins\",\n null,\n null,\n null,\n null,\n \"02, 11, 12, 13, 19, 22, 23, 32, 33, 34, 49, 53, 62, 71, 72\"\n ],\n [\n \"PEC\",\n \"PEC\",\n \"90870\",\n \"N/A\",\n \"N/A\",\n null,\n null,\n null,\n \"Electroconvulsive Therapy, Single Seizure - Professional\",\n \"Psy\",\n \"Yes\",\n \"No\",\n 1,\n \"Per Visit\",\n null,\n null,\n null,\n null,\n \"11, 19, 21, 22, 51, 52, 53, 56\"\n ],\n [\n \"PAN\",\n \"PAN\",\n \"00104\",\n \"N/A\",\n \"N/A\",\n null,\n null,\n null,\n \"Anesthesia for ECT\",\n \"Psy\",\n \"Yes\",\n \"No\",\n 1,\n \"Per Visit\",\n null,\n null,\n null,\n null,\n \"11, 19, 21, 22, 51, 52, 53, 56\"\n ],\n [\n \"POH\",\n \"POH\",\n \"0901\",\n \"N/A\",\n \"N/A\",\n null,\n null,\n null,\n \"Inpatient/Outpatient Facility Fee for Electroconvulsive Therapy - Facility\",\n \"Psy\",\n \"Yes\",\n \"No\",\n 1,\n \"Per Diem\",\n null,\n null,\n null,\n null,\n \"11, 19, 21, 22, 51, 52, 53, 56\"\n ]\n ]\n }\n ],\n \"notes\": \"Fields not explicitly present in the text were set to NULL as required. Multi-line CPT add-on codes and modifiers were preserved with newline separation where they appeared stacked in the source.\"\n}\n\nMapping info:\n[\n {\n \"DB Field Name\": \"MAPSET\",\n \"Description\": \"Mapping Set Code\",\n \"Function\": \"The mapset field allows each contract to have different mappings of service classes that are unique.\",\n \"Mapping Notes\": \"this is not listed in MSAG document. Use a default value of TST for testing, or alternatively prompt the user to provide the value. (future state we will need a mechanism to create/use an existing mapset value)\",\n \"Document field name\": \"Internal field (see Mapping Notes)\"\n },\n {\n \"DB Field Name\": \"SVCCLS\",\n \"Description\": \"Service Class\",\n \"Function\": \"To group service code together so that they may be reimbursed using the same authorization.\",\n \"Mapping Notes\": \"each row on the MSAG will be loaded twice, one with the AUTH CLASS (Or CONNECTS AUTH CLASS) value and one with the BENEFIT CLASS (Or CONNECTS BENEFIT CLASS) value. \",\n \"Document field name\": \"AUTH CLASS (Or CONNECTS AUTH CLASS) or BENEFIT CLASS(Or CONNECTS BENEFIT CLASS) (see Mapping Notes)\"\n },\n {\n \"DB Field Name\": \"LVLVAL\",\n \"Description\": \"Level Value\",\n \"Function\": \"This field defines what the mapping is applicable to\",\n \"Mapping Notes\": \"For the record with the AUTH CLASS (Or CONNECTS AUTH CLASS), this should be 2, for the BENEFIT CLASS(Or CONNECTS BENEFIT CLASS) it should be 1\",\n \"Document field name\": \"Internal field (see Mapping Notes)\"\n },\n {\n \"DB Field Name\": \"RECSEQ\",\n \"Description\": \"RECORD SEQUENCE NUMBER\",\n \"Function\": \"The record sequence field contains a unique number for each possible mapping of a diagnosis class to a given diagnosis range (low to high).\",\n \"Mapping Notes\": \"As each record is added for a unique combo of MAPSET, SVCCLS, and LVLVAL, this field will need to start at 1 for the first record and increment by 1 with each record added\",\n \"Document field name\": \"Internal field (see Mapping Notes)\"\n },\n {\n \"DB Field Name\": \"EFFDAT\",\n \"Description\": \"Effective Date\",\n \"Function\": \"Effective Date of the service class\",\n \"Mapping Notes\": \"unless an effective date is included in the documents, or stated in the request, populate this with 0. When a date is provided, it should be populated in CYYMMDD format (e.g. 1/1/2025 will be stored as 2250101)\",\n \"Document field name\": \"Internal field (see Mapping Notes)\"\n },\n {\n \"DB Field Name\": \"EXPDAT\",\n \"Description\": \"Expiration Date\",\n \"Function\": \"Expiration Date of the service class\",\n \"Mapping Notes\": \"unless an expiration date is included in the documents, or stated in the request, populate this with 9999999. When a date is provided, it should be populated in CYYMMDD format (e.g. 1/1/2025 will be stored as 2250101)\",\n \"Document field name\": \"Internal field (see Mapping Notes)\"\n },\n {\n \"DB Field Name\": \"DESCRP\",\n \"Description\": \"REFERENCE DESCRIPTION\",\n \"Function\": \"A brief description of the mapping.\",\n \"Mapping Notes\": \"Use the \\u2018Service Type\\u2019 column. Note this is only listed once for each class of codes, but should be used for all codes in that set. (e.g. with OEF, \\u2018Acute Inpatient\\u2019 as the DESCRP for all IPF records loaded). \",\n \"Document field name\": \"Service Type\"\n },\n {\n \"DB Field Name\": \"SVCCDL\",\n \"Description\": \"Service Code LOW/FROM\",\n \"Function\": NaN,\n \"Mapping Notes\": \"Use the Rev/HCPCS/CPT value. This cannot be blank\",\n \"Document field name\": \"Rev/HCPCS/CPT\"\n },\n {\n \"DB Field Name\": \"MODCDL\",\n \"Description\": \"Modifier Code LOW/FROM\",\n \"Function\": NaN,\n \"Mapping Notes\": \"Use MODIFIER 1 value. This may be blank\",\n \"Document field name\": \"MODIFIER 1\"\n },\n {\n \"DB Field Name\": \"MODCL2\",\n \"Description\": \"MOD CODE LOW/FROM #2\",\n \"Function\": \"MOD CODE LOW/FROM #2\",\n \"Mapping Notes\": \"Use MODIFIER 2 value. This may be blank\",\n \"Document field name\": \"MODIFIER 2\"\n },\n {\n \"DB Field Name\": \"MODCL3\",\n \"Description\": \"MOD CODE LOW/FROM #3\",\n \"Function\": \"MOD CODE LOW/FROM #3\",\n \"Mapping Notes\": \"Use MODIFIER 3 value. This may be blank\",\n \"Document field name\": \"MODIFIER 3\"\n },\n {\n \"DB Field Name\": \"MODCL4\",\n \"Description\": \"MOD CODE LOW/FROM #4\",\n \"Function\": \"MOD CODE LOW/FROM #4\",\n \"Mapping Notes\": \"Use MODIFIER 4 value. This may be blank\",\n \"Document field name\": \"MODIFIER 4\"\n },\n {\n \"DB Field Name\": \"SVCCDH\",\n \"Description\": \"SVC CODE HIGHT/TO\",\n \"Function\": \"SVC CODE HIGHT/TO\",\n \"Mapping Notes\": \"Use the Rev/HCPCS/CPT value. This cannot be blank\",\n \"Document field name\": \"Rev/HCPCS/CPT\"\n },\n {\n \"DB Field Name\": \"MODCDH\",\n \"Description\": \"MOD CODE HIGHT/TO\",\n \"Function\": \"MOD CODE HIGHT/TO\",\n \"Mapping Notes\": \"Use MODIFIER 1 value. This may be blank\",\n \"Document field name\": \"MODIFIER 1\"\n },\n {\n \"DB Field Name\": \"MODCH2\",\n \"Description\": \"MOD CODE HIGH/TO #2\",\n \"Function\": \"MOD CODE HIGH/TO #2\",\n \"Mapping Notes\": \"Use MODIFIER 2 value. This may be blank\",\n \"Document field name\": \"MODIFIER 2\"\n },\n {\n \"DB Field Name\": \"MODCH3\",\n \"Description\": \"MOD CODE HIGH/TO #3\",\n \"Function\": \"MOD CODE HIGH/TO #3\",\n \"Mapping Notes\": \"Use MODIFIER 3 value. This may be blank\",\n \"Document field name\": \"MODIFIER 3\"\n },\n {\n \"DB Field Name\": \"MODCH4\",\n \"Description\": \"MOD CODE HIGH/TO #4\",\n \"Function\": \"MOD CODE HIGH/TO #4\",\n \"Mapping Notes\": \"Use MODIFIER 4 value. This may be blank\",\n \"Document field name\": \"MODIFIER 4\"\n },\n {\n \"DB Field Name\": \"TYPCOD\",\n \"Description\": \"Type of Service Code\",\n \"Function\": NaN,\n \"Mapping Notes\": \"Ideally, we would pull this value from SVCMAS for the service code. Absent that, let\\u2019s use some simplified values for testing, with the following rules:\\na.\\tIf the length of the service code is less than 5 characters, use RC\\nb.\\tIf the length is 5 or more characters and it starts with a letter, use HC\\nc.\\tAny other codes, use CP\",\n \"Document field name\": \"Internal field (see Mapping Notes)\"\n },\n {\n \"DB Field Name\": \"CLMTYP\",\n \"Description\": \"Claim Type Code\",\n \"Function\": \"Used to group claims by type and to segregate services for fee schedules and claims processing.\",\n \"Mapping Notes\": \"leave this value blank for all records\",\n \"Document field name\": \"Internal field (see Mapping Notes)\"\n },\n {\n \"DB Field Name\": \"ATHEFF\",\n \"Description\": \"Auth Effective Days\",\n \"Function\": \"The number of days prior to the EFFDAT in ADTMAS that services will be allowed for auth if match all other existing criteria\",\n \"Mapping Notes\": \"For testing, we can set this to 0 (this is not generally used since parity)\",\n \"Document field name\": \"Internal field (see Mapping Notes)\"\n },\n {\n \"DB Field Name\": \"ATHEXP\",\n \"Description\": \"Auth Expiration Days\",\n \"Function\": \"The number of days post the EXPDAT in ADTMAS that services will be allowed for auth if match all other existing criteria\",\n \"Mapping Notes\": \"For testing, we can set this to 0 (this is not generally used since parity)\",\n \"Document field name\": \"Internal field (see Mapping Notes)\"\n },\n {\n \"DB Field Name\": \"SYSDAT\",\n \"Description\": \"System Add Date\",\n \"Function\": \"The date the record was entered into the system.\",\n \"Mapping Notes\": \"populate with the current date in CYYMMDD format (i.e. 1/1/2025 will be stored as 2250101)\",\n \"Document field name\": \"Internal field (see Mapping Notes)\"\n },\n {\n \"DB Field Name\": \"USERAD\",\n \"Description\": \"User ID of person who added record\",\n \"Function\": \"To indentify user who added record.\",\n \"Mapping Notes\": \"populate with a unique value for this process, for testing use a default of BENAGENT\",\n \"Document field name\": \"Internal field (see Mapping Notes)\"\n },\n {\n \"DB Field Name\": \"LSTCHG\",\n \"Description\": \"Last Change Date\",\n \"Function\": \"This is the date the record was last changed in the system.\",\n \"Mapping Notes\": \"populate with the current date in CYYMMDD format (i.e. 1/1/2025 will be stored as 2250101)\",\n \"Document field name\": \"Internal field (see Mapping Notes)\"\n },\n {\n \"DB Field Name\": \"USERID\",\n \"Description\": \"Last User to Change Record\",\n \"Function\": \"This is the ID of the user who last modified the record in the system.\",\n \"Mapping Notes\": \"populate with a unique value for this process, for testing use a default of BENAGENT\",\n \"Document field name\": \"Internal field (see Mapping Notes)\"\n },\n {\n \"DB Field Name\": \"SCLMASUNQ\",\n \"Description\": \"Record Uniqueness\",\n \"Function\": \"Used in MHS record locking\",\n \"Mapping Notes\": \"use a 24hr timestamp to create up to an 8-digit number (e.g. 2:34:42:15pm will be stored as 14344215)\",\n \"Document field name\": \"Internal field (see Mapping Notes)\"\n },\n {\n \"DB Field Name\": \"SCLMASSQR\",\n \"Description\": \"Record Sequence\",\n \"Function\": \"Used in MHS record locking\",\n \"Mapping Notes\": \"populate this with 0 for all added records. \",\n \"Document field name\": \"Internal field (see Mapping Notes)\"\n },\n {\n \"DB Field Name\": \"MCDIND\",\n \"Description\": \"MEDICAID ONLY SERVICE IND\",\n \"Function\": \"Medicaid only service indicator\",\n \"Mapping Notes\": \"for testing, leave this blank (future state \\u2013 this will only be applicable to \\u2018Duals\\u2019 plans)\",\n \"Document field name\": \"Internal field (see Mapping Notes)\"\n },\n {\n \"DB Field Name\": \"HOLIND\",\n \"Description\": \"HIGHER-OF LOGIC INDICATOR\",\n \"Function\": \"Higher-of logic indicator\",\n \"Mapping Notes\": \"for testing, leave this blank (future state \\u2013 this will only be applicable to \\u2018Duals\\u2019 plans)\",\n \"Document field name\": \"Internal field (see Mapping Notes)\"\n }\n]\n" } ] }'""",
"Extracted tabular data from LLM Response for page - 2",
'{ "columns": [ "MAPSET", "SVCCLS", "LVLVAL", "RECSEQ", "EFFDAT", "EXPDAT", "DESCRP", "SVCCDL", "MODCDL", "MODCL2", "MODCL3", "MODCL4", "SVCCDH", "MODCDH", "MODCH2", "MODCH3", "MODCH4", "TYPCOD", "CLMTYP", "ATHEFF", "ATHEXP", "SYSDAT", "USERAD", "LSTCHG", "USERID", "SCLMASUNQ", "SCLMASSQR", "MCDIND", "HOLIND" ], "values": [ ["TST", null, 2, 1, 0, 9999999, "TIN EVL", 99217, null, null, null, null, 99217, null, null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 1, 1, 0, 9999999, "TIN EVL", 99217, null, null, null, null, 99217, null, null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 2, 2, 0, 9999999, "TIN EVL", 99217, "GT", null, null, null, 99217, "GT", null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 1, 2, 0, 9999999, "TIN EVL", 99217, "GT", null, null, null, 99217, "GT", null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 2, 3, 0, 9999999, "TIN EVL", 99218, null, null, null, null, 99218, null, null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 1, 3, 0, 9999999, "TIN EVL", 99218, null, null, null, null, 99218, null, null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 2, 4, 0, 9999999, "TIN EVL", 99218, "GT", null, null, null, 99218, "GT", null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 1, 4, 0, 9999999, "TIN EVL", 99218, "GT", null, null, null, 99218, "GT", null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 2, 5, 0, 9999999, "TIN EVL", 99219, null, null, null, null, 99219, null, null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 1, 5, 0, 9999999, "TIN EVL", 99219, null, null, null, null, 99219, null, null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 2, 6, 0, 9999999, "TIN EVL", 99219, "GT", null, null, null, 99219, "GT", null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 1, 6, 0, 9999999, "TIN EVL", 99219, "GT", null, null, null, 99219, "GT", null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 2, 7, 0, 9999999, "TIN EVL", 99220, null, null, null, null, 99220, null, null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 1, 7, 0, 9999999, "TIN EVL", 99220, null, null, null, null, 99220, null, null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 2, 8, 0, 9999999, "TIN EVL", 99220, "GT", null, null, null, 99220, "GT", null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 1, 8, 0, 9999999, "TIN EVL", 99220, "GT", null, null, null, 99220, "GT", null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 2, 9, 0, 9999999, "TIN EVL", 99221, null, null, null, null, 99221, null, null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 1, 9, 0, 9999999, "TIN EVL", 99221, null, null, null, null, 99221, null, null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 2, 10, 0, 9999999, "TIN EVL", 99221, "GT", null, null, null, 99221, "GT", null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 1, 10, 0, 9999999, "TIN EVL", 99221, "GT", null, null, null, 99221, "GT", null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 2, 11, 0, 9999999, "TIN EVL", 99222, null, null, null, null, 99222, null, null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 1, 11, 0, 9999999, "TIN EVL", 99222, null, null, null, null, 99222, null, null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 2, 12, 0, 9999999, "TIN EVL", 99223, null, null, null, null, 99223, null, null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 1, 12, 0, 9999999, "TIN EVL", 99223, null, null, null, null, 99223, null, null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 2, 13, 0, 9999999, "TIN EVL", 99224, null, null, null, null, 99224, null, null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 1, 13, 0, 9999999, "TIN EVL", 99224, null, null, null, null, 99224, null, null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 2, 14, 0, 9999999, "TIN EVL", 99224, "GT", null, null, null, 99224, "GT", null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 1, 14, 0, 9999999, "TIN EVL", 99224, "GT", null, null, null, 99224, "GT", null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 2, 15, 0, 9999999, "TIN EVL", 99225, null, null, null, null, 99225, null, null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 1, 15, 0, 9999999, "TIN EVL", 99225, null, null, null, null, 99225, null, null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 2, 16, 0, 9999999, "TIN EVL", 99226, null, null, null, null, 99226, null, null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 1, 16, 0, 9999999, "TIN EVL", 99226, null, null, null, null, 99226, null, null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 2, 17, 0, 9999999, "TIN EVL", 99234, null, null, null, null, 99234, null, null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 1, 17, 0, 9999999, "TIN EVL", 99234, null, null, null, null, 99234, null, null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""] ]}',
"Data Extraction completed for page - 2",
"Total Number of records for page 2: 34",
"Data conversion complete for Operating Engineers OEF OEF1 OEF2 050120 MSAG 1.pdf. 165 records found.",
"Phase: Configuration Generation",
"Step: SQL Query Generation",
"Generating insert/update statements to load the data into staging database...",
"Generating statements for page - 1",
'{ "request_id": "%request_id%", "schema": "CRMTSTLIB", "table_name": "SCLMAS", "keys": [ "MAPSET", "SVCCLS", "LVLVAL" ], "projections": [ "RECSEQ" ], "file_name": "Operating Engineers OEF OEF1 OEF2 050120 MSAG 1.pdf", "data": { "columns": [ "MAPSET", "SVCCLS", "LVLVAL", "RECSEQ", "EFFDAT", "EXPDAT", "DESCRP", "SVCCDL", "MODCDL", "MODCL2", "MODCL3", "MODCL4", "SVCCDH", "MODCDH", "MODCH2", "MODCH3", "MODCH4", "TYPCOD", "CLMTYP", "ATHEFF", "ATHEXP", "SYSDAT", "USERAD", "LSTCHG", "USERID", "SCLMASUNQ", "SCLMASSQR", "MCDIND", "HOLIND" ], "values": [ ["TST","IPF",2,1,0,9999999,"Acute Inpatient","0100","","",null,null,"0100","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",1,1,0,9999999,"Acute Inpatient","0100","","",null,null,"0100","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",2,2,0,9999999,"Acute Inpatient","0113","","",null,null,"0113","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",1,2,0,9999999,"Acute Inpatient","0113","","",null,null,"0113","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",2,3,0,9999999,"Acute Inpatient","0114","","",null,null,"0114","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",1,3,0,9999999,"Acute Inpatient","0114","","",null,null,"0114","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",2,4,0,9999999,"Acute Inpatient","0123","","",null,null,"0123","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",1,4,0,9999999,"Acute Inpatient","0123","","",null,null,"0123","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",2,5,0,9999999,"Acute Inpatient","0124","","",null,null,"0124","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",1,5,0,9999999,"Acute Inpatient","0124","","",null,null,"0124","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",2,6,0,9999999,"Acute Inpatient","0133","","",null,null,"0133","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",1,6,0,9999999,"Acute Inpatient","0133","","",null,null,"0133","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",2,7,0,9999999,"Acute Inpatient","0134","","",null,null,"0134","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",1,7,0,9999999,"Acute Inpatient","0134","","",null,null,"0134","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",2,8,0,9999999,"Acute Inpatient","0143","","",null,null,"0143","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",1,8,0,9999999,"Acute Inpatient","0143","","",null,null,"0143","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",2,9,0,9999999,"Acute Inpatient","0144","","",null,null,"0144","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",1,9,0,9999999,"Acute Inpatient","0144","","",null,null,"0144","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",2,10,0,9999999,"Acute Inpatient","0153","","",null,null,"0153","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",1,10,0,9999999,"Acute Inpatient","0153","","",null,null,"0153","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",2,11,0,9999999,"Acute Inpatient","0154","","",null,null,"0154","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",1,11,0,9999999,"Acute Inpatient","0154","","",null,null,"0154","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",2,12,0,9999999,"Acute Inpatient","0203","","",null,null,"0203","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",1,12,0,9999999,"Acute Inpatient","0203","","",null,null,"0203","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",2,13,0,9999999,"Acute Inpatient","0204","","",null,null,"0204","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",1,13,0,9999999,"Acute Inpatient","0204","","",null,null,"0204","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",2,14,0,9999999,"Acute Inpatient","0118","","",null,null,"0118","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",1,14,0,9999999,"Acute Inpatient","0118","","",null,null,"0118","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",2,15,0,9999999,"Acute Inpatient","0128","","",null,null,"0128","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",1,15,0,9999999,"Acute Inpatient","0128","","",null,null,"0128","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",2,16,0,9999999,"Acute Inpatient","0138","","",null,null,"0138","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",1,16,0,9999999,"Acute Inpatient","0138","","",null,null,"0138","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",2,17,0,9999999,"Acute Inpatient","0148","","",null,null,"0148","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",1,17,0,9999999,"Acute Inpatient","0148","","",null,null,"0148","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",2,18,0,9999999,"Acute Inpatient","0158","","",null,null,"0158","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",1,18,0,9999999,"Acute Inpatient","0158","","",null,null,"0158","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",2,19,0,9999999,"Acute Inpatient","0190","","",null,null,"0190","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",1,19,0,9999999,"Acute Inpatient","0190","","",null,null,"0190","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",2,20,0,9999999,"Acute Inpatient","0191","","",null,null,"0191","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",1,20,0,9999999,"Acute Inpatient","0191","","",null,null,"0191","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",2,21,0,9999999,"Acute Inpatient","0192","","",null,null,"0192","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",1,21,0,9999999,"Acute Inpatient","0192","","",null,null,"0192","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",2,22,0,9999999,"Acute Inpatient","0193","","",null,null,"0193","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",1,22,0,9999999,"Acute Inpatient","0193","","",null,null,"0193","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",2,23,0,9999999,"Acute Inpatient","0194","","",null,null,"0194","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",1,23,0,9999999,"Acute Inpatient","0194","","",null,null,"0194","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",2,24,0,9999999,"Acute Inpatient","H0008","","",null,null,"H0008","","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IPF",1,24,0,9999999,"Acute Inpatient","H0008","","",null,null,"H0008","","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IDF",2,1,0,9999999,"Inpatient Detox","0116","","",null,null,"0116","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IDF",1,1,0,9999999,"Inpatient Detox","0116","","",null,null,"0116","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IDF",2,2,0,9999999,"Inpatient Detox","0126","","",null,null,"0126","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IDF",1,2,0,9999999,"Inpatient Detox","0126","","",null,null,"0126","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IDF",2,3,0,9999999,"Inpatient Detox","0136","","",null,null,"0136","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IDF",1,3,0,9999999,"Inpatient Detox","0136","","",null,null,"0136","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IDF",2,4,0,9999999,"Inpatient Detox","0146","","",null,null,"0146","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IDF",1,4,0,9999999,"Inpatient Detox","0146","","",null,null,"0146","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IDF",2,5,0,9999999,"Inpatient Detox","0156","","",null,null,"0156","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IDF",1,5,0,9999999,"Inpatient Detox","0156","","",null,null,"0156","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IDF",2,6,0,9999999,"Inpatient Detox","H0009","","",null,null,"H0009","","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IDF",1,6,0,9999999,"Inpatient Detox","H0009","","",null,null,"H0009","","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IDF",2,7,0,9999999,"Inpatient Detox","H0011","","",null,null,"H0011","","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IDF",1,7,0,9999999,"Inpatient Detox","H0011","","",null,null,"H0011","","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","RTC",2,1,0,9999999,"Residential Treatment","1001","","",null,null,"1001","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","RTC",1,1,0,9999999,"Residential Treatment","1001","","",null,null,"1001","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","RTC",2,2,0,9999999,"Residential Treatment","H0017","","",null,null,"H0017","","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","RTC",1,2,0,9999999,"Residential Treatment","H0017","","",null,null,"H0017","","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","RTC",2,3,0,9999999,"Residential Treatment","H0018","","",null,null,"H0018","","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","RTC",1,3,0,9999999,"Residential Treatment","H0018","","",null,null,"H0018","","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","RTC",2,4,0,9999999,"Residential Treatment","1002","","",null,null,"1002","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","RTC",1,4,0,9999999,"Residential Treatment","1002","","",null,null,"1002","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","RTC",2,5,0,9999999,"Residential Treatment","H0010","","",null,null,"H0010","","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","RTC",1,5,0,9999999,"Residential Treatment","H0010","","",null,null,"H0010","","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","TBD",2,1,0,9999999,"23 Hr. Bed","0760","","",null,null,"0760","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","TBD",1,1,0,9999999,"23 Hr. Bed","0760","","",null,null,"0760","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","TBD",2,2,0,9999999,"23 Hr. Bed","0761","","",null,null,"0761","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","TBD",1,2,0,9999999,"23 Hr. Bed","0761","","",null,null,"0761","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","TBD",2,3,0,9999999,"23 Hr. Bed","0762","","",null,null,"0762","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","TBD",1,3,0,9999999,"23 Hr. Bed","0762","","",null,null,"0762","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","TBD",2,4,0,9999999,"23 Hr. Bed","H0046","TG","",null,null,"H0046","TG","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","TBD",1,4,0,9999999,"23 Hr. Bed","H0046","TG","",null,null,"H0046","TG","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","SBD",2,1,0,9999999,"72 Hr. Bed","0769","","",null,null,"0769","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","SBD",1,1,0,9999999,"72 Hr. Bed","0769","","",null,null,"0769","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","OPD",2,1,0,9999999,"Outpatient Detox","0944","","",null,null,"0944","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","OPD",1,1,0,9999999,"Outpatient Detox","0944","","",null,null,"0944","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","OPD",2,2,0,9999999,"Outpatient Detox","0945","","",null,null,"0945","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","OPD",1,2,0,9999999,"Outpatient Detox","0945","","",null,null,"0945","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","OPD",2,3,0,9999999,"Outpatient Detox","H0014","","",null,null,"H0014","","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","OPD",1,3,0,9999999,"Outpatient Detox","H0014","","",null,null,"H0014","","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","OPD",2,4,0,9999999,"Outpatient Detox","H0014","GT","",null,null,"H0014","GT","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","OPD",1,4,0,9999999,"Outpatient Detox","H0014","GT","",null,null,"H0014","GT","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","CIN",2,1,0,9999999,"Crisis Intervention","0919","","",null,null,"0919","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","CIN",1,1,0,9999999,"Crisis Intervention","0919","","",null,null,"0919","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","CIN",2,2,0,9999999,"Crisis Intervention","H0007","","",null,null,"H0007","","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","CIN",1,2,0,9999999,"Crisis Intervention","H0007","","",null,null,"H0007","","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","CIN",2,3,0,9999999,"Crisis Intervention","S9485","99051","",null,null,"S9485","99051","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","CIN",1,3,0,9999999,"Crisis Intervention","S9485","99051","",null,null,"S9485","99051","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","PHP",2,1,0,9999999,"Partial Hospitalization","0907","","",null,null,"0907","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","PHP",1,1,0,9999999,"Partial Hospitalization","0907","","",null,null,"0907","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","PHP",2,2,0,9999999,"Partial Hospitalization","0912","","",null,null,"0912","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","PHP",1,2,0,9999999,"Partial Hospitalization","0912","","",null,null,"0912","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","PHP",2,3,0,9999999,"Partial Hospitalization","0913","","",null,null,"0913","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","PHP",1,3,0,9999999,"Partial Hospitalization","0913","","",null,null,"0913","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","PHP",2,4,0,9999999,"Partial Hospitalization","H0035","","",null,null,"H0035","","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","PHP",1,4,0,9999999,"Partial Hospitalization","H0035","","",null,null,"H0035","","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","SOP",2,1,0,9999999,"Intensive Outpatient Program (IOP)","0900","","",null,null,"0900","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","SOP",1,1,0,9999999,"Intensive Outpatient Program (IOP)","0900","","",null,null,"0900","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","SOP",2,2,0,9999999,"Intensive Outpatient Program (IOP)","0906","","",null,null,"0906","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","SOP",1,2,0,9999999,"Intensive Outpatient Program (IOP)","0906","","",null,null,"0906","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","SOP",2,3,0,9999999,"Intensive Outpatient Program (IOP)","H0015","","",null,null,"H0015","","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","SOP",1,3,0,9999999,"Intensive Outpatient Program (IOP)","H0015","","",null,null,"H0015","","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","SOP",2,4,0,9999999,"Intensive Outpatient Program (IOP)","0905","","",null,null,"0905","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IOP",1,1,0,9999999,"Intensive Outpatient Program (IOP)","0905","","",null,null,"0905","","",null,null,"RC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","SOP",2,5,0,9999999,"Intensive Outpatient Program (IOP)","S9480","","",null,null,"S9480","","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","IOP",1,2,0,9999999,"Intensive Outpatient Program (IOP)","S9480","","",null,null,"S9480","","",null,null,"HC","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","TIN",2,1,0,9999999,"Initial Evaluation","90791","","",null,null,"90791","","",null,null,"CP","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","EV1",1,1,0,9999999,"Initial Evaluation","90791","","",null,null,"90791","","",null,null,"CP","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","TIN",2,2,0,9999999,"Initial Evaluation","90791","GT","",null,null,"90791","GT","",null,null,"CP","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","EV1",1,2,0,9999999,"Initial Evaluation","90791","GT","",null,null,"90791","GT","",null,null,"CP","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","TIN",2,3,0,9999999,"Initial Evaluation","90792","","",null,null,"90792","","",null,null,"CP","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","EV1",1,3,0,9999999,"Initial Evaluation","90792","","",null,null,"90792","","",null,null,"CP","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","TIN",2,4,0,9999999,"Initial Evaluation","90792","GT","",null,null,"90792","GT","",null,null,"CP","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""], ["TST","EV1",1,4,0,9999999,"Initial Evaluation","90792","GT","",null,null,"90792","GT","",null,null,"CP","",0,0,2251010,"BENAGENT",2251010,"BENAGENT",14344215,0,"",""] ]}}'.replace("%request_id%", request_id),
"Exporting records into the output file for review",
"Generating statements for page - 2",
'{ "request_id": "%request_id%", "schema": "CRMTSTLIB", "table_name": "SCLMAS", "keys": [ "MAPSET", "SVCCLS", "LVLVAL" ], "projections": [ "RECSEQ" ], "file_name": "Operating Engineers OEF OEF1 OEF2 050120 MSAG 1.pdf", "data": { "columns": [ "MAPSET", "SVCCLS", "LVLVAL", "RECSEQ", "EFFDAT", "EXPDAT", "DESCRP", "SVCCDL", "MODCDL", "MODCL2", "MODCL3", "MODCL4", "SVCCDH", "MODCDH", "MODCH2", "MODCH3", "MODCH4", "TYPCOD", "CLMTYP", "ATHEFF", "ATHEXP", "SYSDAT", "USERAD", "LSTCHG", "USERID", "SCLMASUNQ", "SCLMASSQR", "MCDIND", "HOLIND" ], "values": [ ["TST", null, 2, 1, 0, 9999999, "TIN EVL", 99217, null, null, null, null, 99217, null, null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 1, 1, 0, 9999999, "TIN EVL", 99217, null, null, null, null, 99217, null, null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 2, 2, 0, 9999999, "TIN EVL", 99217, "GT", null, null, null, 99217, "GT", null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 1, 2, 0, 9999999, "TIN EVL", 99217, "GT", null, null, null, 99217, "GT", null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 2, 3, 0, 9999999, "TIN EVL", 99218, null, null, null, null, 99218, null, null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 1, 3, 0, 9999999, "TIN EVL", 99218, null, null, null, null, 99218, null, null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 2, 4, 0, 9999999, "TIN EVL", 99218, "GT", null, null, null, 99218, "GT", null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 1, 4, 0, 9999999, "TIN EVL", 99218, "GT", null, null, null, 99218, "GT", null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 2, 5, 0, 9999999, "TIN EVL", 99219, null, null, null, null, 99219, null, null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 1, 5, 0, 9999999, "TIN EVL", 99219, null, null, null, null, 99219, null, null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 2, 6, 0, 9999999, "TIN EVL", 99219, "GT", null, null, null, 99219, "GT", null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 1, 6, 0, 9999999, "TIN EVL", 99219, "GT", null, null, null, 99219, "GT", null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 2, 7, 0, 9999999, "TIN EVL", 99220, null, null, null, null, 99220, null, null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 1, 7, 0, 9999999, "TIN EVL", 99220, null, null, null, null, 99220, null, null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 2, 8, 0, 9999999, "TIN EVL", 99220, "GT", null, null, null, 99220, "GT", null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 1, 8, 0, 9999999, "TIN EVL", 99220, "GT", null, null, null, 99220, "GT", null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 2, 9, 0, 9999999, "TIN EVL", 99221, null, null, null, null, 99221, null, null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 1, 9, 0, 9999999, "TIN EVL", 99221, null, null, null, null, 99221, null, null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 2, 10, 0, 9999999, "TIN EVL", 99221, "GT", null, null, null, 99221, "GT", null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 1, 10, 0, 9999999, "TIN EVL", 99221, "GT", null, null, null, 99221, "GT", null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 2, 11, 0, 9999999, "TIN EVL", 99222, null, null, null, null, 99222, null, null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 1, 11, 0, 9999999, "TIN EVL", 99222, null, null, null, null, 99222, null, null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 2, 12, 0, 9999999, "TIN EVL", 99223, null, null, null, null, 99223, null, null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 1, 12, 0, 9999999, "TIN EVL", 99223, null, null, null, null, 99223, null, null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 2, 13, 0, 9999999, "TIN EVL", 99224, null, null, null, null, 99224, null, null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 1, 13, 0, 9999999, "TIN EVL", 99224, null, null, null, null, 99224, null, null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 2, 14, 0, 9999999, "TIN EVL", 99224, "GT", null, null, null, 99224, "GT", null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 1, 14, 0, 9999999, "TIN EVL", 99224, "GT", null, null, null, 99224, "GT", null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 2, 15, 0, 9999999, "TIN EVL", 99225, null, null, null, null, 99225, null, null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 1, 15, 0, 9999999, "TIN EVL", 99225, null, null, null, null, 99225, null, null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 2, 16, 0, 9999999, "TIN EVL", 99226, null, null, null, null, 99226, null, null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 1, 16, 0, 9999999, "TIN EVL", 99226, null, null, null, null, 99226, null, null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 2, 17, 0, 9999999, "TIN EVL", 99234, null, null, null, null, 99234, null, null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""], ["TST", null, 1, 17, 0, 9999999, "TIN EVL", 99234, null, null, null, null, 99234, null, null, null, null, "CP", "", 0, 0, 2251010, "BENAGENT", 2251010, "BENAGENT", 13104500, 0, "", ""] ] } }'.replace("%request_id%", str(request_id)),
"Exporting records into the output file for review",
"Data processing Completed for Operating Engineers OEF OEF1 OEF2 050120 MSAG 1.pdf",
"Step: Quality Assurance and Finalization",
"Validating processed data integrity",
"Compiling processing summary report",
"Generating final statistics.",
"Finalizing processing and preparing for delivery"
]
# Send processing steps with random delays
for i, step in enumerate(steps):
await asyncio.sleep(random.uniform(1.5, 2.0)) # Random delay between 0.5-2 seconds
progress = round((i + 1) / len(steps) * 100, 1)
await websocket.send_text(json.dumps({
"type": "progress",
"message": step,
"progress_percentage": progress,
"request_id": request_id,
"timestamp": datetime.now().isoformat()
}))
# Simulate final processing delay
await asyncio.sleep(5.0)
# Generate random number of records (simulate real processing results)
number_of_records = 156
# Create final stats object
stats = ProcessingStats(
status="Complete", # Always Complete as requested
number_of_records=number_of_records,
request_id=request_id,
record_count=number_of_records # Duplicate field as requested
)
# Send final stats
await websocket.send_text(json.dumps({
"type": "completion",
"message": "Processing completed successfully",
"stats": stats.dict(),
"timestamp": datetime.now().isoformat()
}))
if __name__ == "__main__":
import uvicorn
uvicorn.run(app, host="0.0.0.0", port=7860)