|
|
|
@ -312,13 +312,15 @@ public class LtHisConnectionServiceImpl implements ILtHisConnectionService { |
|
|
|
// 病史信息 - PmsPatientPersonal
|
|
|
|
List<Map<String, Object>> personalList = new ArrayList<>(); |
|
|
|
Map<String, Object> personal = new HashMap<>(); |
|
|
|
personal.put("patientId", patientId); |
|
|
|
personal.put("visitNo", visitNo); |
|
|
|
// personal.put("patientId", patientId);
|
|
|
|
// personal.put("visitNo", visitNo);
|
|
|
|
pmsPatientPersonal.setPatientId(patientId); |
|
|
|
pmsPatientPersonal.setVisitNo(visitNo); |
|
|
|
if (CollUtil.isNotEmpty(blxx)) { |
|
|
|
Map<String, Object> item = blxx.get(0); |
|
|
|
log.info("视图blxx信息: {}", item); |
|
|
|
|
|
|
|
Map<String, Object> smokingMap = extractSmokingInfo((String) item.get("是否吸烟")); |
|
|
|
Map<String, Object> smokingMap = extractSmokingInfo((String) item.get("是否吸烟"),pmsPatientPersonal); |
|
|
|
Map<String, Object> drinkMap = extractDrinkInfo((String) item.get("是否饮酒")); |
|
|
|
personal.putAll(smokingMap); |
|
|
|
personal.putAll(drinkMap); |
|
|
|
@ -441,14 +443,15 @@ public class LtHisConnectionServiceImpl implements ILtHisConnectionService { |
|
|
|
.execute(); |
|
|
|
} |
|
|
|
|
|
|
|
public static Map<String, Object> extractSmokingInfo(String text) { |
|
|
|
public static Map<String, Object> extractSmokingInfo(String text,PmsPatientPersonal pmsPatientPersonal) { |
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
if(StrUtil.isEmpty(text)){ |
|
|
|
return result; |
|
|
|
} |
|
|
|
// 是否吸烟 - 先判断否定情况
|
|
|
|
int smokingHistory = (text.contains("否认吸烟史") || text.contains("无吸烟史")) ? 0 : 1; |
|
|
|
result.put("smokingHistory", smokingHistory); |
|
|
|
// result.put("smokingHistory", smokingHistory);
|
|
|
|
pmsPatientPersonal.setSmokingHistory((byte) smokingHistory); |
|
|
|
|
|
|
|
// 只有有吸烟史时才提取其他信息
|
|
|
|
if (smokingHistory == 1) { |
|
|
|
@ -458,12 +461,19 @@ public class LtHisConnectionServiceImpl implements ILtHisConnectionService { |
|
|
|
if (matcher1.find()) { |
|
|
|
String group = matcher1.group(1); |
|
|
|
if (StrUtil.isNotBlank(group)) { |
|
|
|
result.put("smokingYear", group); |
|
|
|
// result.put("smokingYear", group);
|
|
|
|
try { |
|
|
|
pmsPatientPersonal.setSmokingYear(Integer.parseInt(group)); |
|
|
|
}catch (Exception e){ |
|
|
|
log.error("吸烟年龄解析异常"); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
//是否戒烟
|
|
|
|
int smokingQuit = text.contains("未戒烟") ? 0 : 1; |
|
|
|
result.put("smokingQuit", smokingQuit); |
|
|
|
// result.put("smokingQuit", smokingQuit);
|
|
|
|
pmsPatientPersonal.setSmokingQuit((byte) smokingQuit); |
|
|
|
|
|
|
|
if (smokingQuit == 1) { |
|
|
|
Pattern pattern2 = Pattern.compile("已?戒(?:烟|酒)?\\s*(\\d+)\\s*(月|年)\\s*(?:余)?"); |
|
|
|
@ -473,9 +483,11 @@ public class LtHisConnectionServiceImpl implements ILtHisConnectionService { |
|
|
|
String unit = matcher2.group(2); |
|
|
|
|
|
|
|
if ("月".equals(unit)) { |
|
|
|
result.put("smokingQuitYear", 1); |
|
|
|
// result.put("smokingQuitYear", 1);
|
|
|
|
pmsPatientPersonal.setSmokingQuitYear(Integer.parseInt(number)); |
|
|
|
} else { |
|
|
|
result.put("smokingQuitYear", number); |
|
|
|
// result.put("smokingQuitYear", number);
|
|
|
|
pmsPatientPersonal.setSmokingQuitYear(Integer.parseInt(number)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|