Files
clinicpro/graphify-out/cache/ast/v0.8.44/5b9cc4215a15c89facbacc3e796147edcd9915d547d75fddeb9477a3636e0afd.json
T
hamedandClaude Opus 4.8 51432c7bb9 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>
2026-07-11 14:07:18 +03:30

1 line
9.8 KiB
JSON

{"nodes": [{"id": "users_hamed_pj_my_pj_clinic_pro_clinicpro_tests_shared_persiantexttest_php", "label": "PersianTextTest.php", "file_type": "code", "source_file": "tests/Shared/PersianTextTest.php", "source_location": "L1"}, {"id": "shared_persiantexttest_persiantexttest", "label": "PersianTextTest", "file_type": "code", "source_file": "tests/Shared/PersianTextTest.php", "source_location": "L8"}, {"id": "testcase", "label": "TestCase", "file_type": "code", "source_file": "", "source_location": ""}, {"id": "shared_persiantexttest_persiantexttest_testarabicyehandkafareunified", "label": ".testArabicYehAndKafAreUnified()", "file_type": "code", "source_file": "tests/Shared/PersianTextTest.php", "source_location": "L10"}, {"id": "shared_persiantexttest_persiantexttest_testhalfspaceandextrawhitespace", "label": ".testHalfSpaceAndExtraWhitespace()", "file_type": "code", "source_file": "tests/Shared/PersianTextTest.php", "source_location": "L15"}, {"id": "shared_persiantexttest_persiantexttest_testpersianandarabicdigits", "label": ".testPersianAndArabicDigits()", "file_type": "code", "source_file": "tests/Shared/PersianTextTest.php", "source_location": "L20"}, {"id": "shared_persiantexttest_persiantexttest_teststripdoctortitle", "label": ".testStripDoctorTitle()", "file_type": "code", "source_file": "tests/Shared/PersianTextTest.php", "source_location": "L26"}, {"id": "shared_persiantexttest_persiantexttest_testdifferentnamesstaydifferent", "label": ".testDifferentNamesStayDifferent()", "file_type": "code", "source_file": "tests/Shared/PersianTextTest.php", "source_location": "L37"}], "edges": [{"source": "users_hamed_pj_my_pj_clinic_pro_clinicpro_tests_shared_persiantexttest_php", "target": "persiantext", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "tests/Shared/PersianTextTest.php", "source_location": "L5", "weight": 1.0}, {"source": "users_hamed_pj_my_pj_clinic_pro_clinicpro_tests_shared_persiantexttest_php", "target": "testcase", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "tests/Shared/PersianTextTest.php", "source_location": "L6", "weight": 1.0}, {"source": "users_hamed_pj_my_pj_clinic_pro_clinicpro_tests_shared_persiantexttest_php", "target": "shared_persiantexttest_persiantexttest", "relation": "contains", "confidence": "EXTRACTED", "source_file": "tests/Shared/PersianTextTest.php", "source_location": "L8", "weight": 1.0}, {"source": "shared_persiantexttest_persiantexttest", "target": "testcase", "relation": "inherits", "confidence": "EXTRACTED", "source_file": "tests/Shared/PersianTextTest.php", "source_location": "L8", "weight": 1.0}, {"source": "shared_persiantexttest_persiantexttest", "target": "shared_persiantexttest_persiantexttest_testarabicyehandkafareunified", "relation": "method", "confidence": "EXTRACTED", "source_file": "tests/Shared/PersianTextTest.php", "source_location": "L10", "weight": 1.0}, {"source": "shared_persiantexttest_persiantexttest", "target": "shared_persiantexttest_persiantexttest_testhalfspaceandextrawhitespace", "relation": "method", "confidence": "EXTRACTED", "source_file": "tests/Shared/PersianTextTest.php", "source_location": "L15", "weight": 1.0}, {"source": "shared_persiantexttest_persiantexttest", "target": "shared_persiantexttest_persiantexttest_testpersianandarabicdigits", "relation": "method", "confidence": "EXTRACTED", "source_file": "tests/Shared/PersianTextTest.php", "source_location": "L20", "weight": 1.0}, {"source": "shared_persiantexttest_persiantexttest", "target": "shared_persiantexttest_persiantexttest_teststripdoctortitle", "relation": "method", "confidence": "EXTRACTED", "source_file": "tests/Shared/PersianTextTest.php", "source_location": "L26", "weight": 1.0}, {"source": "shared_persiantexttest_persiantexttest", "target": "shared_persiantexttest_persiantexttest_testdifferentnamesstaydifferent", "relation": "method", "confidence": "EXTRACTED", "source_file": "tests/Shared/PersianTextTest.php", "source_location": "L37", "weight": 1.0}], "raw_calls": [{"caller_nid": "shared_persiantexttest_persiantexttest_testarabicyehandkafareunified", "callee": "assertTrue", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/PersianTextTest.php", "source_location": "L12", "receiver": null}, {"caller_nid": "shared_persiantexttest_persiantexttest_testarabicyehandkafareunified", "callee": "PersianText", "is_member_call": false, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/PersianTextTest.php", "source_location": "L12", "receiver": null}, {"caller_nid": "shared_persiantexttest_persiantexttest_testhalfspaceandextrawhitespace", "callee": "assertTrue", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/PersianTextTest.php", "source_location": "L17", "receiver": null}, {"caller_nid": "shared_persiantexttest_persiantexttest_testhalfspaceandextrawhitespace", "callee": "PersianText", "is_member_call": false, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/PersianTextTest.php", "source_location": "L17", "receiver": null}, {"caller_nid": "shared_persiantexttest_persiantexttest_testpersianandarabicdigits", "callee": "assertSame", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/PersianTextTest.php", "source_location": "L22", "receiver": null}, {"caller_nid": "shared_persiantexttest_persiantexttest_testpersianandarabicdigits", "callee": "PersianText", "is_member_call": false, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/PersianTextTest.php", "source_location": "L22", "receiver": null}, {"caller_nid": "shared_persiantexttest_persiantexttest_testpersianandarabicdigits", "callee": "assertSame", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/PersianTextTest.php", "source_location": "L23", "receiver": null}, {"caller_nid": "shared_persiantexttest_persiantexttest_testpersianandarabicdigits", "callee": "PersianText", "is_member_call": false, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/PersianTextTest.php", "source_location": "L23", "receiver": null}, {"caller_nid": "shared_persiantexttest_persiantexttest_teststripdoctortitle", "callee": "assertSame", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/PersianTextTest.php", "source_location": "L28", "receiver": null}, {"caller_nid": "shared_persiantexttest_persiantexttest_teststripdoctortitle", "callee": "PersianText", "is_member_call": false, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/PersianTextTest.php", "source_location": "L28", "receiver": null}, {"caller_nid": "shared_persiantexttest_persiantexttest_teststripdoctortitle", "callee": "assertSame", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/PersianTextTest.php", "source_location": "L29", "receiver": null}, {"caller_nid": "shared_persiantexttest_persiantexttest_teststripdoctortitle", "callee": "PersianText", "is_member_call": false, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/PersianTextTest.php", "source_location": "L29", "receiver": null}, {"caller_nid": "shared_persiantexttest_persiantexttest_teststripdoctortitle", "callee": "assertSame", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/PersianTextTest.php", "source_location": "L30", "receiver": null}, {"caller_nid": "shared_persiantexttest_persiantexttest_teststripdoctortitle", "callee": "PersianText", "is_member_call": false, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/PersianTextTest.php", "source_location": "L30", "receiver": null}, {"caller_nid": "shared_persiantexttest_persiantexttest_teststripdoctortitle", "callee": "assertSame", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/PersianTextTest.php", "source_location": "L31", "receiver": null}, {"caller_nid": "shared_persiantexttest_persiantexttest_teststripdoctortitle", "callee": "PersianText", "is_member_call": false, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/PersianTextTest.php", "source_location": "L31", "receiver": null}, {"caller_nid": "shared_persiantexttest_persiantexttest_teststripdoctortitle", "callee": "assertSame", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/PersianTextTest.php", "source_location": "L33", "receiver": null}, {"caller_nid": "shared_persiantexttest_persiantexttest_teststripdoctortitle", "callee": "PersianText", "is_member_call": false, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/PersianTextTest.php", "source_location": "L33", "receiver": null}, {"caller_nid": "shared_persiantexttest_persiantexttest_teststripdoctortitle", "callee": "assertSame", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/PersianTextTest.php", "source_location": "L34", "receiver": null}, {"caller_nid": "shared_persiantexttest_persiantexttest_teststripdoctortitle", "callee": "PersianText", "is_member_call": false, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/PersianTextTest.php", "source_location": "L34", "receiver": null}, {"caller_nid": "shared_persiantexttest_persiantexttest_testdifferentnamesstaydifferent", "callee": "assertFalse", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/PersianTextTest.php", "source_location": "L39", "receiver": null}, {"caller_nid": "shared_persiantexttest_persiantexttest_testdifferentnamesstaydifferent", "callee": "PersianText", "is_member_call": false, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/PersianTextTest.php", "source_location": "L39", "receiver": null}]}