|
@@ -18,6 +18,8 @@ import thyyxxk.webserver.utils.FilterUtil;
|
|
|
import thyyxxk.webserver.utils.ResultVoUtil;
|
|
|
import thyyxxk.webserver.utils.TokenUtil;
|
|
|
|
|
|
+import java.text.ParseException;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
|
|
|
import static thyyxxk.webserver.utils.YibaoHttpUtil.httpPost;
|
|
@@ -45,9 +47,22 @@ public class PatientService {
|
|
|
if (null == data) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.NULL_POINTER, "没有住院号【" + inpatientNo + "】的在院业务!");
|
|
|
}
|
|
|
+ if (null != data.getSocialNo() && data.getSocialNo().trim().length() == 18 && !data.getSocialNo().startsWith("K")) {
|
|
|
+ try {
|
|
|
+ data.setBirthDate(getBirthdayFromSocialNo(data.getSocialNo()));
|
|
|
+ } catch (ParseException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
return ResultVoUtil.success(data);
|
|
|
}
|
|
|
|
|
|
+ private Date getBirthdayFromSocialNo(String socialNo) throws ParseException {
|
|
|
+ String birth = socialNo.substring(6, 14);
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
|
|
|
+ return sdf.parse(birth);
|
|
|
+ }
|
|
|
+
|
|
|
public ResultVo<HashMap<String, Object>> getDisDiag(String inpatientNo, Integer admissTimes) {
|
|
|
HashMap<String, Object> map = new HashMap<>();
|
|
|
map.put("yb", dao.getYibaoDisDiags(inpatientNo, admissTimes));
|