مطالبات التأمين

NPHIES — CCHI · المرحلة 1

الحالة الحالية: Mock (development) فحص أهلية التغطية + تقديم مطالبات الجلسات تلقائياً لشركات التأمين الصحي.

المواصفات

ContractApp\Integrations\Contracts\InsuranceClaims
Mock adapterApp\Integrations\Mock\MockNphies
Production adapter (مخطط)App\Integrations\Production\NphiesAdapter
Driver keyconfig('sakeenah.integrations.insurance.driver')
الوثائق الرسميةhttps://nphies.sa/integration

الميزات المعتمدة عليه

الاستخدام في الـ Code

use App\Integrations\Contracts\InsuranceClaims;

class MyController {
    public function __construct(
        private readonly InsuranceClaims $service,
    ) {}

    public function action() {
        // $this->service يتحقن تلقائياً (mock أو production)
        // حسب config('sakeenah.integrations.insurance.driver')
    }
}

لرفع التكامل إلى Production

  1. اطلب credentials من الموزود الرسمي
    تواصل مع: NPHIES — CCHI
  2. ابنِ Production Adapter
    // app/Integrations/Production/NphiesAdapter.php
    namespace App\Integrations\Production;
    
    use App\Integrations\Contracts\InsuranceClaims;
    use Illuminate\Support\Facades\Http;
    
    class NphiesAdapter implements InsuranceClaims {
        public function __construct(
            private string $apiKey = config('sakeenah.integrations.insurance.api_key'),
        ) {}
    
        // Implement all interface methods using real HTTP calls
        // Use Laravel's Http::withToken($this->apiKey)->post(...)
    }
  3. ضع credentials في .env
    INSURANCE_DRIVER=production
    INSURANCE_API_KEY=your_real_key_here
  4. اختبر — كتب feature test يستخدم mock أولاً، ثم integration test على staging
  5. أعد تشغيلphp artisan config:clear

موافقات + Compliance

المتعلق