feat(followup-audio): normalize extraction to record field contracts

This commit is contained in:
2026-10-12 14:34:31 +08:00
parent 9e3aa9fc61
commit 86041042b9
9 changed files with 449 additions and 21 deletions
@@ -122,6 +122,9 @@ final class FollowupAudioApply
} else {
$data += ['diagnosis_id' => (int) $task['diagnosis_id'], 'patient_id' => (int) $task['patient_id'], 'create_time' => $now];
if ($kind === 'blood') { $data['source'] = 0; }
// Audio omissions mean unknown, not the legacy exercise defaults (0 minutes / low).
// Insert-only: omitted fields on an update must retain their existing values.
if ($kind === 'exercise') { $data += ['duration' => null, 'intensity' => null]; }
$targetId = (int) Db::name($table)->insertGetId($data);
$action = 'insert';
}