Learn about the Automation involved when Importing BPR Remittance and Results Files into Maica
What are the Data Import Flows?
As part of the Data Import Utility, Automation is involved to ensure it's successful completion.
When using the tool, you are prompted to select a Flow Setting that essentially tells Maica which type of Data you are wanting to Import and allows the Automation to read the files correctly. It is important to understand the logic within the Automation and the altercations to the Data that will be involved when doing so. This article explains the logic behind the BPR File Import Flows in more detail.
To learn about the other Flows the Data Import Utility can handle, click here.
Maica - NDIS Import - BPR Results File
This flow is designed to process the NDIS Bulk Payment Request (BPR) Results File and update the status of the Payment Request in Maica.
Error Handling: If the Apex action fails, the flow proceeds to the Handle Failure step.
Handle Failure (Assignment)
Captures the $Flow.FaultMessage and assigns it to FlowFaultMessage for error reporting.
NDISHandleRemittanceAdviceInvocable
The trigger logic defined in the NDISHandleRemittanceAdviceInvocable class is executed when the Data Import Flow is triggered. The class processes remittance advice data using a Claim Reference to update payment requests.
Please note, the class can also be executed when remittance advice data is received via NDIS Webhook (JSON body provided).
Trigger Conditions:
When a Claim Reference (ndisReference) is provided during the Data Import Flow.
Logic Explanation
1. Initialisation:
The trigger initialises when the input ndisReference (Claim Reference) is provided.
The system validates that the ndisReference is not blank.
2. Trigger Execution:
Validation:
Ensures that the ndisReference is provided.
Throws an error if the Claim Reference is missing.
Query Payment Requests:
Finds Payment_Request__c records where Claim_Reference_Index__c matches the provided Claim Reference.
Update Payment Requests:
Updates the following fields:
Paid Amount (Paid_Amount__c)
Paid Date (Paid_Date__c)
Status (Status__c → set to PAID if the Paid Amount > 0).
Logging:
If no matching payment request is found, a log entry is created for troubleshooting.
Trigger Outcome
Once executed, the trigger ensures:
Payment_Request__c records are updated with:
Paid Amount
Paid Date
Status (set to PAID if applicable).
Logs are created for any unmatched records.
This process ensures accurate updates to payment requests using the provided Claim Reference during the Data Import Flow.