|
|
@@ -132,62 +132,52 @@ public class SiMzFeeService {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, result.getString(ERROR_MESSAGE));
|
|
|
}
|
|
|
|
|
|
- private ResultVo<String> uploadOutpatientInfo(SpcChrDiseAcct indise, SiPatInfo siPatInfo, String staffId) {
|
|
|
+ private ResultVo<String> uploadOutpatientInfo(SpcChrDiseAcct diseInfo, SiPatInfo siPatInfo, String staffId) {
|
|
|
JSONObject input = exec.makeTradeHeaderWithInsureArea(SiFunction.UPLOAD_OUTPATIENT_INFO,
|
|
|
siPatInfo.getInsuplcAdmdvs(), staffId);
|
|
|
JSONObject mdtrtinfo = new JSONObject();
|
|
|
- List<Diseinfo> diseinfo;
|
|
|
- if (StringUtil.notBlank(indise.getOpspDiseCode())) {
|
|
|
- diseinfo = new ArrayList<>();
|
|
|
- Diseinfo diag = mzDao.selectDiseinfo(siPatInfo.getPatNo(), siPatInfo.getTimes());
|
|
|
- diag.setDiagCode(indise.getOpspDiseCode());
|
|
|
- diag.setDiagName(indise.getOpspDiseName());
|
|
|
- diseinfo.add(diag);
|
|
|
+ List<Diagnoses> diagnosesList = new ArrayList<>();
|
|
|
+ String icdCodeNew = mzDao.selectIcdCodeNew(siPatInfo.getPatNo(), siPatInfo.getTimes());
|
|
|
+ if (StringUtil.isBlank(icdCodeNew)) {
|
|
|
+ diagnosesList = mzDao.selectMzDiags(siPatInfo.getPatNo(), siPatInfo.getTimes());
|
|
|
+ if (null == diagnosesList || diagnosesList.isEmpty()) {
|
|
|
+ log.info("【{}】 上传就诊信息失败,门诊诊断为空。", siPatInfo.getPatNo());
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "患者的门诊诊断为空,请联系医生填写。");
|
|
|
+ }
|
|
|
} else {
|
|
|
- if (siPatInfo.getFromDirectReg()) {
|
|
|
- String icdCodeNew = mzDao.selectIcdCodeNew(siPatInfo.getPatNo(), siPatInfo.getTimes());
|
|
|
- if (StringUtil.isBlank(icdCodeNew)) {
|
|
|
- log.info("【{}】 上传就诊信息失败,门诊诊断为空。", siPatInfo.getPatNo());
|
|
|
- return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "患者的门诊诊断为空,请联系医生填写。");
|
|
|
- }
|
|
|
- diseinfo = new ArrayList<>();
|
|
|
- Diseinfo base = mzDao.selectDiseinfo(siPatInfo.getPatNo(), siPatInfo.getTimes());
|
|
|
- String[] icds = icdCodeNew.split(",");
|
|
|
- for (int i = 0; i < icds.length; i++) {
|
|
|
- String icd = icds[i];
|
|
|
- String icdTextNew = mzDao.selectIcdTextNew(icd);
|
|
|
- Diseinfo diag = new Diseinfo();
|
|
|
- diag.setDiagCode(icd);
|
|
|
- diag.setDiagName(icdTextNew);
|
|
|
- diag.setDiagSrtNo(i + 1);
|
|
|
- diag.setDiagType("1");
|
|
|
- diag.setValiFlag("1");
|
|
|
- diag.setDiagDept(base.getDiagDept());
|
|
|
- diag.setDiagTime(base.getDiagTime());
|
|
|
- diag.setDiseDorNo(base.getDiseDorNo());
|
|
|
- diag.setDiseDorName(base.getDiseDorName());
|
|
|
- diseinfo.add(diag);
|
|
|
- }
|
|
|
- indise.setOpspDiseCode(diseinfo.get(0).getDiagCode());
|
|
|
- indise.setOpspDiseName(diseinfo.get(0).getDiagName());
|
|
|
- } else {
|
|
|
- diseinfo = mzDao.selectMzDiags(siPatInfo.getPatNo(), siPatInfo.getTimes());
|
|
|
- if (null == diseinfo || diseinfo.isEmpty()) {
|
|
|
- log.info("【{}】 上传就诊信息失败,门诊诊断为空。", siPatInfo.getPatNo());
|
|
|
- return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "患者的门诊诊断为空,请联系医生填写,或者自行补录。");
|
|
|
- }
|
|
|
+ Diagnoses base = mzDao.selectDiseinfo(siPatInfo.getPatNo(), siPatInfo.getTimes());
|
|
|
+ String[] icds = icdCodeNew.split(",");
|
|
|
+ for (int i = 0; i < icds.length; i++) {
|
|
|
+ String icd = icds[i];
|
|
|
+ String icdTextNew = mzDao.selectIcdTextNew(icd);
|
|
|
+ Diagnoses diag = new Diagnoses();
|
|
|
+ diag.setDiagCode(icd);
|
|
|
+ diag.setDiagName(icdTextNew);
|
|
|
+ diag.setDiagSrtNo(i + 1);
|
|
|
+ diag.setDiagType("1");
|
|
|
+ diag.setValiFlag("1");
|
|
|
+ diag.setDiagDept(base.getDiagDept());
|
|
|
+ diag.setDiagTime(base.getDiagTime());
|
|
|
+ diag.setDiseDorNo(base.getDiseDorNo());
|
|
|
+ diag.setDiseDorName(base.getDiseDorName());
|
|
|
+ diagnosesList.add(diag);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (siPatInfo.getMedType().equals("14") || siPatInfo.getMedType().equals("51")) {
|
|
|
+ if (StringUtil.isBlank(diseInfo.getOpspDiseCode())) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "生育门诊与慢特病门诊的病种不能为空 !");
|
|
|
}
|
|
|
}
|
|
|
mdtrtinfo.put("mdtrt_id", siPatInfo.getMdtrtId());
|
|
|
mdtrtinfo.put("psn_no", siPatInfo.getPsnNo());
|
|
|
mdtrtinfo.put("med_type", siPatInfo.getMedType());
|
|
|
mdtrtinfo.put("begntime", DateUtil.formatDatetime(siPatInfo.getVisitDatetime()));
|
|
|
- mdtrtinfo.put("main_cond_dscr", indise.getOpspDiseName());
|
|
|
- mdtrtinfo.put("dise_codg", indise.getOpspDiseCode());
|
|
|
- mdtrtinfo.put("dise_name", indise.getOpspDiseName());
|
|
|
+ mdtrtinfo.put("main_cond_dscr", diseInfo.getOpspDiseName());
|
|
|
+ mdtrtinfo.put("dise_codg", diseInfo.getOpspDiseCode());
|
|
|
+ mdtrtinfo.put("dise_name", diseInfo.getOpspDiseName());
|
|
|
mdtrtinfo.put("birctrl_type", "");
|
|
|
mdtrtinfo.put("birctrl_matn_date", "");
|
|
|
- String ref = JSONObject.toJSONString(diseinfo);
|
|
|
+ String ref = JSONObject.toJSONString(diagnosesList);
|
|
|
input.getJSONObject("input").put("mdtrtinfo", mdtrtinfo);
|
|
|
input.getJSONObject("input").put("diseinfo", JSONArray.parse(ref));
|
|
|
JSONObject result = exec.executeTrade(input, SiFunction.UPLOAD_OUTPATIENT_INFO);
|
|
|
@@ -195,7 +185,8 @@ public class SiMzFeeService {
|
|
|
Integer infcode = result.getInteger(RESULT_CODE);
|
|
|
logDao.insert(new SiLog(input, result, siPatInfo.getPatNo(), siPatInfo.getTimes(), infcode, siPatInfo.getPsnNo()));
|
|
|
if (result.getIntValue(RESULT_CODE) == 0) {
|
|
|
- mzDao.updatePatDiseinfo(siPatInfo.getPatNo(), siPatInfo.getTimes(), indise.getOpspDiseCode(), indise.getOpspDiseName());
|
|
|
+ Diagnoses main = diagnosesList.get(0);
|
|
|
+ mzDao.updatePatDiseinfo(siPatInfo.getPatNo(), siPatInfo.getTimes(), main.getDiagCode(), main.getDiagName());
|
|
|
return ResultVoUtil.success("门诊就诊信息上传成功。");
|
|
|
}
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, result.getString(ERROR_MESSAGE));
|