Subcontractor Document Return
Executive Summary
Subcontractor Document Return gathers the PDF documents that subcontractors have sent back into AlayaCare and combines them into one return PDF per client folder. When AlayaCare reports that new attachments arrived for clients, staff start a new report for a document date. The system collects the received PDF files from each affected client's Marketplace Documents "Received" folders in AlayaCare, merges the files that have not been returned before into a combined PDF (one per client folder per file date), and keeps the PDF with the job. Each run is listed on the main page, and opening a run shows the folders it created, the return PDF for each, and the files that went into it.
Key Features
- Start a new run for a chosen document date
- Pick up new attachment notifications from AlayaCare's attachment queue before building the return
- For each client with attachments that day, look in the client's Marketplace Documents folder in AlayaCare for sub-folders whose names end in "Received"
- Combine the PDF files in each folder that have not been returned in an earlier run into one return PDF per file date
- Skip any file already included in an earlier run
- Review earlier runs with who added them and when they were processed
- Open a run to see each client folder, whether a return PDF exists, when it was created, and its upload status
- Download a folder's return PDF
- See the list of files that were combined into a folder's return PDF
Typical Workflow
- Click Start A New Report.
- Choose the Document Date To Use and click Save. A progress panel shows while the run works.
- When the run finishes, "Finished" is shown and the run opens automatically.
- In the run, review the client folders. Click the PDF icon to download a folder's return PDF.
- Click the edit icon (or right-click a row and choose Edit) to see the files that were combined into a folder's PDF, then click Close.
- Use the back arrow at the top of the page to return to the list of runs.
Available Permissions
The following permissions are available to be assigned to AlayaCare Roles:
| Attribute | What It Controls |
|---|---|
| View | Open the page |
The run page that opens from a run in the list is controlled by a separate permission named Subcontractor Document Return, which must also be granted for the run to open.
Main Grid
Lists every run, newest first (14 rows per page).
| Column | Description |
|---|---|
| ID | Run number. |
| Added | Date and time the run was started, in the user's time zone. |
| Added By | User who started the run. |
| Processing Start | When processing began. |
| Processing End | When processing finished. |
| Manage Records | An edit icon that opens the run. |
Actions
| Button | Description |
|---|---|
| Start A New Report | Opens the Start A New Report dialog. A warning "Unable to locate ACI Attachments Queue" is shown, and nothing opens, if the attachment queue has not been set up. |
| Edit (icon on a row, or right-click a row) | Opens the run. |
Dialog Components
Start A New Report
Opens from Start A New Report.
| Field | Purpose |
|---|---|
| Document Date To Use | The day whose attachment notifications are used. Clients that had new attachments notified between the start and end of this day (in the user's time zone) are included. |
Click Save to start the run or Cancel to close. If AlayaCare cannot be signed in to, "Login To Alaya Failed" is shown and the run does not start.
Subcontractor Document Return Run
Opens from the main grid, and automatically when a new run finishes. The top of the page shows read-only details of the run: Return Date, Branch, Processing Start, Processing End and Duration (Mins).
Grid
Lists the client folders found by the run (12 rows per page).
| Column | Description |
|---|---|
| Client ID | AlayaCare client ID. |
| Client Name | Client last name, first name. |
| Folder | The "Received" folder in AlayaCare the files came from. |
| Subcontractor | Subcontractor name, when recorded for the folder. |
| has Return PDF | Checked when a return PDF has been created for the folder. |
| Return Filename | File name of the return PDF, when recorded. |
| Return Created At | When the return PDF was created, in the user's time zone. |
| Upload Status | Status of the return upload, when recorded. |
| Uploaded At | When the return was uploaded, when recorded. |
| Upload Message | Message about the upload, when recorded. |
| Actions | A PDF icon (Download PDF) and an edit icon. |
Grid Actions
| Button | Description |
|---|---|
| Download PDF (icon on a row) | Downloads the folder's return PDF. Available only when the folder has a return PDF. The file is named with the return file name when there is one, otherwise return.pdf. |
| Edit (icon on a row, or right-click a row and choose Edit) | Opens Folder Detail for the row. |
Folder Detail
A dialog listing the files that were combined into the folder's return PDF, in a single File column (12 rows per page). Click Close to return to the run.
Dependencies
The following tables must be configured for lookups on this view to work:
| Table | Description |
|---|---|
| SQS Queues | Must include the queue named ACI_Attachments, which delivers AlayaCare attachment notifications. Without it, new runs cannot be started. |
Processing Overviews
This section describes what happens after you confirm a processing action.
Save (Start A New Report)
- Signs in to AlayaCare, then creates the run with the user, start time and the chosen document date.
- Reads all waiting notifications from the attachment queue and saves each one. A notification is removed from the queue only after it has been saved; reading stops if a save or removal fails.
- Works out the start and end of the chosen day in the user's time zone, and finds the clients that have saved notifications within that period (one entry per client).
- For each client, loads the client record from AlayaCare, then lists the client's Marketplace Documents folder. Only sub-folders whose names end in "Received" are used.
- For each such folder, lists its files and keeps only PDF files. Each file's last-modified time is converted to the client's time zone, and the files are grouped by that date.
- For each date, drops any file that was already included in an earlier run. If nothing is left, nothing is created for that date.
- Otherwise creates a client folder entry in the run, downloads each remaining file from AlayaCare, merges them into one PDF, records each file against the folder, and saves the merged PDF with the folder and the time it was created.
- Saves the end time and duration on the run, shows "Finished", and opens the run.