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:
@@ -97,14 +97,25 @@ class ConsultationService
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $vitals
|
||||
* @param array{source?: string, device_id?: int|null, raw_payload?: array<string, mixed>|null} $provenance
|
||||
*/
|
||||
protected function saveVitals(Consultation $consultation, string $ownerRef, array $vitals, ?string $actorRef): void
|
||||
{
|
||||
if (empty(array_filter($vitals))) {
|
||||
return;
|
||||
public function saveVitals(
|
||||
Consultation $consultation,
|
||||
string $ownerRef,
|
||||
array $vitals,
|
||||
?string $actorRef = null,
|
||||
array $provenance = [],
|
||||
): ?VitalSign {
|
||||
$numeric = collect($vitals)->only([
|
||||
'bp_systolic', 'bp_diastolic', 'pulse', 'temperature',
|
||||
'weight_kg', 'height_cm', 'spo2', 'respiratory_rate',
|
||||
])->filter(fn ($v) => $v !== null && $v !== '')->all();
|
||||
|
||||
if ($numeric === []) {
|
||||
return null;
|
||||
}
|
||||
|
||||
VitalSign::create([
|
||||
return VitalSign::create([
|
||||
'owner_ref' => $ownerRef,
|
||||
'consultation_id' => $consultation->id,
|
||||
'bp_systolic' => $vitals['bp_systolic'] ?? null,
|
||||
@@ -117,6 +128,9 @@ class ConsultationService
|
||||
'respiratory_rate' => $vitals['respiratory_rate'] ?? null,
|
||||
'recorded_by' => $actorRef,
|
||||
'recorded_at' => now(),
|
||||
'source' => $provenance['source'] ?? VitalSign::SOURCE_MANUAL,
|
||||
'device_id' => $provenance['device_id'] ?? null,
|
||||
'raw_payload' => $provenance['raw_payload'] ?? null,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user