|
@@ -1,5 +1,6 @@
|
|
|
package com.ywt.alipaympapi.service.impl;
|
|
|
|
|
|
+import com.google.protobuf.TextFormat;
|
|
|
import com.ywt.alipaympapi.core.utils.*;
|
|
|
import com.ywt.alipaympapi.models.BaseResponse;
|
|
|
import com.ywt.alipaympapi.models.enums.LastChoiceEnum;
|
|
@@ -119,7 +120,7 @@ public class InpatientServiceImpl implements InpatientService {
|
|
|
data.setInpatientId(medicalCard.getPatientId());
|
|
|
data.setInpatientName(BizUtil.maskedName(medicalCard.getPatientName()));
|
|
|
data.setSex(medicalCard.getSex() == 1 ? "男" : "女");
|
|
|
- data.setInpatientAge(Integer.parseInt(getAgeFromMedicalCard(medicalCard)));
|
|
|
+ data.setInpatientAge(getAgeIntFromMedicalCard(medicalCard));
|
|
|
InpatientVo vo = getInpatientVo(userId, medicalCard.getPatientId());
|
|
|
data.setAdmNo(Checker.getStringValue(vo.getAdmNo()));
|
|
|
list.add(data);
|
|
@@ -475,6 +476,17 @@ public class InpatientServiceImpl implements InpatientService {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
+ private int getAgeIntFromMedicalCard(MedicalCard card) {
|
|
|
+ try {
|
|
|
+ String ageStr = getAgeFromMedicalCard(card);
|
|
|
+ return ageStr.isEmpty() ? 0 : Integer.parseInt(ageStr);
|
|
|
+ } catch (NumberFormatException e) {
|
|
|
+ log.error("InpatientServiceImpl#getAgeIntFromMedicalCard(card={} ):\n {}", TextFormat.printToUnicodeString(card),
|
|
|
+ e.getMessage());
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private String getAgeFromMedicalCard(MedicalCard card) {
|
|
|
int age = -1;
|
|
|
String idNo = card.getIdNo();
|
|
@@ -529,7 +541,7 @@ public class InpatientServiceImpl implements InpatientService {
|
|
|
data.setInpatientName(BizUtil.maskedName(medicalCard.getPatientName()));
|
|
|
data.setSex(medicalCard.getSex() == 1 ? "男" : "女");
|
|
|
Date date = DateUtil.stringToDate(medicalCard.getBirthday(), DateUtil.DADE_FROMAT_YMD);
|
|
|
- data.setInpatientAge(Integer.parseInt(getAgeFromMedicalCard(medicalCard)));
|
|
|
+ data.setInpatientAge(getAgeIntFromMedicalCard(medicalCard));
|
|
|
InpatientVo vo = getInpatientVo(userId, medicalCard.getPatientId());
|
|
|
return data;
|
|
|
}
|