$text, 'passed' => !TcmConsultationPulsePolicy::validate([], $text)['valid']]; } foreach (['率', '压', '搏', '络', '管'] as $suffix) { $text = $missing . '脉' . $suffix . '相关记录,保留该信息缺口。'; $checks[] = ['text' => $text, 'passed' => TcmConsultationPulsePolicy::validate([], $text)['valid']]; } } foreach (['心率78次/分。', '冠状动脉钙化。', '静脉血栓病史待核实。', '记录脉络病变原始资料。', 'pulse rate 78/min.', 'pulse pressure 40mmHg.'] as $text) { $checks[] = ['text' => $text, 'passed' => TcmConsultationPulsePolicy::validate([], $text)['valid']]; } $failed = array_values(array_filter($checks, static fn(array $check): bool => !$check['passed'])); echo json_encode(['scope' => 'finite missing-pulse noun boundary; no clinical or provider acceptance', 'checks' => count($checks), 'passed' => count($checks) - count($failed), 'failed' => $failed], JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT) . PHP_EOL; exit($failed ? 1 : 0);