Securing Patient Data: A UU PDP Compliance Guide for SIMRS & Clinics
N
Back to Blog

Securing Patient Data: A UU PDP Compliance Guide for SIMRS & Clinics

Industri Kesehatan
Nugroho Setiawan · Konsultan IT & Full Stack Developer 19 Jun 2026 16 min baca 3,462 kata 511 views
This article provides an in-depth discussion of technical and procedural strategies for securing patient data in accordance with Indonesia's Personal Data Protection Law (UU PDP) No. 27 of 2022. We will review concrete implementations in SIMRS and Clinic MIS, from encryption to access management, wi

In the era of digitalization of healthcare services, patient data leaks are no longer a hypothetical threat, but a real risk that has the potential to harm millions of individuals and cause fines of up to billions of rupiah for healthcare facilities. The Personal Data Protection Law (UU PDP) No. 27 of 2022 has explicitly regulated the obligations of data controllers, including hospitals and clinics, to protect sensitive patient information. Medical record data, laboratory test results, treatment history, and biometric data are all personal data that require extra protection. Failure to comply with this regulation not only damages the institution's reputation and patient trust, but can also lead to severe administrative and criminal sanctions. As an Operations Manager and Full Stack Developer experienced in the development of SIMRS, SIM Klinik, as well as integration with BPJS, SatuSehat, and FHIR, Nugroho Setiawan fully understands the complexity and crucial nature of this data security aspect. This article will guide you, Hospital IT Managers, clinic owners, operations managers, and decision makers, through practical and in-depth steps to build a secure and UU PDP-compliant system. We will discuss basic concepts, technical implementation, real code examples, and the latest best practices, ensuring your patient data is optimally protected.

For your information, data shows that the healthcare sector is a primary target for cyber attacks. The IBM Cost of a Data Breach Report 2023 states that the average cost of a data breach in the healthcare industry reaches USD 10.93 million, the highest among all industries for the 3rd consecutive year. This figure reflects how vulnerable health data is and how vital investment in security is. Compliance with the UU PDP is not only about avoiding sanctions, but about maintaining the integrity of healthcare services and public trust.

Basic Concepts of Patient Data Protection Under the UU PDP

The main foundation in securing patient data is a comprehensive understanding of UU PDP No. 27 of 2022. This law defines 'Personal Data' as any data about a person whether identified or identifiable individually or combined with other information either directly or indirectly through electronic or non-electronic systems. In the healthcare context, patient data is inherently 'Specific Personal Data' which includes health data, biometrics, genetics, criminal records, and children's data, which requires a higher level of protection. Concrete examples include the Population Identification Number (NIK), full name, date of birth, address, blood type, allergy history, disease diagnosis (ICD-10/ICD-9-CM), laboratory results (LOINC), radiology images (DICOM), and patient progress notes.

The UU PDP establishes eight basic principles of personal data protection that must be adhered to by data controllers, including healthcare facilities. These principles are: (1) Validity, which means data collection must be based on the consent of the data subject or a legitimate legal basis; (2) Purpose Limitation, data may only be processed for clear and specific purposes; (3) Data Minimization, only relevant and necessary data may be collected; (4) Accuracy, data must be accurate and up-to-date; (5) Limited Storage, data may not be stored longer than necessary; (6) Integrity and Confidentiality, data must be protected from unauthorized access or damage; (7) Accountability, data controllers are responsible for compliance with these principles; and (8) Data Subject Rights, including the right to access, correct, delete, or withdraw consent. Healthcare facilities must also refer to Minister of Health Regulation (PMK) No. 24 of 2022 concerning Medical Records, which mandates the implementation of electronic medical records and the protection of patient data confidentiality.

Violations of these principles can result in administrative sanctions in the form of written warnings, temporary suspension of data processing activities, administrative fines, and revocation of business licenses. In addition, there are also criminal sanctions for individuals who intentionally commit illegal acts related to personal data. For example, Article 67 paragraph (1) of the UU PDP states that any person who intentionally and unlawfully obtains or collects personal data that does not belong to them with the intent to benefit themselves or others may be punished with imprisonment for a maximum of 5 years and/or a fine of at most Rp 5 billion. Therefore, building a strong information security framework, often by adopting international standards such as ISO 27001 for an Information Security Management System (ISMS), is crucial to ensure compliance and risk mitigation.

Technical Implementation of Data Security in Health Information Systems

Translating the principles of the UU PDP into technical implementation requires a layered strategy that covers the entire data lifecycle. First, **Encryption** is the front line. Patient data must be encrypted both at rest and in transit. For data at rest, you can use full disk encryption such as LUKS on a Linux server (for example Ubuntu Server 22.04 LTS) or BitLocker on Windows Server. At the database level, PostgreSQL 16 provides the `pg_crypto` module for encrypting specific columns, or consider a Transparent Data Encryption (TDE) solution if using an enterprise database edition. For data in transit, ensure all communication between systems, including integration with BPJS, SatuSehat, and FHIR, uses the TLS 1.2 protocol or newer (ideally TLS 1.3) with strong cipher suites (for example ECDHE-RSA-AES256-GCM-SHA384). API Gateways such as Kong or Nginx can be configured to automatically enforce these security policies.

Second, **Role-Based Access Control (RBAC)** is very essential. Your SIMRS or Clinic SIM must ensure that each user can only access data relevant to their role. For example, a doctor may only view the medical records of patients under their responsibility, while registration staff can only access patient demographic data. IT admins, even though they have access to the infrastructure, must not have direct access to patient data without strict audit logs. Frameworks like Laravel 11.x can utilize packages such as Spatie Permission, while Node.js 20 LTS applications can implement RBAC using middleware with JSON Web Tokens (JWT) that contain user role information.

Third, a comprehensive **Audit Trail** is a necessity. Every access, modification, or deletion of patient data must be recorded in detail, including who did it, when, and from where. PostgreSQL 16 has logging features that can be configured extensively, and you can also implement triggers on critical tables to record data changes. These logs must be stored separately from the main system and protected from modification. These logs are crucial for digital forensics in the event of an incident.

Fourth, solid **Data Backup and Recovery**. Implement a 3-2-1 backup strategy: at least 3 copies of data, stored on 2 different types of media, with 1 copy stored offsite. Ensure backups are encrypted and tested periodically to ensure their integrity. A Disaster Recovery Plan (DRP) must exist and be simulated regularly. For systems integrated with SatuSehat using the FHIR R4 and HL7 v2.5.1 standards, ensure that connectors such as HAPI FHIR 6.8 or other custom solutions also have integrated audit and security mechanisms, using OAuth 2.0 or OpenID Connect for secure inter-system authentication.

Example Security Implementation Code

To provide a more concrete picture, let's look at some examples of data security implementation at the application level. First, encrypting sensitive data in the database using Laravel. Laravel provides strong encryption facilities through the `Crypt` facade. This is very useful for storing data such as ID card numbers, patient bank account numbers, or highly specific diagnostic information that is rarely accessed directly but requires high protection. The encryption key (`APP_KEY`) must be kept confidential and rotated periodically according to your security policy. Laravel uses OpenSSL with the AES-256-CBC cipher by default, which is a strong industry standard. Ensure your `APP_KEY` is generated correctly and stored in the production environment as an environment variable.

<?phpnamespace AppHttpControllers;use AppModelsPatient;use IlluminateSupportFacadesCrypt;use IlluminateHttpRequest;class PatientController extends Controller{    public function store(Request $request)    {        $validatedData = $request->validate([            'name' => 'required|string|max:255',            'dob' => 'required|date',            'nik' => 'required|string|unique:patients|max:16', // NIK        ]);        $patient = new Patient();        $patient->name = $validatedData['name'];        $patient->dob = $validatedData['dob'];        // Encrypt NIK before saving        $patient->nik = Crypt::encryptString($validatedData['nik']);        $patient->save();        return response()->json(['message' => 'Patient data created successfully.'], 201);    }    public function show($id)    {        $patient = Patient::findOrFail($id);        // Decrypt NIK when retrieved        $patient->nik = Crypt::decryptString($patient->nik);        return response()->json($patient);    }}

The code above shows how a patient's National Identity Number (NIK) is encrypted before being stored in the database and decrypted when retrieved. The `Patient` model is assumed to have a `nik` column with the `text` data type so it can hold the encrypted string. This is an effective approach to protect sensitive data at the application level, adding a layer of security on top of database encryption.

Second, implementing Role-Based Access Control (RBAC) using middleware in a Node.js application with Express.js. This ensures that only users with certain roles can access certain routes or functionality. In this example, we will create middleware that checks whether the user has the 'doctor' role before allowing access to the route for viewing medical records. Role information is usually included in the JSON Web Token (JWT) after user authentication.

// authMiddleware.jsconst jwt = require('jsonwebtoken');const secretKey = process.env.JWT_SECRET || 'supersecretkey'; // Replace with a strong secret key// Middleware to verify JWT and extract rolesexports.verifyToken = (req, res, next) => {    const token = req.headers['authorization'];    if (!token) {        return res.status(403).json({ message: 'No token provided!' });    }    jwt.verify(token.split(' ')[1], secretKey, (err, decoded) => {        if (err) {            return res.status(401).json({ message: 'Unauthorized!' });        }        req.user = decoded; // Store the decoded JWT payload in the request object        next();    });};exports.checkRole = (roles) => {    return (req, res, next) => {        if (!req.user || !req.user.roles) {            return res.status(403).json({ message: 'Access denied. User role not found.' });        }        const userRoles = req.user.roles;        const hasRequiredRole = roles.some(role => userRoles.includes(role));        if (hasRequiredRole) {            next();        } else {            res.status(403).json({ message: 'Access denied. Insufficient permissions.' });        }    };};// app.js (usage example)const express = require('express');const app = express();const { verifyToken, checkRole } = require('./authMiddleware');app.use(express.json());// Protected route for doctorsapp.get('/api/patient-records/:id', verifyToken, checkRole(['dokter', 'admin']), (req, res) => {    // Logic to retrieve patient medical records    res.json({ message: `Patient medical record ${req.params.id} successfully accessed by ${req.user.username}` });});app.listen(3000, () => console.log('Server running on port 3000'));

This code shows how `verifyToken` validates the JWT from the `Authorization` header and `checkRole` checks whether the decoded user role (for example 'dokter' or 'admin') is included in the list of roles allowed to access a particular route. This is an effective method for implementing RBAC on an API, ensuring that only authorized users can access sensitive resources.

Handling Data Payloads and Errors

When interacting with external systems such as SatuSehat or BPJS, managing data payloads becomes very critical. We must ensure that the data sent and received conforms to standards, is secure, and is strictly validated. The FHIR (Fast Healthcare Interoperability Resources) R4 standard is a commonly used framework for health data exchange. Below is an example of a realistic FHIR Patient resource payload, which contains sensitive patient data:

{  "resourceType": "Patient",  "id": "example-patient-001",  "meta": {    "profile": [      "http://hl7.org/fhir/R4/StructureDefinition/Patient"    ]  },  "identifier": [    {      "use": "official",      "type": {        "coding": [          {            "system": "http://terminology.hl7.org/CodeSystem/v2-0203",            "code": "MR"          }        ]      },      "system": "http://example.org/fhir/sid/patient/mrn",      "value": "123456789"    },    {      "use": "official",      "type": {        "coding": [          {            "system": "http://terminology.hl7.org/CodeSystem/v2-0203",            "code": "NI"          }        ]      },      "system": "urn:oid:2.16.840.1.113883.3.242.11.1.1",      "value": "327601xxxxxxxxxxxx"    }  ],  "active": true,  "name": [    {      "use": "official",      "family": "Setiawan",      "given": [        "Budi",        "Nugroho"      ]    }  ],  "telecom": [    {      "system": "phone",      "value": "+6281234567890",      "use": "mobile"    },    {      "system": "email",      "value": "budi.setiawan@example.com"    }  ],  "gender": "male",  "birthDate": "1985-01-15",  "address": [    {      "use": "home",      "type": "physical",      "line": [        "Jl. Kesehatan No. 10"      ],      "city": "Jakarta",      "postalCode": "12345",      "country": "ID"    }  ]}

The payload above contains the patient's NIK (`327601xxxxxxxxxxxx`), name, date of birth, gender, address, and contact details. All of this information is sensitive personal data. When sending this payload to SatuSehat or receiving it from another system, make sure of several things: (1) **Schema Validation:** The payload must be validated against the relevant FHIR R4 schema to ensure data format and integrity. (2) **Encryption in Transit:** Communication must use TLS 1.3. (3) **Authentication & Authorization:** Use OAuth 2.0 or OpenID Connect to ensure that only authorized systems can send/receive data. (4) **Data Minimization:** Only send data that is truly needed by the receiving party for a legitimate purpose.

In addition, error handling is also crucial. When an error occurs, the system must provide an informative error message for developers or administrators, but must not leak sensitive information to end users or unauthorized parties. Below is an example of a good versus bad error message, along with how to handle it:

// Example of a bad error message: internal details leaked{  "status": 500,  "message": "SQLSTATE[23505]: Unique violation: 7 ERROR: duplicate key value violates unique constraint 'patients_nik_unique' (SQL: insert into "patients" ("name", "dob", "nik", "updated_at", "created_at") values (Budi Setiawan, 1985-01-15, 327601xxxxxxxxxxxx, 2023-10-27 10:00:00, 2023-10-27 10:00:00))"}// Example of a good error message: informative but safe{  "status": 409,  "code": "DATA_DUPLICATION",  "message": "The NIK you entered is already registered. Please check again or contact the administrator.",  "details": "A patient with the provided NIK already exists in the system. Please use a unique NIK." // This detail is for internal logging only}

For error handling, every application must have a centralized logging mechanism (for example using ELK Stack or Splunk) that records errors in detail, but ensures that sensitive details (such as full SQL queries with patient data) are only visible to authorized system administrators and are not exposed to the public. Use a unique transaction ID for each API request, so that when an error occurs, this ID can be used to trace the error details in internal logs without needing to display sensitive details to the user. Always return a generic but informative error message on the frontend/API response for the user, while storing technical details for debugging in the backend.

Best Practices for Patient Data Security

  1. Establishment of Clear Internal Policies: Create and implement a Personal Data Protection Policy and Standard Operating Procedures (SOP) that detail how patient data is collected, processed, stored, and deleted, in accordance with the PDP Law and PMK No. 24 of 2022. Ensure these policies are easily accessible and understood by all staff.
  2. Continuous Employee Training and Education: Conduct regular training on data security and PDP Law compliance for all staff, from receptionists to doctors and the IT team. This education must cover identification of cyber threats, strong password practices, handling phishing emails, and incident reporting procedures.
  3. Routine Security Audits and Risk Assessments: Conduct Vulnerability Assessment (VA) and Penetration Testing (PT) periodically, at least once a year, by an independent third party. This helps identify security gaps before they are exploited and ensures the system remains resilient against the latest threats.
  4. Strict Identity and Access Management (IAM): Implement multi-factor authentication (MFA) for all access to systems containing patient data. Ensure complex password policies and periodic password rotation. Implement the principle of least privilege, which is granting the minimum access rights necessary for each role.
  5. Log Monitoring and Incident Response System: Use a Security Information and Event Management (SIEM) system to monitor system activity logs in real-time, detect anomalies, and provide early warnings of potential security incidents. Prepare a clear Incident Response Plan (IRP) and train the team to implement it in the event of a data breach.
  6. Cooperation Agreements with Third Parties (Data Processing Agreement): If you use third-party vendors (for example cloud service providers, external laboratory vendors, or EMR software providers), ensure there is a Data Processing Agreement that binds them to comply with the same security standards and PDP Law as you. Conduct due diligence on their security practices.
  7. Comprehensive Data Encryption: Ensure all patient data is encrypted, both at rest (data at rest) and in transit (data in transit). Use strong industry-standard encryption algorithms such as AES-256 and secure communication protocols such as TLS 1.3. Consider application-level encryption for highly sensitive data.
  8. Data Masking and Anonymization for Non-Production Environments: For development, testing, or training environments, use data that has been masked or anonymized to avoid using real patient data. Tools such as Faker (for Laravel or Node.js) can help generate realistic dummy data.
  9. System Updates and Patch Management: Ensure the server operating system (for example Ubuntu Server 22.04 LTS), database (PostgreSQL 16), framework (Laravel 11.x, Node.js 20 LTS), and all third-party libraries are always updated with the latest security patches. Automating the patch process can reduce vulnerability risks.

FAQ

Q1: What is Specific Personal Data according to the PDP Law and why does health data fall under it?
A1: Specific Personal Data is a category of personal data that requires higher protection because of its highly sensitive nature and potential to cause discrimination if misused. According to the PDP Law, this includes health data, biometrics, genetics, political views, religious beliefs, criminal records, and children's data. Health data is included because it reveals information about a person's physical and mental condition, disease history, diagnosis, and treatment, which is highly private information and can cause stigma or discrimination if not properly protected. Breaches of this data can have serious impacts on individuals.

Q2: What is the role of SIMRS in PDP Law compliance?
A2: SIMRS (Hospital Management Information System) has a central role in PDP Law compliance because it is the main place for storing and processing most patient personal data. SIMRS must be designed with built-in security features such as role-based access control (RBAC), data encryption, comprehensive audit trails, and strong backup/recovery mechanisms. SIMRS must also support the implementation of privacy policies, such as the ability to manage data subject consent and facilitate data subject rights (for example, the right to access or delete their data). SIMRS compliance is the key to the overall success of healthcare facility compliance.

Q3: What are the sanctions for violating the PDP Law regarding patient data?
A3: Sanctions for violating the PDP Law regarding patient data can be administrative and criminal. Administrative sanctions include written warnings, temporary suspension of data processing activities, administrative fines (up to 2% of annual revenue), and revocation of business licenses. Criminal sanctions can include imprisonment for a maximum of 6 years or a fine of up to Rp 6 billion, depending on the type of violation (for example, unlawfully obtaining data, disclosing data that does not belong to one, or falsifying personal data). These sanctions apply to data controllers (healthcare facilities) and individuals who commit violations.

Q4: How can SatuSehat integration be ensured to be secure in accordance with the PDP Law?
A4: To ensure SatuSehat integration is secure in accordance with the PDP Law, there are several crucial steps. First, ensure communication uses secure protocols such as HTTPS with TLS 1.3 and strict server certificate validation. Second, implement strong authentication and authorization using the OAuth 2.0 or OpenID Connect standards specified by SatuSehat. Third, ensure the data sent complies with the FHIR R4 standard and includes only the necessary information. Fourth, record all data exchange activities with SatuSehat in a secure and immutable audit log. Fifth, conduct regular security testing on your integration connector to identify potential vulnerabilities.

Q5: Is encryption alone enough to protect patient data?
A5: Encryption is a very important security component, but it is not enough on its own. Encryption protects data from unauthorized access when stored or transferred, but it does not protect against other threats such as phishing attacks, malware, or human error. Protecting patient data requires a layered strategy that includes role-based access control (RBAC), audit trails, identity and access management (IAM), strong security policies, employee training, routine system updates (patch management), and an incident response plan. Encryption is part of a larger puzzle in building a comprehensive security ecosystem.

Q6: How often should healthcare facilities conduct data security audits?
A6: Healthcare facilities should conduct data security audits routinely, at least once a year, or more often if there are significant changes to systems or IT infrastructure. These audits should include vulnerability assessment, penetration testing by an independent third party, and review of security policies and procedures. In addition to external audits, internal audits and security log reviews should be carried out continuously, even daily or weekly. Regular audits help ensure that systems remain secure against evolving threats and remain compliant with applicable regulations.

The future of digital healthcare depends heavily on trust. This trust can only be built and maintained if patients' personal data is protected to the highest standards, in accordance with the mandate of the PDP Law. Implementing the technical and procedural security measures outlined above is not merely a legal obligation, but a strategic investment in the sustainability and reputation of your healthcare facility. With the adoption of appropriate technology, strong policies, and high employee awareness, you can create a secure and trustworthy data environment. If you need further consultation or assistance in designing, developing, and implementing a secure SIMRS or SIM Klinik solution that complies with the PDP Law and is integrated with digital health ecosystems such as BPJS and SatuSehat, do not hesitate to contact Nugroho Setiawan. We are ready to help you build a solid and secure digital foundation.

This article is part of the knowledge base of Nugroho Setiawan, an IT consultant in Jogja (Yogyakarta). Related solutions: SIMRS (Hospital Information System) Clinic Management System SatuSehat Integration. Need a free consultation?

Terakhir diperbarui 18 Oct 2026

Komentar

Komentar ditinjau sebelum tampil.

Belum ada komentar. Jadilah yang pertama!

Butuh bantuan implementasi atau dashboard data?

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

WhatsApp Jasa Visualisasi Data Demo VizStudio
Produk & Solusi SIMRS ERP Portfolio Konsultasi Gratis