# Repo Working Notes - Verify the actual file, class name, and call site before changing a library/controller reference. - If a class load error appears, check the existing library file and the current repo usage pattern first. - Do not swap to a different library name on assumption alone. - Keep fixes minimal and local unless the user asks for a broader refactor. - If a task changes live DB objects such as table schema, trigger, stored procedure, or function, always add a SQL record file under `sql/manual_changes/`. - Name the SQL record file with the pattern `YYYY-MM-DD-.sql`. - The SQL record file must include the actual SQL change that was applied, not just a note. - Before every `commit` and `push`, always check first whether local branch needs to pull/rebase from remote. - To upload to IBL, run `bash scripts/upload_ibl_committed_files.sh`. Only run this when the user explicitly asks to upload to IBL. Do not run automatically after commit/push. ## PDP Encryption & BIRT Report UU PDP No. 27/2022 mengharuskan enkripsi PII pasien. `M_PatientDOB`, `M_PatientName`, dll di-mask NULL di kolom plain, nilai asli ada di kolom `_enc` (AES-256-GCM). ### Pola wajib: PHP Proxy Stream BIRT membaca dari tabel `patient_print_cache`. Cache harus di-populate PHP sebelum BIRT dipanggil, dan dihapus segera setelah PDF di-stream. ``` FE → PHP proxy → populate cache → fetch BIRT → delete cache → stream PDF ``` **Jangan pernah** buat FE langsung build URL `/birt/frameset?...` lalu set ke iframe/window.open tanpa lewat PHP proxy — cache tidak akan pernah terisi, data pasien kosong di report. ### Endpoint proxy yang tersedia ``` GET /one-api-lab/tools/birt_proxy/stream_by_code Params: token, report_code (print_transaction code), PT_OrderHeaderID Return: binary PDF ``` Untuk BE yang perlu return URL ke FE, gunakan `Reporturl` library: ```php $this->load->library('reporturl'); [$ok, $url] = $this->reporturl->get_report_url_by_code($report_code, [ 'PT_OrderHeaderID' => $order_id, 'PUsername' => $username, ]); // $url sudah mengarah ke stream_by_code — tidak perlu populate/delete cache manual ``` ### Daftar print_transaction code | Group | Print siap | Print belum siap | Email | |-------|-----------|-----------------|-------| | LAB | `LAB-RESULT-P-01` | `LAB-RESULT-NP-01` | `LAB-RESULT-P-02` | | LAB (Inggris) | `LABEN-RESULT-P-01` | `LABEN-RESULT-NP-01` | `LABEN-RESULT-P-02` | | Mikro (terlampir) | `MIKRO-RESULT-P-01` | `MIKRO-RESULT-NP-01` | `MIKRO-RESULT-P-02` | | Mikro (tidak terlampir) | `LAB-RESULT-P-01` | `LAB-RESULT-NP-01` | `LAB-RESULT-P-02` | | Mikro (Inggris) | `MIKROEN-RESULT-P-01` | `MIKROEN-RESULT-NP-01` | `MIKROEN-RESULT-P-02` | | FNA | `FNA-RESULT-P-01` | `FNA-RESULT-NP-01` | `FNA-RESULT-P-02` | | Patologi Anatomi | `PA-RESULT-P-01` | `PA-RESULT-NP-01` | `PA-RESULT-P-02` | | Papsmear | `PAP-RESULT-P-01` | `PAP-RESULT-NP-01` | `PAP-RESULT-P-02` | | Pap Smear LCP | `PAPLCP-RESULT-P-01` | `PAPLCP-RESULT-NP-01` | `PAPLCP-RESULT-P-02` | | Pap Smear LCP (Inggris) | `PAPLEN-RESULT-P-01` | `PAPLEN-RESULT-NP-01` | `PAPLEN-RESULT-P-02` | | Preparasi Sperma | `PS-RESULT-P-01` | `PS-RESULT-NP-01` | `PS-RESULT-P-02` | | DFI | `DFI-RESULT-P-01` | `DFI-RESULT-NP-01` | `DFI-RESULT-P-02` | | Cytologi | `CT-RESULT-P-01` | `CT-RESULT-NP-01` | `CT-RESULT-P-02` | ### Deteksi modul yang belum difix Cari pola ini di FE: ``` /birt/frameset?__report= ``` Kalau ditemukan di JS/Vue yang langsung set ke iframe/object/window.open tanpa lewat PHP proxy, itu harus diganti ke `stream_by_code`. ### Library terkait - `application/libraries/Ibl_patient_decrypt.php` — populate/delete `patient_print_cache` - `application/libraries/Ibl_sampling_normal.php` — pengganti `fn_sampling_get_normal` MySQL function (semua `Re_px.php` sudah diupdate) - `application/controllers/tools/Birt_proxy.php` — proxy stream handler ## graphify This project has a graphify knowledge graph at graphify-out/. Rules: - Before answering architecture or codebase questions, read graphify-out/GRAPH_REPORT.md for god nodes and community structure - If graphify-out/wiki/index.md exists, navigate it instead of reading raw files - For cross-module "how does X relate to Y" questions, prefer `graphify query ""`, `graphify path "" ""`, or `graphify explain ""` over grep — these traverse the graph's EXTRACTED + INFERRED edges instead of scanning files - After modifying code files in this session, run `graphify update .` to keep the graph current (AST-only, no API cost)