修复就诊人健康信息默认值

This commit is contained in:
2024-11-15 10:36:08 +08:00
parent 4c0960f510
commit efc151ed9e

View File

@@ -185,27 +185,29 @@ class PatientController extends BaseAppController
$info = $HealthForm->info();
$familyHistory = !empty($info['family_history']) ? explode(',', $info['family_history']) : [];
$personHistory = !empty($info['person_history']) ? explode(',', $info['person_history']) : [];
$allergicHistory = !empty($info['allergic_history']) ? explode(',', $info['allergic_history']) : [];
foreach ($familyHistory as $k => $v) {
$info['family_history'][] = [
'name' => $v,
'checked' => true
];
if (!empty($info['family_history'])) {
foreach (explode(',', $info['family_history']) as $v) {
$info['family_history'][] = [
'name' => $v,
'checked' => true
];
}
}
foreach ($personHistory as $k => $v) {
$info['person_history'][] = [
'name' => $v,
'checked' => true
];
if (!empty($info['person_history'])) {
foreach (explode(',', $info['person_history']) as $v) {
$info['person_history'][] = [
'name' => $v,
'checked' => true
];
}
}
foreach ($allergicHistory as $k => $v) {
$info['allergic_history'][] = [
'name' => $v,
'checked' => true
];
if (!empty($info['allergic_history'])) {
foreach (explode(',', $info['allergic_history']) as $v) {
$info['allergic_history'][] = [
'name' => $v,
'checked' => true
];
}
}
return $info;