fix(doctor): strip «دکتر» prefix on IRIMC import + name-fix & purge commands
Root cause of "دکتر دکتر …" (and ellipsis-truncated "…نی") in admin: IRIMC
names already contain the «دکتر» title, while the panel renders «دکتر {name}».
Convention is to store the bare name.
- DoctorImportService: normalize name via PersianText::stripDoctorTitle
(also fixes ي/ی, ك/ک, half-space)
- PersianText::stripDoctorTitle now strips consecutive «دکتر دکتر …» prefixes
- app:doctors:fix-irimc-names: one-off backfill for existing source='irimc'
rows (dry-run supported) — fixed 340 rows
- app:doctors:purge: FK-safe full wipe of doctors + all dependent tables +
orphan surrogate users, for a clean test DB (dry-run default, --force to
apply, prod-guarded)
- tests: PersianTextTest cases for the title stripping; DoctorImportTest
asserts stored name has no «دکتر» prefix
- docs/api/doctor-import.md: name convention + the two new commands
Verified: import "دکتر صفورا حجازی نیا" → stored "صفورا حجازی نیا" → panel
shows single «دکتر صفورا حجازی نیا».
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
graphify-out/cache/ast/v0.8.44/0e3d20caf42e18bb85e6cec731cff7076cb85c6b2cbc547abb921fa84a468a50.json
Vendored
+1
File diff suppressed because one or more lines are too long
graphify-out/cache/ast/v0.8.44/1f37217049a8ca479d497bb907bafb8f9bcc2e265fb08195460c0f397733a972.json
Vendored
+1
File diff suppressed because one or more lines are too long
graphify-out/cache/ast/v0.8.44/2cb340da1777982d5574a2b0814759c29b69df1c17c980a29833e9cb256eaf14.json
Vendored
+1
File diff suppressed because one or more lines are too long
graphify-out/cache/ast/v0.8.44/50fdf90004146a15e585ee236afc779dc00dfe185789afbfd9395d7a0d941b0f.json
Vendored
+1
File diff suppressed because one or more lines are too long
graphify-out/cache/ast/v0.8.44/5b9cc4215a15c89facbacc3e796147edcd9915d547d75fddeb9477a3636e0afd.json
Vendored
+1
File diff suppressed because one or more lines are too long
graphify-out/cache/ast/v0.8.44/8fac38bd8a0c0f92aebb516d01709532f0bec4ec9bfd2f2b44ae6d72dc15ac44.json
Vendored
+1
File diff suppressed because one or more lines are too long
graphify-out/cache/ast/v0.8.44/af59e4c78dd2af8b4fa27e171650c7e12f7b0c656b944634bdb38b2a3b4d0fa3.json
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"nodes": [{"id": "users_hamed_pj_my_pj_clinic_pro_clinicpro_src_shared_util_persiantext_php", "label": "PersianText.php", "file_type": "code", "source_file": "src/Shared/Util/PersianText.php", "source_location": "L1"}, {"id": "util_persiantext_persiantext", "label": "PersianText", "file_type": "code", "source_file": "src/Shared/Util/PersianText.php", "source_location": "L12"}, {"id": "util_persiantext_persiantext_normalize", "label": ".normalize()", "file_type": "code", "source_file": "src/Shared/Util/PersianText.php", "source_location": "L14"}, {"id": "util_persiantext_persiantext_samename", "label": ".sameName()", "file_type": "code", "source_file": "src/Shared/Util/PersianText.php", "source_location": "L40"}, {"id": "util_persiantext_persiantext_stripdoctortitle", "label": ".stripDoctorTitle()", "file_type": "code", "source_file": "src/Shared/Util/PersianText.php", "source_location": "L46"}], "edges": [{"source": "users_hamed_pj_my_pj_clinic_pro_clinicpro_src_shared_util_persiantext_php", "target": "util_persiantext_persiantext", "relation": "contains", "confidence": "EXTRACTED", "source_file": "src/Shared/Util/PersianText.php", "source_location": "L12", "weight": 1.0}, {"source": "util_persiantext_persiantext", "target": "util_persiantext_persiantext_normalize", "relation": "method", "confidence": "EXTRACTED", "source_file": "src/Shared/Util/PersianText.php", "source_location": "L14", "weight": 1.0}, {"source": "util_persiantext_persiantext", "target": "util_persiantext_persiantext_samename", "relation": "method", "confidence": "EXTRACTED", "source_file": "src/Shared/Util/PersianText.php", "source_location": "L40", "weight": 1.0}, {"source": "util_persiantext_persiantext", "target": "util_persiantext_persiantext_stripdoctortitle", "relation": "method", "confidence": "EXTRACTED", "source_file": "src/Shared/Util/PersianText.php", "source_location": "L46", "weight": 1.0}], "raw_calls": [{"caller_nid": "util_persiantext_persiantext_normalize", "callee": "class_exists", "is_member_call": false, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/src/Shared/Util/PersianText.php", "source_location": "L16", "receiver": null}, {"caller_nid": "util_persiantext_persiantext_normalize", "callee": "\\Normalizer", "is_member_call": false, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/src/Shared/Util/PersianText.php", "source_location": "L17", "receiver": null}, {"caller_nid": "util_persiantext_persiantext_normalize", "callee": "strtr", "is_member_call": false, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/src/Shared/Util/PersianText.php", "source_location": "L20", "receiver": null}, {"caller_nid": "util_persiantext_persiantext_normalize", "callee": "strtr", "is_member_call": false, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/src/Shared/Util/PersianText.php", "source_location": "L31", "receiver": null}, {"caller_nid": "util_persiantext_persiantext_normalize", "callee": "array_combine", "is_member_call": false, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/src/Shared/Util/PersianText.php", "source_location": "L31", "receiver": null}, {"caller_nid": "util_persiantext_persiantext_normalize", "callee": "trim", "is_member_call": false, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/src/Shared/Util/PersianText.php", "source_location": "L36", "receiver": null}, {"caller_nid": "util_persiantext_persiantext_normalize", "callee": "preg_replace", "is_member_call": false, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/src/Shared/Util/PersianText.php", "source_location": "L36", "receiver": null}, {"caller_nid": "util_persiantext_persiantext_samename", "callee": "self", "is_member_call": false, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/src/Shared/Util/PersianText.php", "source_location": "L42", "receiver": null}, {"caller_nid": "util_persiantext_persiantext_samename", "callee": "self", "is_member_call": false, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/src/Shared/Util/PersianText.php", "source_location": "L42", "receiver": null}, {"caller_nid": "util_persiantext_persiantext_stripdoctortitle", "callee": "self", "is_member_call": false, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/src/Shared/Util/PersianText.php", "source_location": "L48", "receiver": null}, {"caller_nid": "util_persiantext_persiantext_stripdoctortitle", "callee": "trim", "is_member_call": false, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/src/Shared/Util/PersianText.php", "source_location": "L50", "receiver": null}, {"caller_nid": "util_persiantext_persiantext_stripdoctortitle", "callee": "preg_replace", "is_member_call": false, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/src/Shared/Util/PersianText.php", "source_location": "L50", "receiver": null}]}
|
||||
graphify-out/cache/ast/v0.8.44/b7801eae1d8e5515a35c3c99e9d2858204c660975c0e17f35ec38a0d1afcfc5c.json
Vendored
+1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user