Add clinical device registry, browser wedge scan, and local agent API.
Deploy Ladill Care / deploy (push) Successful in 1m39s
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:
@@ -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']);
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user