الوصفات الإلكترونية
Wasfaty (وصفتي) — MOH · المرحلة 2
الحالة الحالية:
Mock (development)
إصدار وصفات نفسية للمرضى الذين يحتاجون أدوية (عبر طبيب نفسي معتمد فقط).
المواصفات
| Contract | App\Integrations\Contracts\PrescriptionGateway |
|---|---|
| Mock adapter | App\Integrations\Mock\MockWasfaty |
| Production adapter (مخطط) | App\Integrations\Production\WasfatyAdapter |
| Driver key | config('safw.integrations.prescription.driver') |
| الوثائق الرسمية | https://wasfaty.sa |
الميزات المعتمدة عليه
psychiatric_medicationrx_refills
الاستخدام في الـ Code
use App\Integrations\Contracts\PrescriptionGateway;
class MyController {
public function __construct(
private readonly PrescriptionGateway $service,
) {}
public function action() {
// $this->service يتحقن تلقائياً (mock أو production)
// حسب config('safw.integrations.prescription.driver')
}
}
لرفع التكامل إلى Production
-
اطلب credentials من الموزود الرسمي
تواصل مع: Wasfaty (وصفتي) — MOH -
ابنِ Production Adapter
// app/Integrations/Production/WasfatyAdapter.php namespace App\Integrations\Production; use App\Integrations\Contracts\PrescriptionGateway; use Illuminate\Support\Facades\Http; class WasfatyAdapter implements PrescriptionGateway { public function __construct( private string $apiKey = config('safw.integrations.prescription.api_key'), ) {} // Implement all interface methods using real HTTP calls // Use Laravel's Http::withToken($this->apiKey)->post(...) } -
ضع credentials في .env
PRESCRIPTION_DRIVER=production PRESCRIPTION_API_KEY=your_real_key_here - اختبر — كتب feature test يستخدم mock أولاً، ثم integration test على staging
-
أعد تشغيل —
php artisan config:clear
موافقات + Compliance
- تحقق من شروط الموزود الرسمي (في الـ docs URL أعلاه)
- وثّق DPA (Data Processing Agreement) موقّع
- أضف الموزود إلى قائمة الـ subprocessors المنشورة للمستخدمين
- إذا الموزود يخزّن PHI، تأكد أنه ضمن السعودية (data residency)