|
@@ -18,10 +18,8 @@ import thyyxxk.webserver.entity.dictionary.CodeName;
|
|
|
import thyyxxk.webserver.entity.yibao.dismiss.ZyDisYbDiag;
|
|
|
import thyyxxk.webserver.entity.yibao.patient.*;
|
|
|
import thyyxxk.webserver.entity.zhuyuanyisheng.yizhuluru.HuanZheFeiYong;
|
|
|
-import thyyxxk.webserver.utils.DateUtil;
|
|
|
-import thyyxxk.webserver.utils.DecimalUtil;
|
|
|
-import thyyxxk.webserver.utils.ResultVoUtil;
|
|
|
-import thyyxxk.webserver.utils.TokenUtil;
|
|
|
+import thyyxxk.webserver.service.redislike.RedisLikeService;
|
|
|
+import thyyxxk.webserver.utils.*;
|
|
|
|
|
|
import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
@@ -39,12 +37,14 @@ public class PatientService {
|
|
|
private final PatientDao dao;
|
|
|
private final Routines routines;
|
|
|
private final YiZhuLuRuDao yiZhuLuRuDao;
|
|
|
+ private final RedisLikeService redis;
|
|
|
|
|
|
@Autowired
|
|
|
- public PatientService(PatientDao dao, Routines routines, YiZhuLuRuDao yiZhuLuRuDao) {
|
|
|
+ public PatientService(PatientDao dao, Routines routines, YiZhuLuRuDao yiZhuLuRuDao, RedisLikeService redis) {
|
|
|
this.dao = dao;
|
|
|
this.routines = routines;
|
|
|
this.yiZhuLuRuDao = yiZhuLuRuDao;
|
|
|
+ this.redis = redis;
|
|
|
}
|
|
|
|
|
|
public ResultVo<List<Overview>> getOverView(String ward) {
|
|
@@ -59,6 +59,7 @@ public class PatientService {
|
|
|
}
|
|
|
data.setMedTypeName(MedType.getName(data.getMedType()));
|
|
|
data.setInsutypeName(Insutype.getName(data.getInsutype()));
|
|
|
+ data.setDutyNurseName(redis.getEmployeeName(data.getDutyNurse()));
|
|
|
if (null != data.getSocialNo() && data.getSocialNo().trim().length() == 18 && !data.getSocialNo().startsWith("K")) {
|
|
|
try {
|
|
|
HuanZheFeiYong feiYongZhanBi = yiZhuLuRuDao.feiYongXinXi(data.getInpatientNo(), data.getAdmissTimes(), data.getLedgerSn());
|
|
@@ -170,23 +171,55 @@ public class PatientService {
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public ResultVo<String> submitSiPatientYbInfo(SubmitSiPtnt param) {
|
|
|
- param.getPatient().setStaffId(TokenUtil.getTokenUserId());
|
|
|
- MedType medType = MedType.get(param.getPatient().getMedType());
|
|
|
+ Patient patient = param.getPatient();
|
|
|
+ patient.setStaffId(TokenUtil.getTokenUserId());
|
|
|
+ MedType medType = MedType.get(patient.getMedType());
|
|
|
if (null == medType) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "请选择患者的医疗类别!");
|
|
|
}
|
|
|
- String zyh = param.getPatient().getInpatientNo();
|
|
|
- int times = param.getPatient().getAdmissTimes();
|
|
|
+
|
|
|
+ if (StringUtil.isBlank(patient.getDutyNurse())) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "责任护士不能为空!");
|
|
|
+ }
|
|
|
+ if (StringUtil.isBlank(patient.getCountry())) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "国籍不能为空!");
|
|
|
+ }
|
|
|
+ if (StringUtil.isBlank(patient.getNation())) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "民族不能为空!");
|
|
|
+ }
|
|
|
+ if (StringUtil.isBlank(patient.getContactName())) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "联系人不能为空!");
|
|
|
+ }
|
|
|
+ if (StringUtil.isBlank(patient.getContactRelation())) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "联系人关系不能为空!");
|
|
|
+ }
|
|
|
+ if (StringUtil.isBlank(patient.getContactAddrName())) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "联系人地址不能为空!");
|
|
|
+ }
|
|
|
+ if (StringUtil.isBlank(patient.getContactPhone())) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "联系人电话不能为空!");
|
|
|
+ }
|
|
|
+
|
|
|
+ String zyh = patient.getInpatientNo();
|
|
|
+ int times = patient.getAdmissTimes();
|
|
|
param.getDiags().forEach(itm -> {
|
|
|
itm.setInpatientNo(zyh);
|
|
|
itm.setAdmissTimes(times);
|
|
|
});
|
|
|
- param.getPatient().setResponceType(medType.getResponceType());
|
|
|
- log.info("【操作员:{}】保存患者信息:{} ", param.getPatient().getStaffId(), param);
|
|
|
- dao.updateYbRegisterDate(param.getPatient());
|
|
|
- dao.updateSocialNo(param.getPatient().getSocialNo(), param.getPatient().getInpatientNo());
|
|
|
+ patient.setResponceType(medType.getResponceType());
|
|
|
+ log.info("【操作员:{}】保存患者信息:{} ", patient.getStaffId(), param);
|
|
|
+ if (dao.isBatjBa2Exist(patient.getInpatientNo(), patient.getAdmissTimes()) == 0) {
|
|
|
+ dao.createBatjBa2(patient.getInpatientNo(), patient.getAdmissTimes(), patient.getDutyNurse());
|
|
|
+ } else {
|
|
|
+ dao.updateBatjBa2(patient.getInpatientNo(), patient.getAdmissTimes(), patient.getDutyNurse());
|
|
|
+ }
|
|
|
+ dao.updateZyActpatient(patient);
|
|
|
+ dao.updateAPatientMi(patient.getSocialNo(), patient.getInpatientNo(), patient.getCountry(), patient.getNation(),
|
|
|
+ patient.getContactName(), patient.getContactRelation(), patient.getContactAddrName(), patient.getContactPhone());
|
|
|
dao.deleteOldZyInYbDiag(zyh, times);
|
|
|
- dao.insertNewZyInYbDiag(param.getPatient().getStaffId(), param.getDiags());
|
|
|
+ if (ListUtil.notBlank(param.getDiags())) {
|
|
|
+ dao.insertNewZyInYbDiag(patient.getStaffId(), param.getDiags());
|
|
|
+ }
|
|
|
return ResultVoUtil.success();
|
|
|
}
|
|
|
|