bug 处理

This commit is contained in:
13405411873 2025-04-07 17:46:27 +08:00
parent 0f2ef77b0f
commit 44e7d8cbbf
2 changed files with 25 additions and 5 deletions

View File

@ -28,19 +28,39 @@ public class ShellUtil {
String[] parts = line.split(":");
if (parts.length > 1) {
String name = parts[1].trim();
if(StringUtils.isEmpty(patientScript.getPatientName())){
if(StringUtils.isNotEmpty(name)&&StringUtils.isEmpty(patientScript.getPatientName())&&!name.equals("Unknown")){
patientScript.setPatientName(name);
}
}
}
if (line.contains("性别")){
System.out.println(line+"性别************************************************************");
String[] parts = line.split(":");
if (parts.length > 1) {
String sex = parts[1].trim();
if(StringUtils.isNotEmpty(sex)&&StringUtils.isEmpty(patientScript.getPatientSex())&&!sex.equals("Unknown")){
if ("M".equals(sex)){
patientScript.setPatientSex("");
}else {
patientScript.setPatientSex("");
}
}
}
}
if (line.contains("年龄")){
System.out.println(line+"年龄************************************************************");
String[] parts = line.split(":");
if (parts.length > 1) {
String age = parts[1].trim();
patientScript.setPatientAge(age);
}else {
patientScript.setPatientAge("0");
if (StringUtils.isNotEmpty(age)&&StringUtils.isEmpty(patientScript.getPatientAge())&&!age.equals("Unknown")){
// 去除非数字字符
String numericAge = age.replaceAll("[^0-9]", "");
// 将字符串转换为整数
int ageInt = Integer.parseInt(numericAge);
// 设置年龄
patientScript.setPatientAge(String.valueOf(ageInt));
}
}
}

View File

@ -88,7 +88,7 @@
<el-input v-model="form.patientName" placeholder="请输入患者姓名" />
</el-form-item>
<el-form-item label="患者年龄" prop="patientAge">
<el-input v-model="form.patientAge" placeholder="患者年龄" />
<el-input-number v-model="form.patientAge" placeholder="患者年龄" />
</el-form-item>
<el-form-item label="性别" prop="patientSex">
<el-radio-group v-model="form.patientSex">