345 门诊挂号:患者性别数据展示与档案不一致(档案为“女”,挂号显示“未知”)

This commit is contained in:
2026-04-09 13:57:41 +08:00
parent 8a4be4e2ce
commit 6642fd9e1c
4 changed files with 9 additions and 9 deletions

View File

@@ -121,7 +121,7 @@ export function getGenderAndAge(idCard) {
if (m < 0 || (m === 0 && new Date().getDate() < dateOfBirth.getDate())) {
age--;
}
// 提取性别
const gender = idCard.charAt(16) % 2 === 0 ? 1 : 0;
// 提取性别身份证第17位奇数=男, 偶数=女)对应数据库字典 1=男 2=女
const gender = idCard.charAt(16) % 2 === 0 ? 2 : 1;
return { age, gender };
}