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:
+25
-10
@@ -3875,8 +3875,8 @@
|
||||
"semantic_hash": ""
|
||||
},
|
||||
"docs/api/doctor-import.md": {
|
||||
"mtime": 1783757329.074825,
|
||||
"ast_hash": "cadef9a87e1f9249ffe4a78a3b394a45",
|
||||
"mtime": 1783766160.064325,
|
||||
"ast_hash": "28bb80aa78e7650d0b3e7be75bfc12d0",
|
||||
"semantic_hash": ""
|
||||
},
|
||||
"assets/admin/pages/DoctorClaimsPage.tsx": {
|
||||
@@ -3930,13 +3930,13 @@
|
||||
"semantic_hash": ""
|
||||
},
|
||||
"src/Doctor/Service/DoctorImportService.php": {
|
||||
"mtime": 1783757329.091918,
|
||||
"ast_hash": "1e3ad74119be06e751c97438152c10bf",
|
||||
"mtime": 1783765876.696864,
|
||||
"ast_hash": "56bacf3ad261680191151c347f8cd411",
|
||||
"semantic_hash": ""
|
||||
},
|
||||
"src/Shared/Util/PersianText.php": {
|
||||
"mtime": 1783757329.0920727,
|
||||
"ast_hash": "5f7b411848c6a2969e6e299ed2a770a4",
|
||||
"mtime": 1783765891.9874525,
|
||||
"ast_hash": "477051e58ba2a5a5e9cbf25f3a6992d6",
|
||||
"semantic_hash": ""
|
||||
},
|
||||
"tests/Doctor/DoctorClaimTest.php": {
|
||||
@@ -3945,13 +3945,13 @@
|
||||
"semantic_hash": ""
|
||||
},
|
||||
"tests/Doctor/DoctorImportTest.php": {
|
||||
"mtime": 1783757329.0924423,
|
||||
"ast_hash": "77366f70913004b4b94367c2f47ef00e",
|
||||
"mtime": 1783765976.698628,
|
||||
"ast_hash": "1d99f84ff5b37dacd93000fa8562f994",
|
||||
"semantic_hash": ""
|
||||
},
|
||||
"tests/Shared/PersianTextTest.php": {
|
||||
"mtime": 1783757329.092578,
|
||||
"ast_hash": "7edac40aa2ee51f7fa7d5fbefc9a49f9",
|
||||
"mtime": 1783765905.1030002,
|
||||
"ast_hash": "c852d71e5f7ab87a0dc9250f9e848bd6",
|
||||
"semantic_hash": ""
|
||||
},
|
||||
".claude/prompt/irimc-import-complete.md": {
|
||||
@@ -3978,5 +3978,20 @@
|
||||
"mtime": 1783751951.8968952,
|
||||
"ast_hash": "692f883978aaad1f269b5357ba10a5f6",
|
||||
"semantic_hash": ""
|
||||
},
|
||||
"src/Doctor/Command/FixIrimcNamesCommand.php": {
|
||||
"mtime": 1783766017.2526865,
|
||||
"ast_hash": "fb0cad757bf1405c6919159a374e9154",
|
||||
"semantic_hash": ""
|
||||
},
|
||||
"src/Doctor/Command/PurgeDoctorsCommand.php": {
|
||||
"mtime": 1783766065.697639,
|
||||
"ast_hash": "8ba5c9742c92bbf2a0d01d97ee903dd3",
|
||||
"semantic_hash": ""
|
||||
},
|
||||
".claude/prompt/fix-doctor-name-and-purge.md": {
|
||||
"mtime": 1783765695.1482882,
|
||||
"ast_hash": "b03ab1640dc46aa51114fbc3eba51870",
|
||||
"semantic_hash": ""
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user