Tutorial: Building Automated Financial Reports Compliant with PSAK Standards for Healthcare Facilities
N
Back to Blog

Tutorial: Building Automated Financial Reports Compliant with PSAK Standards for Healthcare Facilities

Tutorial
Nugroho Setiawan · Konsultan IT & Full Stack Developer 09 Sep 2026 14 min baca 3,193 kata 162 views
Learn step by step how to build an automated financial reporting system that complies with PSAK standards. This guide covers architecture, technical implementation, and error handling for healthcare facilities. Enhance the efficiency and accuracy of your financial reporting.

Financial report management is the backbone of operations for every healthcare facility, from large hospitals to primary clinics. However, the process of preparing financial reports in accordance with Statements of Financial Accounting Standards (PSAK) often takes time, is prone to manual errors, and requires significant resources. With the ever-increasing volume of patient, drug, and service transactions, the challenge of presenting accurate, timely, and audit-ready reports becomes greater. Many operational and IT managers in healthcare facilities struggle with fragmented systems, where data from the Hospital Management Information System (SIMRS), pharmacy Point of Sales (POS), and payroll system has not been seamlessly integrated into a single centralized accounting system. As a result, data reconciliation becomes a nightmare, and compliance with PSAK becomes questionable. This article serves as a comprehensive guide for you, IT managers, clinic owners, or decision-makers, who want to automate your financial reporting process. We will discuss basic concepts, technical architecture, implementation code examples, and best practices for building an efficient, accurate system that complies with PSAK standards, drawing on our experience in SIMRS and ERP development.

Basic Concepts of PSAK Financial Report Automation

Statements of Financial Accounting Standards (PSAK) are the primary guidelines in the preparation of financial reports in Indonesia, ensuring consistency and comparability of financial information. For healthcare facilities, compliance with PSAK, especially PSAK 1 (Presentation of Financial Statements) which regulates the format and content of reports, as well as certain ISAK (Interpretations of Financial Accounting Standards) relevant to the service industry, is essential. The main financial statements include the Statement of Financial Position (Balance Sheet), Statement of Comprehensive Income, Statement of Cash Flows, Statement of Changes in Equity, and Notes to the Financial Statements. Automation aims to eliminate manual data input, reduce the risk of errors, accelerate the book closing process, and ensure that every operational transaction is recorded accounting-wise in accordance with the debit-credit principle.

The basic principle of automation is to create a 'single source of truth' for financial data. This means that transaction data occurring in operational modules such as patient registration, billing, drug purchasing, or payroll automatically triggers accounting journals. For example, when a patient makes a payment for medical services in SIMRS, the system will automatically create a journal entry that debits the Cash or Bank account and credits the Medical Service Revenue account, in accordance with the Chart of Accounts (CoA) that has been carefully defined and complies with PSAK. This is far different from the manual approach in which accounting staff must summarize transactions from various sources and input them one by one.

Concrete example: A clinic records 500 patient transactions per day. If each transaction requires 5-10 minutes of manual input to be recorded in the journal, this means 2,500-5,000 minutes or 40-80 work hours per day just for basic recording. Automation reduces this time to zero for input, freeing accounting staff to focus on more complex analysis and reconciliation. Automated data also has higher integrity because it minimizes human intervention and ensures consistency in the application of accounting rules. It also supports a strong audit trail, where every journal entry can be traced back to its original operational transaction, providing full transparency to internal and external auditors.

With automation, financial reports can be generated on-demand, enabling management to make strategic decisions based on real-time data, not outdated data. This also helps in identifying financial trends, analyzing the profitability of services or departments, and more accurate budget planning. Compliance with PSAK is not only an obligation, but also becomes easier to achieve and maintain through a structured and automated system.

Architecture and Technical Implementation of the Automation System

Building a PSAK-standard financial report automation system requires a planned architecture and the right choice of technology. The architecture we recommend centers on data integration from various operational systems into a single centralized accounting platform. First, **Data Ingestion** is the process of pulling data from sources such as SIMRS (which may use PostgreSQL 16 or MySQL 8), pharmacy Point of Sales (POS) systems (MariaDB 10.x), and other ERP systems (for example, Odoo 16 or SAP Business One). This process can be done in batch (for example, at the end of each day) or real-time using an event-driven mechanism.

Next, **Data Transformation (ETL)** is a crucial stage in which raw data from operational systems is transformed into a format suitable for accounting recording. This involves mapping operational transactions (for example, drug sales, doctor fees, patient payments) to the correct accounts in the Chart of Accounts (CoA) in accordance with PSAK. This stage can be implemented using custom microservices built with Node.js 20 LTS (using Express.js) or PHP 8.3 (with Laravel 11.x). Alternatively, specialized ETL tools such as Apache Nifi or Pentaho Data Integration can be used for more complex scenarios. It is important to ensure consistency in account mapping and the application of appropriate accounting rules, such as revenue recognition based on the accrual method.

Transformed data is then stored in a **Data Warehouse or Data Mart** specifically designed for financial analysis. We recommend PostgreSQL 16 due to its powerful OLAP (Online Analytical Processing) features, JSONB support for semi-structured data, and scalability. This data then becomes the foundation for the **Reporting Layer**. For the backend API, Laravel 11.x is highly suitable because of its rich ecosystem, including Eloquent ORM for efficient database interaction and Laravel Sanctum for secure API authentication. The frontend can be built with Vue.js 3 (using the Composition API) or React 18, providing a responsive and intuitive user interface for viewing reports and performing reconciliation. Additionally, integration with Business Intelligence (BI) tools such as Metabase or Apache Superset can provide deeper data visualization.

Another important aspect is **Integration and Communication Between Systems**. For real-time communication, Message Queues such as RabbitMQ 3.12 or Apache Kafka 3.6 can be used to send transaction events between systems. For example, when a patient payment is successful in SIMRS, a 'PaymentProcessed' event is sent to the queue, and the accounting service will listen for that event to automatically create journal entries. For the API, implementing the RESTful API standard with OAuth2 authentication or API tokens is very important for security and interoperability. With this architecture, healthcare facilities can have an integrated, efficient financial system and be ready for audits with accurate and real-time data.

Example Code for Journal Entry Implementation

To provide a concrete overview, let us see how journal entry recording can be implemented using a modern framework such as Laravel 11.x and PostgreSQL 16 database. The core part of the accounting system is the journal table that records every debit and credit movement. Below is an example Laravel migration to create the `journal_entries` table that serves as the basis for recording financial transactions.

<?phpnamespace Database\Migrations;use Illuminate\Database\Migrations\Migration;use Illuminate\Database\Schema\Blueprint;use Illuminate\Support\Facades\Schema;return new class extends Migration{    /**     * Run the migrations.     */    public function up(): void    {        Schema::create('journal_entries', function (Blueprint $table) {            $table->id();            $table->date('transaction_date');            $table->unsignedBigInteger('account_id');            $table->decimal('debit', 15, 2)->default(0);            $table->decimal('credit', 15, 2)->default(0);            $table->text('description')->nullable();            $table->string('source_document_type')->nullable();            $table->unsignedBigInteger('source_document_id')->nullable();            $table->timestamps();            $table->foreign('account_id')->references('id')->on('chart_of_accounts');            $table->index(['transaction_date', 'account_id']);        });    }    /**     * Reverse the migrations.     */    public function down(): void    {        Schema::dropIfExists('journal_entries');    }

This migration creates the `journal_entries` table that is the core of the accounting system. Every financial transaction, whether debit or credit, will be recorded in this table. The `account_id` column refers to the `chart_of_accounts` table containing the list of accounts according to PSAK. `source_document_type` and `source_document_id` are important for tracking the origin of transactions, for example from the patient payment or drug purchase module. The use of indexes on `transaction_date` and `account_id` will speed up the data aggregation process when preparing monthly or annual financial reports. This ensures that every value movement is recorded in detail and can be audited.

After the journal table is ready, we need a service to post transactions to the journal. This service will ensure that every transaction meets the basic accounting principle, namely the balance of debit and credit. The following is an example implementation in Laravel:

<?phpnamespace App\Services;use App\Models\JournalEntry;use App\Models\Account;use Illuminate\Support\Facades\DB;use Exception;class AccountingService{    public function postTransaction(        string $description,        string $sourceType,        int $sourceId,        array $entries,        string $date = null    ): void {        DB::beginTransaction();        try {            $totalDebit = 0;            $totalCredit = 0;            $transactionDate = $date ? new \DateTime($date) : new \DateTime();            foreach ($entries as $entry) {                $account = Account::where('code', $entry['account_code'])->firstOrFail();                JournalEntry::create([                    'transaction_date' => $transactionDate,                    'account_id' => $account->id,                    'debit' => $entry['debit'] ?? 0,                    'credit' => $entry['credit'] ?? 0,                    'description' => $description,                    'source_document_type' => $sourceType,                    'source_document_id' => $sourceId,                ]);                $totalDebit += ($entry['debit'] ?? 0);                $totalCredit += ($entry['credit'] ?? 0);            }            if (abs($totalDebit - $totalCredit) > 0.01) {                throw new Exception("Debit and Credit amounts do not balance for transaction: " . $description);            }            DB::commit();        } catch (Exception $e) {            DB::rollBack();            throw $e;        }    }}

This `AccountingService` class provides the `postTransaction` method to record transactions to the journal. This method accepts an `entries` array containing account details and debit/credit amounts. It is important to ensure that total debits always equal total credits to maintain general ledger balance. We use database transactions (DB::beginTransaction, DB::commit, DB::rollBack) to guarantee operation atomicity, meaning all entries are successfully saved or none at all. This is crucial for financial data integrity. If there is an error, for example an account not found or debit/credit imbalance, the entire operation will be rolled back to prevent inconsistent data. This function serves as a bridge between operational activities and accounting recording, ensuring every activity in SIMRS or other systems is correctly reflected in the general ledger.

Data Integration and Error Handling

Data integration is the heart of financial statement automation systems. Transaction data that occurs in operational systems (for example, SIMRS) must be sent to the accounting system. The following is an example of a realistic JSON payload for representing patient payments from SIMRS to the accounting system:

{  "transaction_id": "INV-20231120-001",  "transaction_date": "2023-11-20",  "patient_id": "P-00123",  "invoice_number": "INV/RS/2023/11/001",  "total_amount": 1500000.00,  "payment_method": "Cash",  "items": [    {      "service_code": "CONSULT_DR_A",      "description": "Konsultasi Dokter Umum",      "amount": 250000.00,      "revenue_account_code": "41101"    },    {      "service_code": "MED_PARACETAMOL",      "description": "Obat Paracetamol 500mg",      "amount": 50000.00,      "revenue_account_code": "41102"    }  ],  "payment_details": {    "cash_received": 1500000.00,    "change_given": 0.00,    "cash_account_code": "11101"  }}

The JSON payload above represents a single patient payment transaction. SIMRS sends this data to the accounting system's API endpoint. The accounting system then processes this payload, mapping `revenue_account_code` (for example, 41101 for Medical Consultation Revenue and 41102 for Drug Sales Revenue) and `cash_account_code` (for example, 11101 for Cash in Bank) to the defined Chart of Accounts. Thus, one operational transaction produces several balanced journal entries (debit Cash, credit Revenue). This integration can be done synchronously (direct API call) or asynchronously (via a message queue such as RabbitMQ for resilience and scalability).

Error handling is a crucial aspect of financial data integration. Errors can occur for various reasons, such as invalid account codes, debit/credit imbalance, or connectivity issues. Examples of error messages that may appear are: {"code": "ACC-001", "message": "Account code '41101' not found in Chart of Accounts."} or {"code": "TRANS-002", "message": "Transaction imbalance: total debit (1500000.00) does not equal total credit (1450000.00)."}.

Effective error handling strategies include: First, **Robust Data Validation**. Every API endpoint must have strict validation to ensure the integrity of incoming data. Second, **Centralized Logging**. Use a centralized logging system such as the ELK Stack (Elasticsearch, Logstash, Kibana) or Grafana Loki to record all transactions and errors. This makes troubleshooting easier. Third, **Alerting System**. Configure real-time alerts (for example, via Slack or email) for critical errors such as transaction imbalance or integration failure. Fourth, **Automatic Retry Mechanism**. For temporary errors (transient errors) such as network issues, implement a retry mechanism with exponential backoff. Fifth, **Manual Reconciliation**. Provide an interface or tools for the finance team to review and correct failed transactions manually, especially for persistent errors that require human intervention. Finally, ensure **Idempotency** in the API, meaning sending the same payload repeatedly will not create duplicate journal entries. This prevents duplicate data issues if a retry or network failure occurs.

Best Practices for PSAK Financial Statement Automation

  1. Define a Comprehensive Chart of Accounts (CoA) in Accordance with PSAK: Align the CoA with relevant PSAK (e.g., PSAK 1, ISAK 35) and your healthcare facility's operational needs. Ensure every type of revenue, expense, asset, and liability has a clear account and a logical hierarchy to facilitate reporting and analysis. This will be the main foundation for your automated accounting system.
  2. Implement a Strong and Detailed Audit Trail: Every change to financial data, from creating journal entries to modifications, must be fully recorded. Record who changed it, when, from where (IP address), and what changes were made. This audit trail is crucial for compliance, accounting forensics, and maintaining data integrity.
  3. Apply Strict Data Validation at Every Entry Point: Ensure that data entering the accounting system is clean and valid. Validation must be performed at the data source (e.g., SIMRS) and also at the accounting system's API. This includes validation of numeric format, correct dates, existing account references, and reasonable value limits.
  4. Automatically Test Debit/Credit Balance for Every Transaction: The system must automatically check that total debits always equal total credits for every journal entry. If not balanced, the transaction must be rejected or flagged for manual review, preventing fundamental errors in the general ledger and financial statements.
  5. Use Secure, Efficient, and Idempotent API Integration: Ensure the API used for data transfer between systems is secure (using OAuth2 or API tokens), optimized for performance, and able to handle duplicate requests without creating duplicate entries. Good API design will reduce the risk of integration failures.
  6. Plan System Scalability from the Initial Design Stage: Consider future growth in transaction data volume. Use scalable databases such as PostgreSQL or ClickHouse, a microservices architecture for modularity, and appropriate caching techniques to maintain system performance as data grows.
  7. Provide Clear Manual Reconciliation and Exception Mechanisms: Although automation is the main goal, still provide features for the finance team to perform manual reconciliation, especially for complex transactions or during initial implementation. Define clear workflows for handling exceptions and errors that cannot be resolved automatically.
  8. Focus on Flexible Reporting and Data Visualization: In addition to standard PSAK reports, provide the ability to generate dashboards and ad-hoc reports. This enables management to analyze financial performance from various perspectives, such as profitability per service or cost efficiency per department, for better decision-making.
  9. Prioritize Financial Data Security with Encryption and Access Control: Protect sensitive data with encryption at rest (data at rest) and in transit (data in transit). Apply strict role-based access control (RBAC) to ensure only authorized users can access and modify financial data. Perform security audits regularly.

FAQ About PSAK Financial Statement Automation

  1. Q: Can this system be integrated with an existing SIMRS?

    A: Yes, it is very possible. The best approach is to use an API (Application Programming Interface) to pull transaction data from SIMRS. We have experience with various SIMRS and can design a suitable connector, whether through REST API, HL7 FHIR, or even reading directly from the database with proper permissions, ensuring accurate and real-time financial data. The integration process will begin with an in-depth analysis of your existing SIMRS data structure.

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

    A: Implementation time varies depending on the complexity and scale of the healthcare facility. For a basic system with integration to one data source, it may take 3-6 months. However, for a more comprehensive implementation with many modules and specific PSAK adjustments, it can reach 9-12 months or more. The stages include requirements analysis, architecture design, development, thorough testing, and end-user training to ensure successful adoption.

  3. Q: Does this system meet all PSAK standards in Indonesia?

    A: This system is designed to facilitate compliance with key PSAK such as PSAK 1 (Presentation of Financial Statements), PSAK 2 (Statement of Cash Flows), and other related standards. However, it is important to note that final compliance also depends on correct Chart of Accounts configuration and the internal accounting policies applied. We will work with your accounting team to ensure proper mapping and help interpret the standards applicable to your healthcare facility context.

  4. Q: How does the system handle future PSAK changes?

    A: Flexibility is key. Our system is built with a modular architecture that allows adjustment of accounting and reporting rules. Changes to PSAK, such as updates to revenue recognition standards or asset classification, can be accommodated through reconfiguration of system parameters or development of additional modules without needing to overhaul the entire core system. We also provide ongoing support services for this adaptation, ensuring your system remains relevant to the latest regulations.

  • Q: Are there financial data security risks with automation systems?

    A: Data security is a top priority. We implement industry security standards such as data encryption (at rest and in transit), strict role-based access control (RBAC), and detailed audit trails. In addition, the system will undergo regular penetration testing to identify and fix potential vulnerabilities, ensuring the confidentiality and integrity of your financial data. The entire infrastructure will also be managed with best security practices.

  • Q: Can this system generate customized reports for management besides PSAK reports?

    A: Of course. In addition to standard PSAK financial reports, this system is designed to generate various managerial reports. These include department performance reports, cost analysis per patient, service profitability, and real-time dashboards that can be tailored to management's specific needs for strategic decision-making. Flexibility in reporting is one of the main advantages of this automation, allowing you to gain insights beyond mere compliance.

  • Automation of standard PSAK financial reports is no longer a luxury, but a necessity for healthcare facilities that want to remain competitive and compliant in the digital era. By implementing the right system, you will not only improve reporting efficiency and accuracy, but also free your team from repetitive manual tasks, allowing them to focus on strategic analysis and improving patient services. The solution we offer is designed to provide full visibility into your financial condition, support faster and more accurate decision-making, and ensure full compliance with applicable accounting regulations. If you are ready to take your healthcare facility's financial reports to the next level with smart, PSAK-compliant automation, Nugroho Setiawan and team are ready to help. We offer in-depth consultation, custom system design, through full implementation. Contact us today to discuss your specific needs and how our solution can have a real impact on your operational efficiency and financial compliance.

    This article is part of education by Nugroho Setiawan, IT consultant Jogja. Related solutions: PilarPOS SIMRS SIM Klinik. Need free consultation?

    Terakhir diperbarui 18 Oct 2026

    Komentar

    Komentar ditinjau sebelum tampil.

    Belum ada komentar. Jadilah yang pertama!

    Butuh bantuan implementasi?

    Saya membantu konsultasi IT & pengembangan aplikasi untuk rumah sakit, klinik, dan bisnis di Yogyakarta (DIY), Magelang, dan sekitarnya.

    Produk & Solusi SIMRS ERP Portfolio Konsultasi Gratis