feat: add core backend modules, inventory services, and patch scripts for AI Pharmacy API

This commit is contained in:
2026-09-15 11:15:15 +05:30
parent 22a03043ea
commit 1f9378d96c
41 changed files with 1413 additions and 130 deletions
+18
View File
@@ -0,0 +1,18 @@
const fs = require('fs');
const path = 'C:/Users/CSH12/Desktop/Hospital_Api/all-applications-api/app/Services/PharmacyWebhookController.php';
let code = fs.readFileSync(path, 'utf8');
const target3 = ` // Find patient ID from users table using full name match
$patient = \\App\\Entities\\User::whereRaw("LOWER(CONCAT(first_name, ' ', last_name)) = ?", [strtolower(trim($subjectRef))])
->orWhere('id', $subjectRef)
->first();`;
const replace3 = ` // Find patient ID from users table using full name match via DB to bypass any scopes
$patient = \\Illuminate\\Support\\Facades\\DB::table('users')
->whereRaw("LOWER(CONCAT(first_name, ' ', last_name)) = ?", [strtolower(trim($subjectRef))])
->orWhere('id', $subjectRef)
->first();`;
code = code.replace(target3, replace3);
fs.writeFileSync(path, code);
console.log("Successfully patched to use DB::table('users')");