Add clinical device registry, browser wedge scan, and local agent API.
Deploy Ladill Care / deploy (push) Successful in 1m39s

Branch-scoped Care devices with hashed agent tokens, patient barcode lookup/labels, and provenance-aware vitals from a minimal device agent (Pro for agent hardware; wedge free).

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-07-17 14:28:46 +00:00
co-authored by Cursor
parent 1da90203e8
commit e0a7a64d38
37 changed files with 1970 additions and 10 deletions
@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('care_devices', function (Blueprint $table) {
$table->id();
$table->string('owner_ref')->index();
$table->foreignId('organization_id')->constrained('care_organizations')->cascadeOnDelete();
$table->foreignId('branch_id')->nullable()->constrained('care_branches')->nullOnDelete();
$table->string('name');
$table->string('type'); // barcode_scanner, thermometer, …
$table->string('status')->default('offline'); // active, offline, disabled
$table->string('connection_mode')->default('manual'); // browser_wedge, agent, web_bluetooth, manual
$table->string('device_token_hash')->nullable()->unique();
$table->timestamp('last_seen_at')->nullable();
$table->json('metadata')->nullable();
$table->timestamps();
$table->softDeletes();
$table->index(['organization_id', 'branch_id', 'status']);
$table->index(['owner_ref', 'type']);
});
}
public function down(): void
{
Schema::dropIfExists('care_devices');
}
};
@@ -0,0 +1,26 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::table('care_vital_signs', function (Blueprint $table) {
$table->string('source')->default('manual')->after('recorded_at'); // manual, device, import
$table->foreignId('device_id')->nullable()->after('source')
->constrained('care_devices')->nullOnDelete();
$table->json('raw_payload')->nullable()->after('device_id');
});
}
public function down(): void
{
Schema::table('care_vital_signs', function (Blueprint $table) {
$table->dropConstrainedForeignId('device_id');
$table->dropColumn(['source', 'raw_payload']);
});
}
};