|
|
@@ -543,20 +543,21 @@ public class SiMzFeeService {
|
|
|
|
|
|
public ResultVo<FundDetail> directRegistration(DirectionRegParam param) {
|
|
|
log.info("门诊共济:{}", param);
|
|
|
- mzDao.updateMzTimes(param.getPatientId(), param.getTimes());
|
|
|
+ if (mzDao.selectExistCount(param.getPatientId(), param.getTimes()) == 0) {
|
|
|
+ mzDao.updateMzTimes(param.getPatientId(), param.getTimes());
|
|
|
+ }
|
|
|
+ mzDao.deleteTempPatinfo(param.getPatientId(), param.getTimes());
|
|
|
MzPatientInfo mzptnt = new MzPatientInfo();
|
|
|
mzptnt.setStaffId(param.getStaffId());
|
|
|
mzptnt.setPatNo(param.getPatientId());
|
|
|
mzptnt.setTimes(param.getTimes());
|
|
|
mzptnt.setAcctUsedFlag(String.valueOf(param.getAcctUsedFlag()));
|
|
|
-
|
|
|
SiPatInfo siPatInfo = mzDao.selectSiPatInfoForMz(mzptnt.getPatNo(), mzptnt.getTimes());
|
|
|
mzptnt.setInsuplcAdmdvs(siPatInfo.getInsuplcAdmdvs());
|
|
|
mzptnt.setInsutype(siPatInfo.getInsutype());
|
|
|
mzptnt.setPsnType(siPatInfo.getPsnType());
|
|
|
mzptnt.setName(siPatInfo.getPsnName());
|
|
|
mzptnt.setSocialNo(siPatInfo.getCertno());
|
|
|
-
|
|
|
if (StringUtil.notBlank(param.getReadCardResult())) {
|
|
|
MdtrtCertType mdtrtCertType = MdtrtCertType.get(param.getReadCardType());
|
|
|
mzptnt.setMdtrtCertType(mdtrtCertType.getLabel());
|
|
|
@@ -577,7 +578,6 @@ public class SiMzFeeService {
|
|
|
siPatInfo.setFromDirectReg(true);
|
|
|
SpcChrDiseAcct spcChrDiseAcct = new SpcChrDiseAcct();
|
|
|
ResultVo<String> upldMdtrtRes = uploadOutpatientInfo(spcChrDiseAcct, siPatInfo, param.getStaffId());
|
|
|
- log.info("上传就诊信息:{}", upldMdtrtRes);
|
|
|
if (null == upldMdtrtRes) {
|
|
|
revokeOutpatientRegistration(mzptnt);
|
|
|
return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
|
|
|
@@ -589,7 +589,6 @@ public class SiMzFeeService {
|
|
|
|
|
|
// 上传就诊信息成功后生成门诊医保费用
|
|
|
ResultVo<List<Map<String, Object>>> getMzRcptRes = webHisSrvc.getMzReceipts(webHisUrl, mzptnt);
|
|
|
- log.info("获取门诊处方:{}", getMzRcptRes);
|
|
|
if (null == getMzRcptRes) {
|
|
|
revokeOutpatientRegistration(mzptnt);
|
|
|
return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
|
|
|
@@ -605,8 +604,10 @@ public class SiMzFeeService {
|
|
|
mzReceipts.addAll(entry.getValue());
|
|
|
}
|
|
|
}
|
|
|
+ if (mzReceipts.isEmpty()) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.NULL_POINTER, "没有可以上传到医保的费用。");
|
|
|
+ }
|
|
|
ResultVo<String> insertSiMzFeeRes = webHisSrvc.insertSiMzFeesForThmz(webHisUrl, mzReceipts);
|
|
|
- log.info("生成医保费用:{}", insertSiMzFeeRes);
|
|
|
if (null == insertSiMzFeeRes) {
|
|
|
revokeOutpatientRegistration(mzptnt);
|
|
|
return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
|