PCC AR Aging: Web Interface vs. Database Procedures
This document explains the relationship between the PCC web interface for AR Aging reports and the underlying database stored procedures. Understanding this relationship can help reconcile differences between reports generated through different methods.
Overview
The PCC AR Aging system consists of two main components:
- Web Interface: The screens shown in the screenshots where users can select parameters and run reports
- Database Procedures: The stored procedures (
sproc_ar_agingandsproc_ar_aging_postdate) that perform the actual calculations
Web Interface Components
The PCC web interface for AR Aging reports includes various elements for filtering and running reports. The interface allows users to select parameters such as reference date, aging method, and various filters.
Key Elements:
- Report Selection: "AR Aging 'New'" at the top of the screen
- Date Selection: Reference date for aging calculations
- Aging Bracket: Allows selection of aging method (effective date or transaction date)
- Filtering Options:
- Payer Type
- Payer Reporting Group
- Resident Status
- Payer
- Specific Residents
- Output Options: Run Now, Excel, PDF/Print
Database Stored Procedures
The database contains two main stored procedures for AR aging:
- sproc_ar_aging: Ages transactions based on effective date (service date)
- sproc_ar_aging_postdate: Ages transactions based on transaction date (posting date)
How They Connect
When a user runs a report through the web interface:
- The web application collects all the parameters selected by the user
- Based on the aging method selected, it calls either
sproc_ar_agingorsproc_ar_aging_postdate - It passes the selected parameters to the stored procedure
- The stored procedure executes and returns results
- The web application formats and displays these results
Key Differences
Parameter Handling
| Web Interface | Database Procedure |
|---|---|
| Offers user-friendly dropdowns and selections | Accepts raw parameter values |
| May apply default filters | Only applies filters explicitly passed as parameters |
| May have additional validation | Minimal validation of inputs |
Output Formatting
| Web Interface | Database Procedure |
|---|---|
| Formatted for screen viewing | Returns raw data in result sets |
| Offers export to Excel/PDF | Returns tabular data only |
| May include charts or visualizations | Text/numeric data only |
| May apply additional sorting or grouping | Basic sorting only |
Calculation Nuances
In some cases, the web interface might:
- Apply additional business rules not in the stored procedures
- Filter out certain results based on user permissions
- Aggregate data differently for display purposes
- Round numbers or format currencies differently
Common Discrepancies
When comparing reports from the web interface versus direct database queries, you might notice:
- Different Totals: Due to filtering differences or parameter handling
- Missing Records: The web interface might filter out certain payers or residents
- Timing Differences: Reports run at different times might show different results
- Formatting Variations: The same data might appear differently
Troubleshooting Differences
If you notice discrepancies between the web interface and database reports:
- Check Parameters: Ensure you're using identical parameters in both methods
- Verify Reference Date: Even small differences in reference date can change results
- Examine Filters: The web interface might apply implicit filters
- Check Timing: Ensure both reports are run at the same time (or with the same data snapshot)
Technical Implementation
For technical users, here's how the connection works:
- The PCC web application is likely built using ASP.NET or a similar web framework
- When a user submits the form to run a report, the application:
- Validates user inputs
- Constructs a SQL command to call the appropriate stored procedure
- Executes the command against the database
- Processes the returned data
- Renders the results in HTML or exports to the requested format
Accessing Raw Data
If you need to access the raw data directly:
-
Database Query: You can execute the stored procedures directly:
EXEC dbo.sproc_ar_aging @fac_ids = '1', @reference_date = '20230501'; -
Data Export: The web interface allows exporting to Excel, which can then be analyzed
Conclusion
The PCC web interface provides a user-friendly way to access the AR aging data calculated by the database stored procedures. While they work with the same underlying data, differences in parameter handling, filtering, and presentation can sometimes lead to apparent discrepancies between reports generated through different methods.
Understanding the relationship between these components can help reconcile differences and ensure consistent reporting across your organization.