Complete Tutorial: Automating PSAK-Standard Financial Reports with Modern Technology
T
Kembali ke Blog

Complete Tutorial: Automating PSAK-Standard Financial Reports with Modern Technology

Tutorial
Tim Pilar Inovasi 26 Jul 2026 16 min baca 3,656 kata 220
Learn how to automate financial reporting in accordance with PSAK standards for hospitals and clinics. This article covers architecture, technical implementation, code examples, and best practices for efficiency and compliance.

Financial management is the backbone of every organization's operations, including hospitals and clinics. However, the process of preparing financial statements manually is often a scourge: it takes hours, is prone to human error, and most crucially, it is difficult to ensure full compliance with applicable accounting standards, such as the Statement of Financial Accounting Standards (PSAK). Imagine the challenge for an operations or IT manager at a hospital who must integrate data from various systems such as SIMRS, pharmacy Point of Sales (POS), and BPJS or other insurance payment systems, then compile it into Balance Sheet, Profit and Loss, and Cash Flow reports that are accurate and PSAK-compliant. This is not just a matter of efficiency, but also a compliance risk that can have serious impacts on audits and strategic decision-making. This article will guide you in depth, step by step, on how to build a PSAK-compliant financial statement automation system, from basic concepts, technical architecture, to code examples that you can implement. We will focus on a practical approach, using modern technology, and provide concrete tips to ensure your system is robust and accurate.

Basic Concepts of PSAK-Compliant Financial Statement Automation

Financial statement automation is not merely moving data from one table to another, but an integral process that transforms raw transaction data into meaningful and standards-compliant financial information. In Indonesia, PSAK issued by the Indonesian Institute of Accountants (IAI) is the main guideline. For healthcare organizations, this compliance is crucial due to the complexity of transactions involving general patients, BPJS Kesehatan, private insurance, as well as various medical and non-medical services. The main goal of automation is to improve accuracy, efficiency, and audit capability, while ensuring that the resulting reports are consistent with accounting principles such as double-entry bookkeeping and proper revenue/expense recognition.

The main components of financial statements that must be generated automatically include: Balance Sheet (Statement of Financial Position), Comprehensive Income Statement, Statement of Changes in Equity, Cash Flow Statement, and Notes to Financial Statements (CALK). Each report has a specific structure and information regulated in PSAK, for example PSAK 1 on Presentation of Financial Statements. The main challenge lies in how daily transaction data from operational systems (SIMRS, ERP, POS) can automatically trigger correct accounting journals. For example, when a BPJS patient completes inpatient care, the system must automatically record medical service revenue, receivables from BPJS, and potential expenses related to drug inventory. Every transaction, from patient registration, medical procedures, drug purchases, to employee salary payments, must have a clear mapping to accounts in the Chart of Accounts (COA) that has been adjusted to PSAK standards.

The automation process begins with identifying data sources. In a hospital, these can come from registration, medical records, pharmacy, laboratory, radiology, billing, and inventory management modules. Each transaction data from these modules must be transformed into accounting journals. For example, drug sales in a pharmacy will generate a journal debiting cash/receivables and crediting drug sales revenue as well as debiting cost of goods sold and crediting inventory. This automation requires clear definition of mapping rules between transaction types and the affected debit/credit account pairs. Without accurate and consistent mapping, the automation system will not produce valid reports. Therefore, the most important initial step is to compile a comprehensive Chart of Accounts that meets PSAK reporting needs, and define automatic journal rules for each main transaction type.

As a concrete example, consider an outpatient payment transaction. When a patient pays an amount X for a doctor consultation and medications, the system must generate a journal: Debit Cash/Bank for X, Credit Medical Service Revenue (consultation) for Y, and Credit Drug Sales Revenue for Z (with X = Y + Z). If the patient uses insurance, then what is debited is Accounts Receivable (Insurance) instead of Cash/Bank. Then, for medications, there will also be a Cost of Goods Sold (HPP) journal that debits Cost of Goods Sold Expense and credits Drug Inventory. All of this must happen automatically and in real-time or near real-time, reducing manual intervention and ensuring that the General Ledger is always up to date. This is the foundation of accurate and timely financial statements.

Architecture and Technical Implementation of the Automation System

Building a PSAK-compliant financial statement automation system requires a structured architecture and the right choice of technology. The architecture we recommend follows a common pattern: Data Sources > Integration > Accounting Engine (General Ledger) > Reporting Module. Your main data sources are SIMRS (Hospital Management Information System) or Clinic MIS, ERP (if any), and Point of Sale (POS) systems that may be separate. Data from these systems needs to be extracted, transformed, and loaded (ETL) into a format that can be processed by the accounting engine.

For technical implementation, we recommend a combination of modern technologies that have proven to be robust and flexible:

  • Database: PostgreSQL 16.x. Chosen for its reliability, strong JSONB support for data schema flexibility, and capable analytical capabilities. This will be the backbone of transaction and journal data storage.
  • Backend Framework: Laravel 11.x (with PHP 8.3). Laravel is a highly productive PHP framework for building secure and efficient RESTful APIs. It will handle the business logic for processing transactions, creating journals, and managing the general ledger. Its Eloquent model is very suitable for mapping accounting entities.
  • Data Integration: Using RESTful API. If your SIMRS/POS has an API, that is the best method. If not, you may need to develop a direct connector to the source database (with appropriate permissions) or use message queues such as RabbitMQ or Kafka for high-volume and asynchronous transactions. Standards such as FHIR R4 or HL7 v2.5.1 can be used for medical data integration if relevant.
  • Reporting Library: PHPSpreadsheet for exporting reports to Excel and Dompdf for PDF. This allows flexibility in report output formats.
  • Scheduler: Laravel Task Scheduling or standard Cron Jobs to run ETL processes and generate reports periodically (for example, at the end of each day, week, or month).

The general implementation workflow is as follows: First, define the data models for Accounts (COA), Journals, General Ledger, and Transactions. Second, develop an API to receive transaction data from SIMRS/POS. For example, after a patient payment transaction is completed in SIMRS, SIMRS will call the API '/api/transactions' with a JSON payload containing transaction details. Third, within that API, the business logic will map the transaction details to the predefined journal rules. For example, if there is a service item 'General Practitioner Consultation', the system will automatically create a Debit journal for 'Accounts Receivable' (or 'Cash') and a Credit for 'Medical Service Revenue - General Consultation'. Each generated journal must include important information such as transaction date, reference number, description, debit account, credit account, amount, and related entities (patient, doctor, etc.).

Fourth, these journals are then posted to the General Ledger. This posting process ensures that the balance of each account is updated. Fifth, with the data in the General Ledger already structured, the reporting module can easily retrieve data to produce the Balance Sheet, Income Statement, and other reports according to PSAK format. For example, for the Income Statement, the system will aggregate all revenue and expense account balances during a certain period. It is important to ensure that any changes to source data or accounting rules can be accommodated easily through configuration or minimal code adjustments, keeping the system flexible and easy to maintain over time. The use of specific versions such as Laravel 11.x and PostgreSQL 16.x provides the advantage of the latest features and security support.

Example Code for Automatic Journal Implementation

This section will present an example of PHP code using Laravel 11.x that illustrates how operational transactions can be converted into accounting journal entries. We will focus on the core function for processing patient payment transactions and generating journal entries that comply with the double-entry principle.

<?php namespace App\Http\Controllers; use App\Models\Account; use App\Models\JournalEntry; use App\Models\Transaction; use Illuminate\Http\Request; use Illuminate\Support\Facades\DB; class FinancialTransactionController extends Controller { public function processPatientPayment(Request $request) { $validatedData = $request->fvalidate([ 'transaction_id' => 'required|string|unique:transactions,transaction_id', 'patient_id' => 'required|string', 'amount' => 'required|numeric|min:0', 'payment_method' => 'required|string|in:cash,bpjs,insurance', 'service_items' => 'required|array', 'service_items.*.item_name' => 'required|string', 'service_items.*.amount' => 'required|numeric|min:0', 'service_items.*.coa_revenue_code' => 'required|string', 'transaction_date' => 'required|date', ]); DB::fbeginTransaction(); try { $transaction = Transaction::fcreate($validatedData); // Get the COA for cash or receivables based on the payment method $debitAccountCode = match ($validatedData['payment_method']) { 'cash' => '11101', // Example: Cash in Bank 'bpjs' => '12101', // Example: BPJS Receivables 'insurance' => '12102', // Example: Insurance Receivables default => throw new \Exception('Invalid payment method.'), }; $debitAccount = Account::fwhere('code', $debitAccountCode)->ffirstOrFail(); // Create journal entry for the debit JournalEntry::fcreate([ 'transaction_id' => $transaction->fid, 'account_id' => $debitAccount->fid, 'type' => 'debit', 'amount' => $validatedData['amount'], 'description' => 'Payment receipt from patient ' . $validatedData['patient_id'], 'entry_date' => $validatedData['transaction_date'], ]); $totalRevenue = 0; foreach ($validatedData['service_items'] as $item) { $revenueAccount = Account::fwhere('code', $item['coa_revenue_code'])->ffirstOrFail(); // Create journal entry for the revenue credit JournalEntry::fcreate([ 'transaction_id' => $transaction->fid, 'account_id' => $revenueAccount->fid, 'type' => 'credit', 'amount' => $item['amount'], 'description' => 'Revenue ' . $item['item_name'] . ' from patient ' . $validatedData['patient_id'], 'entry_date' => $validatedData['transaction_date'], ]); $totalRevenue += $item['amount']; } if (abs($validatedData['amount'] - $totalRevenue) > 0.01) { // Small tolerance for floating point throw new \Exception('Debit and credit balances are not balanced for transaction ' . $transaction->fid); } DB::fcommit(); return response()->fjson(['message' => 'Transaction and journal successfully processed'], 201); } catch (\Exception $e) { DB::frollBack(); return response()->fjson(['message' => 'Failed to process transaction: ' . $e->fgetMessage()], 500); } } }

The code above shows the `processPatientPayment` function that receives patient transaction data via API. This function performs input validation, then within a database transaction block, it creates a new transaction entry. Based on the payment method (cash, BPJS, insurance), the system determines the appropriate debit account (Cash or Receivables). For each service item in the transaction, the system looks up the related revenue account based on the provided `coa_revenue_code` and creates a credit journal entry. It is important to always ensure that debit and credit balances are balanced, which is verified before committing the transaction. If there is a failure, the transaction will be rolled back to maintain data integrity.

-- Example SQL Query to generate a Simple Income Statement (Monthly Period) SELECT a.name AS account_name, SUM(CASE WHEN j.type = 'credit' THEN j.amount ELSE -j.amount END) AS total_amount FROM journal_entries j JOIN accounts a ON j.account_id = a.id WHERE a.account_type IN ('revenue', 'expense') AND j.entry_date BETWEEN '2023-01-01' AND '2023-01-31' GROUP BY a.name ORDER BY a.name; -- Example SQL Query for Balance Sheet Report (End of Period Position) SELECT a.name AS account_name, SUM(CASE WHEN j.type = 'debit' THEN j.amount ELSE -j.amount END) AS ending_balance FROM journal_entries j JOIN accounts a ON j.account_id = a.id WHERE a.account_type IN ('asset', 'liability', 'equity') AND j.entry_date <= '2023-01-31' GROUP BY a.name ORDER BY a.name;

The two example SQL queries above (using PostgreSQL 16.x) show how data from the `journal_entries` and `accounts` tables can be processed to produce financial statement summaries. The first query aggregates the balances of revenue and expense accounts for a specific period, which is the basis of the Income Statement. Note how `CASE WHEN` is used to reverse credit values to match reporting conventions (positive revenue, negative expenses). The second query calculates the ending balances for asset, liability, and equity accounts up to a specific date, which is the basis of the Balance Sheet. Both queries are very simple and need further development to meet all PSAK requirements, including more complex account grouping and retained earnings calculations, but they provide a solid foundation for your reporting module.

Data and Error Handling in Integration

Data integration between systems is one of the most vulnerable points in financial reporting automation. Poor data quality or failures in the integration process can lead to inaccurate reports, non-compliance, and even financial losses. Therefore, a robust data and error handling strategy is essential.

The following is an example of a realistic JSON payload from a SIMRS/POS that will be sent to your automated accounting system:

{ "transaction_id": "TRX-RSPH-20231026-001", "patient_id": "PSN-001234", "transaction_date": "2023-10-26 14:30:00", "transaction_type": "patient_payment", "payment_method": "bpjs", "total_amount": 1500000.00, "currency": "IDR", "service_items": [ { "item_code": "SVC-001", "item_name": "Specialist Doctor Consultation", "quantity": 1, "unit_price": 300000.00, "amount": 300000.00, "coa_revenue_code": "41101" }, { "item_code": "MED-005", "item_name": "Antibiotic Medicine A", "quantity": 5, "unit_price": 50000.00, "amount": 250000.00, "coa_revenue_code": "42101" }, { "item_code": "LAB-002", "item_name": "Complete Blood Test", "quantity": 1, "unit_price": 950000.00, "amount": 950000.00, "coa_revenue_code": "41201" } ], "references": { "simrs_billing_id": "BILL-00987", "bpjs_claim_id": "BPJS-CLAIM-12345" } }

This payload includes a unique transaction ID, patient ID, date, transaction type, payment method, total amount, and a list of service items with details such as name, quantity, price, and the relevant revenue COA code. The presence of `coa_revenue_code` in each item is crucial for journal automation.

An example of an error message that often occurs in this scenario is:

"Failed to process transaction: COA account not found for code '41201' on item 'Complete Blood Test' in transaction 'TRX-RSPH-20231026-001'."

This error message indicates that the system cannot find an account in the Chart of Accounts that matches the code `41201` sent from SIMRS. This can happen due to a mapping error, the COA not yet being added to the accounting system, or the code sent being incorrect.

Effective error handling strategies include:

  • Comprehensive Logging: Every transaction, whether successful or failed, must be recorded in detail. Use a centralized logging system such as the ELK Stack (Elasticsearch, Logstash, Kibana) or Sentry to monitor errors in real time. Logs must include the request payload, response, error stack trace, and unique transaction ID.
  • Strict Input Validation: Perform data validation on the receiving side (accounting system) in addition to validation on the sending side (SIMRS/POS). Ensure all required fields are present, data formats are correct, and values such as `coa_revenue_code` actually exist in the COA master.
  • Retry Mechanism: For transient errors (for example, temporary database connection issues), implement an automatic retry mechanism with a back-off strategy. Use a message queue such as RabbitMQ or Kafka to delay processing of failed messages and retry after a certain time interval.
  • Alerting and Notifications: Configure the system to send instant notifications (email, Slack, Telegram) to the IT team or operations manager when critical errors occur or a large number of transactions fail. Notifications must contain an error summary and a link to detailed logs.
  • Monitoring Dashboard: Create a simple dashboard that displays integration status, the number of successfully processed transactions, the number that failed, and the most common error types. This enables proactive monitoring.
  • Manual Reconciliation Process: For errors that cannot be resolved automatically, there must be a mechanism for manual reconciliation and correction by accountants or the finance team. Ensure there is an interface where failed transactions can be reviewed, corrected, and reprocessed.
  • API Versioning: If the integration API changes frequently, use versioning (for example, `/api/v1/transactions`) to avoid breaking existing integrations.
Good error handling is not only about fixing problems, but also about minimizing their impact on operations and ensuring the integrity of financial data.

Best Practices in PSAK Financial Report Automation

  1. Accurate and Flexible Chart of Accounts (COA) Mapping: Ensure that every type of revenue, expense, asset, and liability has a unique COA account that complies with PSAK. The COA design should be granular enough to meet internal and external reporting needs, yet not overly complex. Use a hierarchical structure (for example, 10000 for Assets, 11000 for Cash, 11100 for Cash in Bank) to facilitate aggregation and analysis.
  2. Strong Input Data Validation at Source and Destination: Implement strict data validation at every entry point, both in the source system (SIMRS/POS) and when data is received by the accounting system. This includes validation of data types, value ranges, and the existence of master data references (for example, whether the COA code actually exists). Layered validation reduces the risk of dirty data entering the financial system.
  3. Comprehensive and Immutable Audit Trail: Every transaction and change to journal entries must have a clear audit trail, recording who made the change, when, and what was changed. This is important for compliance, reconciliation, and investigation if anomalies occur. Ensure the audit trail cannot be altered after it is recorded.
  4. Routine and Automated Reconciliation: Perform regular data reconciliation between your operational systems and accounting system. For example, total revenue from SIMRS must match the total revenue recorded in the general ledger. Automate the daily or weekly reconciliation process to detect discrepancies early and enable rapid correction.
  5. Security of Sensitive Financial Data: Implement strong security measures, including data encryption in transit and at rest, Role-Based Access Control (RBAC) to limit who can view or modify financial data, as well as regular penetration testing and security audits. Consider compliance with data security standards such as ISO 27001.
  6. System Architecture Scalability: Design your system so that it can grow along with your organization's growth. Use a microservices or modular architecture where possible, separate critical components such as journal processing and reporting. This will facilitate the addition of new features, performance improvements, and maintenance without disrupting the entire system.
  7. Parameterization of Accounting Rules for Flexibility: Avoid hardcoding accounting rules in code. Instead, store these rules (for example, transaction-to-COA mapping, tax rates) in configuration or a database that can be changed by authorized users without the need for code changes. This will facilitate adaptation to changes in internal policies or PSAK standards in the future (for example, updates to PSAK 73 on Leases).

FAQ

  1. What is the biggest challenge in automating PSAK financial reports for hospitals?

    The biggest challenge is the complexity of PSAK rules that must be applied to various types of medical and non-medical transactions, as well as data integration from various operational systems that may not be designed for accounting. Inconsistent data quality and improper Chart of Accounts (COA) mapping are also often major obstacles. Ensuring that every transaction in SIMRS or POS triggers correct and balanced journal entries automatically requires in-depth analysis.

  2. How long does it take to implement this automation system?

    Implementation time varies greatly depending on the scale and complexity of the organization. For a small clinic with a relatively simple system, it may take 3-6 months. Meanwhile, for a large hospital with many SIMRS modules, complex integration, and high transaction volume, this process can take 9-18 months or more. The analysis, design, development, testing, and user training stages all require significant time.

  3. Can this system be integrated with the SIMRS already in our hospital?

    Yes, most automation systems can be integrated with existing SIMRS. Integration methods can be through an API (Application Programming Interface) if the SIMRS has API support, or through a direct connection to the SIMRS database (with strict approval and security), or even through scheduled export/import files. However, the level of difficulty and cost of integration depends greatly on the existing SIMRS architecture and the availability of its technical documentation.

  4. What if there are changes to PSAK standards in the future, can this system adapt?

    A well-designed system should have the flexibility to adapt to changes in PSAK standards. This is achieved through parameterization of accounting rules, where COA mapping and journal logic are stored in configuration that can be changed without modifying the core code. Modular design also allows updating specific components without affecting the entire system. Routine monitoring of PSAK updates from IAI and adaptation planning are key.

  5. What types of reports can be generated automatically by this system?

    This system can generate various core financial reports in accordance with PSAK, including the Balance Sheet (Statement of Financial Position), Comprehensive Income Statement, Statement of Changes in Equity, Cash Flow Statement (both direct and indirect methods), and part of the Notes to Financial Statements (CALK) that are numerical in nature. In addition, internal reports such as General Ledger Reports, Subsidiary Ledger Reports, Accounts Receivable Reports, Accounts Payable Reports, and Inventory Reports can also be generated automatically.

  6. How can we ensure the security of highly sensitive financial data in an automation system?

    Data security is the top priority. The steps that must be taken include encryption of sensitive data (both at rest and in transit), implementation of strict role-based access control (RBAC), use of multi-factor authentication, as well as regular security audits and testing (for example, penetration testing). In addition, ensure the system has an immutable audit trail and regular data backups for disaster recovery. Compliance with data privacy regulations such as GDPR or the Personal Data Protection Act also needs to be considered.

Automation of financial reports in accordance with PSAK standards is a strategic investment that will transform the way your hospital and clinic manage finances. This is not only about reducing manual workload, but also about improving accuracy, transparency, and speed in decision-making. With proper implementation, supported by a solid architecture, modern technology, and a deep understanding of accounting principles, your organization will be ready to face audit challenges, meet regulatory requirements, and optimize financial performance. Do not let manual reports hinder your growth potential. If you are ready to take your organization to the next level with a financial report automation solution that is PSAK-compliant and tailored to your specific needs, Nugroho Setiawan and our team of experts are ready to help. Contact us for a free consultation and demonstration of a custom solution that can accelerate your financial digital transformation.

Related solutions by PT Pilar Inovasi Informatika (Pilar Inovasi IT products): PilarPOS SIMRS (Hospital Information System) BPJS & SatuSehat Integration. Need a free consultation?

Terakhir diperbarui 18 Oct 2026

Komentar

Komentar ditinjau sebelum tampil.

Belum ada komentar. Jadilah yang pertama!